From 64a4b9ae88163d099be3499f09b1c40ac7a8a6eb Mon Sep 17 00:00:00 2001 From: Wilhelm Behncke Date: Sun, 6 Nov 2022 11:41:07 +0100 Subject: [PATCH] BUGFIX: Limit width of thumbnail image --- .../src/components/Main/Thumbnail.tsx | 1 + Resources/Public/AssetEditor/Plugin.css.map | 2 +- Resources/Public/AssetEditor/Plugin.js | 2 +- Resources/Public/AssetEditor/Plugin.js.map | 2 +- Resources/Public/Assets/main.bundle.css | 6 +- Resources/Public/Assets/main.bundle.js | 100 ++++++++++-------- Resources/Public/Assets/main.bundle.js.map | 2 +- 7 files changed, 66 insertions(+), 49 deletions(-) diff --git a/Resources/Private/JavaScript/media-module/src/components/Main/Thumbnail.tsx b/Resources/Private/JavaScript/media-module/src/components/Main/Thumbnail.tsx index 5f0b185f2..ee6771ef1 100644 --- a/Resources/Private/JavaScript/media-module/src/components/Main/Thumbnail.tsx +++ b/Resources/Private/JavaScript/media-module/src/components/Main/Thumbnail.tsx @@ -54,6 +54,7 @@ const useStyles = createUseMediaUiStyles((theme: MediaUiTheme) => ({ backgroundPosition: '0 0, 10px 10px', backgroundSize: '20px 20px', maxHeight: '250px', + maxWidth: '100%', }, }, caption: { diff --git a/Resources/Public/AssetEditor/Plugin.css.map b/Resources/Public/AssetEditor/Plugin.css.map index d3677ca32..36d181d56 100644 --- a/Resources/Public/AssetEditor/Plugin.css.map +++ b/Resources/Public/AssetEditor/Plugin.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-image-lightbox/style.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"./Plugin.css","sourcesContent":["@-webkit-keyframes style__closeWindow___2YNOe {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes style__closeWindow___2YNOe {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n.style__ril__outer___1zYzZ {\n background-color: rgba(0, 0, 0, 0.85);\n outline: none;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n width: 100%;\n height: 100%;\n -ms-content-zooming: none;\n -ms-user-select: none;\n -ms-touch-select: none;\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.style__ril__outerClosing___3n_rB {\n opacity: 0;\n}\n\n.style__ril__inner___dYbbg {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.style__ril__image___ohhGk,\n.style__ril__imagePrev___1TitV,\n.style__ril__imageNext___qIMp_ {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n margin: auto;\n max-width: none;\n -ms-content-zooming: none;\n -ms-user-select: none;\n -ms-touch-select: none;\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.style__ril__imageDiscourager___1loUi {\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n}\n\n.style__ril__navButtons___rD-18 {\n border: none;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 20px;\n height: 34px;\n padding: 40px 30px;\n margin: auto;\n cursor: pointer;\n opacity: 0.7;\n}\n\n.style__ril__navButtons___rD-18:hover {\n opacity: 1;\n}\n\n.style__ril__navButtons___rD-18:active {\n opacity: 0.7;\n}\n\n.style__ril__navButtonPrev___3XfSU {\n left: 0;\n background: rgba(0, 0, 0, 0.2)\n url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDE5LDMgLTIsLTIgLTE2LDE2IDE2LDE2IDEsLTEgLTE1LC0xNSAxNSwtMTUgeiIgZmlsbD0iI0ZGRiIvPjwvc3ZnPg==')\n no-repeat center;\n}\n\n.style__ril__navButtonNext___lV26z {\n right: 0;\n background: rgba(0, 0, 0, 0.2)\n url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDEsMyAyLC0yIDE2LDE2IC0xNiwxNiAtMSwtMSAxNSwtMTUgLTE1LC0xNSB6IiBmaWxsPSIjRkZGIi8+PC9zdmc+')\n no-repeat center;\n}\n\n.style__ril__downloadBlocker___2Jwql {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');\n background-size: cover;\n}\n\n.style__ril__caption___20juT,\n.style__ril__toolbar___10lYy {\n background-color: rgba(0, 0, 0, 0.5);\n position: absolute;\n left: 0;\n right: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n\n.style__ril__caption___20juT {\n bottom: 0;\n max-height: 150px;\n overflow: auto;\n}\n\n.style__ril__captionContent___6dnIh {\n padding: 10px 20px;\n color: #fff;\n}\n\n.style__ril__toolbar___10lYy {\n top: 0;\n height: 50px;\n}\n\n.style__ril__toolbarSide___1-5RY {\n height: 50px;\n margin: 0;\n}\n\n.style__ril__toolbarLeftSide___33kts {\n padding-left: 20px;\n padding-right: 0;\n -webkit-box-flex: 0;\n -ms-flex: 0 1 auto;\n flex: 0 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.style__ril__toolbarRightSide___3xRiA {\n padding-left: 0;\n padding-right: 20px;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n\n.style__ril__toolbarItem___33nhp {\n display: inline-block;\n line-height: 50px;\n padding: 0;\n color: #fff;\n font-size: 120%;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.style__ril__toolbarItemChild___1uo52 {\n vertical-align: middle;\n}\n\n.style__ril__builtinButton___2ew22 {\n width: 40px;\n height: 35px;\n cursor: pointer;\n border: none;\n opacity: 0.7;\n}\n\n.style__ril__builtinButton___2ew22:hover {\n opacity: 1;\n}\n\n.style__ril__builtinButton___2ew22:active {\n outline: none;\n}\n\n.style__ril__builtinButtonDisabled___3xK7K {\n cursor: default;\n opacity: 0.5;\n}\n\n.style__ril__builtinButtonDisabled___3xK7K:hover {\n opacity: 0.5;\n}\n\n.style__ril__closeButton___2Ge8S {\n background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIj48cGF0aCBkPSJtIDEsMyAxLjI1LC0xLjI1IDcuNSw3LjUgNy41LC03LjUgMS4yNSwxLjI1IC03LjUsNy41IDcuNSw3LjUgLTEuMjUsMS4yNSAtNy41LC03LjUgLTcuNSw3LjUgLTEuMjUsLTEuMjUgNy41LC03LjUgLTcuNSwtNy41IHoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=')\n no-repeat center;\n}\n\n.style__ril__zoomInButton___2okkJ {\n background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PHBhdGggZD0iTTEyIDV2NiIvPjwvZz48Y2lyY2xlIGN4PSIxMiIgY3k9IjgiIHI9IjciIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+')\n no-repeat center;\n}\n\n.style__ril__zoomOutButton___2U6Nk {\n background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PC9nPjxjaXJjbGUgY3g9IjEyIiBjeT0iOCIgcj0iNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=')\n no-repeat center;\n}\n\n.style__ril__outerAnimating___2Z5fK {\n -webkit-animation-name: style__closeWindow___2YNOe;\n animation-name: style__closeWindow___2YNOe;\n}\n\n@-webkit-keyframes style__pointFade___2ppwA {\n 0%,\n 19.999%,\n 100% {\n opacity: 0;\n }\n 20% {\n opacity: 1;\n }\n}\n\n@keyframes style__pointFade___2ppwA {\n 0%,\n 19.999%,\n 100% {\n opacity: 0;\n }\n 20% {\n opacity: 1;\n }\n}\n\n.style__ril__loadingCircle___23cHC {\n width: 60px;\n height: 60px;\n position: relative;\n}\n\n.style__ril__loadingCirclePoint___3pCVl {\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.style__ril__loadingCirclePoint___3pCVl::before {\n content: '';\n display: block;\n margin: 0 auto;\n width: 11%;\n height: 30%;\n background-color: #fff;\n border-radius: 30%;\n -webkit-animation: style__pointFade___2ppwA 800ms infinite ease-in-out both;\n animation: style__pointFade___2ppwA 800ms infinite ease-in-out both;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(1) {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(7) {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(1)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(7)::before {\n -webkit-animation-delay: -800ms;\n animation-delay: -800ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(2) {\n -webkit-transform: rotate(30deg);\n transform: rotate(30deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(8) {\n -webkit-transform: rotate(210deg);\n transform: rotate(210deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(2)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(8)::before {\n -webkit-animation-delay: -666ms;\n animation-delay: -666ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(3) {\n -webkit-transform: rotate(60deg);\n transform: rotate(60deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(9) {\n -webkit-transform: rotate(240deg);\n transform: rotate(240deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(3)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(9)::before {\n -webkit-animation-delay: -533ms;\n animation-delay: -533ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(4) {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(10) {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(4)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(10)::before {\n -webkit-animation-delay: -400ms;\n animation-delay: -400ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(5) {\n -webkit-transform: rotate(120deg);\n transform: rotate(120deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(11) {\n -webkit-transform: rotate(300deg);\n transform: rotate(300deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(5)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(11)::before {\n -webkit-animation-delay: -266ms;\n animation-delay: -266ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(6) {\n -webkit-transform: rotate(150deg);\n transform: rotate(150deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(12) {\n -webkit-transform: rotate(330deg);\n transform: rotate(330deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(6)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(12)::before {\n -webkit-animation-delay: -133ms;\n animation-delay: -133ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(7) {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(13) {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(7)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(13)::before {\n -webkit-animation-delay: 0ms;\n animation-delay: 0ms;\n}\n\n.style__ril__loadingContainer___38L0C {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n.style__ril__imagePrev___1TitV .style__ril__loadingContainer___38L0C,\n.style__ril__imageNext___qIMp_ .style__ril__loadingContainer___38L0C {\n display: none;\n}\n\n.style__ril__errorContainer___3sKjX {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n color: #fff;\n}\n\n.style__ril__imagePrev___1TitV .style__ril__errorContainer___3sKjX,\n.style__ril__imageNext___qIMp_ .style__ril__errorContainer___3sKjX {\n display: none;\n}\n\n.style__ril__loadingContainer__icon___2nrVt {\n color: #fff;\n position: absolute;\n top: 50%;\n left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-image-lightbox/style.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"./Plugin.css","sourcesContent":["@-webkit-keyframes style__closeWindow___2YNOe {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes style__closeWindow___2YNOe {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n.style__ril__outer___1zYzZ {\n background-color: rgba(0, 0, 0, 0.85);\n outline: none;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n width: 100%;\n height: 100%;\n -ms-content-zooming: none;\n -ms-user-select: none;\n -ms-touch-select: none;\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.style__ril__outerClosing___3n_rB {\n opacity: 0;\n}\n\n.style__ril__inner___dYbbg {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.style__ril__image___ohhGk,\n.style__ril__imagePrev___1TitV,\n.style__ril__imageNext___qIMp_ {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n margin: auto;\n max-width: none;\n -ms-content-zooming: none;\n -ms-user-select: none;\n -ms-touch-select: none;\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.style__ril__imageDiscourager___1loUi {\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n}\n\n.style__ril__navButtons___rD-18 {\n border: none;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 20px;\n height: 34px;\n padding: 40px 30px;\n margin: auto;\n cursor: pointer;\n opacity: 0.7;\n}\n\n.style__ril__navButtons___rD-18:hover {\n opacity: 1;\n}\n\n.style__ril__navButtons___rD-18:active {\n opacity: 0.7;\n}\n\n.style__ril__navButtonPrev___3XfSU {\n left: 0;\n background: rgba(0, 0, 0, 0.2)\n url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDE5LDMgLTIsLTIgLTE2LDE2IDE2LDE2IDEsLTEgLTE1LC0xNSAxNSwtMTUgeiIgZmlsbD0iI0ZGRiIvPjwvc3ZnPg==')\n no-repeat center;\n}\n\n.style__ril__navButtonNext___lV26z {\n right: 0;\n background: rgba(0, 0, 0, 0.2)\n url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDEsMyAyLC0yIDE2LDE2IC0xNiwxNiAtMSwtMSAxNSwtMTUgLTE1LC0xNSB6IiBmaWxsPSIjRkZGIi8+PC9zdmc+')\n no-repeat center;\n}\n\n.style__ril__downloadBlocker___2Jwql {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');\n background-size: cover;\n}\n\n.style__ril__caption___20juT,\n.style__ril__toolbar___10lYy {\n background-color: rgba(0, 0, 0, 0.5);\n position: absolute;\n left: 0;\n right: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n\n.style__ril__caption___20juT {\n bottom: 0;\n max-height: 150px;\n overflow: auto;\n}\n\n.style__ril__captionContent___6dnIh {\n padding: 10px 20px;\n color: #fff;\n}\n\n.style__ril__toolbar___10lYy {\n top: 0;\n height: 50px;\n}\n\n.style__ril__toolbarSide___1-5RY {\n height: 50px;\n margin: 0;\n}\n\n.style__ril__toolbarLeftSide___33kts {\n padding-left: 20px;\n padding-right: 0;\n -webkit-box-flex: 0;\n -ms-flex: 0 1 auto;\n flex: 0 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.style__ril__toolbarRightSide___3xRiA {\n padding-left: 0;\n padding-right: 20px;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n\n.style__ril__toolbarItem___33nhp {\n display: inline-block;\n line-height: 50px;\n padding: 0;\n color: #fff;\n font-size: 120%;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.style__ril__toolbarItemChild___1uo52 {\n vertical-align: middle;\n}\n\n.style__ril__builtinButton___2ew22 {\n width: 40px;\n height: 35px;\n cursor: pointer;\n border: none;\n opacity: 0.7;\n}\n\n.style__ril__builtinButton___2ew22:hover {\n opacity: 1;\n}\n\n.style__ril__builtinButton___2ew22:active {\n outline: none;\n}\n\n.style__ril__builtinButtonDisabled___3xK7K {\n cursor: default;\n opacity: 0.5;\n}\n\n.style__ril__builtinButtonDisabled___3xK7K:hover {\n opacity: 0.5;\n}\n\n.style__ril__closeButton___2Ge8S {\n background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIj48cGF0aCBkPSJtIDEsMyAxLjI1LC0xLjI1IDcuNSw3LjUgNy41LC03LjUgMS4yNSwxLjI1IC03LjUsNy41IDcuNSw3LjUgLTEuMjUsMS4yNSAtNy41LC03LjUgLTcuNSw3LjUgLTEuMjUsLTEuMjUgNy41LC03LjUgLTcuNSwtNy41IHoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=')\n no-repeat center;\n}\n\n.style__ril__zoomInButton___2okkJ {\n background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PHBhdGggZD0iTTEyIDV2NiIvPjwvZz48Y2lyY2xlIGN4PSIxMiIgY3k9IjgiIHI9IjciIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+')\n no-repeat center;\n}\n\n.style__ril__zoomOutButton___2U6Nk {\n background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PC9nPjxjaXJjbGUgY3g9IjEyIiBjeT0iOCIgcj0iNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=')\n no-repeat center;\n}\n\n.style__ril__outerAnimating___2Z5fK {\n -webkit-animation-name: style__closeWindow___2YNOe;\n animation-name: style__closeWindow___2YNOe;\n}\n\n@-webkit-keyframes style__pointFade___2ppwA {\n 0%,\n 19.999%,\n 100% {\n opacity: 0;\n }\n 20% {\n opacity: 1;\n }\n}\n\n@keyframes style__pointFade___2ppwA {\n 0%,\n 19.999%,\n 100% {\n opacity: 0;\n }\n 20% {\n opacity: 1;\n }\n}\n\n.style__ril__loadingCircle___23cHC {\n width: 60px;\n height: 60px;\n position: relative;\n}\n\n.style__ril__loadingCirclePoint___3pCVl {\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.style__ril__loadingCirclePoint___3pCVl::before {\n content: '';\n display: block;\n margin: 0 auto;\n width: 11%;\n height: 30%;\n background-color: #fff;\n border-radius: 30%;\n -webkit-animation: style__pointFade___2ppwA 800ms infinite ease-in-out both;\n animation: style__pointFade___2ppwA 800ms infinite ease-in-out both;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(1) {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(7) {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(1)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(7)::before {\n -webkit-animation-delay: -800ms;\n animation-delay: -800ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(2) {\n -webkit-transform: rotate(30deg);\n transform: rotate(30deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(8) {\n -webkit-transform: rotate(210deg);\n transform: rotate(210deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(2)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(8)::before {\n -webkit-animation-delay: -666ms;\n animation-delay: -666ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(3) {\n -webkit-transform: rotate(60deg);\n transform: rotate(60deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(9) {\n -webkit-transform: rotate(240deg);\n transform: rotate(240deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(3)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(9)::before {\n -webkit-animation-delay: -533ms;\n animation-delay: -533ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(4) {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(10) {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(4)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(10)::before {\n -webkit-animation-delay: -400ms;\n animation-delay: -400ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(5) {\n -webkit-transform: rotate(120deg);\n transform: rotate(120deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(11) {\n -webkit-transform: rotate(300deg);\n transform: rotate(300deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(5)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(11)::before {\n -webkit-animation-delay: -266ms;\n animation-delay: -266ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(6) {\n -webkit-transform: rotate(150deg);\n transform: rotate(150deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(12) {\n -webkit-transform: rotate(330deg);\n transform: rotate(330deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(6)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(12)::before {\n -webkit-animation-delay: -133ms;\n animation-delay: -133ms;\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(7) {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(13) {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n}\n\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(7)::before,\n.style__ril__loadingCirclePoint___3pCVl:nth-of-type(13)::before {\n -webkit-animation-delay: 0ms;\n animation-delay: 0ms;\n}\n\n.style__ril__loadingContainer___38L0C {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n.style__ril__imagePrev___1TitV .style__ril__loadingContainer___38L0C,\n.style__ril__imageNext___qIMp_ .style__ril__loadingContainer___38L0C {\n display: none;\n}\n\n.style__ril__errorContainer___3sKjX {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n color: #fff;\n}\n\n.style__ril__imagePrev___1TitV .style__ril__errorContainer___3sKjX,\n.style__ril__imageNext___qIMp_ .style__ril__errorContainer___3sKjX {\n display: none;\n}\n\n.style__ril__loadingContainer__icon___2nrVt {\n color: #fff;\n position: absolute;\n top: 50%;\n left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/Resources/Public/AssetEditor/Plugin.js b/Resources/Public/AssetEditor/Plugin.js index cdf490775..7c431a411 100644 --- a/Resources/Public/AssetEditor/Plugin.js +++ b/Resources/Public/AssetEditor/Plugin.js @@ -1,3 +1,3 @@ /*! For license information please see Plugin.js.LICENSE.txt */ -!function(e){var t={};function __webpack_require__(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)__webpack_require__.d(n,r,function(t){return e[t]}.bind(null,r));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=149)}([function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(31));e.exports=(0,r.default)("vendor")().React},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return __extends})),n.d(t,"__assign",(function(){return __assign})),n.d(t,"__rest",(function(){return __rest})),n.d(t,"__decorate",(function(){return __decorate})),n.d(t,"__param",(function(){return __param})),n.d(t,"__metadata",(function(){return __metadata})),n.d(t,"__awaiter",(function(){return __awaiter})),n.d(t,"__generator",(function(){return __generator})),n.d(t,"__createBinding",(function(){return __createBinding})),n.d(t,"__exportStar",(function(){return __exportStar})),n.d(t,"__values",(function(){return __values})),n.d(t,"__read",(function(){return __read})),n.d(t,"__spread",(function(){return __spread})),n.d(t,"__spreadArrays",(function(){return __spreadArrays})),n.d(t,"__await",(function(){return __await})),n.d(t,"__asyncGenerator",(function(){return __asyncGenerator})),n.d(t,"__asyncDelegator",(function(){return __asyncDelegator})),n.d(t,"__asyncValues",(function(){return __asyncValues})),n.d(t,"__makeTemplateObject",(function(){return __makeTemplateObject})),n.d(t,"__importStar",(function(){return __importStar})),n.d(t,"__importDefault",(function(){return __importDefault})),n.d(t,"__classPrivateFieldGet",(function(){return __classPrivateFieldGet})),n.d(t,"__classPrivateFieldSet",(function(){return __classPrivateFieldSet}));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return(__assign=Object.assign||function __assign(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function __param(e,t){return function(n,r){t(n,r,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(i,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(s){return function step(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function __spread(){for(var e=[],t=0;t1||resume(e,t)}))})}function resume(e,t){try{!function step(e){e.value instanceof __await?Promise.resolve(e.value.v).then(fulfill,reject):settle(o[0][2],e)}(i[e](t))}catch(e){settle(o[0][3],e)}}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){e(t),o.shift(),o.length&&resume(o[0][0],o[0][1])}}function __asyncDelegator(e){var t,n;return t={},verb("next"),verb("throw",(function(e){throw e})),verb("return"),t[Symbol.iterator]=function(){return this},t;function verb(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:__await(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=__values(e),t={},verb("next"),verb("throw"),verb("return"),t[Symbol.asyncIterator]=function(){return this},t);function verb(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function settle(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";n.d(t,"L",(function(){return shouldInclude})),n.d(t,"y",(function(){return hasDirectives})),n.d(t,"x",(function(){return hasClientExports})),n.d(t,"k",(function(){return createFragmentMap})),n.d(t,"p",(function(){return getFragmentQueryDocument})),n.d(t,"o",(function(){return getFragmentFromSelection})),n.d(t,"r",(function(){return getOperationDefinition})),n.d(t,"s",(function(){return getOperationName})),n.d(t,"n",(function(){return getFragmentDefinitions})),n.d(t,"t",(function(){return getQueryDefinition})),n.d(t,"q",(function(){return getMainDefinition})),n.d(t,"m",(function(){return getDefaultValues})),n.d(t,"E",(function(){return makeReference})),n.d(t,"C",(function(){return storeUtils_isReference})),n.d(t,"z",(function(){return isField})),n.d(t,"A",(function(){return isInlineFragment})),n.d(t,"M",(function(){return storeKeyNameFromField})),n.d(t,"e",(function(){return argumentsObjectFromField})),n.d(t,"K",(function(){return resultKeyNameFromField})),n.d(t,"u",(function(){return getStoreKeyName})),n.d(t,"v",(function(){return getTypenameFromResult})),n.d(t,"d",(function(){return addTypenameToDocument})),n.d(t,"g",(function(){return buildQueryFromSelectionSet})),n.d(t,"J",(function(){return removeConnectionDirectiveFromDocument})),n.d(t,"I",(function(){return removeClientSetsFromDocument})),n.d(t,"c",(function(){return h.a})),n.d(t,"G",(function(){return mergeDeep})),n.d(t,"H",(function(){return mergeDeepArray})),n.d(t,"b",(function(){return f})),n.d(t,"i",(function(){return cloneDeep})),n.d(t,"F",(function(){return maybeDeepFreeze})),n.d(t,"D",(function(){return iterateObserversSafely})),n.d(t,"f",(function(){return asyncMap})),n.d(t,"a",(function(){return m})),n.d(t,"l",(function(){return fixObservableSubclass})),n.d(t,"B",(function(){return isNonEmptyArray})),n.d(t,"w",(function(){return graphQLResultHasError})),n.d(t,"h",(function(){return b})),n.d(t,"j",(function(){return compact}));var r=n(143),i=n(3);function shouldInclude(e,t){var n=e.directives;return!n||!n.length||function getInclusionDirectives(e){var t=[];e&&e.length&&e.forEach((function(e){if(function isInclusionDirective(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments;e.name.value;Object(i.b)(n&&1===n.length,39);var r=n[0];Object(i.b)(r.name&&"if"===r.name.value,40);var o=r.value;Object(i.b)(o&&("Variable"===o.kind||"BooleanValue"===o.kind),41),t.push({directive:e,ifArgument:r})}}));return t}(n).every((function(e){var n=e.directive,r=e.ifArgument,o=!1;return"Variable"===r.value.kind?(o=t&&t[r.value.name.value],Object(i.b)(void 0!==o,38)):o=r.value.value,"skip"===n.name.value?!o:o}))}function hasDirectives(e,t){return function getDirectiveNames(e){var t=[];return Object(r.b)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function hasClientExports(e){return e&&hasDirectives(["client"],e)&&hasDirectives(["export"],e)}var o=n(1);function getFragmentQueryDocument(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.a(42);"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(Object(i.b)(1===r.length,43),n=r[0].name.value),Object(o.__assign)(Object(o.__assign)({},e),{definitions:Object(o.__spreadArrays)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions)})}function createFragmentMap(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function getFragmentFromSelection(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=t&&t[e.name.value];return Object(i.b)(n,44),n;default:return null}}var a=n(144),s=n.n(a);function makeReference(e){return{__ref:String(e)}}function storeUtils_isReference(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function valueToObjectRepresentation(e,t,n,r){if(function isIntValue(e){return"IntValue"===e.kind}(n)||function isFloatValue(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function isBooleanValue(e){return"BooleanValue"===e.kind}(n)||function isStringValue(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function isObjectValue(e){return"ObjectValue"===e.kind}(n)){var o={};n.fields.map((function(e){return valueToObjectRepresentation(o,e.name,e.value,r)})),e[t.value]=o}else if(function isVariable(e){return"Variable"===e.kind}(n)){var a=(r||{})[n.name.value];e[t.value]=a}else if(function isListValue(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return valueToObjectRepresentation(n,t,e,r),n[t.value]}));else if(function isEnumValue(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function isNullValue(e){return"NullValue"===e.kind}(n))throw new i.a(53);e[t.value]=null}}function storeKeyNameFromField(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var i=r.name,o=r.value;return valueToObjectRepresentation(n[e.name.value],i,o,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,i=e.value;return valueToObjectRepresentation(r,n,i,t)}))),getStoreKeyName(e.name.value,r,n)}var l=["connection","include","skip","client","rest","export"];function getStoreKeyName(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),n.connection.key+"("+JSON.stringify(i)+")"}return n.connection.key}var o=e;if(t){var a=s()(t);o+="("+a+")"}return n&&Object.keys(n).forEach((function(e){-1===l.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@"+e+"("+JSON.stringify(n[e])+")":o+="@"+e)})),o}function argumentsObjectFromField(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return valueToObjectRepresentation(n,r,i,t)})),n}return null}function resultKeyNameFromField(e){return e.alias?e.alias.value:e.name.value}function getTypenameFromResult(e,t,n){if("string"==typeof e.__typename)return e.__typename;for(var r=0,i=t.selections;r1)for(var r=new f,i=1;i0}function graphQLResultHasError(e){return e.errors&&e.errors.length>0||!1}fixObservableSubclass(m);var b="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function compact(){for(var e=[],t=0;t=l)return console[e].apply(console,arguments)}}function setVerbosity(e){var t=s[l];return l=Math.max(0,s.indexOf(e)),t}!function(e){e.log=wrapConsoleMethod("log"),e.warn=wrapConsoleMethod("warn"),e.error=wrapConsoleMethod("error")}(invariant||(invariant={}));"object"==typeof e&&e.env}).call(this,n(88))},function(e,t,n){"use strict";n.r(t);var r=n(30);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);var o=n(98);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i)},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(31));e.exports=(0,r.default)("vendor")().PropTypes},function(e,t,n){"use strict";n.r(t),n.d(t,"DefaultValue",(function(){return Jr})),n.d(t,"RecoilRoot",(function(){return ei})),n.d(t,"atom",(function(){return ni})),n.d(t,"atomFamily",(function(){return oi})),n.d(t,"batchUpdates",(function(){return Pi})),n.d(t,"constSelector",(function(){return si})),n.d(t,"errorSelector",(function(){return li})),n.d(t,"isRecoilValue",(function(){return Ii})),n.d(t,"noWait",(function(){return wi})),n.d(t,"readOnlySelector",(function(){return ui})),n.d(t,"retentionZone",(function(){return ii})),n.d(t,"selector",(function(){return ri})),n.d(t,"selectorFamily",(function(){return ai})),n.d(t,"setBatcher",(function(){return Mi})),n.d(t,"snapshot_UNSTABLE",(function(){return ki})),n.d(t,"useGetRecoilValueInfo_UNSTABLE",(function(){return yi})),n.d(t,"useGotoRecoilSnapshot",(function(){return gi})),n.d(t,"useRecoilBridgeAcrossReactRoots_UNSTABLE",(function(){return ti})),n.d(t,"useRecoilCallback",(function(){return bi})),n.d(t,"useRecoilSnapshot",(function(){return _i})),n.d(t,"useRecoilState",(function(){return fi})),n.d(t,"useRecoilStateLoadable",(function(){return pi})),n.d(t,"useRecoilTransactionObserver_UNSTABLE",(function(){return Si})),n.d(t,"useRecoilValue",(function(){return ci})),n.d(t,"useRecoilValueLoadable",(function(){return di})),n.d(t,"useResetRecoilState",(function(){return vi})),n.d(t,"useRetain",(function(){return mi})),n.d(t,"useSetRecoilState",(function(){return hi})),n.d(t,"useSetUnvalidatedAtomValues_UNSTABLE",(function(){return Ei})),n.d(t,"useTransactionObservation_UNSTABLE",(function(){return Oi})),n.d(t,"waitForAll",(function(){return Ai})),n.d(t,"waitForAllSettled",(function(){return ji})),n.d(t,"waitForAny",(function(){return Ci})),n.d(t,"waitForNone",(function(){return Ti}));var r=n(59),i=n.n(r),o=n(0),a=n.n(o);var s=function nullthrows(e,t){if(null!=e)return e;throw new Error(null!=t?t:"Got unexpected null or undefined")};var l=function recoverableViolation(e,t,{error:n}={}){return null};var u={setByAddingToSet:function setByAddingToSet(e,t){const n=new Set(e);return n.add(t),n},setByDeletingFromSet:function setByDeletingFromSet(e,t){const n=new Set(e);return n.delete(t),n},mapBySettingInMap:function mapBySettingInMap(e,t,n){const r=new Map(e);return r.set(t,n),r},mapByUpdatingInMap:function mapByUpdatingInMap(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r},mapByDeletingFromMap:function mapByDeletingFromMap(e,t){const n=new Map(e);return n.delete(t),n},mapByDeletingMultipleFromMap:function mapByDeletingMultipleFromMap(e,t){const n=new Map(e);return t.forEach(e=>n.delete(e)),n}};var c=function*filterIterable(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)};const d=(new Map).set("recoil_hamt_2020",!0);function Recoil_gkx(e){var t;return null!==(t=d.get(e))&&void 0!==t&&t}Recoil_gkx.setPass=e=>{d.set(e,!0)},Recoil_gkx.setFail=e=>{d.set(e,!1)};var f=Recoil_gkx;var p=function mapIterable(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()};var h=function expectationViolation(e,...t){0};function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class AbstractRecoilValue{constructor(e){_defineProperty(this,"key",void 0),this.key=e}}class RecoilState extends AbstractRecoilValue{}class RecoilValueReadOnly extends AbstractRecoilValue{}var v={AbstractRecoilValue:AbstractRecoilValue,RecoilState:RecoilState,RecoilValueReadOnly:RecoilValueReadOnly,isRecoilValue:function isRecoilValue(e){return e instanceof RecoilState||e instanceof RecoilValueReadOnly}},y=v.AbstractRecoilValue,m=v.RecoilState,b=v.RecoilValueReadOnly,g=v.isRecoilValue,_=Object.freeze({__proto__:null,AbstractRecoilValue:y,RecoilState:m,RecoilValueReadOnly:b,isRecoilValue:g});class DefaultValue{}const S=new DefaultValue;class RecoilValueNotReady extends Error{constructor(e){super(`Tried to set the value of Recoil selector ${e} using an updater function, but it is an async selector in a pending or error state; this is not supported.`)}}const O=new Map,E=new Map;class NodeMissingError extends Error{}const w=new Map;function getConfigDeletionHandler(e){return w.get(e)}var T={nodes:O,recoilValues:E,registerNode:function registerNode(e){if(O.has(e.key)){const t=`Duplicate atom key "${e.key}". This is a FATAL ERROR in\n production. But it is safe to ignore this warning if it occurred because of\n hot module replacement.`;console.warn(t)}O.set(e.key,e);const t=null==e.set?new _.RecoilValueReadOnly(e.key):new _.RecoilState(e.key);return E.set(e.key,t),t},getNode:function getNode(e){const t=O.get(e);if(null==t)throw new NodeMissingError(`Missing definition for RecoilValue: "${e}""`);return t},getNodeMaybe:function getNodeMaybe(e){return O.get(e)},deleteNodeConfigIfPossible:function deleteNodeConfigIfPossible(e){var t;if(!f("recoil_memory_managament_2020"))return;const n=O.get(e);var r;(null==n||null===(t=n.shouldDeleteConfigOnRelease)||void 0===t?void 0:t.call(n))&&(O.delete(e),null===(r=getConfigDeletionHandler(e))||void 0===r||r(),w.delete(e))},setConfigDeletionHandler:function setConfigDeletionHandler(e,t){f("recoil_memory_managament_2020")&&(void 0===t?w.delete(e):w.set(e,t))},getConfigDeletionHandler:getConfigDeletionHandler,recoilValuesForKeys:function recoilValuesForKeys(e){return p(e,e=>s(E.get(e)))},NodeMissingError:NodeMissingError,DefaultValue:DefaultValue,DEFAULT_VALUE:S,RecoilValueNotReady:RecoilValueNotReady};class RetentionZone{}var C={RetentionZone:RetentionZone,retentionZone:function retentionZone(){return new RetentionZone}};const{setByAddingToSet:j}=u,{getNode:I,getNodeMaybe:P,recoilValuesForKeys:M}=T,{RetentionZone:k}=C,R=Object.freeze(new Set);class ReadOnlyRecoilValueError extends Error{}function initializeNodeIfNewToStore(e,t,n,r){const i=e.getState();if(i.nodeCleanupFunctions.has(n))return;const o=I(n),a=function initializeRetentionForNode(e,t,n){if(!f("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function addToZone(e){let n=r.get(e);n||r.set(e,n=new Set),n.add(t)}if(n instanceof k)addToZone(n);else if(Array.isArray(n))for(const e of n)addToZone(e);return()=>{if(!f("recoil_memory_managament_2020"))return;const r=e.getState().retention.nodesRetainedByZone;function deleteFromZone(e){const n=r.get(e);n&&n.delete(t),n&&0===n.size&&r.delete(e)}if(n instanceof k)deleteFromZone(n);else if(Array.isArray(n))for(const e of n)deleteFromZone(e)}}(e,n,o.retainedBy),s=o.init(e,t,r);i.nodeCleanupFunctions.set(n,()=>{s(),a()})}function peekNodeLoadable(e,t,n){return I(n).peek(e,t)}function getDownstreamNodes(e,t,n){const r=new Set,i=Array.from(n),o=e.getGraph(t.version);for(let e=i.pop();e;e=i.pop()){var a;r.add(e);const t=null!==(a=o.nodeToNodeSubscriptions.get(e))&&void 0!==a?a:R;for(const e of t)r.has(e)||i.push(e)}return r}var x={getNodeLoadable:function getNodeLoadable(e,t,n){return initializeNodeIfNewToStore(e,t,n,"get"),I(n).get(e,t)},peekNodeLoadable:peekNodeLoadable,setNodeValue:function setNodeValue(e,t,n,r){const i=I(n);if(null==i.set)throw new ReadOnlyRecoilValueError("Attempt to set read-only RecoilValue: "+n);const o=i.set;return initializeNodeIfNewToStore(e,t,n,"set"),o(e,t,r)},cleanUpNode:function cleanUpNode(e,t){var n;const r=e.getState();null===(n=r.nodeCleanupFunctions.get(t))||void 0===n||n(),r.nodeCleanupFunctions.delete(t)},setUnvalidatedAtomValue_DEPRECATED:function setUnvalidatedAtomValue_DEPRECATED(e,t,n){var r;const i=P(t);return null==i||null===(r=i.invalidate)||void 0===r||r.call(i,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:j(e.dirtyAtoms,t)}},peekNodeInfo:function peekNodeInfo(e,t,n){var r,i,o;const a=e.getState(),s=e.getGraph(t.version),l=a.knownAtoms.has(n)?"atom":a.knownSelectors.has(n)?"selector":void 0,u=c(getDownstreamNodes(e,t,new Set([n])),e=>e!==n);return{loadable:peekNodeLoadable(e,t,n),isActive:a.knownAtoms.has(n)||a.knownSelectors.has(n),isSet:"selector"!==l&&t.atomValues.has(n),isModified:t.dirtyAtoms.has(n),type:l,deps:M(null!==(r=s.nodeDeps.get(n))&&void 0!==r?r:[]),subscribers:{nodes:M(u),components:p(null!==(i=null===(o=a.nodeToComponentSubscriptions.get(n))||void 0===o?void 0:o.values())&&void 0!==i?i:[],([e])=>({name:e}))}}},getDownstreamNodes:getDownstreamNodes,initializeNodeIfNewToStore:initializeNodeIfNewToStore};const{getDownstreamNodes:D,getNodeLoadable:N,setNodeValue:L}=x,{getNodeMaybe:F}=T,{DefaultValue:U,RecoilValueNotReady:V}=T,{AbstractRecoilValue:B,RecoilState:q,RecoilValueReadOnly:Q,isRecoilValue:$}=_;function applyAction(e,t,n){if("set"===n.type){const{recoilValue:r,valueOrUpdater:i}=n,o=function valueFromValueOrUpdater(e,t,{key:n},r){if("function"==typeof r){const i=N(e,t,n);if("loading"===i.state)throw new V(n);if("hasError"===i.state)throw i.contents;return r(i.contents)}return r}(e,t,r,i),a=L(e,t,r.key,o);for(const[e,n]of a.entries())writeLoadableToTreeState(t,e,n)}else if("setLoadable"===n.type){const{recoilValue:{key:e},loadable:r}=n;writeLoadableToTreeState(t,e,r)}else if("markModified"===n.type){const{recoilValue:{key:e}}=n;t.dirtyAtoms.add(e)}else if("setUnvalidated"===n.type){var r;const{recoilValue:{key:e},unvalidatedValue:i}=n,o=F(e);null==o||null===(r=o.invalidate)||void 0===r||r.call(o,t),t.atomValues.delete(e),t.nonvalidatedAtoms.set(e,i),t.dirtyAtoms.add(e)}else l("Unknown action "+n.type)}function writeLoadableToTreeState(e,t,n){"hasValue"===n.state&&n.contents instanceof U?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function applyActionsToStore(e,t){e.replaceState(n=>{const r=function copyTreeState(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}(n);for(const n of t)applyAction(e,r,n);return invalidateDownstreams(e,r),r})}function queueOrPerformStateUpdate(e,t){if(W.length){const n=W[W.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else applyActionsToStore(e,[t])}const W=[];function invalidateDownstreams(e,t){const n=D(e,t,t.dirtyAtoms);for(const e of n){var r,i;null===(r=F(e))||void 0===r||null===(i=r.invalidate)||void 0===i||i.call(r,t)}}function setRecoilValue(e,t,n){queueOrPerformStateUpdate(e,{type:"set",recoilValue:t,valueOrUpdater:n})}let G=0;var H={RecoilValueReadOnly:Q,AbstractRecoilValue:B,RecoilState:q,getRecoilValueAsLoadable:function getRecoilValueAsLoadable(e,{key:t},n=e.getState().currentTree){var r,i;const o=e.getState();return n.version!==o.currentTree.version&&n.version!==(null===(r=o.nextTree)||void 0===r?void 0:r.version)&&n.version!==(null===(i=o.previousTree)||void 0===i?void 0:i.version)&&l("Tried to read from a discarded tree"),N(e,n,t)},setRecoilValue:setRecoilValue,setRecoilValueLoadable:function setRecoilValueLoadable(e,t,n){if(n instanceof U)return setRecoilValue(e,t,n);queueOrPerformStateUpdate(e,{type:"setLoadable",recoilValue:t,loadable:n})},markRecoilValueModified:function markRecoilValueModified(e,t){queueOrPerformStateUpdate(e,{type:"markModified",recoilValue:t})},setUnvalidatedRecoilValue:function setUnvalidatedRecoilValue(e,t,n){queueOrPerformStateUpdate(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})},subscribeToRecoilValue:function subscribeToRecoilValue(e,{key:t},n,r=null){const i=G++,o=e.getState();return o.nodeToComponentSubscriptions.has(t)||o.nodeToComponentSubscriptions.set(t,new Map),s(o.nodeToComponentSubscriptions.get(t)).set(i,[null!=r?r:"",n]),{release:()=>{const n=e.getState(),r=n.nodeToComponentSubscriptions.get(t);void 0!==r&&r.has(i)?(r.delete(i),0===r.size&&n.nodeToComponentSubscriptions.delete(t)):l(`Subscription missing at release time for atom ${t}. This is a bug in Recoil.`)}}},isRecoilValue:$,applyAtomValueWrites:function applyAtomValueWrites(e,t){const n=e.clone();return t.forEach((e,t)=>{"hasValue"===e.state&&e.contents instanceof U?n.delete(t):n.set(t,e)}),n},batchStart:function batchStart(){const e=new Map;return W.push(e),()=>{for(const[t,n]of e)applyActionsToStore(t,n);W.pop()!==e&&l("Incorrect order of batch popping")}},invalidateDownstreams_FOR_TESTING:invalidateDownstreams};const{unstable_batchedUpdates:K}=i.a;var Y={unstable_batchedUpdates:K};const{unstable_batchedUpdates:X}=Y;var Z={unstable_batchedUpdates:X};const{batchStart:J}=H,{unstable_batchedUpdates:ee}=Z;let te=ee;var ne={getBatcher:()=>te,setBatcher:e=>{te=e},batchUpdates:e=>{te(()=>{let batchEnd=()=>{};try{batchEnd=J(),e()}finally{batchEnd()}})}};var re={enqueueExecution:function enqueueExecution(e,t){t()}};var ie=function differenceSets(e,...t){const n=new Set;e:for(const r of e){for(const e of t)if(e.has(r))continue e;n.add(r)}return n};var oe=function mapMap(e,t){const n=new Map;return e.forEach((e,r)=>{n.set(r,t(e,r))}),n};function mergeDependencyMapIntoGraph(e,t,n){const{nodeDeps:r,nodeToNodeSubscriptions:i}=t;e.forEach((e,t)=>{const o=r.get(t);if(o&&n&&o!==n.nodeDeps.get(t))return;r.set(t,new Set(e));if((null==o?e:ie(e,o)).forEach(e=>{i.has(e)||i.set(e,new Set);s(i.get(e)).add(t)}),o){ie(o,e).forEach(e=>{if(!i.has(e))return;const n=s(i.get(e));n.delete(t),0===n.size&&i.delete(e)})}})}var ae={addToDependencyMap:function addToDependencyMap(e,t,n){n.has(e)||n.set(e,new Set),s(n.get(e)).add(t)},cloneGraph:function cloneGraph(e){return{nodeDeps:oe(e.nodeDeps,e=>new Set(e)),nodeToNodeSubscriptions:oe(e.nodeToNodeSubscriptions,e=>new Set(e))}},graph:function graph(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}},mergeDepsIntoDependencyMap:function mergeDepsIntoDependencyMap(e,t){e.forEach((e,n)=>{t.has(n)||t.set(n,new Set);const r=s(t.get(n));e.forEach(e=>r.add(e))})},saveDependencyMapToStore:function saveDependencyMapToStore(e,t,n){var r,i,o,a;const s=t.getState();n!==s.currentTree.version&&n!==(null===(r=s.nextTree)||void 0===r?void 0:r.version)&&n!==(null===(i=s.previousTree)||void 0===i?void 0:i.version)&&l("Tried to save dependencies to a discarded tree");const u=t.getGraph(n);if(mergeDependencyMapIntoGraph(e,u),n===(null===(o=s.previousTree)||void 0===o?void 0:o.version)){mergeDependencyMapIntoGraph(e,t.getGraph(s.currentTree.version),u)}if(n===(null===(a=s.previousTree)||void 0===a?void 0:a.version)||n===s.currentTree.version){var c;const n=null===(c=s.nextTree)||void 0===c?void 0:c.version;if(void 0!==n){mergeDependencyMapIntoGraph(e,t.getGraph(n),u)}}}};var se=function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n={},r=Math.pow(2,5),i=r-1,o=r/2,a=r/4,s={},l=function constant(e){return function(){return e}},u=n.hash=function(e){var n=void 0===e?"undefined":t(e);if("number"===n)return e;"string"!==n&&(e+="");for(var r=0,i=0,o=e.length;i>>e&i},d=function toBitmap(e){return 1<>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}(e&t-1)},p=function arrayUpdate(e,t,n,r){var i=r;if(!e){var o=r.length;i=new Array(o);for(var a=0;a1?b(e,this.hash,l):l[0]}var u=r();return u===s?this:(++a.value,S(e,n,this.hash,this,i,m(e,i,o,u)))},T=function IndexedNode__modify(e,t,n,r,i,a,s){var l=this.mask,u=this.children,m=c(n,i),b=d(m),S=f(l,b),E=l&b,w=E?u[S]:v,T=w._modify(e,t,n+5,r,i,a,s);if(w===T)return this;var C=O(e,this),j=l,I=void 0;if(E&&y(T)){if(!(j&=~b))return v;if(u.length<=2&&function isLeaf(e){return e===v||1===e.type||2===e.type}(u[1^S]))return u[1^S];I=h(C,S,u)}else if(E||y(T))I=p(C,S,T,u);else{if(u.length>=o)return function expand(e,t,n,r,i){for(var o=[],a=r,s=0,l=0;a;++l)1&a&&(o[l]=i[s++]),a>>>=1;return o[t]=n,_(e,s+1,o)}(e,m,T,l,u);j|=b,I=function arraySpliceIn(e,t,n,r){var i=r.length;if(e){for(var o=i;o>=t;)r[o--]=r[o];return r[t]=n,r}for(var a=0,s=0,l=new Array(i+1);afe++;function makeEmptyTreeState(){const e=getNextTreeStateVersion();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:de(),nonvalidatedAtoms:de()}}var pe={makeEmptyTreeState:makeEmptyTreeState,makeEmptyStoreState:function makeEmptyStoreState(){const e=makeEmptyTreeState();return{currentTree:e,nextTree:null,previousTree:null,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:(new Map).set(e.version,ce()),versionsUsedByComponent:new Map,retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}},getNextTreeStateVersion:getNextTreeStateVersion};var he=function unionSets(...e){const t=new Set;for(const n of e)for(const e of n)t.add(e);return t};var ve=function someSet(e,t,n){const r=e.entries();let i=r.next();for(;!i.done;){const o=i.value;if(t.call(n,o[1],o[0],e))return!0;i=r.next()}return!1};const{cleanUpNode:ye}=x,{deleteNodeConfigIfPossible:me,getNode:be}=T,{RetentionZone:ge}=C,_e=new Set;function releaseRetainablesNowOnCurrentTree(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return void l("releaseNodesNowOnCurrentTree should only be called at the end of a batch");const i=new Set;for(const e of t)if(e instanceof ge)for(const t of nodesRetainedByZone(n,e))i.add(t);else i.add(e);const o=function findReleasableNodes(e,t){const n=e.getState(),r=n.currentTree,i=e.getGraph(r.version),o=new Set,a=new Set;return findReleasableNodesInner(t),o;function findReleasableNodesInner(t){const l=new Set,u=function getDownstreamNodesInTopologicalOrder(e,t,n,r,i){const o=e.getGraph(t.version),a=[],l=new Set;for(;n.size>0;)visit(s(n.values().next().value));return a;function visit(e){if(r.has(e)||i.has(e))return void n.delete(e);if(l.has(e))return;const t=o.nodeToNodeSubscriptions.get(e);if(t)for(const e of t)visit(e);l.add(e),n.delete(e),a.push(e)}}(e,r,t,o,a);for(const e of u){var c;if("recoilRoot"===be(e).retainedBy){a.add(e);continue}if((null!==(c=n.retention.referenceCounts.get(e))&&void 0!==c?c:0)>0){a.add(e);continue}if(zonesThatCouldRetainNode(e).some(e=>n.retention.referenceCounts.get(e))){a.add(e);continue}const t=i.nodeToNodeSubscriptions.get(e);t&&ve(t,e=>a.has(e))?a.add(e):(o.add(e),l.add(e))}const d=new Set;for(const e of l)for(const t of null!==(f=i.nodeDeps.get(e))&&void 0!==f?f:_e){var f;o.has(t)||d.add(t)}d.size&&findReleasableNodesInner(d)}}(e,i);for(const t of o)releaseNode(e,r,t)}function releaseNode(e,t,n){if(!f("recoil_memory_managament_2020"))return;ye(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const i=zonesThatCouldRetainNode(n);for(const e of i){var o;null===(o=r.retention.nodesRetainedByZone.get(e))||void 0===o||o.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const a=r.graphsByVersion.get(t.version);if(a){const e=a.nodeDeps.get(n);if(void 0!==e){a.nodeDeps.delete(n);for(const t of e){var s;null===(s=a.nodeToNodeSubscriptions.get(t))||void 0===s||s.delete(n)}}a.nodeToNodeSubscriptions.delete(n)}me(n)}function nodesRetainedByZone(e,t){var n;return null!==(n=e.retention.nodesRetainedByZone.get(t))&&void 0!==n?n:_e}function zonesThatCouldRetainNode(e){const t=be(e).retainedBy;return void 0===t||"components"===t||"recoilRoot"===t?[]:t instanceof ge?[t]:t}var Se={updateRetainCount:function updateRetainCount(e,t,n){var r;if(!f("recoil_memory_managament_2020"))return;const i=e.getState().retention.referenceCounts,o=(null!==(r=i.get(t))&&void 0!==r?r:0)+n;0===o?(i.delete(t),function scheduleOrPerformPossibleReleaseOfRetainable(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):releaseRetainablesNowOnCurrentTree(e,new Set([t]))}(e,t)):i.set(t,o)},releaseScheduledRetainablesNow:function releaseScheduledRetainablesNow(e){if(!f("recoil_memory_managament_2020"))return;const t=e.getState();releaseRetainablesNowOnCurrentTree(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()},retainedByOptionWithDefault:function retainedByOptionWithDefault(e){return void 0===e?"recoilRoot":e}};var Oe=function*concatIterables(e){for(const t of e)for(const e of t)yield e};var Ee={isSSR:"undefined"==typeof window,isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product};const{isSSR:we}=Ee,{batchUpdates:Te}=ne,{initializeNodeIfNewToStore:Ce,peekNodeInfo:Ae}=x,{graph:je}=ae,{DEFAULT_VALUE:Ie,recoilValues:Pe,recoilValuesForKeys:Me}=T,{AbstractRecoilValue:ke,getRecoilValueAsLoadable:Re,setRecoilValue:xe,setUnvalidatedRecoilValue:De}=H,{getNextTreeStateVersion:Ne,makeEmptyStoreState:Le}=pe;class Snapshot{constructor(e){_defineProperty(this,"_store",void 0),_defineProperty(this,"_refCount",0),_defineProperty(this,"getLoadable",e=>(this.checkRefCount_INTERNAL(),Re(this._store,e))),_defineProperty(this,"getPromise",e=>(this.checkRefCount_INTERNAL(),this.getLoadable(e).toPromise())),_defineProperty(this,"getNodes_UNSTABLE",e=>{if(this.checkRefCount_INTERNAL(),!0===(null==e?void 0:e.isModified)){if(!1===(null==e?void 0:e.isInitialized))return[];const t=this._store.getState().currentTree;return Me(t.dirtyAtoms)}const t=this._store.getState().knownAtoms,n=this._store.getState().knownSelectors;return null==(null==e?void 0:e.isInitialized)?Pe.values():!0===e.isInitialized?Me(Oe([this._store.getState().knownAtoms,this._store.getState().knownSelectors])):c(Pe.values(),({key:e})=>!t.has(e)&&!n.has(e))}),_defineProperty(this,"getInfo_UNSTABLE",({key:e})=>(this.checkRefCount_INTERNAL(),Ae(this._store,this._store.getState().currentTree,e))),_defineProperty(this,"map",e=>{this.checkRefCount_INTERNAL();const t=new MutableSnapshot(this);return e(t),cloneSnapshot(t.getStore_INTERNAL())}),_defineProperty(this,"asyncMap",async e=>{this.checkRefCount_INTERNAL();const t=new MutableSnapshot(this);return await e(t),cloneSnapshot(t.getStore_INTERNAL())}),this._store={getState:()=>e,replaceState:t=>{e.currentTree=t(e.currentTree)},getGraph:t=>{const n=e.graphsByVersion;if(n.has(t))return s(n.get(t));const r=je();return n.set(t,r),r},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw new Error("Cannot subscribe to Snapshots")}};for(const t of this._store.getState().nodeCleanupFunctions.keys())Ce(this._store,e.currentTree,t,"get");this.retain(),this.autorelease()}retain(){if(!f("recoil_memory_managament_2020"))return()=>{};this._refCount++;let e=!1;return()=>{e||(e=!0,this.release())}}autorelease(){f("recoil_memory_managament_2020")&&(we||window.setTimeout(()=>this.release(),0))}release(){f("recoil_memory_managament_2020")&&(this._refCount--,this._refCount)}checkRefCount_INTERNAL(){f("recoil_memory_managament_2020")&&this._refCount}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this.getID_INTERNAL()}getID_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}}function cloneStoreState(e,t,n=!1){const r=e.getState(),i=n?Ne():t.version;return{currentTree:n?{version:i,stateID:i,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()}:t,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:(new Map).set(i,e.getGraph(t.version)),versionsUsedByComponent:new Map,retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}function cloneSnapshot(e,t="current"){const n=e.getState(),r="current"===t?n.currentTree:s(n.previousTree);return new Snapshot(cloneStoreState(e,r))}class MutableSnapshot extends Snapshot{constructor(e){super(cloneStoreState(e.getStore_INTERNAL(),e.getStore_INTERNAL().getState().currentTree,!0)),_defineProperty(this,"set",(e,t)=>{this.checkRefCount_INTERNAL(),Te(()=>{xe(this.getStore_INTERNAL(),e,t)})}),_defineProperty(this,"reset",e=>{this.checkRefCount_INTERNAL(),Te(()=>xe(this.getStore_INTERNAL(),e,Ie))}),_defineProperty(this,"setUnvalidatedAtomValues_DEPRECATED",e=>{this.checkRefCount_INTERNAL();const t=this.getStore_INTERNAL();Te(()=>{for(const[n,r]of e.entries())De(t,new ke(n),r)})})}}var Fe={Snapshot:Snapshot,MutableSnapshot:MutableSnapshot,freshSnapshot:function freshSnapshot(e){const t=new Snapshot(Le());return null!=e?t.map(e):t},cloneSnapshot:cloneSnapshot},Ue=Fe.Snapshot,Ve=Fe.MutableSnapshot,Be=Fe.freshSnapshot,qe=Fe.cloneSnapshot,ze=Object.freeze({__proto__:null,Snapshot:Ue,MutableSnapshot:Ve,freshSnapshot:Be,cloneSnapshot:qe});const{getNextTreeStateVersion:Qe,makeEmptyStoreState:$e}=pe,{cleanUpNode:We,getDownstreamNodes:Ge,setNodeValue:He,setUnvalidatedAtomValue_DEPRECATED:Ke}=x,{graph:Ye}=ae,{cloneGraph:Xe}=ae,{applyAtomValueWrites:Ze}=H,{releaseScheduledRetainablesNow:Je}=Se,{freshSnapshot:et}=ze,{useCallback:tt,useContext:nt,useEffect:rt,useMemo:it,useRef:ot,useState:at}=a.a;function notInAContext(){throw new Error("This component must be used inside a component.")}const st=Object.freeze({getState:notInAContext,replaceState:notInAContext,getGraph:notInAContext,subscribeToTransactions:notInAContext,addTransactionMetadata:notInAContext});let lt=!1;function startNextTreeIfNeeded(e){if(lt)throw new Error("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");if(null===e.nextTree){const t=e.currentTree.version,n=Qe();e.nextTree={...e.currentTree,version:n,stateID:n,dirtyAtoms:new Set,transactionMetadata:{}},e.graphsByVersion.set(n,Xe(s(e.graphsByVersion.get(t))))}}const ut=a.a.createContext({current:st}),useStoreRef=()=>nt(ut),ct=a.a.createContext(null);function sendEndOfBatchNotifications(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[n,i]of t.nodeTransactionSubscriptions)if(r.has(n))for(const[t,n]of i)n(e);for(const[n,r]of t.transactionSubscriptions)r(e);const i=Ge(e,n,r);for(const e of i){const r=t.nodeToComponentSubscriptions.get(e);if(r)for(const[e,[t,i]]of r)i(n)}t.suspendedComponentResolvers.forEach(e=>e())}t.queuedComponentCallbacks_DEPRECATED.forEach(e=>e(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function Batcher({setNotifyBatcherOfChange:e}){const t=useStoreRef(),[n,r]=at([]);return e(()=>r({})),rt(()=>{re.enqueueExecution("Batcher",()=>{const e=t.current.getState(),{nextTree:n}=e;if(null===n)return;e.previousTree=e.currentTree,e.currentTree=n,e.nextTree=null,sendEndOfBatchNotifications(t.current);const r=s(e.previousTree).version;e.graphsByVersion.delete(r),e.previousTree=null,f("recoil_memory_managament_2020")&&Je(t.current)})}),rt(()=>()=>{e(()=>{})},[e]),null}let dt=0;var ft={useStoreRef:useStoreRef,useRecoilMutableSource:function useRecoilMutableSource(){const e=nt(ct);return null==e&&h("Attempted to use a Recoil hook outside of a . must be an ancestor of any component that uses Recoil hooks."),e},RecoilRoot:function RecoilRoot({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){var i;let o;const l=ot(null),u=tt(e=>{l.current=e},[l]),c=null!==(i=a.a.createMutableSource)&&void 0!==i?i:a.a.unstable_createMutableSource,d=null!=n?n:{getState:()=>o.current,replaceState:e=>{const t=f.current.getState();startNextTreeIfNeeded(t);const n=s(t.nextTree);let r;try{lt=!0,r=e(n)}finally{lt=!1}r!==n&&(t.nextTree=r,s(l.current)())},getGraph:e=>{const t=o.current.graphsByVersion;if(t.has(e))return s(t.get(e));const n=Ye();return t.set(e,n),n},subscribeToTransactions:(e,t)=>{if(null==t){const{transactionSubscriptions:t}=f.current.getState(),n=dt++;return t.set(n,e),{release:()=>{t.delete(n)}}}{const{nodeTransactionSubscriptions:n}=f.current.getState();n.has(t)||n.set(t,new Map);const r=dt++;return s(n.get(t)).set(r,e),{release:()=>{const e=n.get(t);e&&(e.delete(r),0===e.size&&n.delete(t))}}}},addTransactionMetadata:e=>{startNextTreeIfNeeded(f.current.getState());for(const t of Object.keys(e))s(f.current.getState().nextTree).transactionMetadata[t]=e[t]}},f=ot(d);o=ot(null!=e?function initialStoreState_DEPRECATED(e,t){const n=$e();return t({set:(t,r)=>{const i=n.currentTree,o=He(e,i,t.key,r),a=new Set(o.keys()),s=i.nonvalidatedAtoms.clone();for(const e of a)s.delete(e);n.currentTree={...i,dirtyAtoms:he(i.dirtyAtoms,a),atomValues:Ze(i.atomValues,o),nonvalidatedAtoms:s}},setUnvalidatedAtomValues:e=>{e.forEach((e,t)=>{n.currentTree=Ke(n.currentTree,t,e)})}}),n}(d,e):null!=t?function initialStoreState(e){return et().map(e).getStore_INTERNAL().getState()}(t):$e());const p=it(()=>c?c(o,()=>o.current.currentTree.version):null,[c,o]);return rt(()=>()=>{for(const e of f.current.getState().knownAtoms)We(f.current,e)},[]),a.a.createElement(ut.Provider,{value:f},a.a.createElement(ct.Provider,{value:p},a.a.createElement(Batcher,{setNotifyBatcherOfChange:u}),r))},sendEndOfBatchNotifications_FOR_TESTING:sendEndOfBatchNotifications};var pt=function filterMap(e,t){const n=new Map;for(const[r,i]of e)t(i,r)&&n.set(r,i);return n};var ht=function filterSet(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n};var vt=function invariant(e,t){if(!e)throw new Error(t)};var yt,mt=function mergeMaps(...e){const t=new Map;for(let n=0;n"};const{batchUpdates:Et}=ne,{DEFAULT_VALUE:wt,getNode:Tt,nodes:Ct}=T,{useRecoilMutableSource:At,useStoreRef:jt}=ft,{isRecoilValue:It}=_,{AbstractRecoilValue:Pt,getRecoilValueAsLoadable:Mt,setRecoilValue:kt,setRecoilValueLoadable:Rt,setUnvalidatedRecoilValue:xt,subscribeToRecoilValue:Dt}=H,{updateRetainCount:Nt}=Se,{RetentionZone:Lt}=C,{Snapshot:Ft,cloneSnapshot:Ut}=ze,{setByAddingToSet:Vt}=u,{isSSR:Bt}=Ee,{mutableSourceExists:qt,useMutableSource:zt}=gt,{useCallback:Qt,useEffect:$t,useMemo:Wt,useRef:Gt,useState:Ht}=a.a;function handleLoadable(e,t,n){if("hasValue"===e.state)return e.contents;if("loading"===e.state){throw new Promise(e=>{n.current.getState().suspendedComponentResolvers.add(e)})}throw"hasError"===e.state?e.contents:new Error(`Invalid value of loadable atom "${t.key}"`)}function useRecoilValueLoadable(e){return f("recoil_memory_managament_2020")&&useRetain(e),qt()?function useRecoilValueLoadable_MUTABLESOURCE(e){const t=jt(),n=Qt(()=>{const n=t.current,r=n.getState().currentTree;return Mt(n,e,r)},[t,e]),r=Qt(()=>n(),[n]),i=Ot(),o=Qt((r,o)=>{const a=t.current;return Dt(a,e,()=>{if(!f("recoil_suppress_rerender_in_callback"))return o();const e=n();l.current.is(e)||o()},i).release},[t,e,i,n]),a=At(),s=zt(a,r,o),l=Gt(s);return $t(()=>{l.current=s}),s}(e):function useRecoilValueLoadable_LEGACY(e){const t=jt(),[n,r]=Ht([]),i=Ot();$t(()=>{const n=t.current,o=n.getState(),s=Dt(n,e,t=>{var i;if(!f("recoil_suppress_rerender_in_callback"))return r([]);const o=Mt(n,e,n.getState().currentTree);(null===(i=a.current)||void 0===i?void 0:i.is(o))||r(o)},i);if(o.nextTree)n.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a.current=null,r([])});else{var l;if(!f("recoil_suppress_rerender_in_callback"))return r([]);const t=Mt(n,e,n.getState().currentTree);(null===(l=a.current)||void 0===l?void 0:l.is(t))||r(t)}return s.release},[i,e,t]);const o=Mt(t.current,e),a=Gt(o);return $t(()=>{a.current=o}),o}(e)}function useRecoilValue(e){const t=jt();return handleLoadable(useRecoilValueLoadable(e),e,t)}function useSetRecoilState(e){const t=jt();return Qt(n=>{kt(t.current,e,n)},[t,e])}function useTransactionSubscription(e){const t=jt();$t(()=>t.current.subscribeToTransactions(e).release,[e,t])}function externallyVisibleAtomValuesInState(e){const t=e.atomValues.toMap(),n=oe(pt(t,(e,t)=>{const n=Tt(t).persistence_UNSTABLE;return null!=n&&"none"!==n.type&&"hasValue"===e.state}),e=>e.contents);return mt(e.nonvalidatedAtoms.toMap(),n)}function usePrevious(e){const t=Gt();return $t(()=>{t.current=e}),t.current}function useGotoRecoilSnapshot(){const e=jt();return Qt(t=>{var n;const r=e.current.getState(),i=null!==(n=r.nextTree)&&void 0!==n?n:r.currentTree,o=t.getStore_INTERNAL().getState().currentTree;Et(()=>{const n=new Set;for(const e of[i.atomValues.keys(),o.atomValues.keys()])for(const t of e){var r,a;(null===(r=i.atomValues.get(t))||void 0===r?void 0:r.contents)!==(null===(a=o.atomValues.get(t))||void 0===a?void 0:a.contents)&&Tt(t).shouldRestoreFromSnapshots&&n.add(t)}n.forEach(t=>{Rt(e.current,new Pt(t),o.atomValues.has(t)?s(o.atomValues.get(t)):wt)}),e.current.replaceState(e=>({...e,stateID:t.getID_INTERNAL()}))})},[e])}class Sentinel{}const Kt=new Sentinel;function useRetain(e){if(f("recoil_memory_managament_2020"))return function useRetain_ACTUAL(e){const t=(Array.isArray(e)?e:[e]).map(e=>e instanceof Lt?e:e.key),n=jt();$t(()=>{if(!f("recoil_memory_managament_2020"))return;const e=n.current;if(r.current&&!Bt)window.clearTimeout(r.current),r.current=null;else{l("Did not retain recoil value on render, or committed after timeout elapsed. This is fine, but odd.");for(const n of t)Nt(e,n,1)}return()=>{for(const n of t)Nt(e,n,-1)}},[n,...t]);const r=Gt(),i=usePrevious(t);if(!(Bt||void 0!==i&&_t(i,t))){const e=n.current;for(const n of t)Nt(e,n,1);if(i)for(const t of i)Nt(e,t,-1);r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{r.current=null;for(const n of t)Nt(e,n,-1)},12e4)}}(e)}var Yt={recoilComponentGetRecoilValueCount_FOR_TESTING:{current:0},useGotoRecoilSnapshot:useGotoRecoilSnapshot,useRecoilCallback:function useRecoilCallback(e,t){const n=jt(),r=useGotoRecoilSnapshot();return Qt((...t)=>{function set(e,t){kt(n.current,e,t)}function reset(e){kt(n.current,e,wt)}const i=Ut(n.current);let o=Kt;return Et(()=>{const n="useRecoilCallback expects a function that returns a function: it accepts a function of the type (RecoilInterface) => T = R and returns a callback function T => R, where RecoilInterface is an object {snapshot, set, ...} and T and R are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if("function"!=typeof e)throw new Error(n);const a=e({set:set,reset:reset,snapshot:i,gotoSnapshot:r});if("function"!=typeof a)throw new Error(n);o=a(...t)}),o instanceof Sentinel&&vt(!1),o},null!=t?[...t,n]:void 0)},useRecoilInterface:function useRecoilInterface_DEPRECATED(){const e=jt(),[t,n]=Ht([]),r=Gt(new Set);r.current=new Set;const i=Gt(new Set),o=Gt(new Map),a=Qt(e=>{const t=o.current.get(e);t&&(t.release(),o.current.delete(e))},[o]),s=Ot();return $t(()=>{const t=e.current;function updateState(e,t){o.current.has(t)&&n([])}ie(r.current,i.current).forEach(e=>{if(o.current.has(e))return void h(`Double subscription to RecoilValue "${e}"`);const n=Dt(t,new Pt(e),t=>{updateState(0,e)},s);o.current.set(e,n);t.getState().nextTree?t.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{updateState(t.getState(),e)}):updateState(t.getState(),e)}),ie(i.current,r.current).forEach(e=>{a(e)}),i.current=r.current}),$t(()=>{const e=o.current;return()=>e.forEach((e,t)=>a(t))},[a]),Wt(()=>{function useSetRecoilState(t){return n=>{kt(e.current,t,n)}}function useRecoilValueLoadable(t){return r.current.has(t.key)||(r.current=Vt(r.current,t.key)),Mt(e.current,t)}function useRecoilValue(t){return handleLoadable(useRecoilValueLoadable(t),t,e)}return{getRecoilValue:useRecoilValue,getRecoilValueLoadable:useRecoilValueLoadable,getRecoilState:function useRecoilState(e){return[useRecoilValue(e),useSetRecoilState(e)]},getRecoilStateLoadable:function useRecoilStateLoadable(e){return[useRecoilValueLoadable(e),useSetRecoilState(e)]},getSetRecoilState:useSetRecoilState,getResetRecoilState:function useResetRecoilState(t){return()=>kt(e.current,t,wt)}}},[r,e])},useRecoilSnapshot:function useRecoilSnapshot(){const e=jt(),[t,n]=Ht(()=>Ut(e.current)),r=usePrevious(t),i=Gt();return $t(()=>(i.current&&!Bt&&window.clearTimeout(i.current),t.retain()),[t]),useTransactionSubscription(Qt(e=>n(Ut(e)),[])),r===t||Bt||(i.current&&(null==r||r.release(),window.clearTimeout(i.current)),t.retain(),i.current=window.setTimeout(()=>{t.release(),i.current=null},12e4)),t},useRecoilState:function useRecoilState(e){return[useRecoilValue(e),useSetRecoilState(e)]},useRecoilStateLoadable:function useRecoilStateLoadable(e){return[useRecoilValueLoadable(e),useSetRecoilState(e)]},useRecoilTransactionObserver:function useRecoilTransactionObserver(e){useTransactionSubscription(Qt(t=>{const n=Ut(t,"current"),r=Ut(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))},useRecoilValue:useRecoilValue,useRecoilValueLoadable:useRecoilValueLoadable,useRetain:useRetain,useResetRecoilState:function useResetRecoilState(e){const t=jt();return Qt(()=>{kt(t.current,e,wt)},[t,e])},useSetRecoilState:useSetRecoilState,useSetUnvalidatedAtomValues:function useSetUnvalidatedAtomValues(){const e=jt();return(t,n={})=>{Et(()=>{e.current.addTransactionMetadata(n),t.forEach((t,n)=>xt(e.current,new Pt(n),t))})}},useTransactionObservation_DEPRECATED:function useTransactionObservation_DEPRECATED(e){useTransactionSubscription(Qt(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(l("Transaction subscribers notified without a previous tree being present -- this is a bug in Recoil"),n=t.getState().currentTree);const i=externallyVisibleAtomValuesInState(r),o=externallyVisibleAtomValuesInState(n),a=oe(Ct,e=>{var t,n,r,i;return{persistence_UNSTABLE:{type:null!==(t=null===(n=e.persistence_UNSTABLE)||void 0===n?void 0:n.type)&&void 0!==t?t:"none",backButton:null!==(r=null===(i=e.persistence_UNSTABLE)||void 0===i?void 0:i.backButton)&&void 0!==r&&r}}}),s=ht(r.dirtyAtoms,e=>i.has(e)||o.has(e));e({atomValues:i,previousAtomValues:o,atomInfo:a,modifiedAtoms:s,transactionMetadata:{...r.transactionMetadata}})},[e]))},useTransactionSubscription_DEPRECATED:useTransactionSubscription};const{peekNodeInfo:Xt}=x,{useStoreRef:Zt}=ft;var Jt=function useGetRecoilValueInfo(){const e=Zt();return({key:t})=>Xt(e.current,e.current.getState().currentTree,t)};const{RecoilRoot:en,useStoreRef:tn}=ft,{useMemo:nn}=a.a;var rn=function useRecoilBridgeAcrossReactRoots(){const e=tn().current;return nn(()=>function RecoilBridge({children:t}){return a.a.createElement(en,{store_INTERNAL:e},t)},[e])};var on=function isPromise(e){return!!e&&"function"==typeof e.then};class Canceled{}const an=new Canceled,sn={getValue(){if("loading"===this.state)throw this.contents.then(({__value:e})=>e);if("hasValue"!==this.state)throw this.contents;return this.contents},toPromise(){return"hasValue"===this.state?Promise.resolve(this.contents):"hasError"===this.state?Promise.reject(this.contents):this.contents.then(({__value:e})=>e)},valueMaybe(){return"hasValue"===this.state?this.contents:void 0},valueOrThrow(){if("hasValue"!==this.state){throw new Error(`Loadable expected value, but in "${this.state}" state`)}return this.contents},errorMaybe(){return"hasError"===this.state?this.contents:void 0},errorOrThrow(){if("hasError"!==this.state){throw new Error(`Loadable expected error, but in "${this.state}" state`)}return this.contents},promiseMaybe(){return"loading"===this.state?this.contents.then(({__value:e})=>e):void 0},promiseOrThrow(){if("loading"!==this.state){throw new Error(`Loadable expected promise, but in "${this.state}" state`)}return this.contents.then(({__value:e})=>e)},is(e){return e.state===this.state&&e.contents===this.contents},map(e){if("hasError"===this.state)return this;if("hasValue"===this.state)try{const t=e(this.contents);return on(t)?loadableWithPromise(t):loadableWithValue(t)}catch(t){return on(t)?loadableWithPromise(t.next(()=>e(this.contents))):loadableWithError(t)}if("loading"===this.state)return loadableWithPromise(this.contents.then(e).catch(t=>{if(on(t))return t.then(()=>e(this.contents));throw t}));throw new Error("Invalid Loadable state")}};function loadableWithValue(e){return Object.freeze({state:"hasValue",contents:e,...sn})}function loadableWithError(e){return Object.freeze({state:"hasError",contents:e,...sn})}function loadableWithPromise(e){return Object.freeze({state:"loading",contents:e,...sn})}var ln={loadableWithValue:loadableWithValue,loadableWithError:loadableWithError,loadableWithPromise:loadableWithPromise,loadableLoading:function loadableLoading(){return loadableWithPromise(new Promise(()=>{}))},loadableAll:function loadableAll(e){return e.every(e=>"hasValue"===e.state)?loadableWithValue(e.map(e=>e.contents)):e.some(e=>"hasError"===e.state)?loadableWithError(s(e.find(e=>"hasError"===e.state),"Invalid loadable passed to loadableAll").contents):loadableWithPromise(Promise.all(e.map(e=>e.contents)).then(e=>({__value:e})))},Canceled:Canceled,CANCELED:an};const{isReactNative:un,isSSR:cn}=Ee;var dn=function stableStringify(e,t={allowFunctions:!1}){return function stringify(e,t,n){if("string"==typeof e&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if(!0!==(null==t?void 0:t.allowFunctions))throw new Error("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(null===e)return"null";var r;if("object"!=typeof e)return null!==(r=JSON.stringify(e))&&void 0!==r?r:"";if(on(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((e,n)=>stringify(e,t,n.toString()))}]`;if("function"==typeof e.toJSON)return stringify(e.toJSON(n),t,n);if(e instanceof Map){const r={};for(const[n,i]of e)r["string"==typeof n?n:stringify(n,t)]=i;return stringify(r,t,n)}return e instanceof Set?stringify(Array.from(e).sort((e,n)=>stringify(e,t).localeCompare(stringify(n,t))),t,n):void 0!==Symbol&&null!=e[Symbol.iterator]&&"function"==typeof e[Symbol.iterator]?stringify(Array.from(e),t,n):`{${Object.keys(e).filter(t=>void 0!==e[t]).sort().map(n=>`${stringify(n,t)}:${stringify(e[n],t,n)}`).join(",")}}`}(e,t)};const findLeaf=(e,t,n)=>{var r;if(null==e)return;if(null==n||null===(r=n.onNodeVisit)||void 0===r||r.call(n,e),"leaf"===e.type)return e;const i=t(e.nodeKey);return findLeaf(e.branches.get(i),t,n)},addLeaf=(e,t,n,r,i,o)=>{var a;let s;if(null==e)if(0===t.length)s={type:"leaf",value:r,parent:n,branchKey:i};else{const[e,...a]=t,[l,u]=e;s={type:"branch",nodeKey:l,parent:n,branches:new Map,branchKey:i},s.branches.set(u,addLeaf(null,a,s,r,u,o))}else if(s=e,t.length){const[n,...i]=t,[a,s]=n;("branch"!==e.type||e.nodeKey!==a)&&vt(!1),e.branches.set(s,addLeaf(e.branches.get(s),i,e,r,s,o))}return null==o||null===(a=o.onNodeVisit)||void 0===a||a.call(o,s),s},pruneNodeFromTree=(e,t,n)=>n?(n.branches.delete(t.branchKey),pruneUpstreamBranches(e,n,n.parent)):e===t,pruneUpstreamBranches=(e,t,n)=>n?(0===t.branches.size&&n.branches.delete(t.branchKey),pruneUpstreamBranches(e,n,n.parent)):e===t,countDownstreamLeaves=e=>"leaf"===e.type?1:Array.from(e.branches.values()).reduce((e,t)=>e+countDownstreamLeaves(t),0);var fn=class TreeCache{constructor(e){var t,n,r;_defineProperty(this,"_numLeafs",void 0),_defineProperty(this,"_root",void 0),_defineProperty(this,"_onHit",void 0),_defineProperty(this,"_onSet",void 0),_defineProperty(this,"_mapNodeValue",void 0),this._numLeafs=0,this._root=null,this._onHit=null!==(t=null==e?void 0:e.onHit)&&void 0!==t?t:()=>{},this._onSet=null!==(n=null==e?void 0:e.onSet)&&void 0!==n?n:()=>{},this._mapNodeValue=null!==(r=null==e?void 0:e.mapNodeValue)&&void 0!==r?r:e=>e}size(){return this._numLeafs}root(){return this._root}get(e,t){var n;return null===(n=this.getLeafNode(e,t))||void 0===n?void 0:n.value}getLeafNode(e,t){return findLeaf(this.root(),t=>this._mapNodeValue(e(t)),{onNodeVisit:e=>{null==t||t.onNodeVisit(e),"leaf"===e.type&&this._onHit(e)}})}set(e,t,n){let r;const i=addLeaf(this.root(),e.map(([e,t])=>[e,this._mapNodeValue(t)]),null,t,null,{onNodeVisit:e=>{null==n||n.onNodeVisit(e),"leaf"===e.type&&(r=e)}});this.root()||(this._root=i),this._numLeafs++,this._onSet(s(r))}delete(e){if(!this.root())return!1;const t=s(this.root());return!!pruneNodeFromTree(t,e,e.parent)&&(e===t||"branch"===t.type&&!t.branches.size?(this._root=null,this._numLeafs=0,!0):(this._numLeafs-=countDownstreamLeaves(e),!0))}clear(){this._numLeafs=0,this._root=null}},pn=Object.freeze({__proto__:null,TreeCache:fn});var hn=class LRUCache{constructor(e){var t;_defineProperty(this,"_maxSize",void 0),_defineProperty(this,"_size",void 0),_defineProperty(this,"_head",void 0),_defineProperty(this,"_tail",void 0),_defineProperty(this,"_map",void 0),_defineProperty(this,"_keyMapper",void 0),this._maxSize=e.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=null!==(t=e.mapKey)&&void 0!==t?t:e=>e}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(e){return this._map.has(this._keyMapper(e))}get(e){const t=this._keyMapper(e),n=this._map.get(t);if(n)return this.set(e,n.value),n.value}set(e,t){const n=this._keyMapper(e);this._map.get(n)&&this.delete(e);const r=this.head(),i={key:e,right:r,left:null,value:t};r?r.left=i:this._tail=i,this._map.set(n,i),this._head=i,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const e=this.tail();e&&this.delete(e.key)}delete(e){const t=this._keyMapper(e);if(!this._size||!this._map.has(t))return;const n=s(this._map.get(t)),r=n.right,i=n.left;r&&(r.left=n.left),i&&(i.right=n.right),n===this.head()&&(this._head=r),n===this.tail()&&(this._tail=i),this._map.delete(t),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}},vn=Object.freeze({__proto__:null,LRUCache:hn});const{LRUCache:yn}=vn,{TreeCache:mn}=pn;var bn=function treeCacheLRU(e,t=(e=>e)){const n=new yn({maxSize:e}),r=new mn({mapNodeValue:t,onHit:e=>{n.set(e,!0)},onSet:t=>{const i=n.tail();n.set(t,!0),i&&r.size()>e&&r.delete(i.key)}});return r};const{TreeCache:gn}=pn,_n={equality:"reference",eviction:"none",maxSize:1/0};var Sn=function treeCacheFromPolicy({equality:e=_n.equality,eviction:t=_n.eviction,maxSize:n=_n.maxSize}=_n){return function getTreeCache(e,t,n){switch(e){case"none":return new gn({mapNodeValue:n});case"lru":return bn(s(t),n)}throw new Error("Unrecognized eviction policy "+e)}(t,n,function getValueMapper(e){switch(e){case"reference":return e=>e;case"value":return e=>dn(e)}throw new Error("Unrecognized equality policy "+e)}(e))};var On={startPerfBlock:function startPerfBlock(e){return()=>null}};const{CANCELED:En,Canceled:wn,loadableWithError:Tn,loadableWithPromise:Cn,loadableWithValue:An}=ln,{getNodeLoadable:jn,peekNodeLoadable:In,setNodeValue:Pn}=x,{saveDependencyMapToStore:Mn}=ae,{DEFAULT_VALUE:kn,RecoilValueNotReady:Rn,getConfigDeletionHandler:xn,registerNode:Dn}=T,{isRecoilValue:Nn}=_,{AbstractRecoilValue:Ln}=_,{setRecoilValueLoadable:Fn}=H,{retainedByOptionWithDefault:Un}=Se,{startPerfBlock:Vn}=On,Bn=[],qn=new Map,zn=(()=>{let e=0;return()=>e++})();var Qn=function selector(e){const{key:t,get:n,cachePolicy_UNSTABLE:r}=e,i=null!=e.set?e.set:void 0,o=Sn(null!=r?r:{equality:"reference",eviction:"none"}),a=Un(e.retainedBy_UNSTABLE),u=new Map;let c=0;function selectorIsLive(){return!f("recoil_memory_managament_2020")||c>0}function getExecutionInfo(e){return u.has(e)||u.set(e,{depValuesDiscoveredSoFarDuringAsyncWork:null,latestLoadable:null,latestExecutionId:null,stateVersion:null}),s(u.get(e))}function selectorInit(e){return c++,e.getState().knownSelectors.add(t),()=>{c--,e.getState().knownSelectors.delete(t),u.delete(e)}}function selectorShouldDeleteConfigOnRelease(){return void 0!==xn(t)&&!selectorIsLive()}function notifyStoreWhenAsyncSettles(e,t,n){if("loading"===t.state){let t=qn.get(n);null==t&&qn.set(n,t=new Set),t.add(e)}}function getCachedNodeLoadable(e,t,n){if(t.atomValues.has(n))return s(t.atomValues.get(n));const r=jn(e,t,n),i=e.getState().knownSelectors.has(n);return"loading"!==r.state&&i&&t.atomValues.set(n,r),r}function wrapPendingDependencyPromise(e,n,r,i,o){return n.then(n=>{if(!selectorIsLive())return clearExecutionInfo(e,o),En;if(n instanceof wn)return l("Selector was released while it had dependencies"),En;const{__key:i,__value:a}=null!=n?n:{};let s=!0;null!=i&&(r.atomValues.set(i,An(a)),s=!1);const[u,c]=evaluateSelectorGetter(e,r,o,s);if(isLatestExecution(e,o)&&updateExecutionInfoDepValues(c,e,o),maybeFreezeLoadableContents(u),"loading"!==u.state&&(setCache(r,depValuesToDepRoute(c),u),setDepsInStore(e,r,new Set(c.keys()),o),setLoadableInStoreToNotifyDeps(e,u,o)),"hasError"===u.state)throw u.contents;return"hasValue"===u.state?{__value:u.contents,__key:t}:u.contents}).catch(t=>{if(!selectorIsLive())return clearExecutionInfo(e,o),En;const n=Tn(t);throw maybeFreezeValue(t),setCache(r,depValuesToDepRoute(i),Tn(t)),setDepsInStore(e,r,new Set(i.keys()),o),setLoadableInStoreToNotifyDeps(e,n,o),t})}function setLoadableInStoreToNotifyDeps(e,n,r){isLatestExecution(e,r)&&(setExecutionInfo(n,e),function notifyStoresOfSettledAsync(e,n){const r=qn.get(n);if(void 0!==r){for(const n of r)Fn(n,new Ln(t),e);qn.delete(n)}}(n,r))}function setDepsInStore(e,n,r,i){var o,a,s,l,u,c,d;(isLatestExecution(e,i)||n.version===(null===(o=e.getState())||void 0===o||null===(a=o.currentTree)||void 0===a?void 0:a.version)||n.version===(null===(s=e.getState())||void 0===s||null===(l=s.nextTree)||void 0===l?void 0:l.version))&&Mn(new Map([[t,r]]),e,null!==(u=null===(c=e.getState())||void 0===c||null===(d=c.nextTree)||void 0===d?void 0:d.version)&&void 0!==u?u:e.getState().currentTree.version)}function evaluateSelectorGetter(e,r,i,o=!1){const a=Vn(t);let s,l,u=!1;const c=new Map,d=new Set;function getRecoilValue(t){const{key:n}=t;!function setNewDepInStore(e,t,n,r,i){n.add(r),setDepsInStore(e,t,n,i)}(e,r,d,n,i);const a=o?jn(e,r,n):getCachedNodeLoadable(e,r,n);if(c.set(n,a),"hasValue"===a.state)return a.contents;throw a.contents}setDepsInStore(e,r,d,i);try{s=n({get:getRecoilValue}),s=Nn(s)?getRecoilValue(s):s,on(s)?s=function wrapPendingPromise(e,n,r,i,o){return n.then(n=>{if(!selectorIsLive())return clearExecutionInfo(e,o),En;const a=An(n);return maybeFreezeValue(n),setCache(r,depValuesToDepRoute(i),a),setDepsInStore(e,r,new Set(i.keys()),o),setLoadableInStoreToNotifyDeps(e,a,o),{__value:n,__key:t}}).catch(t=>{if(!selectorIsLive())return clearExecutionInfo(e,o),En;if(isLatestExecution(e,o)&&updateExecutionInfoDepValues(i,e,o),on(t))return wrapPendingDependencyPromise(e,t,r,i,o);const n=Tn(t);throw maybeFreezeValue(t),setCache(r,depValuesToDepRoute(i),n),setDepsInStore(e,r,new Set(i.keys()),o),setLoadableInStoreToNotifyDeps(e,n,o),t})}(e,s,r,c,i).finally(a):a()}catch(t){s=t,on(s)?s=wrapPendingDependencyPromise(e,s,r,c,i).finally(a):(u=!0,a())}return l=u?Tn(s):on(s)?Cn(s):An(s),maybeFreezeLoadableContents(l),[l,c]}function depValuesToDepRoute(e){return Array.from(e.entries()).map(([e,t])=>[e,t.contents])}function getValFromRunningNewExecutionAndUpdatedDeps(e,t){const n=zn(),[r,i]=evaluateSelectorGetter(e,t,n);return setExecutionInfo(r,e,i,n,t),function maybeSetCacheWithLoadable(e,t,n){"loading"!==n.state&&setCache(e,t,n)}(t,depValuesToDepRoute(i),r),notifyStoreWhenAsyncSettles(e,r,n),r}function getSelectorValAndUpdatedDeps(e,n){const r=function getValFromCacheAndUpdatedDownstreamDeps(e,n){const r=new Set,i=getExecutionInfo(e),a=o.get(t=>{"string"!=typeof t&&vt(!1);return getCachedNodeLoadable(e,n,t).contents},{onNodeVisit:e=>{"branch"===e.type&&e.nodeKey!==t&&"string"==typeof e.nodeKey&&r.add(e.nodeKey)}});return a&&setDepsInStore(e,n,r,i.latestExecutionId),a}(e,n);if(null!=r)return setExecutionInfo(r,e),r;const i=function getExecutionInfoOfInProgressExecution(e,t){var n;const[,r]=null!==(n=Array.from(u.entries()).find(([,n])=>null!=n.latestLoadable&&null!=n.latestExecutionId&&!function haveAsyncDepsChanged(e,t){var n,r;const i=getExecutionInfo(e),o=null!==(n=i.depValuesDiscoveredSoFarDuringAsyncWork)&&void 0!==n?n:new Map,a=Array((null!==(r=d.get(t.version))&&void 0!==r?r:new Map).entries()),s=d.has(t.version)&&a.length===o.size&&a.every(([e,t])=>o.get(e)===t);if(null==o||t.version===i.stateVersion||s)return!1;return d.set(t.version,new Map(o)),Array.from(o).some(([n,r])=>{const i=getCachedNodeLoadable(e,t,n);return i.contents!==r.contents&&!("loading"===r.state&&"loading"!==i.state)})}(e,t)))&&void 0!==n?n:[];return r}(e,n);if(i){const t=i;return notifyStoreWhenAsyncSettles(e,s(t.latestLoadable),s(t.latestExecutionId)),s(t.latestLoadable)}return getValFromRunningNewExecutionAndUpdatedDeps(e,n)}const d=new Map;function setExecutionInfo(e,t,n,r,i){const o=getExecutionInfo(t);"loading"===e.state?(o.depValuesDiscoveredSoFarDuringAsyncWork=n,o.latestExecutionId=r,o.latestLoadable=e,o.stateVersion=null==i?void 0:i.version):(o.depValuesDiscoveredSoFarDuringAsyncWork=null,o.latestExecutionId=null,o.latestLoadable=null,o.stateVersion=null)}function updateExecutionInfoDepValues(e,t,n){const r=getExecutionInfo(t);isLatestExecution(t,n)&&(r.depValuesDiscoveredSoFarDuringAsyncWork=e)}function clearExecutionInfo(e,t){isLatestExecution(e,t)&&u.delete(e)}function isLatestExecution(e,t){return t===getExecutionInfo(e).latestExecutionId}function maybeFreezeLoadableContents(e){"loading"!==e.state&&maybeFreezeValue(e.contents)}function maybeFreezeValue(e){0}function setCache(e,n,r){e.atomValues.set(t,r),o.set(n,r)}function selectorPeek(e,t){return o.get(n=>{"string"!=typeof n&&vt(!1);const r=In(e,t,n);return null==r?void 0:r.contents})}function selectorGet(e,n){return function detectCircularDependencies(e){if(Bn.includes(t)){const e="Recoil selector has circular dependencies: "+Bn.slice(Bn.indexOf(t)).join(" → ");return Tn(new Error(e))}Bn.push(t);try{return e()}finally{Bn.pop()}}(()=>getSelectorValAndUpdatedDeps(e,n))}function invalidateSelector(e){e.atomValues.delete(t)}if(null!=i){return Dn({key:t,peek:selectorPeek,get:selectorGet,set:function selectorSet(e,t,n){let r=!1;const o=new Map;function getRecoilValue({key:n}){if(r)throw new Error("Recoil: Async selector sets are not currently supported.");const i=getCachedNodeLoadable(e,t,n);if("hasValue"===i.state)return i.contents;throw"loading"===i.state?new Rn(n):i.contents}function setRecoilState(n,i){if(r)throw new Error("Recoil: Async selector sets are not currently supported.");const a="function"==typeof i?i(getRecoilValue(n)):i;Pn(e,t,n.key,a).forEach((e,t)=>o.set(t,e))}const a=i({set:setRecoilState,get:getRecoilValue,reset:function resetRecoilState(e){setRecoilState(e,kn)}},n);if(void 0!==a)throw on(a)?new Error("Recoil: Async selector sets are not currently supported."):new Error("Recoil: selector set should be a void function.");return r=!0,o},init:selectorInit,invalidate:invalidateSelector,shouldDeleteConfigOnRelease:selectorShouldDeleteConfigOnRelease,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:a})}return Dn({key:t,peek:selectorPeek,get:selectorGet,init:selectorInit,invalidate:invalidateSelector,shouldDeleteConfigOnRelease:selectorShouldDeleteConfigOnRelease,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:a})};const{loadableWithError:$n,loadableWithPromise:Wn,loadableWithValue:Gn}=ln,{DEFAULT_VALUE:Hn,DefaultValue:Kn,getConfigDeletionHandler:Yn,registerNode:Xn,setConfigDeletionHandler:Zn}=T,{isRecoilValue:Jn}=_,{markRecoilValueModified:er,setRecoilValue:tr,setRecoilValueLoadable:nr}=H,{retainedByOptionWithDefault:rr}=Se;function baseAtom(e){const{key:t,persistence_UNSTABLE:n}=e,r=rr(e.retainedBy_UNSTABLE);let i=0,o=on(e.default)?Wn(e.default.then(e=>{o=Gn(e);return{__key:t,__value:e}}).catch(e=>{throw o=$n(e),e})):Gn(e.default),a=void 0;const u=new Map;const c=Xn({key:t,peek:function peekAtom(e,n){var r,i,s;return null!==(r=null!==(i=n.atomValues.get(t))&&void 0!==i?i:null===(s=a)||void 0===s?void 0:s[1])&&void 0!==r?r:o},get:function getAtom(e,r){if(r.atomValues.has(t))return s(r.atomValues.get(t));if(r.nonvalidatedAtoms.has(t)){if(null!=a)return a;if(null==n)return h(`Tried to restore a persisted value for atom ${t} but it has no persistence settings.`),o;const e=r.nonvalidatedAtoms.get(t),i=n.validator(e,Hn),s=i instanceof Kn?o:Gn(i);return a=s,a}return o},set:function setAtom(e,n,r){if(n.atomValues.has(t)){const e=s(n.atomValues.get(t));if("hasValue"===e.state&&r===e.contents)return new Map}else if(!n.nonvalidatedAtoms.has(t)&&r instanceof Kn)return new Map;return a=void 0,(new Map).set(t,Gn(r))},init:function initAtom(n,r,a){i++;const s=n.getState().knownAtoms.has(t);if(n.getState().knownAtoms.add(t),"loading"===o.state){const notifyDefaultSubscribers=()=>{var e;(null!==(e=n.getState().nextTree)&&void 0!==e?e:n.getState().currentTree).atomValues.has(t)||er(n,c)};o.contents.then(notifyDefaultSubscribers).catch(notifyDefaultSubscribers)}let d=Hn,f=null;if(null!=e.effects_UNSTABLE&&!s){let r=!0;const setSelf=e=>t=>{if(r){const e=d instanceof Kn||on(d)?"hasValue"===o.state?o.contents:Hn:d;d="function"==typeof t?t(e):t}else{if(on(t))throw new Error("Setting atoms to async values is not implemented.");"function"!=typeof t&&(f={effect:e,value:t}),tr(n,c,"function"==typeof t?n=>{const r=t(n);return f={effect:e,value:r},r}:t)}},resetSelf=e=>()=>setSelf(e)(Hn),onSet=e=>r=>{n.subscribeToTransactions(n=>{var i;let{currentTree:a,previousTree:s}=n.getState();s||(l("Transaction subscribers notified without a next tree being present -- this is a bug in Recoil"),s=a);const u=a.atomValues.get(t);if(null==u||"hasValue"===u.state){var c,d,p;const n=null!=u?u.contents:Hn,i=null!==(c=s.atomValues.get(t))&&void 0!==c?c:o,a="hasValue"===i.state?i.contents:Hn;(null===(d=f)||void 0===d?void 0:d.effect)===e&&(null===(p=f)||void 0===p?void 0:p.value)===n||r(n,a)}(null===(i=f)||void 0===i?void 0:i.effect)===e&&(f=null)},t)};for(const t of null!==(p=e.effects_UNSTABLE)&&void 0!==p?p:[]){var p;const e=t({node:c,trigger:a,setSelf:setSelf(t),resetSelf:resetSelf(t),onSet:onSet(t)});null!=e&&u.set(n,e)}r=!1}if(!(d instanceof Kn)){var h;const e=on(d)?Wn(function wrapPendingPromise(e,n){const r=n.then(n=>{var i,o;return(null===(o=(null!==(i=e.getState().nextTree)&&void 0!==i?i:e.getState().currentTree).atomValues.get(t))||void 0===o?void 0:o.contents)===r&&tr(e,c,n),{__key:t,__value:n}}).catch(n=>{var i,o;throw(null===(o=(null!==(i=e.getState().nextTree)&&void 0!==i?i:e.getState().currentTree).atomValues.get(t))||void 0===o?void 0:o.contents)===r&&nr(e,c,$n(n)),n});return r}(n,d)):Gn(d);r.atomValues.set(t,e),null===(h=n.getState().nextTree)||void 0===h||h.atomValues.set(t,e)}return()=>{var e;i--,null===(e=u.get(n))||void 0===e||e(),u.delete(n),n.getState().knownAtoms.delete(t)}},invalidate:function invalidateAtom(){a=void 0},shouldDeleteConfigOnRelease:function shouldDeleteConfigOnReleaseAtom(){return void 0!==Yn(t)&&i<=0},dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return c}function atom(e){const{default:t,...n}=e;return Jn(t)?function atomWithFallback(e){const t=atom({...e,default:Hn,persistence_UNSTABLE:void 0===e.persistence_UNSTABLE?void 0:{...e.persistence_UNSTABLE,validator:t=>t instanceof Kn?t:s(e.persistence_UNSTABLE).validator(t,Hn)},effects_UNSTABLE:e.effects_UNSTABLE}),n=Qn({key:e.key+"__withFallback",get:({get:n})=>{const r=n(t);return r instanceof Kn?e.default:r},set:({set:e},n)=>e(t,n),dangerouslyAllowMutability:e.dangerouslyAllowMutability});return Zn(n.key,Yn(e.key)),n}({...n,default:t}):baseAtom({...n,default:t})}var ir=atom;var or=class MapCache{constructor(e){var t;_defineProperty(this,"_map",void 0),_defineProperty(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=null!==(t=null==e?void 0:e.mapKey)&&void 0!==t?t:e=>e}size(){return this._map.size}has(e){return this._map.has(this._keyMapper(e))}get(e){return this._map.get(this._keyMapper(e))}set(e,t){this._map.set(this._keyMapper(e),t)}delete(e){this._map.delete(this._keyMapper(e))}clear(){this._map.clear()}},ar=Object.freeze({__proto__:null,MapCache:or});const{LRUCache:sr}=vn,{MapCache:lr}=ar,ur={equality:"reference",eviction:"none",maxSize:1/0};var cr=function cacheFromPolicy({equality:e=ur.equality,eviction:t=ur.eviction,maxSize:n=ur.maxSize}=ur){return function getCache(e,t,n){switch(e){case"none":return new lr({mapKey:n});case"lru":return new sr({mapKey:n,maxSize:s(t)})}throw new Error("Unrecognized eviction policy "+e)}(t,n,function getValueMapper$1(e){switch(e){case"reference":return e=>e;case"value":return e=>dn(e)}throw new Error("Unrecognized equality policy "+e)}(e))};const{setConfigDeletionHandler:dr}=T;let fr=0;var pr=function selectorFamily(e){var t;const n=cr(null!==(t=e.cachePolicyForParams_UNSTABLE)&&void 0!==t?t:{equality:"value",eviction:"none"});return t=>{var r;const i=n.get(t);if(null!=i)return i;const o=`${e.key}__selectorFamily/${null!==(r=dn(t,{allowFunctions:!0}))&&void 0!==r?r:"void"}/${fr++}`,myGet=n=>e.get(t)(n),a=e.cachePolicy_UNSTABLE,s="function"==typeof e.retainedBy_UNSTABLE?e.retainedBy_UNSTABLE(t):e.retainedBy_UNSTABLE;let l;if(null!=e.set){const n=e.set;l=Qn({key:o,get:myGet,set:(e,r)=>n(t)(e,r),cachePolicy_UNSTABLE:a,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:s})}else l=Qn({key:o,get:myGet,cachePolicy_UNSTABLE:a,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:s});return n.set(t,l),dr(l.key,()=>{n.delete(t)}),l}};const{DEFAULT_VALUE:hr,DefaultValue:vr,setConfigDeletionHandler:yr}=T;var mr=function atomFamily(e){var t;const n=cr(null!==(t=e.cachePolicyForParams_UNSTABLE)&&void 0!==t?t:{equality:"value",eviction:"none"}),r={key:e.key,default:hr,persistence_UNSTABLE:e.persistence_UNSTABLE};let i;i=ir(r);const o=pr({key:e.key+"__atomFamily/Default",get:t=>({get:n})=>{const r=n("function"==typeof i?i(t):i);return r instanceof vr?"function"==typeof e.default?e.default(t):e.default:r},dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:e.retainedBy_UNSTABLE});return t=>{var r;const i=n.get(t);if(null!=i)return i;const{cachePolicyForParams_UNSTABLE:a,...s}=e,l=ir({...s,key:`${e.key}__${null!==(r=dn(t))&&void 0!==r?r:"void"}`,default:o(t),retainedBy_UNSTABLE:"function"==typeof e.retainedBy_UNSTABLE?e.retainedBy_UNSTABLE(t):e.retainedBy_UNSTABLE,effects_UNSTABLE:"function"==typeof e.effects_UNSTABLE?e.effects_UNSTABLE(t):e.effects_UNSTABLE});return n.set(t,l),yr(l.key,()=>{n.delete(t)}),l}};const br=pr({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});var gr=function constSelector(e){return br(e)};const _r=pr({key:"__error",get:e=>()=>{throw new Error(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});var Sr=function errorSelector(e){return _r(e)};var Or=function readOnlySelector(e){return e};const{loadableWithError:Er,loadableWithPromise:wr,loadableWithValue:Tr}=ln;function concurrentRequests(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[i,o]of t.entries())try{n[i]=e(o)}catch(e){r[i]=e}return[n,r]}function isError(e){return null!=e&&!on(e)}function unwrapDependencies(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function getValueFromLoadablePromiseResult(e){return null!=e&&"object"==typeof e&&e.hasOwnProperty("__value")?e.__value:e}function wrapResults(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((e,n,r)=>({...e,[n]:t[r]}),{})}function wrapLoadables(e,t,n){return wrapResults(e,n.map((e,n)=>null==e?Tr(t[n]):on(e)?wr(e):Er(e)))}var Cr={waitForNone:pr({key:"__waitForNone",get:e=>({get:t})=>{const n=unwrapDependencies(e),[r,i]=concurrentRequests(t,n);return wrapLoadables(e,r,i)}}),waitForAny:pr({key:"__waitForAny",get:e=>({get:t})=>{const n=unwrapDependencies(e),[r,i]=concurrentRequests(t,n);return i.some(e=>!on(e))?wrapLoadables(e,r,i):new Promise(t=>{for(const[n,o]of i.entries())on(o)&&o.then(o=>{r[n]=getValueFromLoadablePromiseResult(o),i[n]=void 0,t(wrapLoadables(e,r,i))}).catch(o=>{i[n]=o,t(wrapLoadables(e,r,i))})})}}),waitForAll:pr({key:"__waitForAll",get:e=>({get:t})=>{const n=unwrapDependencies(e),[r,i]=concurrentRequests(t,n);if(i.every(e=>null==e))return wrapResults(e,r);const o=i.find(isError);if(null!=o)throw o;return Promise.all(i).then(t=>wrapResults(e,function combineAsyncResultsWithSyncResults(e,t){return t.map((t,n)=>void 0===t?e[n]:t)}(r,t).map(getValueFromLoadablePromiseResult)))}}),waitForAllSettled:pr({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=unwrapDependencies(e),[r,i]=concurrentRequests(t,n);return i.every(e=>!on(e))?wrapLoadables(e,r,i):Promise.all(i.map((e,t)=>on(e)?e.then(e=>{r[t]=getValueFromLoadablePromiseResult(e),i[t]=void 0}).catch(e=>{r[t]=void 0,i[t]=e}):null)).then(()=>wrapLoadables(e,r,i))}}),noWait:pr({key:"__noWait",get:e=>({get:t})=>{try{return Tr(t(e))}catch(e){return on(e)?wr(e):Er(e)}}})};const{batchUpdates:Ar,setBatcher:jr}=ne,{DefaultValue:Ir}=T,{RecoilRoot:Pr}=ft,{isRecoilValue:Mr}=_,{retentionZone:kr}=C,{freshSnapshot:Rr}=ze,{useGotoRecoilSnapshot:xr,useRecoilCallback:Dr,useRecoilSnapshot:Nr,useRecoilState:Lr,useRecoilStateLoadable:Fr,useRecoilTransactionObserver:Ur,useRecoilValue:Vr,useRecoilValueLoadable:Br,useResetRecoilState:qr,useRetain:zr,useSetRecoilState:Qr,useSetUnvalidatedAtomValues:$r,useTransactionObservation_DEPRECATED:Wr}=Yt,{noWait:Gr,waitForAll:Hr,waitForAllSettled:Kr,waitForAny:Yr,waitForNone:Xr}=Cr;var Zr={DefaultValue:Ir,RecoilRoot:Pr,useRecoilBridgeAcrossReactRoots_UNSTABLE:rn,atom:ir,selector:Qn,retentionZone:kr,atomFamily:mr,selectorFamily:pr,constSelector:gr,errorSelector:Sr,readOnlySelector:Or,useRecoilValue:Vr,useRecoilValueLoadable:Br,useRecoilState:Lr,useRecoilStateLoadable:Fr,useSetRecoilState:Qr,useResetRecoilState:qr,useGetRecoilValueInfo_UNSTABLE:Jt,useRetain:zr,useRecoilCallback:Dr,useGotoRecoilSnapshot:xr,useRecoilSnapshot:Nr,useRecoilTransactionObserver_UNSTABLE:Ur,useTransactionObservation_UNSTABLE:Wr,useSetUnvalidatedAtomValues_UNSTABLE:$r,noWait:Gr,waitForNone:Xr,waitForAny:Yr,waitForAll:Hr,waitForAllSettled:Kr,isRecoilValue:Mr,batchUpdates:Ar,setBatcher:jr,snapshot_UNSTABLE:Rr},Jr=Zr.DefaultValue,ei=Zr.RecoilRoot,ti=Zr.useRecoilBridgeAcrossReactRoots_UNSTABLE,ni=Zr.atom,ri=Zr.selector,ii=Zr.retentionZone,oi=Zr.atomFamily,ai=Zr.selectorFamily,si=Zr.constSelector,li=Zr.errorSelector,ui=Zr.readOnlySelector,ci=Zr.useRecoilValue,di=Zr.useRecoilValueLoadable,fi=Zr.useRecoilState,pi=Zr.useRecoilStateLoadable,hi=Zr.useSetRecoilState,vi=Zr.useResetRecoilState,yi=Zr.useGetRecoilValueInfo_UNSTABLE,mi=Zr.useRetain,bi=Zr.useRecoilCallback,gi=Zr.useGotoRecoilSnapshot,_i=Zr.useRecoilSnapshot,Si=Zr.useRecoilTransactionObserver_UNSTABLE,Oi=Zr.useTransactionObservation_UNSTABLE,Ei=Zr.useSetUnvalidatedAtomValues_UNSTABLE,wi=Zr.noWait,Ti=Zr.waitForNone,Ci=Zr.waitForAny,Ai=Zr.waitForAll,ji=Zr.waitForAllSettled,Ii=Zr.isRecoilValue,Pi=Zr.batchUpdates,Mi=Zr.setBatcher,ki=Zr.snapshot_UNSTABLE;t.default=Zr},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useNotify=t.useMediaUiTheme=t.useMediaUi=t.useIntl=t.createUseMediaUiStyles=t.NotifyProvider=t.MediaUiThemeProvider=t.MediaUiProvider=t.IntlProvider=t.Helper=t.Events=t.Components=void 0;var a=n(65);Object.defineProperty(t,"IntlProvider",{enumerable:!0,get:function(){return a.IntlProvider}}),Object.defineProperty(t,"MediaUiProvider",{enumerable:!0,get:function(){return a.MediaUiProvider}}),Object.defineProperty(t,"MediaUiThemeProvider",{enumerable:!0,get:function(){return a.MediaUiThemeProvider}}),Object.defineProperty(t,"NotifyProvider",{enumerable:!0,get:function(){return a.NotifyProvider}}),Object.defineProperty(t,"createUseMediaUiStyles",{enumerable:!0,get:function(){return a.createUseMediaUiStyles}}),Object.defineProperty(t,"useIntl",{enumerable:!0,get:function(){return a.useIntl}}),Object.defineProperty(t,"useMediaUi",{enumerable:!0,get:function(){return a.useMediaUi}}),Object.defineProperty(t,"useMediaUiTheme",{enumerable:!0,get:function(){return a.useMediaUiTheme}}),Object.defineProperty(t,"useNotify",{enumerable:!0,get:function(){return a.useNotify}});var s=o(n(56));t.Events=s;var l=o(n(45));t.Components=l;var u=o(n(57));t.Helper=u},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(31));e.exports=(0,r.default)("NeosProjectPackages")().ReactUiComponents},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useUpdateTag=t.useUpdateAssetCollection=t.useUpdateAsset=t.useUntagAsset=t.useTagsQuery=t.useSetAssetTags=t.useSetAssetCollections=t.useSelectedTag=t.useSelectedAssetCollection=t.useSelectedAsset=t.useSelectTag=t.useSelectAssetSource=t.useSelectAssetCollection=t.useSelectAsset=t.useImportAsset=t.useEvent=t.useDeleteTag=t.useDeleteAssetCollection=t.useDeleteAsset=t.useCreateTag=t.useCreateAssetCollection=t.useConfigQuery=t.useAssetsQuery=t.useAssetSourcesQuery=t.useAssetQuery=t.useAssetCountQuery=t.useAssetCollectionsQuery=void 0;var i=r(n(173));t.useAssetCollectionsQuery=i.default;var o=r(n(186));t.useAssetCountQuery=o.default;var a=r(n(107));t.useAssetQuery=a.default;var s=r(n(194));t.useAssetSourcesQuery=s.default;var l=r(n(195));t.useAssetsQuery=l.default;var u=r(n(196));t.useConfigQuery=u.default;var c=r(n(197));t.useCreateAssetCollection=c.default;var d=r(n(211));t.useCreateTag=d.default;var f=r(n(212));t.useDeleteAsset=f.default;var p=r(n(216));t.useDeleteAssetCollection=p.default;var h=r(n(217));t.useDeleteTag=h.default;var v=r(n(218));t.useEvent=v.default;var y=r(n(219));t.useImportAsset=y.default;var m=r(n(220));t.useSelectAsset=m.default;var b=r(n(221));t.useSelectAssetCollection=b.default;var g=r(n(222));t.useSelectAssetSource=g.default;var _=r(n(223));t.useSelectTag=_.default;var S=r(n(224));t.useSelectedAsset=S.default;var O=r(n(69));t.useSelectedAssetCollection=O.default;var E=r(n(67));t.useSelectedTag=E.default;var w=r(n(225));t.useSetAssetCollections=w.default;var T=r(n(226));t.useSetAssetTags=T.default;var C=r(n(227));t.useTagsQuery=C.default;var j=r(n(228));t.useUntagAsset=j.default;var I=r(n(229));t.useUpdateAsset=I.default;var P=r(n(230));t.useUpdateAssetCollection=P.default;var M=r(n(231));t.useUpdateTag=M.default},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return fieldNameFromStoreName})),n.d(t,"e",(function(){return selectionSetMatchesResult})),n.d(t,"f",(function(){return storeValueIsStoreObject})),n.d(t,"d",(function(){return makeProcessedFieldsMerger}));var r=n(2),i=Object.prototype.hasOwnProperty;var o=/^[_a-z][_0-9a-z]*/i;function fieldNameFromStoreName(e){var t=e.match(o);return t?t[0]:e}function selectionSetMatchesResult(e,t,n){return!(!t||"object"!=typeof t)&&(Array.isArray(t)?t.every((function(t){return selectionSetMatchesResult(e,t,n)})):e.selections.every((function(e){if(Object(r.z)(e)&&Object(r.L)(e,n)){var o=Object(r.K)(e);return i.call(t,o)&&(!e.selectionSet||selectionSetMatchesResult(e.selectionSet,t[o],n))}return!0})))}function storeValueIsStoreObject(e){return null!==e&&"object"==typeof e&&!Object(r.C)(e)&&!Array.isArray(e)}function makeProcessedFieldsMerger(){return new r.b}},function(e,t,n){"use strict";n.d(t,"a",(function(){return equal}));var r=Object.prototype,i=r.toString,o=r.hasOwnProperty,a=Function.prototype.toString,s=new Map;function equal(e,t){try{return function check(e,t){if(e===t)return!0;var n=i.call(e),r=i.call(t);if(n!==r)return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(previouslyCompared(e,t))return!0;var s=definedKeys(e),u=definedKeys(t),c=s.length;if(c!==u.length)return!1;for(var d=0;d=0&&e.indexOf(t,n)===n}(g,l)}return!1}(e,t)}finally{s.clear()}}function definedKeys(e){return Object.keys(e).filter(isDefinedKey,e)}function isDefinedKey(e){return void 0!==this[e]}var l="{ [native code] }";function previouslyCompared(e,t){var n=s.get(e);if(n){if(n.has(t))return!0}else s.set(e,n=new Set);return n.add(t),!1}},function(e,t,n){"use strict";function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<+~=|^:(),"'`\s])/g,f="undefined"!=typeof CSS&&CSS.escape,jss_esm_escape=function(e){return f?f(e):e.replace(d,"\\$1")},p=function(){function BaseStyleRule(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return BaseStyleRule.prototype.prop=function prop(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},BaseStyleRule}(),h=function(e){function StyleRule(t,n,r){var i;(i=e.call(this,t,n,r)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var o=r.selector,a=r.scoped,s=r.sheet,l=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=l(_assertThisInitialized(_assertThisInitialized(i)),s),i.selectorText="."+jss_esm_escape(i.id)),i}Object(a.a)(StyleRule,e);var t=StyleRule.prototype;return t.applyTo=function applyTo(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},t.toJSON=function toJSON(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=c(n))}return e},t.toString=function toString(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(r.a)({},e,{allowEmpty:!0}):e;return toCss(this.selectorText,this.style,n)},_createClass(StyleRule,[{key:"selector",set:function set(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function get(){return this.selectorText}}]),StyleRule}(p),v={onCreateRule:function onCreateRule(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new h(e,t,n)}},y={indent:1,children:!0},m=/@([\w-]+)/,b=function(){function ConditionalRule(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e;var i=e.match(m);for(var o in this.at=i?i[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new q(Object(r.a)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var e=ConditionalRule.prototype;return e.getRule=function getRule(e){return this.rules.get(e)},e.indexOf=function indexOf(e){return this.rules.indexOf(e)},e.addRule=function addRule(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},e.toString=function toString(e){if(void 0===e&&(e=y),null==e.indent&&(e.indent=y.indent),null==e.children&&(e.children=y.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},ConditionalRule}(),g=/@media|@supports\s+/,_={onCreateRule:function onCreateRule(e,t,n){return g.test(e)?new b(e,t,n):null}},S={indent:1,children:!0},O=/@keyframes\s+([\w-]+)/,E=function(){function KeyframesRule(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=e.match(O);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var l in this.id=!1===o?this.name:jss_esm_escape(s(this,a)),this.rules=new q(Object(r.a)({},n,{parent:this})),t)this.rules.add(l,t[l],Object(r.a)({},n,{parent:this}));this.rules.process()}return KeyframesRule.prototype.toString=function toString(e){if(void 0===e&&(e=S),null==e.indent&&(e.indent=S.indent),null==e.children&&(e.children=S.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},KeyframesRule}(),w=/@keyframes\s+/,T=/\$([\w-]+)/g,C=function findReferencedKeyframe(e,t){return"string"==typeof e?e.replace(T,(function(e,n){return n in t?t[n]:e})):e},j=function replaceRef(e,t,n){var r=e[t],i=C(r,n);i!==r&&(e[t]=i)},I={onCreateRule:function onCreateRule(e,t,n){return"string"==typeof e&&w.test(e)?new E(e,t,n):null},onProcessStyle:function onProcessStyle(e,t,n){return"style"===t.type&&n?("animation-name"in e&&j(e,"animation-name",n.keyframes),"animation"in e&&j(e,"animation",n.keyframes),e):e},onChangeValue:function onChangeValue(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return C(e,r.keyframes);default:return e}}},P=function(e){function KeyframeRule(){for(var t,n=arguments.length,r=new Array(n),i=0;i=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},e.reset=function reset(){this.registry=[]},e.remove=function remove(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},e.toString=function toString(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(s.a)(t,["attached"]),i="",o=0;o0){var n=function findHigherSheet(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function findHighestSheet(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function findCommentNode(e){for(var t=re(),n=0;nn?n:t},se=function(){function DomRenderer(e){this.getPropertyValue=J,this.setProperty=ee,this.removeProperty=te,this.setSelector=ne,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,this.cssRules=[],e&&G.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,i=t.element;this.element=i||function createStyle(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var o=ie();o&&this.element.setAttribute("nonce",o)}var e=DomRenderer.prototype;return e.attach=function attach(){if(!this.element.parentNode&&this.sheet){!function insertStyle(e,t){var n=t.insertionPoint,r=findPrevNode(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else re().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function detach(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},e.deploy=function deploy(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},e.insertRules=function insertRules(e,t){for(var n=0;n0&&(t.refs--,0===t.refs&&t.sheet.detach()):Object(o.a)(!1,"SheetsManager: can't find sheet to unmanage")},_createClass(SheetsManager,[{key:"size",get:function get(){return this.length}}]),SheetsManager}(),de="object"==typeof CSS&&null!=CSS&&"number"in CSS,fe=function create(e){return new ue(e)},pe=fe();t.default=pe},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return isNode}));var r=n(52);function defineInspect(e){var t=e.prototype.toJSON;"function"==typeof t||function invariant(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,r.a&&(e.prototype[r.a]=t)}var i=function(){function Location(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return Location.prototype.toJSON=function toJSON(){return{start:this.start,end:this.end}},Location}();defineInspect(i);var o=function(){function Token(e,t,n,r,i,o,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}return Token.prototype.toJSON=function toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},Token}();function isNode(e){return null!=e&&"string"==typeof e.kind}defineInspect(o)},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS=t.TAG=t.SET_SELECTED_ASSET_SOURCE_ID=t.SELECTED_ASSET_SOURCE_ID=t.CONFIG=t.ASSET_SOURCES=t.ASSET_COUNT=t.ASSET_COLLECTIONS=t.ASSET_COLLECTION=t.ASSETS=t.ASSET=void 0;var i=r(n(174));t.ASSET=i.default;var o=r(n(177));t.ASSETS=o.default;var a=r(n(178));t.ASSET_COLLECTION=a.default;var s=r(n(179));t.ASSET_COLLECTIONS=s.default;var l=r(n(180));t.ASSET_COUNT=l.default;var u=r(n(181));t.ASSET_SOURCES=u.default;var c=r(n(182));t.CONFIG=c.default;var d=r(n(183));t.TAG=d.default;var f=r(n(184));t.TAGS=f.default;var p=n(185);Object.defineProperty(t,"SELECTED_ASSET_SOURCE_ID",{enumerable:!0,get:function(){return p.SELECTED_ASSET_SOURCE_ID}}),Object.defineProperty(t,"SET_SELECTED_ASSET_SOURCE_ID",{enumerable:!0,get:function(){return p.SET_SELECTED_ASSET_SOURCE_ID}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return dep})),n.d(t,"c",(function(){return wrap}));var defaultMakeData=function(){return Object.create(null)},r=Array.prototype,i=r.forEach,o=r.slice,a=function(){function Trie(e,t){void 0===e&&(e=!0),void 0===t&&(t=defaultMakeData),this.weakness=e,this.makeData=t}return Trie.prototype.lookup=function(){for(var e=[],t=0;tthis.max;)this.delete(this.oldest.key)},Cache.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},Cache}(),u=new s.a;function maybeUnsubscribe(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var c=[];function assert(e,t){if(!e)throw new Error(t||"assertion failure")}function valueGet(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var d=function(){function Entry(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++Entry.count}return Entry.prototype.peek=function(){if(1===this.value.length&&!mightBeDirty(this))return this.value[0]},Entry.prototype.recompute=function(e){return assert(!this.recomputing,"already recomputing"),function rememberParent(e){var t=u.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),mightBeDirty(e)?reportDirtyChild(t,e):reportCleanChild(t,e),t}(this),mightBeDirty(this)?function reallyRecompute(e,t){forgetChildren(e),u.withValue(e,recomputeNewValue,[e,t]),function maybeSubscribe(e,t){if("function"==typeof e.subscribe)try{maybeUnsubscribe(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function setClean(e){if(e.dirty=!1,mightBeDirty(e))return;reportClean(e)}(e);return valueGet(e.value)}(this,e):valueGet(this.value)},Entry.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,reportDirty(this),forgetChildren(this),maybeUnsubscribe(this))},Entry.prototype.dispose=function(){var e=this;forgetChildren(this),maybeUnsubscribe(this),this.parents.forEach((function(t){t.setDirty(),forgetChild(t,e)}))},Entry.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=c.pop()||new Set),this.deps.add(e)},Entry.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),c.push(this.deps),this.deps=null)},Entry.count=0,Entry}();function recomputeNewValue(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function mightBeDirty(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function reportDirty(e){e.parents.forEach((function(t){return reportDirtyChild(t,e)}))}function reportClean(e){e.parents.forEach((function(t){return reportCleanChild(t,e)}))}function reportDirtyChild(e,t){if(assert(e.childValues.has(t)),assert(mightBeDirty(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=c.pop()||new Set;e.dirtyChildren.add(t),reportDirty(e)}function reportCleanChild(e,t){assert(e.childValues.has(t)),assert(!mightBeDirty(t));var n=e.childValues.get(t);0===n.length?e.childValues.set(t,function valueCopy(e){return e.slice(0)}(t.value)):function valueIs(e,t){var n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}(n,t.value)||e.setDirty(),removeDirtyChild(e,t),mightBeDirty(e)||reportClean(e)}function removeDirtyChild(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(c.length<100&&c.push(n),e.dirtyChildren=null))}function forgetChildren(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){forgetChild(e,n)})),e.forgetDeps(),assert(null===e.dirtyChildren)}function forgetChild(e,t){t.parents.delete(e),e.childValues.delete(t),removeDirtyChild(e,t)}function dep(e){var t=new Map,n=e&&e.subscribe;function depend(e){var r=u.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(maybeUnsubscribe(i),i.unsubscribe=n(e))}}return depend.dirty=function dirty(e){var n=t.get(e);n&&(n.forEach((function(e){return e.setDirty()})),t.delete(e),maybeUnsubscribe(n))},depend}var f=new a("function"==typeof WeakMap);function defaultMakeCacheKey(){for(var e=[],t=0;t0)e!==o&&(e=o,t.forEach((function(e){getCacheInfo(e).dep.dirty(rv),broadcast(e)})),consumeAndIterate(n,(function(t){return t(e)})));else{var a=i.getValue();a&&(r(a),getCacheInfo(a).dep(rv))}return e};rv.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var r=rv.attachCache=function(e){return t.add(e),getCacheInfo(e).vars.add(rv),rv};return rv.forgetCache=function(e){return t.delete(e)},rv}function broadcast(e){e.broadcastWatches&&e.broadcastWatches()}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType;t.a=i},function(e,t,n){"use strict";function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return _objectWithoutPropertiesLoose}))},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.TAG_FRAGMENT=void 0;var i,o=n(4);t.TAG_FRAGMENT=o.gql(i||(i=r(["\n fragment TagProps on Tag {\n id\n label\n }\n"],["\n fragment TagProps on Tag {\n id\n label\n }\n"])))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useUnusedAssetCountQuery=t.useUnusedAssetsQuery=t.useAssetUsagesQuery=t.showUnusedAssetsState=t.assetUsageDetailsModalState=t.UsageDetailsMetadataType=t.USAGE_DETAILS_GROUP_FRAGMENT=t.UNUSED_ASSETS=t.AssetUsagesToggleButton=t.AssetUsagesModal=t.ASSET_USAGE_DETAILS=void 0;var i=r(n(112));t.ASSET_USAGE_DETAILS=i.default;var o=r(n(114));t.UNUSED_ASSETS=o.default;var a=r(n(113));t.USAGE_DETAILS_GROUP_FRAGMENT=a.default;var s=n(246);Object.defineProperty(t,"UsageDetailsMetadataType",{enumerable:!0,get:function(){return s.UsageDetailsMetadataType}});var l=r(n(247));t.AssetUsagesModal=l.default;var u=r(n(249));t.AssetUsagesToggleButton=u.default;var c=r(n(71));t.assetUsageDetailsModalState=c.default;var d=r(n(116));t.showUnusedAssetsState=d.default;var f=r(n(115));t.useAssetUsagesQuery=f.default;var p=r(n(250));t.useUnusedAssetsQuery=p.default;var h=r(n(251));t.useUnusedAssetCountQuery=h.default},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Main=t.AssetActions=t.ListViewItem=t.ListView=t.Thumbnail=t.ThumbnailView=void 0;var i=r(n(325));t.AssetActions=i.default;var o=r(n(326));t.ListView=o.default;var a=r(n(327));t.ListViewItem=a.default;var s=r(n(328));t.Main=s.default;var l=r(n(330));t.Thumbnail=l.default;var u=r(n(331));t.ThumbnailView=u.default},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function r(e,t,n,i,o){this.message=e,this.path=t,this.query=n,this.clientOnly=i,this.variables=o}},function(e,t,n){"use strict";var __assign=function(){return(__assign=Object.assign||function __assign(e){for(var t,n=1,r=arguments.length;n120){for(var f=Math.floor(l/80),p=l%80,h=[],v=0;v",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),l=n(62);function devAssert(e,t){if(!Boolean(e))throw new Error(t)}var u=function instanceOf(e,t){return e instanceof t};function source_defineProperties(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||devAssert(0,"Body must be a string. Received: ".concat(Object(l.a)(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||devAssert(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||devAssert(0,"column in locationOffset is 1-indexed and must be positive.")}return function source_createClass(e,t,n){return t&&source_defineProperties(e.prototype,t),n&&source_defineProperties(e,n),e}(Source,[{key:r,get:function get(){return"Source"}}]),Source}();var d=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),f=n(63),p=function(){function Lexer(e){var t=new a.b(s.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var e=Lexer.prototype;return e.advance=function advance(){return this.lastToken=this.token,this.token=this.lookahead()},e.lookahead=function lookahead(){var e=this.token;if(e.kind!==s.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=readToken(this,e)}while(e.kind===s.COMMENT);return e},Lexer}();function printCharCode(e){return isNaN(e)?s.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function readToken(e,t){for(var n=e.source,r=n.body,i=r.length,o=t.end;o31||9===o));return new a.b(s.COMMENT,t,u,n,r,i,l.slice(t+1,u))}function readNumber(e,t,n,r,i,o){var l=e.body,u=n,c=t,d=!1;if(45===u&&(u=l.charCodeAt(++c)),48===u){if((u=l.charCodeAt(++c))>=48&&u<=57)throw syntaxError(e,c,"Invalid number, unexpected digit after 0: ".concat(printCharCode(u),"."))}else c=readDigits(e,c,u),u=l.charCodeAt(c);if(46===u&&(d=!0,u=l.charCodeAt(++c),c=readDigits(e,c,u),u=l.charCodeAt(c)),69!==u&&101!==u||(d=!0,43!==(u=l.charCodeAt(++c))&&45!==u||(u=l.charCodeAt(++c)),c=readDigits(e,c,u),u=l.charCodeAt(c)),46===u||function isNameStart(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(u))throw syntaxError(e,c,"Invalid number, expected digit but got: ".concat(printCharCode(u),"."));return new a.b(d?s.FLOAT:s.INT,t,c,r,i,o,l.slice(t,c))}function readDigits(e,t,n){var r=e.body,i=t,o=n;if(o>=48&&o<=57){do{o=r.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw syntaxError(e,i,"Invalid number, expected digit but got: ".concat(printCharCode(o),"."))}function readString(e,t,n,r,i){for(var o,l,u,c,d=e.body,f=t+1,p=f,h=0,v="";f=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function readName(e,t,n,r,i){for(var o=e.body,l=o.length,u=t+1,c=0;u!==l&&!isNaN(c=o.charCodeAt(u))&&(95===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++u;return new a.b(s.NAME,t,u,n,r,i,o.slice(t,u))}var h=function(){function Parser(e,t){var n=function isSource(e){return u(e,c)}(e)?e:new c(e);this._lexer=new p(n),this._options=t}var e=Parser.prototype;return e.parseName=function parseName(){var e=this.expectToken(s.NAME);return{kind:o.NAME,value:e.value,loc:this.loc(e)}},e.parseDocument=function parseDocument(){var e=this._lexer.token;return{kind:o.DOCUMENT,definitions:this.many(s.SOF,this.parseDefinition,s.EOF),loc:this.loc(e)}},e.parseDefinition=function parseDefinition(){if(this.peek(s.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(s.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function parseOperationDefinition(){var e=this._lexer.token;if(this.peek(s.BRACE_L))return{kind:o.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(s.NAME)&&(t=this.parseName()),{kind:o.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},e.parseOperationType=function parseOperationType(){var e=this.expectToken(s.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},e.parseVariableDefinitions=function parseVariableDefinitions(){return this.optionalMany(s.PAREN_L,this.parseVariableDefinition,s.PAREN_R)},e.parseVariableDefinition=function parseVariableDefinition(){var e=this._lexer.token;return{kind:o.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(s.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(s.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},e.parseVariable=function parseVariable(){var e=this._lexer.token;return this.expectToken(s.DOLLAR),{kind:o.VARIABLE,name:this.parseName(),loc:this.loc(e)}},e.parseSelectionSet=function parseSelectionSet(){var e=this._lexer.token;return{kind:o.SELECTION_SET,selections:this.many(s.BRACE_L,this.parseSelection,s.BRACE_R),loc:this.loc(e)}},e.parseSelection=function parseSelection(){return this.peek(s.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function parseField(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(s.COLON)?(e=r,t=this.parseName()):t=r,{kind:o.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(s.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function parseArguments(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(s.PAREN_L,t,s.PAREN_R)},e.parseArgument=function parseArgument(){var e=this._lexer.token,t=this.parseName();return this.expectToken(s.COLON),{kind:o.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},e.parseConstArgument=function parseConstArgument(){var e=this._lexer.token;return{kind:o.ARGUMENT,name:this.parseName(),value:(this.expectToken(s.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},e.parseFragment=function parseFragment(){var e=this._lexer.token;this.expectToken(s.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(s.NAME)?{kind:o.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:o.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},e.parseFragmentDefinition=function parseFragmentDefinition(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:o.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:o.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},e.parseFragmentName=function parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},e.parseValueLiteral=function parseValueLiteral(e){var t=this._lexer.token;switch(t.kind){case s.BRACKET_L:return this.parseList(e);case s.BRACE_L:return this.parseObject(e);case s.INT:return this._lexer.advance(),{kind:o.INT,value:t.value,loc:this.loc(t)};case s.FLOAT:return this._lexer.advance(),{kind:o.FLOAT,value:t.value,loc:this.loc(t)};case s.STRING:case s.BLOCK_STRING:return this.parseStringLiteral();case s.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:o.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:o.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:o.NULL,loc:this.loc(t)};default:return{kind:o.ENUM,value:t.value,loc:this.loc(t)}}case s.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},e.parseStringLiteral=function parseStringLiteral(){var e=this._lexer.token;return this._lexer.advance(),{kind:o.STRING,value:e.value,block:e.kind===s.BLOCK_STRING,loc:this.loc(e)}},e.parseList=function parseList(e){var t=this,n=this._lexer.token;return{kind:o.LIST,values:this.any(s.BRACKET_L,(function item(){return t.parseValueLiteral(e)}),s.BRACKET_R),loc:this.loc(n)}},e.parseObject=function parseObject(e){var t=this,n=this._lexer.token;return{kind:o.OBJECT,fields:this.any(s.BRACE_L,(function item(){return t.parseObjectField(e)}),s.BRACE_R),loc:this.loc(n)}},e.parseObjectField=function parseObjectField(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(s.COLON),{kind:o.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},e.parseDirectives=function parseDirectives(e){for(var t=[];this.peek(s.AT);)t.push(this.parseDirective(e));return t},e.parseDirective=function parseDirective(e){var t=this._lexer.token;return this.expectToken(s.AT),{kind:o.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},e.parseTypeReference=function parseTypeReference(){var e,t=this._lexer.token;return this.expectOptionalToken(s.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(s.BRACKET_R),e={kind:o.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(s.BANG)?{kind:o.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},e.parseNamedType=function parseNamedType(){var e=this._lexer.token;return{kind:o.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},e.parseTypeSystemDefinition=function parseTypeSystemDefinition(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===s.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},e.peekDescription=function peekDescription(){return this.peek(s.STRING)||this.peek(s.BLOCK_STRING)},e.parseDescription=function parseDescription(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function parseSchemaDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(s.BRACE_L,this.parseOperationTypeDefinition,s.BRACE_R);return{kind:o.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},e.parseOperationTypeDefinition=function parseOperationTypeDefinition(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(s.COLON);var n=this.parseNamedType();return{kind:o.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},e.parseScalarTypeDefinition=function parseScalarTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:o.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},e.parseObjectTypeDefinition=function parseObjectTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:o.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},e.parseImplementsInterfaces=function parseImplementsInterfaces(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(s.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(s.AMP)||this.peek(s.NAME));return t}return this.delimitedMany(s.AMP,this.parseNamedType)},e.parseFieldsDefinition=function parseFieldsDefinition(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(s.BRACE_L)&&this._lexer.lookahead().kind===s.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(s.BRACE_L,this.parseFieldDefinition,s.BRACE_R)},e.parseFieldDefinition=function parseFieldDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(s.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:o.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a,loc:this.loc(e)}},e.parseArgumentDefs=function parseArgumentDefs(){return this.optionalMany(s.PAREN_L,this.parseInputValueDef,s.PAREN_R)},e.parseInputValueDef=function parseInputValueDef(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(s.COLON);var r,i=this.parseTypeReference();this.expectOptionalToken(s.EQUALS)&&(r=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:o.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:a,loc:this.loc(e)}},e.parseInterfaceTypeDefinition=function parseInterfaceTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:o.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},e.parseUnionTypeDefinition=function parseUnionTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:o.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},e.parseUnionMemberTypes=function parseUnionMemberTypes(){return this.expectOptionalToken(s.EQUALS)?this.delimitedMany(s.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function parseEnumTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:o.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},e.parseEnumValuesDefinition=function parseEnumValuesDefinition(){return this.optionalMany(s.BRACE_L,this.parseEnumValueDefinition,s.BRACE_R)},e.parseEnumValueDefinition=function parseEnumValueDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:o.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},e.parseInputObjectTypeDefinition=function parseInputObjectTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:o.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},e.parseInputFieldsDefinition=function parseInputFieldsDefinition(){return this.optionalMany(s.BRACE_L,this.parseInputValueDef,s.BRACE_R)},e.parseTypeSystemExtension=function parseTypeSystemExtension(){var e=this._lexer.lookahead();if(e.kind===s.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},e.parseSchemaExtension=function parseSchemaExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(s.BRACE_L,this.parseOperationTypeDefinition,s.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:o.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},e.parseScalarTypeExtension=function parseScalarTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:o.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},e.parseObjectTypeExtension=function parseObjectTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:o.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},e.parseInterfaceTypeExtension=function parseInterfaceTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:o.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},e.parseUnionTypeExtension=function parseUnionTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:o.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},e.parseEnumTypeExtension=function parseEnumTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:o.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},e.parseInputObjectTypeExtension=function parseInputObjectTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:o.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},e.parseDirectiveDefinition=function parseDirectiveDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(s.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:o.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a,loc:this.loc(e)}},e.parseDirectiveLocations=function parseDirectiveLocations(){return this.delimitedMany(s.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function parseDirectiveLocation(){var e=this._lexer.token,t=this.parseName();if(void 0!==d[t.value])return t;throw this.unexpected(e)},e.loc=function loc(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new a.a(e,this._lexer.lastToken,this._lexer.source)},e.peek=function peek(e){return this._lexer.token.kind===e},e.expectToken=function expectToken(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw syntaxError(this._lexer.source,t.start,"Expected ".concat(getTokenKindDesc(e),", found ").concat(getTokenDesc(t),"."))},e.expectOptionalToken=function expectOptionalToken(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},e.expectKeyword=function expectKeyword(e){var t=this._lexer.token;if(t.kind!==s.NAME||t.value!==e)throw syntaxError(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(getTokenDesc(t),"."));this._lexer.advance()},e.expectOptionalKeyword=function expectOptionalKeyword(e){var t=this._lexer.token;return t.kind===s.NAME&&t.value===e&&(this._lexer.advance(),!0)},e.unexpected=function unexpected(e){var t=null!=e?e:this._lexer.token;return syntaxError(this._lexer.source,t.start,"Unexpected ".concat(getTokenDesc(t),"."))},e.any=function any(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},e.optionalMany=function optionalMany(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},e.many=function many(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},e.delimitedMany=function delimitedMany(e,t){this.expectOptionalToken(e);var n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n},Parser}();function getTokenDesc(e){var t=e.value;return getTokenKindDesc(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function getTokenKindDesc(e){return function isPunctuatorTokenKind(e){return e===s.BANG||e===s.DOLLAR||e===s.AMP||e===s.PAREN_L||e===s.PAREN_R||e===s.SPREAD||e===s.COLON||e===s.EQUALS||e===s.AT||e===s.BRACKET_L||e===s.BRACKET_R||e===s.BRACE_L||e===s.PIPE||e===s.BRACE_R}(e)?'"'.concat(e,'"'):e}var v=new Map,y=new Map,m=!0,b=!1;function normalize(e){return e.replace(/[\s,]+/g," ").trim()}function processFragments(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=function cacheKeyFromLoc(e){return normalize(e.source.body.substring(e.start,e.end))}(e.loc),o=y.get(r);o&&!o.has(i)?m&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||y.set(r,o=new Set),o.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e)})),__assign(__assign({},e),{definitions:n})}function lib_parseDocument(e){var t=normalize(e);if(!v.has(t)){var n=function parse(e,t){return new h(e,t).parseDocument()}(e,{experimentalFragmentVariables:b});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");v.set(t,function stripLoc(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(processFragments(n)))}return v.get(t)}function gql(e){for(var t=[],n=1;n=300&&Object(r.d)(t,n,"Response not successful: Received status code "+t.status),Array.isArray(n)||i.call(n,"data")||i.call(n,"errors")||Object(r.d)(t,n,"Server response was missing for query '"+(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName)+"'."),n}))}}var o=n(3),serializeFetchParameter=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=new o.a(23);throw r.parseError=e,r}return n},a=n(1),s=n(143),l=n(63);function print(e){return Object(s.b)(e,{leave:u})}var u={Name:function Name(e){return e.value},Variable:function Variable(e){return"$"+e.name},Document:function Document(e){return join(e.definitions,"\n\n")+"\n"},OperationDefinition:function OperationDefinition(e){var t=e.operation,n=e.name,r=wrap("(",join(e.variableDefinitions,", "),")"),i=join(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?join([t,join([n,r]),i,o]," "):o},VariableDefinition:function VariableDefinition(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+wrap(" = ",r)+wrap(" ",join(i," "))},SelectionSet:function SelectionSet(e){return block(e.selections)},Field:function Field(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet,a=wrap("",t,": ")+n,s=a+wrap("(",join(r,", "),")");return s.length>80&&(s=a+wrap("(\n",indent(join(r,"\n")),"\n)")),join([s,join(i," "),o]," ")},Argument:function Argument(e){return e.name+": "+e.value},FragmentSpread:function FragmentSpread(e){return"..."+e.name+wrap(" ",join(e.directives," "))},InlineFragment:function InlineFragment(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return join(["...",wrap("on ",t),join(n," "),r]," ")},FragmentDefinition:function FragmentDefinition(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(wrap("(",join(r,", "),")")," ")+"on ".concat(n," ").concat(wrap("",join(i," ")," "))+o},IntValue:function IntValue(e){return e.value},FloatValue:function FloatValue(e){return e.value},StringValue:function StringValue(e,t){var n=e.value;return e.block?Object(l.b)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function BooleanValue(e){return e.value?"true":"false"},NullValue:function NullValue(){return"null"},EnumValue:function EnumValue(e){return e.value},ListValue:function ListValue(e){return"["+join(e.values,", ")+"]"},ObjectValue:function ObjectValue(e){return"{"+join(e.fields,", ")+"}"},ObjectField:function ObjectField(e){return e.name+": "+e.value},Directive:function Directive(e){return"@"+e.name+wrap("(",join(e.arguments,", "),")")},NamedType:function NamedType(e){return e.name},ListType:function ListType(e){return"["+e.type+"]"},NonNullType:function NonNullType(e){return e.type+"!"},SchemaDefinition:addDescription((function(e){var t=e.directives,n=e.operationTypes;return join(["schema",join(t," "),block(n)]," ")})),OperationTypeDefinition:function OperationTypeDefinition(e){return e.operation+": "+e.type},ScalarTypeDefinition:addDescription((function(e){return join(["scalar",e.name,join(e.directives," ")]," ")})),ObjectTypeDefinition:addDescription((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return join(["type",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")})),FieldDefinition:addDescription((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(hasMultilineItems(n)?wrap("(\n",indent(join(n,"\n")),"\n)"):wrap("(",join(n,", "),")"))+": "+r+wrap(" ",join(i," "))})),InputValueDefinition:addDescription((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return join([t+": "+n,wrap("= ",r),join(i," ")]," ")})),InterfaceTypeDefinition:addDescription((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return join(["interface",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")})),UnionTypeDefinition:addDescription((function(e){var t=e.name,n=e.directives,r=e.types;return join(["union",t,join(n," "),r&&0!==r.length?"= "+join(r," | "):""]," ")})),EnumTypeDefinition:addDescription((function(e){var t=e.name,n=e.directives,r=e.values;return join(["enum",t,join(n," "),block(r)]," ")})),EnumValueDefinition:addDescription((function(e){return join([e.name,join(e.directives," ")]," ")})),InputObjectTypeDefinition:addDescription((function(e){var t=e.name,n=e.directives,r=e.fields;return join(["input",t,join(n," "),block(r)]," ")})),DirectiveDefinition:addDescription((function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(hasMultilineItems(n)?wrap("(\n",indent(join(n,"\n")),"\n)"):wrap("(",join(n,", "),")"))+(r?" repeatable":"")+" on "+join(i," | ")})),SchemaExtension:function SchemaExtension(e){var t=e.directives,n=e.operationTypes;return join(["extend schema",join(t," "),block(n)]," ")},ScalarTypeExtension:function ScalarTypeExtension(e){return join(["extend scalar",e.name,join(e.directives," ")]," ")},ObjectTypeExtension:function ObjectTypeExtension(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return join(["extend type",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")},InterfaceTypeExtension:function InterfaceTypeExtension(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return join(["extend interface",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")},UnionTypeExtension:function UnionTypeExtension(e){var t=e.name,n=e.directives,r=e.types;return join(["extend union",t,join(n," "),r&&0!==r.length?"= "+join(r," | "):""]," ")},EnumTypeExtension:function EnumTypeExtension(e){var t=e.name,n=e.directives,r=e.values;return join(["extend enum",t,join(n," "),block(r)]," ")},InputObjectTypeExtension:function InputObjectTypeExtension(e){var t=e.name,n=e.directives,r=e.fields;return join(["extend input",t,join(n," "),block(r)]," ")}};function addDescription(e){return function(t){return join([t.description,e(t)],"\n")}}function join(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(n))&&void 0!==t?t:""}function block(e){return wrap("{\n",indent(join(e,"\n")),"\n}")}function wrap(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function indent(e){return wrap(" ",e.replace(/\n/g,"\n "))}function isMultiline(e){return-1!==e.indexOf("\n")}function hasMultilineItems(e){return null!=e&&e.some(isMultiline)}var c={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},selectHttpOptionsAndBody=function(e,t){for(var n=[],r=2;r0},ObservableQuery.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},ObservableQuery}(s.c);function defaultSubscriptionObserverErrorCallback(e){}Object(s.l)(u)},function(e,t,n){"use strict";n.d(t,"a",(function(){return inspect}));var r=n(52);function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function inspect(e){return formatValue(e,[])}function formatValue(e,t){switch(_typeof(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function formatObjectValue(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),i=function getCustomFn(e){var t=e[String(r.a)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var o=i.call(e);if(o!==e)return"string"==typeof o?o:formatValue(o,n)}else if(Array.isArray(e))return function formatArray(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,i=[],o=0;o1&&i.push("... ".concat(r," more items"));return"["+i.join(", ")+"]"}(e,n);return function formatObject(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>2)return"["+function getObjectTag(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]";return"{ "+n.map((function(n){return n+": "+formatValue(e[n],t)})).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}},function(e,t,n){"use strict";function dedentBlockStringValue(e){var t=e.split(/\r\n|[\n\r]/g),n=function getBlockStringIndentation(e){for(var t,n=!0,r=!0,i=0,o=null,a=0;ai&&isBlank(t[o-1]);)--o;return t.slice(i,o).join("\n")}function isBlank(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!r||o||a||n,l="";return!s||r&&i||(l+="\n"+t),l+=t?e.replace(/\n/g,"\n"+t):e,s&&(l+="\n"),'"""'+l.replace(/"""/g,'\\"""')+'"""'}n.d(t,"a",(function(){return dedentBlockStringValue})),n.d(t,"b",(function(){return printBlockString}))},function(e,t,n){"use strict";var r=n(234),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function getStatics(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function hoistNonReactStatics(e,t,n){if("string"!=typeof t){if(p){var r=f(t);r&&r!==p&&hoistNonReactStatics(e,r,n)}var i=u(t);c&&(i=i.concat(c(t)));for(var a=getStatics(e),s=getStatics(t),h=0;ht&&h.error(p("uploadDialog.warning.maxFiles","You can only upload a maximum of {limit} files. {rejected} File(s) rejected",{limit:m,rejected:e.length-t})),0!==t){var r=(e.length1,preventDropOnDocument:!0,accept:t}),g=b.getRootProps,_=b.getInputProps,S=b.isDragAccept,O=b.isDragActive,E=b.isDragReject,w=f({isDragAccept:S,isDragActive:O,isDragReject:E});return s.createElement("section",null,s.createElement("div",r({},g({className:w.dropzone})),s.createElement("input",r({},_())),s.createElement("p",null,p("uploadDialog.dropzone.caption","Drag 'n' drop some files here, or click to select files")),(null==y?void 0:y.uploadMaxFileSize)>0&&s.createElement("p",null,p("uploadDialog.maxFileSize","Maximum file size is {size} and file limit is {limit}",{size:d.humanFileSize(y.uploadMaxFileSize),limit:m}))),i&&s.createElement("p",null,p("uploadDialog.label.uploading","Uploading…")))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(7),u=a(n(125)),c=l.createUseMediaUiStyles((function(e){return{fileList:{marginTop:e.spacing.full,display:"flex",flexDirection:"row",flexWrap:"wrap"},fileListHeader:{flex:"1 1 100%",marginBottom:e.spacing.full,fontSize:e.fontSize}}}));t.default=s.memo((function(e){var t=e.files,n=e.loading,r=e.uploadState,i=l.useIntl().translate,o=c();return s.createElement("aside",{className:o.fileList},t.selected.length>0&&s.createElement(s.Fragment,null,s.createElement("h4",{className:o.fileListHeader},i("uploadDialog.fileList.header","Selected files")),t.selected.map((function(e){return s.createElement(u.default,{file:e,loading:n,fileState:r.find((function(t){return t.filename===e.name})),key:e.id})}))),t.rejected.length>0&&s.createElement(s.Fragment,null,s.createElement("h4",{className:o.fileListHeader},i("uploadDialog.fileList.uploadedHeader","Failed uploads")),t.rejected.map((function(e){return s.createElement(u.default,{file:e,fileState:r.find((function(t){return t.filename===e.name})),key:e.id})}))),t.finished.length>0&&s.createElement(s.Fragment,null,s.createElement("h4",{className:o.fileListHeader},i("uploadDialog.fileList.uploadedHeader","Successful uploads")),t.finished.map((function(e){return s.createElement(u.default,{file:e,fileState:r.find((function(t){return t.filename===e.name})),key:e.id})}))))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.REPLACE_ASSET=t.UPLOAD_FILE=t.UPLOAD_FILES=void 0;var i=r(n(271));t.REPLACE_ASSET=i.default;var o=r(n(272));t.UPLOAD_FILES=o.default;var a=r(n(273));t.UPLOAD_FILE=a.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(286)).default,i=r.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=r.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=r.canUseDOM?window.NodeList:{},t.canUseDOM=r.canUseDOM;t.default=i},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7).createUseMediaUiStyles({propertyGroup:{}});t.default=function(e){var t=e.children,n=e.label,r=l();return a.createElement("div",{className:r.propertyGroup},a.createElement(s.Label,null,n),t)}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=l.createUseMediaUiStyles((function(e){return{actions:{display:"flex",position:"sticky",backgroundColor:e.colors.mainBackground,bottom:0,"& > *":{flex:1}}}}));t.default=function(e){var t=e.hasUnpublishedChanges,n=e.handleApply,r=e.handleDiscard,i=u(),o=l.useIntl().translate;return a.createElement("div",{className:i.actions},a.createElement(s.Button,{disabled:!t,size:"regular",style:"lighter",hoverStyle:"brand",onClick:r},o("inspector.actions.discard","Discard")),a.createElement(s.Button,{disabled:!t,size:"regular",style:"success",hoverStyle:"success",onClick:n},o("inspector.actions.apply","Apply")))}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7).createUseMediaUiStyles((function(e){return{inspector:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridAutoRows:"auto",gridGap:e.spacing.full,"& input, & textarea":{width:"100%"}}}}));t.default=function(e){var t=e.children,n=s();return a.createElement("div",{className:n.inspector},t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return mergeOptions})),n.d(t,"a",(function(){return g}));var r=n(1),i=n(3),o=n(20),a=n(2),s=n(50),l=n(11),u=n(21),c=n(61),d=n(13),f=n(143),p=n(33),h=function(){function LocalState(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return LocalState.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Object(a.G)(t.resolvers,e)})):this.resolvers=Object(a.G)(this.resolvers,e)},LocalState.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},LocalState.prototype.getResolvers=function(){return this.resolvers||{}},LocalState.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,o=e.variables,a=e.onlyRunForcedResolvers,s=void 0!==a&&a;return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(e){return t?[2,this.resolveDocument(t,n.data,i,o,this.fragmentMatcher,s).then((function(e){return Object(r.__assign)(Object(r.__assign)({},n),{data:e.result})}))]:[2,n]}))}))},LocalState.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},LocalState.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},LocalState.prototype.clientQuery=function(e){return Object(a.y)(["client"],e)&&this.resolvers?e:null},LocalState.prototype.serverQuery=function(e){return Object(a.I)(e)},LocalState.prototype.prepareContext=function(e){var t=this.cache;return Object(r.__assign)(Object(r.__assign)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},LocalState.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return Object(r.__assign)(Object(r.__assign)({},t),e.exportedVariables)}))]:[2,Object(r.__assign)({},t)]}))}))},LocalState.prototype.shouldForceResolvers=function(e){var t=!1;return Object(f.b)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return f.a}}}),t},LocalState.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Object(a.g)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},LocalState.prototype.resolveDocument=function(e,t,n,i,o,s){return void 0===n&&(n={}),void 0===i&&(i={}),void 0===o&&(o=function(){return!0}),void 0===s&&(s=!1),Object(r.__awaiter)(this,void 0,void 0,(function(){var l,u,c,d,f,p,h,v,y;return Object(r.__generator)(this,(function(m){return l=Object(a.q)(e),u=Object(a.n)(e),c=Object(a.k)(u),d=l.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",h=(p=this).cache,v=p.client,y={fragmentMap:c,context:Object(r.__assign)(Object(r.__assign)({},n),{cache:h,client:v}),variables:i,fragmentMatcher:o,defaultOperationType:f,exportedVariables:{},onlyRunForcedResolvers:s},[2,this.resolveSelectionSet(l.selectionSet,t,y).then((function(e){return{result:e,exportedVariables:y.exportedVariables}}))]}))}))},LocalState.prototype.resolveSelectionSet=function(e,t,n){return Object(r.__awaiter)(this,void 0,void 0,(function(){var o,s,l,u,c,d=this;return Object(r.__generator)(this,(function(f){return o=n.fragmentMap,s=n.context,l=n.variables,u=[t],c=function(e){return Object(r.__awaiter)(d,void 0,void 0,(function(){var c,d;return Object(r.__generator)(this,(function(r){return Object(a.L)(e,l)?Object(a.z)(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&u.push(((n={})[Object(a.K)(e)]=t,n))}))]:(Object(a.A)(e)?c=e:(c=o[e.name.value],Object(i.b)(c,11)),c&&c.typeCondition&&(d=c.typeCondition.name.value,n.fragmentMatcher(t,d,s))?[2,this.resolveSelectionSet(c.selectionSet,t,n).then((function(e){u.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(c)).then((function(){return Object(a.H)(u)}))]}))}))},LocalState.prototype.resolveField=function(e,t,n){return Object(r.__awaiter)(this,void 0,void 0,(function(){var i,o,s,l,u,c,d,f,h,v=this;return Object(r.__generator)(this,(function(r){return i=n.variables,o=e.name.value,s=Object(a.K)(e),l=o!==s,u=t[s]||t[o],c=Promise.resolve(u),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(d=t.__typename||n.defaultOperationType,(f=this.resolvers&&this.resolvers[d])&&(h=f[l?o:s])&&(c=Promise.resolve(p.cacheSlot.withValue(this.cache,h,[t,Object(a.e)(e,i),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,c.then((function(t){return void 0===t&&(t=u),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?v.resolveSubSelectedArray(e,t,n):e.selectionSet?v.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},LocalState.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},LocalState}(),v=new(a.h?WeakMap:Map);function wrapDestructiveCacheMethod(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return v.set(e,(v.get(e)+1)%1e15),n.apply(this,arguments)})}function cancelNotifyTimeout(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var y=function(){function QueryInfo(e){this.cache=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.diff=null,this.observableQuery=null,v.has(e)||(v.set(e,0),wrapDestructiveCacheMethod(e,"evict"),wrapDestructiveCacheMethod(e,"modify"),wrapDestructiveCacheMethod(e,"reset"))}return QueryInfo.prototype.init=function(e){var t=e.networkStatus||d.a.loading;return this.variables&&this.networkStatus!==d.a.loading&&!Object(l.a)(this.variables,e.variables)&&(t=d.a.setVariables),Object(l.a)(e.variables,this.variables)||(this.diff=null),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},QueryInfo.prototype.reset=function(){cancelNotifyTimeout(this),this.diff=null,this.dirty=!1},QueryInfo.prototype.getDiff=function(e){return void 0===e&&(e=this.variables),this.diff&&Object(l.a)(e,this.variables)?this.diff:(this.updateWatch(this.variables=e),this.diff=this.cache.diff({query:this.document,variables:e,returnPartialData:!0,optimistic:!0}))},QueryInfo.prototype.setDiff=function(e){var t=this,n=this.diff;this.diff=e,this.dirty||(e&&e.result)===(n&&n.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},QueryInfo.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},QueryInfo.prototype.notify=function(){var e=this;cancelNotifyTimeout(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},QueryInfo.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Object(d.b)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},QueryInfo.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),delete this.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var e=this.observableQuery;e&&e.stopPolling()}},QueryInfo.prototype.cancel=function(){},QueryInfo.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;n&&"no-cache"===n.options.fetchPolicy||this.lastWatch&&this.lastWatch.query===this.document&&Object(l.a)(e,this.lastWatch.variables)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch={query:this.document,variables:e,optimistic:!0,callback:function(e){return t.setDiff(e)}}))},QueryInfo.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===v.get(this.cache)&&Object(l.a)(t,n.variables)&&Object(l.a)(e.data,n.result.data))},QueryInfo.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Object(a.B)(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.diff={result:e.data,complete:!0}:!this.stopped&&n&&(shouldWriteResult(e,t.errorPolicy)?this.cache.performTransaction((function(n){if(r.shouldWrite(e,t.variables))n.writeQuery({query:r.document,data:e.data,variables:t.variables}),r.lastWrite={result:e,variables:t.variables,dmCount:v.get(r.cache)};else if(r.diff&&r.diff.complete)return void(e.data=r.diff.result);var i=n.diff({query:r.document,variables:t.variables,returnPartialData:!0,optimistic:!0});r.stopped||r.updateWatch(t.variables),r.diff=i,i.complete&&(e.data=i.result)})):this.lastWrite=void 0)},QueryInfo.prototype.markReady=function(){return this.networkError=null,this.networkStatus=d.a.ready},QueryInfo.prototype.markError=function(e){return this.networkStatus=d.a.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},QueryInfo}();function shouldWriteResult(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Object(a.w)(e);return!r&&n&&e.data&&(r=!0),r}var m=Object.prototype.hasOwnProperty,b=function(){function QueryManager(e){var t=e.cache,n=e.link,r=e.queryDeduplication,i=void 0!==r&&r,o=e.onBroadcast,s=e.ssrMode,l=void 0!==s&&s,u=e.clientAwareness,c=void 0===u?{}:u,d=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(a.h?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.queryDeduplication=i,this.clientAwareness=c,this.localState=d||new h({cache:t}),this.ssrMode=l,this.assumeImmutableResults=!!f,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return QueryManager.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(new i.a(12))},QueryManager.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},QueryManager.prototype.mutate=function(e){var t=e.mutation,n=e.variables,o=e.optimisticResponse,s=e.updateQueries,l=e.refetchQueries,c=void 0===l?[]:l,d=e.awaitRefetchQueries,f=void 0!==d&&d,p=e.update,h=e.errorPolicy,v=void 0===h?"none":h,y=e.fetchPolicy,m=e.context,b=void 0===m?{}:m;return Object(r.__awaiter)(this,void 0,void 0,(function(){var e,l,d;return Object(r.__generator)(this,(function(h){switch(h.label){case 0:return Object(i.b)(t,13),Object(i.b)(!y||"no-cache"===y,14),e=this.generateMutationId(),t=this.transform(t).document,n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,b)]:[3,2];case 1:n=h.sent(),h.label=2;case 2:return l=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:n,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:e,document:t,variables:n,errorPolicy:v,updateQueries:s,update:p}),this.broadcastQueries(),d=this,[2,new Promise((function(i,h){var m,g;d.getObservableFromLink(t,Object(r.__assign)(Object(r.__assign)({},b),{optimisticResponse:o}),n,!1).subscribe({next:function(r){if(Object(a.w)(r)&&"none"===v)g=new u.a({graphQLErrors:r.errors});else{if(l&&(l.loading=!1,l.error=null),"no-cache"!==y)try{d.markMutationResult({mutationId:e,result:r,document:t,variables:n,errorPolicy:v,updateQueries:s,update:p})}catch(e){return void(g=new u.a({networkError:e}))}m=r}},error:function(t){l&&(l.loading=!1,l.error=t),o&&d.cache.removeOptimistic(e),d.broadcastQueries(),h(new u.a({networkError:t}))},complete:function(){if(g&&l&&(l.loading=!1,l.error=g),o&&d.cache.removeOptimistic(e),d.broadcastQueries(),g)h(g);else{"function"==typeof c&&(c=c(m));var t=[];Object(a.B)(c)&&c.forEach((function(e){if("string"==typeof e)d.queries.forEach((function(n){var r=n.observableQuery;r&&r.hasObservers()&&r.queryName===e&&t.push(r.refetch())}));else{var n={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(n.context=e.context),t.push(d.query(n))}})),Promise.all(f?t:[]).then((function(){"ignore"===v&&m&&Object(a.w)(m)&&delete m.errors,i(m)}),h)}}})}))]}}))}))},QueryManager.prototype.markMutationResult=function(e,t){var n=this;if(void 0===t&&(t=this.cache),shouldWriteResult(e.result,e.errorPolicy)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],i=e.updateQueries;i&&this.queries.forEach((function(o,s){var l=o.observableQuery,u=l&&l.queryName;if(u&&m.call(i,u)){var c=i[u],d=n.queries.get(s),f=d.document,p=d.variables,h=t.diff({query:f,variables:p,returnPartialData:!0,optimistic:!1}),v=h.result;if(h.complete&&v){var y=c(v,{mutationResult:e.result,queryName:f&&Object(a.s)(f)||void 0,queryVariables:p});y&&r.push({result:y,dataId:"ROOT_QUERY",query:f,variables:p})}}})),t.performTransaction((function(t){r.forEach((function(e){return t.write(e)}));var n=e.update;n&&n(t,e.result)}),null)}},QueryManager.prototype.markMutationOptimistic=function(e,t){var n=this,i="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(Object(r.__assign)(Object(r.__assign)({},t),{result:{data:i}}),e)}catch(e){}}),t.mutationId)},QueryManager.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},QueryManager.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},QueryManager.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},QueryManager.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),r=Object(a.J)(this.cache.transformForLink(n)),i=this.localState.clientQuery(n),o=r&&this.localState.serverQuery(r),s={document:n,hasClientExports:Object(a.x)(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:i,serverQuery:o,defaultVars:Object(a.m)(Object(a.r)(n))},add=function(e){e&&!t.has(e)&&t.set(e,s)};add(e),add(n),add(i),add(o)}return t.get(e)},QueryManager.prototype.getVariables=function(e,t){return Object(r.__assign)(Object(r.__assign)({},this.transform(e).defaultVars),t)},QueryManager.prototype.watchQuery=function(e){void 0===(e=Object(r.__assign)(Object(r.__assign)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new y(this.cache),n=new c.a({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:e.query,observableQuery:n,variables:e.variables}),n},QueryManager.prototype.query=function(e){var t=this;Object(i.b)(e.query,15),Object(i.b)("Document"===e.query.kind,16),Object(i.b)(!e.returnPartialData,17),Object(i.b)(!e.pollInterval,18);var n=this.generateQueryId();return this.fetchQuery(n,e).finally((function(){return t.stopQuery(n)}))},QueryManager.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},QueryManager.prototype.generateRequestId=function(){return this.requestIdCounter++},QueryManager.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},QueryManager.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},QueryManager.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},QueryManager.prototype.clearStore=function(){return this.cancelPendingFetches(new i.a(19)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=d.a.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset()},QueryManager.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},QueryManager.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.queries.forEach((function(r,i){var o=r.observableQuery;if(o&&o.hasObservers()){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||n.push(o.refetch()),t.getQuery(i).setDiff(null)}})),this.broadcastQueries(),Promise.all(n)},QueryManager.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},QueryManager.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=e.variables,s=e.context,l=void 0===s?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var makeObservable=function(e){return t.getObservableFromLink(n,l,e,!1).map((function(o){if("no-cache"!==r&&(shouldWriteResult(o,i)&&t.cache.write({query:n,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),Object(a.w)(o))throw new u.a({graphQLErrors:o.errors});return o}))};if(this.transform(n).hasClientExports){var c=this.localState.addExportedVariables(n,o,l).then(makeObservable);return new a.c((function(e){var t=null;return c.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return makeObservable(o)},QueryManager.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},QueryManager.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},QueryManager.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},QueryManager.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},QueryManager.prototype.getLocalState=function(){return this.localState},QueryManager.prototype.getObservableFromLink=function(e,t,n,i){var s,l,u=this;void 0===i&&(i=null!==(s=null==t?void 0:t.queryDeduplication)&&void 0!==s?s:this.queryDeduplication);var c=this.transform(e).serverQuery;if(c){var d=this.inFlightLinkObservables,f=this.link,p={query:c,variables:n,operationName:Object(a.s)(c)||void 0,context:this.prepareContext(Object(r.__assign)(Object(r.__assign)({},t),{forceFetch:!i}))};if(t=p.context,i){var h=d.get(c)||new Map;d.set(c,h);var v=JSON.stringify(n);if(!(l=h.get(v))){var y=new a.a([Object(o.execute)(f,p)]);h.set(v,l=y),y.cleanup((function(){h.delete(v)&&h.size<1&&d.delete(c)}))}}else l=new a.a([Object(o.execute)(f,p)])}else l=new a.a([a.c.of({data:{}})]),t=this.prepareContext(t);var m=this.transform(e).clientQuery;return m&&(l=Object(a.f)(l,(function(e){return u.localState.runResolvers({document:m,remoteResult:e,context:t,variables:n})}))),l},QueryManager.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return Object(a.f)(this.getObservableFromLink(e.document,n.context,n.variables),(function(i){var o=Object(a.B)(i.errors);if(r>=e.lastRequestId){if(o&&"none"===n.errorPolicy)throw e.markError(new u.a({graphQLErrors:i.errors}));e.markResult(i,n,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||d.a.ready};return o&&"ignore"!==n.errorPolicy&&(s.errors=i.errors),s}),(function(t){var n=Object(u.b)(t)?t:new u.a({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},QueryManager.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=d.a.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),s=this.getQuery(e),l=s.networkStatus,u=t.fetchPolicy,c=void 0===u?"cache-first":u,f=t.errorPolicy,p=void 0===f?"none":f,h=t.returnPartialData,v=void 0!==h&&h,y=t.notifyOnNetworkStatusChange,m=void 0!==y&&y,b=t.context,g=void 0===b?{}:b;("cache-first"===c||"cache-and-network"===c||"network-only"===c||"no-cache"===c)&&m&&"number"==typeof l&&l!==n&&Object(d.b)(n)&&("cache-first"!==c&&(c="cache-and-network"),v=!0);var _=Object.assign({},t,{query:i,variables:o,fetchPolicy:c,errorPolicy:p,returnPartialData:v,notifyOnNetworkStatusChange:m,context:g}),fromVariables=function(e){return _.variables=e,r.fetchQueryByPolicy(s,_,n)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return S.cancel(e)}))}));var S=new a.a(this.transform(_.query).hasClientExports?this.localState.addExportedVariables(_.query,_.variables,_.context).then(fromVariables):fromVariables(_.variables));return S.cleanup((function(){r.fetchCancelFns.delete(e);var n=t.nextFetchPolicy;n&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof n?n.call(t,t.fetchPolicy||"cache-first"):n)})),S},QueryManager.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,o=t.query,s=t.variables,l=t.fetchPolicy,u=t.errorPolicy,c=t.returnPartialData,f=t.context;e.init({document:o,variables:s,networkStatus:n});var readCache=function(){return e.getDiff(s)},resultsFromCache=function(t,n){void 0===n&&(n=e.networkStatus||d.a.loading);var l=t.result;var fromData=function(e){return a.c.of(Object(r.__assign)({data:e,loading:Object(d.b)(n),networkStatus:n},t.complete?null:{partial:!0}))};return i.transform(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:l},context:f,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return fromData(e.data)})):fromData(l)},resultsFromLink=function(t){return i.getResultsFromLink(e,t,{variables:s,context:f,fetchPolicy:l,errorPolicy:u})};switch(l){default:case"cache-first":return(p=readCache()).complete?[resultsFromCache(p,e.markReady())]:c?[resultsFromCache(p),resultsFromLink(!0)]:[resultsFromLink(!0)];case"cache-and-network":var p;return(p=readCache()).complete||c?[resultsFromCache(p),resultsFromLink(!0)]:[resultsFromLink(!0)];case"cache-only":return[resultsFromCache(readCache(),e.markReady())];case"network-only":return[resultsFromLink(!0)];case"no-cache":return[resultsFromLink(!1)];case"standby":return[]}},QueryManager.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new y(this.cache)),this.queries.get(e)},QueryManager.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Object(r.__assign)(Object(r.__assign)({},t),{clientAwareness:this.clientAwareness})},QueryManager}();function mergeOptions(e,t){return Object(a.j)(e,t,t.variables&&{variables:Object(r.__assign)(Object(r.__assign)({},e.variables),t.variables)})}var g=function(){function ApolloClient(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,a=e.headers,l=e.cache,u=e.ssrMode,c=void 0!==u&&u,d=e.ssrForceFetchDelay,f=void 0===d?0:d,p=e.connectToDevTools,v=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,y=e.queryDeduplication,m=void 0===y||y,g=e.defaultOptions,_=e.assumeImmutableResults,S=void 0!==_&&_,O=e.resolvers,E=e.typeDefs,w=e.fragmentMatcher,T=e.name,C=e.version,j=e.link;if(j||(j=n?new s.HttpLink({uri:n,credentials:r,headers:a}):o.ApolloLink.empty()),!l)throw new i.a(9);this.link=j,this.cache=l,this.disableNetworkFetches=c||f>0,this.queryDeduplication=m,this.defaultOptions=g||{},this.typeDefs=E,f&&setTimeout((function(){return t.disableNetworkFetches=!1}),f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),v&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.15",this.localState=new h({cache:l,client:this,resolvers:O,fragmentMatcher:w}),this.queryManager=new b({cache:this.cache,link:this.link,queryDeduplication:m,ssrMode:c,clientAwareness:{name:T,version:C},localState:this.localState,assumeImmutableResults:S,onBroadcast:v?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return ApolloClient.prototype.stop=function(){this.queryManager.stop()},ApolloClient.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=mergeOptions(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Object(r.__assign)(Object(r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},ApolloClient.prototype.query=function(e){return this.defaultOptions.query&&(e=mergeOptions(this.defaultOptions.query,e)),Object(i.b)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Object(r.__assign)(Object(r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},ApolloClient.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=mergeOptions(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},ApolloClient.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},ApolloClient.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},ApolloClient.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},ApolloClient.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},ApolloClient.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},ApolloClient.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},ApolloClient.prototype.__requestRaw=function(e){return Object(o.execute)(this.link,e)},ApolloClient.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},ApolloClient.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},ApolloClient.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},ApolloClient.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},ApolloClient.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},ApolloClient.prototype.extract=function(e){return this.cache.extract(e)},ApolloClient.prototype.restore=function(e){return this.cache.restore(e)},ApolloClient.prototype.addResolvers=function(e){this.localState.addResolvers(e)},ApolloClient.prototype.setResolvers=function(e){this.localState.setResolvers(e)},ApolloClient.prototype.getResolvers=function(){return this.localState.getResolvers()},ApolloClient.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},ApolloClient.prototype.setLink=function(e){this.link=this.queryManager.link=e},ApolloClient}()},function(e,t,n){e.exports=n(160).Observable},function(e,t,n){"use strict";(function(e,r){var i,o=n(146);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(o.a)(i);t.a=a}).call(this,n(53),n(90)(e))},function(e,t,n){"use strict";t.__esModule=!0;var r=n(1),i=r.__importDefault(n(155)),o=r.__importDefault(n(156)),a=function(e){function SynchronousRegistry(t){var n=e.call(this,t)||this;return n._registry=[],n}return r.__extends(SynchronousRegistry,e),SynchronousRegistry.prototype.set=function(e,t,n){if(void 0===n&&(n=0),"string"!=typeof e)throw new Error("Key must be a string");if("string"!=typeof n&&"number"!=typeof n)throw new Error("Position must be a string or a number");var r={key:e,value:t};n&&(r.position=n);var i=this._registry.findIndex((function(t){return t.key===e}));return-1===i?this._registry.push(r):this._registry[i]=r,t},SynchronousRegistry.prototype.get=function(e){if("string"!=typeof e)return console.error("Key must be a string"),null;var t=this._registry.find((function(t){return t.key===e}));return t?t.value:null},SynchronousRegistry.prototype._getChildrenWrapped=function(e){var t=this._registry.filter((function(t){return 0===t.key.indexOf(e+"/")}));return o.default(t)},SynchronousRegistry.prototype.getChildrenAsObject=function(e){var t={};return this._getChildrenWrapped(e).forEach((function(e){t[e.key]=e.value})),t},SynchronousRegistry.prototype.getChildren=function(e){return this._getChildrenWrapped(e).map((function(e){return e.value}))},SynchronousRegistry.prototype.has=function(e){return"string"!=typeof e?(console.error("Key must be a string"),!1):Boolean(this._registry.find((function(t){return t.key===e})))},SynchronousRegistry.prototype._getAllWrapped=function(){return o.default(this._registry)},SynchronousRegistry.prototype.getAllAsObject=function(){var e={};return this._getAllWrapped().forEach((function(t){e[t.key]=t.value})),e},SynchronousRegistry.prototype.getAllAsList=function(){return this._getAllWrapped().map((function(e){return Object.assign({id:e.key},e.value)}))},SynchronousRegistry}(i.default);t.default=a},function(e,t){var n,r,i=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(n===setTimeout)return setTimeout(e,0);if((n===defaultSetTimout||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){n=defaultSetTimout}try{r="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){r=defaultClearTimeout}}();var o,a=[],s=!1,l=-1;function cleanUpNextTick(){s&&o&&(s=!1,o.length?a=o.concat(a):l=-1,a.length&&drainQueue())}function drainQueue(){if(!s){var e=runTimeout(cleanUpNextTick);s=!0;for(var t=a.length;t;){for(o=a,a=[];++l1)for(var n=1;n0,E=m(),w=c.useCallback((function(){i(b.files.selected).then((function(n){var r=n.data.uploadFiles;_((function(e){return{selected:[],finished:s(e.finished,e.selected.filter((function(e){return r.find((function(t){return t.success&&t.filename===e.name}))}))),rejected:s(e.rejected,e.selected.filter((function(e){return r.find((function(t){return!t.success&&t.filename===e.name}))})))}})),r.some((function(e){return!e.success}))?t.warning(e("uploadDialog.uploadFinishedWithErrors","Some files could not be uploaded")):t.ok(e("uploadDialog.uploadFinished","Upload finished")),r.some((function(e){return e.success}))&&S()})).catch((function(n){t.error(e("fileUpload.error","Upload failed"),n)}))}),[i,b.files.selected,_,t,e,S]),T=c.useCallback((function(e){_((function(t){return r(r({},t),{selected:e})}))}),[_]);return u.createElement(p.Dialog,{isOpen:b.visible,title:e("uploadDialog.title","Upload assets"),onRequestClose:g,actions:[u.createElement(d.Button,{key:"cancel",style:"neutral",hoverStyle:"darken",onClick:g},o?e("uploadDialog.close","Close"):e("uploadDialog.cancel","Cancel")),u.createElement(d.Button,{key:"upload",style:"success",hoverStyle:"success",disabled:!O,onClick:w},e("uploadDialog.upload","Upload"))],style:"wide"},u.createElement("section",{className:E.uploadArea},u.createElement(h.default,{files:b.files.selected,loading:a,onSetFiles:T}),u.createElement(v.default,{files:b.files,loading:a,uploadState:o})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7).createUseMediaUiStyles((function(e){return{fileList:{marginTop:e.spacing.full,display:"flex",flexDirection:"row",flexWrap:"wrap"},fileListHeader:{flex:"1 1 100%",marginBottom:e.spacing.full,fontSize:e.fontSize},thumb:{display:"inline-flex",borderRadius:2,border:"1px solid #eaeaea",marginBottom:e.spacing.half,marginRight:e.spacing.half,width:100,height:100,padding:e.spacing.quarter,boxSizing:"border-box"},thumbInner:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center","& span":{marginLeft:e.spacing.half,userSelect:"none"}},img:{position:"absolute",display:"block",width:"100%",height:"100%",objectFit:"cover",left:0,top:0,zIndex:-1},stateOverlay:{position:"absolute",content:'""',left:0,top:0,right:0,bottom:0,backgroundColor:e.colors.alternatingBackground,opacity:.3,zIndex:-1},loading:{borderColor:e.colors.border,"& $thumbInner:after":{extend:"stateOverlay"}},success:{borderColor:e.colors.success,"& $thumbInner:after":{extend:"stateOverlay",backgroundColor:e.colors.success}},error:{borderColor:e.colors.error,"& $thumbInner:after":{extend:"stateOverlay",backgroundColor:e.colors.error}},warning:{color:e.colors.warn}}}));t.default=a.memo((function(e){var t,n=e.file,r=e.loading,i=void 0!==r&&r,o=e.fileState,u=l(),c=null==o?void 0:o.success,d=o&&!c;return d?t=u.error:c?t=u.success:i&&(t=u.loading),a.createElement("div",{className:[u.thumb,t].join(" "),title:n.name},a.createElement("div",{className:u.thumbInner},a.createElement("img",{src:n.preview,alt:n.name,className:u.img}),i&&a.createElement(s.Icon,{icon:"spinner",spin:!0}),c&&a.createElement(s.Icon,{icon:"check"}),d&&a.createElement(s.Icon,{icon:"exclamation-circle"}),(null==o?void 0:o.result)&&a.createElement("span",null,o.result)))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useUploadFile=t.useUploadFiles=t.useUploadDialogState=void 0;var i=r(n(269));t.useUploadDialogState=i.default;var o=r(n(270));t.useUploadFile=o.default;var a=r(n(274));t.useUploadFiles=a.default},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0,I=b(),P=u.useMemo((function(){var e,t,r=null===(t=null===(e=(null==n?void 0:n.file.mediaType).match(/^(?(?:[.!#%&'`^~$*+\-|\w]+))\//))||void 0===e?void 0:e.groups)||void 0===t?void 0:t.type;return r?r+"/*":""}),[n]),M=u.useCallback((function(){if(0!==S.files.selected.length){var r=S.files.selected[0];o({asset:n,file:r,options:T}).then((function(){t.ok(e("uploadDialog.replacementFinished","Replacement finished")),O(),g()})).catch((function(n){t.error(e("assetReplacement.error","Replacement failed"),n)}))}}),[o,t,e,S,T,g,n,O]),k=u.useCallback((function(e){E((function(t){return r(r({},t),{selected:e})}))}),[E]);return l.createElement(p.Dialog,{isOpen:S.visible,title:e("uploadDialog.replaceAsset","Replace Asset"),onRequestClose:O,actions:[l.createElement(c.Button,{key:"cancel",style:"neutral",hoverStyle:"darken",onClick:O},a?e("uploadDialog.close","Close"):e("uploadDialog.cancel","Cancel")),l.createElement(c.Button,{key:"upload",style:"success",hoverStyle:"success",disabled:!j,onClick:M},e("uploadDialog.replace","Replace"))],style:"wide"},l.createElement("section",{className:I.uploadArea},l.createElement(h.default,{files:S.files.selected,loading:s,onSetFiles:k,maxFiles:1,acceptedFileTypes:P}),l.createElement("section",{className:I.optionSection},l.createElement("div",{className:I.option},l.createElement(c.Label,null,l.createElement(c.CheckBox,{isChecked:T.generateRedirects,onChange:function(e){return C(r(r({},T),{generateRedirects:e}))}}),l.createElement("span",null,e("uploadDialog.generateRedirects","Generate redirects")))),l.createElement("div",{className:I.option},l.createElement(c.Label,null,l.createElement(c.CheckBox,{isChecked:T.keepOriginalFilename,onChange:function(e){return C(r(r({},T),{keepOriginalFilename:e}))}}),l.createElement("span",null,e("uploadDialog.keepOriginalFilename","Keep original filename"))))),l.createElement(v.default,{files:S.files,loading:s,uploadState:a?[a]:[]})))}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function findTabbableDescendants(e){return[].slice.call(e.querySelectorAll("*"),0).filter(tabbable)};var r=/input|select|textarea|button|object/;function hidesContents(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;var n=window.getComputedStyle(e);return t?"visible"!==n.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0:"none"==n.getPropertyValue("display")}function focusable(e,t){var n=e.nodeName.toLowerCase();return(r.test(n)&&!e.disabled||"a"===n&&e.href||t)&&function visible(e){for(var t=e;t&&t!==document.body;){if(hidesContents(t))return!1;t=t.parentNode}return!0}(e)}function tabbable(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&focusable(e,!n)}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNodeList=assertNodeList,t.setElement=function setElement(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);assertNodeList(n,t),t=n}return o=t||o},t.validateElement=validateElement,t.hide=function hide(e){var t=!0,n=!1,r=void 0;try{for(var i,o=validateElement(e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.setAttribute("aria-hidden","true")}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}},t.show=function show(e){var t=!0,n=!1,r=void 0;try{for(var i,o=validateElement(e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.removeAttribute("aria-hidden")}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function documentNotReadyOrSSRTesting(){o=null},t.resetForTesting=function resetForTesting(){o=null};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(285)),i=n(80);var o=null;function assertNodeList(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function validateElement(e){var t=e||o;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,r.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=new function PortalOpenInstances(){var e=this;!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,PortalOpenInstances),this.register=function(t){-1===e.openInstances.indexOf(t)&&(e.openInstances.push(t),e.emit("register"))},this.deregister=function(t){var n=e.openInstances.indexOf(t);-1!==n&&(e.openInstances.splice(n,1),e.emit("deregister"))},this.subscribe=function(t){e.subscribers.push(t)},this.emit=function(t){e.subscribers.forEach((function(n){return n(t,e.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]};t.default=r,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"selectedAssetForPreviewState",default:null});t.default=r},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetCollectionTree=t.SideBarLeft=t.AssetSourceDescription=t.AssetSourceList=void 0;var i=r(n(291));t.AssetSourceList=i.default;var o=r(n(297));t.AssetSourceDescription=o.default;var a=r(n(298));t.SideBarLeft=a.default;var s=n(133);Object.defineProperty(t,"AssetCollectionTree",{enumerable:!0,get:function(){return s.AssetCollectionTree}})},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetCollectionTree=void 0;var i=r(n(299));t.AssetCollectionTree=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={TAG:"neos-tree-tag",COLLECTION:"neos-tree-collection"}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(315),c=n(8),d=n(7),f=n(9),p=n(14),h=d.createUseMediaUiStyles((function(e){return{currentSelection:{display:"flex",flexWrap:"wrap",alignItems:"center",overflow:"hidden"},headline:{userSelect:"none",flex:"1 1 100%",fontWeight:"bold",lineHeight:e.spacing.goldenUnit},label:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","& svg":{marginRight:e.spacing.half}}}}));t.default=a.memo((function(){var e=h(),t=f.useSelectedAsset(),n=f.useSelectedAssetCollection(),r=f.useSelectedTag(),i=l.useRecoilValue(p.selectedInspectorViewState),o=d.useIntl().translate,v=s.useMemo((function(){var e="question",o=null;if("asset"===i){if(null==t?void 0:t.file.mediaType){var a=u.fromString(t.file.mediaType);"audio"===a.type&&(e="file-audio"),"video"===a.type&&(e="file-video"),"image"===a.type&&(e="file-image")}else e="file";o=null==t?void 0:t.label}else"assetCollection"===i?(e="folder",o=null==n?void 0:n.title):"tag"===i&&(e="tag",o=null==r?void 0:r.label);return{icon:e,label:o}}),[t,r,n,i]);return v.label?a.createElement("div",{className:e.currentSelection},a.createElement(c.Headline,{type:"h2",className:e.headline},o("currentSelection.headline","Selected element")),a.createElement("div",{className:e.label,title:v.label},a.createElement(c.Icon,{icon:v.icon}),v.label)):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7),l=n(46),u=s.createUseMediaUiStyles({assetCount:{height:"100%",alignSelf:"flex-start",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none"}});t.default=a.memo((function(){var e=u(),t=s.useIntl().translate,n=l.useAssetCount();return a.createElement("div",{className:e.assetCount},n," ",t("pagination.assetCount","assets"))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;tg&&(r-=i-g),r=Math.max(r,1),i=Math.min(i,g);var o=a(Array(i-r+1)).map((function(e,t){return t+r}));O({start:r,end:i,hasLessPages:r>2,hasMorePages:i+10&&l.createElement("ol",{className:e.list},l.createElement(h.default,{icon:"angle-left",title:o("pagination.previousPageTitle","Go to previous page"),onClick:w,disabled:b||n<=1}),S.start>1&&l.createElement(h.default,{title:o("pagination.firstPageTitle","Go to first page"),onClick:E,disabled:b,page:1}),S.hasLessPages&&l.createElement("li",{className:e.ellipsis},"…"),S.pages.map((function(e){return l.createElement(h.default,{key:e,selected:n===e,onClick:E,disabled:b,title:o("pagination.page","Go to page "+e,[e]),page:e})})),S.hasMorePages&&l.createElement("li",{className:e.ellipsis},"…"),S.end0&&(this.previousOptions.subscription!==this.getOptions().subscription||!Object(l.a)(this.previousOptions.variables,this.getOptions().variables)||this.previousOptions.skip!==this.getOptions().skip)&&(this.cleanup(),t=this.getLoadingResult()),this.initialize(this.getOptions()),this.startSubscription(),this.previousOptions=this.getOptions(),Object(s.__assign)(Object(s.__assign)({},t),{variables:this.getOptions().variables})},SubscriptionData.prototype.afterExecute=function(){this.isMounted=!0},SubscriptionData.prototype.cleanup=function(){this.endSubscription(),delete this.currentObservable.query},SubscriptionData.prototype.initialize=function(e){this.currentObservable.query||!0===this.getOptions().skip||(this.currentObservable.query=this.refreshClient().client.subscribe({query:e.subscription,variables:e.variables,fetchPolicy:e.fetchPolicy,context:e.context}))},SubscriptionData.prototype.startSubscription=function(){this.currentObservable.subscription||(this.currentObservable.subscription=this.currentObservable.query.subscribe({next:this.updateCurrentData.bind(this),error:this.updateError.bind(this),complete:this.completeSubscription.bind(this)}))},SubscriptionData.prototype.getLoadingResult=function(){return{loading:!0,error:void 0,data:void 0}},SubscriptionData.prototype.updateResult=function(e){this.isMounted&&this.setResult(e)},SubscriptionData.prototype.updateCurrentData=function(e){var t=this.getOptions().onSubscriptionData;this.updateResult({data:e.data,loading:!1,error:void 0}),t&&t({client:this.refreshClient().client,subscriptionData:e})},SubscriptionData.prototype.updateError=function(e){this.updateResult({error:e,loading:!1})},SubscriptionData.prototype.completeSubscription=function(){var e=this;Promise.resolve().then((function(){var t=e.getOptions().onSubscriptionComplete;t&&t(),e.endSubscription()}))},SubscriptionData.prototype.endSubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},SubscriptionData}(c),f=n(21),p=n(30),h=function(e){function MutationData(t){var n=t.options,r=t.context,i=t.result,o=t.setResult,a=e.call(this,n,r)||this;return a.runMutation=function(e){void 0===e&&(e={}),a.onMutationStart();var t=a.generateNewMutationId();return a.mutate(e).then((function(e){return a.onMutationCompleted(e,t),e})).catch((function(e){if(a.onMutationError(e,t),!a.getOptions().onError)throw e}))},a.verifyDocumentType(n.mutation,u.a.Mutation),a.result=i,a.setResult=o,a.mostRecentMutationId=0,a}return Object(s.__extends)(MutationData,e),MutationData.prototype.execute=function(e){return this.isMounted=!0,this.verifyDocumentType(this.getOptions().mutation,u.a.Mutation),[this.runMutation,Object(s.__assign)(Object(s.__assign)({},e),{client:this.refreshClient().client})]},MutationData.prototype.afterExecute=function(){return this.isMounted=!0,this.unmount.bind(this)},MutationData.prototype.cleanup=function(){},MutationData.prototype.mutate=function(e){return this.refreshClient().client.mutate(Object(p.mergeOptions)(this.getOptions(),e))},MutationData.prototype.onMutationStart=function(){this.result.loading||this.getOptions().ignoreResults||this.updateResult({loading:!0,error:void 0,data:void 0,called:!0})},MutationData.prototype.onMutationCompleted=function(e,t){var n=this.getOptions(),r=n.onCompleted,i=n.ignoreResults,o=e.data,a=e.errors,s=a&&a.length>0?new f.a({graphQLErrors:a}):void 0;this.isMostRecentMutation(t)&&!i&&this.updateResult({called:!0,loading:!1,data:o,error:s}),r&&r(o)},MutationData.prototype.onMutationError=function(e,t){var n=this.getOptions().onError;this.isMostRecentMutation(t)&&this.updateResult({loading:!1,error:e,data:void 0,called:!0}),n&&n(e)},MutationData.prototype.generateNewMutationId=function(){return++this.mostRecentMutationId},MutationData.prototype.isMostRecentMutation=function(e){return this.mostRecentMutationId===e},MutationData.prototype.updateResult=function(e){!this.isMounted||this.previousResult&&Object(l.a)(this.previousResult,e)||(this.setResult(e),this.previousResult=e)},MutationData}(c),v=function(e){function QueryData(t){var n=t.options,r=t.context,i=t.onNewData,o=e.call(this,n,r)||this;return o.runLazy=!1,o.previous=Object.create(null),o.runLazyQuery=function(e){o.cleanup(),o.runLazy=!0,o.lazyOptions=e,o.onNewData()},o.getQueryResult=function(){var e=o.observableQueryFields(),t=o.getOptions();if(t.skip)e=Object(s.__assign)(Object(s.__assign)({},e),{data:void 0,error:void 0,loading:!1,networkStatus:p.NetworkStatus.ready,called:!0});else if(o.currentObservable){var n=o.currentObservable.getCurrentResult(),r=n.data,i=n.loading,a=n.partial,l=n.networkStatus,u=n.errors,c=n.error;if(u&&u.length>0&&(c=new f.a({graphQLErrors:u})),e=Object(s.__assign)(Object(s.__assign)({},e),{data:r,loading:i,networkStatus:l,error:c,called:!0}),i);else if(c)Object.assign(e,{data:(o.currentObservable.getLastResult()||{}).data});else{var d=o.currentObservable.options.fetchPolicy;if(t.partialRefetch&&a&&(!r||0===Object.keys(r).length)&&"cache-only"!==d)return Object.assign(e,{loading:!0,networkStatus:p.NetworkStatus.loading}),e.refetch(),e}}e.client=o.client,o.setOptions(t,!0);var h=o.previous.result;return o.previous.loading=h&&h.loading||!1,e.previousData=h&&(h.data||h.previousData),o.previous.result=e,o.currentObservable&&o.currentObservable.resetQueryStoreErrors(),e},o.obsRefetch=function(e){var t;return null===(t=o.currentObservable)||void 0===t?void 0:t.refetch(e)},o.obsFetchMore=function(e){return o.currentObservable.fetchMore(e)},o.obsUpdateQuery=function(e){return o.currentObservable.updateQuery(e)},o.obsStartPolling=function(e){var t;null===(t=o.currentObservable)||void 0===t||t.startPolling(e)},o.obsStopPolling=function(){var e;null===(e=o.currentObservable)||void 0===e||e.stopPolling()},o.obsSubscribeToMore=function(e){return o.currentObservable.subscribeToMore(e)},o.onNewData=i,o}return Object(s.__extends)(QueryData,e),QueryData.prototype.execute=function(){this.refreshClient();var e=this.getOptions(),t=e.skip,n=e.query;return(t||n!==this.previous.query)&&(this.removeQuerySubscription(),this.removeObservable(!t),this.previous.query=n),this.updateObservableQuery(),this.isMounted&&this.startQuerySubscription(),this.getExecuteSsrResult()||this.getExecuteResult()},QueryData.prototype.executeLazy=function(){return this.runLazy?[this.runLazyQuery,this.execute()]:[this.runLazyQuery,{loading:!1,networkStatus:p.NetworkStatus.ready,called:!1,data:void 0}]},QueryData.prototype.fetchData=function(){var e=this,t=this.getOptions();return!t.skip&&!1!==t.ssr&&new Promise((function(t){return e.startQuerySubscription(t)}))},QueryData.prototype.afterExecute=function(e){var t=(void 0===e?{}:e).lazy,n=void 0!==t&&t;return this.isMounted=!0,n&&!this.runLazy||this.handleErrorOrCompleted(),this.previousOptions=this.getOptions(),this.unmount.bind(this)},QueryData.prototype.cleanup=function(){this.removeQuerySubscription(),this.removeObservable(!0),delete this.previous.result},QueryData.prototype.getOptions=function(){var t=e.prototype.getOptions.call(this);return this.lazyOptions&&(t.variables=Object(s.__assign)(Object(s.__assign)({},t.variables),this.lazyOptions.variables),t.context=Object(s.__assign)(Object(s.__assign)({},t.context),this.lazyOptions.context)),this.runLazy&&delete t.skip,t},QueryData.prototype.ssrInitiated=function(){return this.context&&this.context.renderPromises},QueryData.prototype.getExecuteResult=function(){var e=this.getQueryResult();return this.startQuerySubscription(),e},QueryData.prototype.getExecuteSsrResult=function(){var e=this.getOptions(),t=e.ssr,n=e.skip,r=!1===t,i=this.refreshClient().client.disableNetworkFetches,o=Object(s.__assign)({loading:!0,networkStatus:p.NetworkStatus.loading,called:!0,data:void 0,stale:!1,client:this.client},this.observableQueryFields());if(r&&(this.ssrInitiated()||i))return this.previous.result=o,o;if(this.ssrInitiated()){var a=this.getQueryResult()||o;return a.loading&&!n&&this.context.renderPromises.addQueryPromise(this,(function(){return null})),a}},QueryData.prototype.prepareObservableQueryOptions=function(){var e=this.getOptions();this.verifyDocumentType(e.query,u.a.Query);var t=e.displayName||"Query";return!this.ssrInitiated()||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e.fetchPolicy="cache-first"),Object(s.__assign)(Object(s.__assign)({},e),{displayName:t,context:e.context})},QueryData.prototype.initializeObservableQuery=function(){if(this.ssrInitiated()&&(this.currentObservable=this.context.renderPromises.getSSRObservable(this.getOptions())),!this.currentObservable){var e=this.prepareObservableQueryOptions();this.previous.observableQueryOptions=Object(s.__assign)(Object(s.__assign)({},e),{children:null}),this.currentObservable=this.refreshClient().client.watchQuery(Object(s.__assign)({},e)),this.ssrInitiated()&&this.context.renderPromises.registerSSRObservable(this.currentObservable,e)}},QueryData.prototype.updateObservableQuery=function(){if(this.currentObservable){if(!this.getOptions().skip){var e=Object(s.__assign)(Object(s.__assign)({},this.prepareObservableQueryOptions()),{children:null});Object(l.a)(e,this.previous.observableQueryOptions)||(this.previous.observableQueryOptions=e,this.currentObservable.setOptions(e).catch((function(){})))}}else this.initializeObservableQuery()},QueryData.prototype.startQuerySubscription=function(e){var t=this;void 0===e&&(e=this.onNewData),this.currentSubscription||this.getOptions().skip||(this.currentSubscription=this.currentObservable.subscribe({next:function(n){var r=n.loading,i=n.networkStatus,o=n.data,a=t.previous.result;a&&a.loading===r&&a.networkStatus===i&&Object(l.a)(a.data,o)||e()},error:function(n){if(t.resubscribeToQuery(),!n.hasOwnProperty("graphQLErrors"))throw n;var r=t.previous.result;(r&&r.loading||!Object(l.a)(n,t.previous.error))&&(t.previous.error=n,e())}}))},QueryData.prototype.resubscribeToQuery=function(){this.removeQuerySubscription();var e=this.currentObservable;if(e){var t=e.getLastError(),n=e.getLastResult();e.resetLastResults(),this.startQuerySubscription(),Object.assign(e,{lastError:t,lastResult:n})}},QueryData.prototype.handleErrorOrCompleted=function(){if(this.currentObservable&&this.previous.result){var e=this.previous.result,t=e.data,n=e.loading,r=e.error;if(!n){var i=this.getOptions(),o=i.query,a=i.variables,s=i.onCompleted,u=i.onError,c=i.skip;if(this.previousOptions&&!this.previous.loading&&Object(l.a)(this.previousOptions.query,o)&&Object(l.a)(this.previousOptions.variables,a))return;!s||r||c?u&&r&&u(r):s(t)}}},QueryData.prototype.removeQuerySubscription=function(){this.currentSubscription&&(this.currentSubscription.unsubscribe(),delete this.currentSubscription)},QueryData.prototype.removeObservable=function(e){this.currentObservable&&(this.currentObservable.tearDownQuery(),e&&delete this.currentObservable)},QueryData.prototype.observableQueryFields=function(){var e;return{variables:null===(e=this.currentObservable)||void 0===e?void 0:e.variables,refetch:this.obsRefetch,fetchMore:this.obsFetchMore,updateQuery:this.obsUpdateQuery,startPolling:this.obsStartPolling,stopPolling:this.obsStopPolling,subscribeToMore:this.obsSubscribeToMore}},QueryData}(c);function useBaseQuery(e,t,n){void 0===n&&(n=!1);var i=Object(r.useContext)(Object(a.c)()),o=Object(r.useReducer)((function(e){return e+1}),0),u=o[0],c=o[1],d=t?Object(s.__assign)(Object(s.__assign)({},t),{query:e}):{query:e},f=Object(r.useRef)(),p=f.current||(f.current=new v({options:d,context:i,onNewData:function(){p.ssrInitiated()?c():Promise.resolve().then((function(){return f.current&&c()}))}}));p.setOptions(d),p.context=i;var h=function useDeepMemo(e,t){var n=Object(r.useRef)();return n.current&&Object(l.a)(t,n.current.key)||(n.current={key:t,value:e()}),n.current.value}((function(){return n?p.executeLazy():p.execute()}),{options:Object(s.__assign)(Object(s.__assign)({},d),{onError:void 0,onCompleted:void 0}),context:i,tick:u}),y=n?h[1]:h;return Object(r.useEffect)((function(){return function(){return p.cleanup()}}),[]),Object(r.useEffect)((function(){return p.afterExecute({lazy:n})}),[y.loading,y.networkStatus,y.error,y.data]),h}function useLazyQuery(e,t){return useBaseQuery(e,t,!0)}function useMutation(e,t){var n=Object(r.useContext)(Object(a.c)()),i=Object(r.useState)({called:!1,loading:!1}),o=i[0],l=i[1],u=t?Object(s.__assign)(Object(s.__assign)({},t),{mutation:e}):{mutation:e},c=Object(r.useRef)();var d=function getMutationDataRef(){return c.current||(c.current=new h({options:u,context:n,result:o,setResult:l})),c.current}();return d.setOptions(u),d.context=n,Object(r.useEffect)((function(){return d.afterExecute()})),d.execute(o)}function useQuery(e,t){return useBaseQuery(e,t,!1)}function useSubscription(e,t){var n=Object(r.useContext)(Object(a.c)()),i=t?Object(s.__assign)(Object(s.__assign)({},t),{subscription:e}):{subscription:e},o=Object(r.useState)({loading:!i.skip,error:void 0,data:void 0}),l=o[0],u=o[1],c=Object(r.useRef)();var f=function getSubscriptionDataRef(){return c.current||(c.current=new d({options:i,context:n,setResult:u})),c.current}();return f.setOptions(i,!0),f.context=n,Object(r.useEffect)((function(){return f.afterExecute()})),Object(r.useEffect)((function(){return f.cleanup.bind(f)}),[]),f.execute(l)}function useReactiveVar(e){var t=e(),n=Object(r.useState)(t)[1];return Object(r.useEffect)((function(){return e.onNextChange(n)}),[t]),Object(r.useEffect)((function(){n(e())}),[]),t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r,i,o=n(1),a=(n(163),n(18)),s=n(60),l=n(41),u=n(2),c=n(3),d=n(11),f=n(10),p=Object.create(null),delModifier=function(){return p},h=Object.create(null),v=function(){function EntityStore(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Object(u.F)(Object(u.C)(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return Object(u.C)(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Object(u.E)(e);if(Object(u.C)(e))return e;var r=n.policies.identify(e)[0];if(r){var i=Object(u.E)(r);return t&&n.merge(r,e),i}}}return EntityStore.prototype.toObject=function(){return Object(o.__assign)({},this.data)},EntityStore.prototype.has=function(e){return void 0!==this.lookup(e,!0)},EntityStore.prototype.get=function(e,t){if(this.group.depend(e,t),f.c.call(this.data,e)){var n=this.data[e];if(n&&f.c.call(n,t))return n[t]}return"__typename"===t&&f.c.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof m?this.parent.get(e,t):void 0},EntityStore.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),f.c.call(this.data,e)?this.data[e]:this instanceof m?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},EntityStore.prototype.merge=function(e,t){var n=this,r=this.lookup(e),i=new u.b(storeObjectReconciler).merge(r,t);if(this.data[e]=i,i!==r&&(delete this.refs[e],this.group.caching)){var o=Object.create(null);r||(o.__exists=1),Object.keys(t).forEach((function(e){if(!r||r[e]!==i[e]){o[e]=1;var t=Object(f.b)(e);t===e||n.policies.hasKeyArgs(i.__typename,t)||(o[t]=1),void 0!==i[e]||n instanceof m||delete i[e]}})),Object.keys(o).forEach((function(t){return n.group.dirty(e,t)}))}},EntityStore.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),a=!1,s=!0,l={DELETE:p,INVALIDATE:h,isReference:u.C,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||Object(u.E)(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(c){var d=Object(f.b)(c),v=r[c];if(void 0!==v){var y="function"==typeof t?t:t[c]||t[d];if(y){var m=y===delModifier?p:y(Object(u.F)(v),Object(o.__assign)(Object(o.__assign)({},l),{fieldName:d,storeFieldName:c,storage:n.getStorage(e,c)}));m===h?n.group.dirty(e,c):(m===p&&(m=void 0),m!==v&&(i[c]=m,a=!0,v=m))}void 0!==v&&(s=!1)}})),a)return this.merge(e,i),s&&(this instanceof m?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},EntityStore.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=delModifier,r):delModifier)}return!1},EntityStore.prototype.evict=function(e){var t=!1;return e.id&&(f.c.call(this.data,e.id)&&(t=this.delete(e.id,e.fieldName,e.args)),this instanceof m&&(t=this.parent.evict(e)||t),(e.fieldName||t)&&this.group.dirty(e.id,e.fieldName||"__exists")),t},EntityStore.prototype.clear=function(){this.replace(null)},EntityStore.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){f.c.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},EntityStore.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&f.c.call(e,n)||t.delete(n)})),e){var n=e.__META,r=Object(o.__rest)(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},EntityStore.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},EntityStore.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},EntityStore.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof m?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},EntityStore.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){f.c.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof m;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},EntityStore.prototype.findChildRefIds=function(e){if(!f.c.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=new Set([this.data[e]]),canTraverse_1=function(e){return null!==e&&"object"==typeof e};n.forEach((function(e){Object(u.C)(e)?t[e.__ref]=!0:canTraverse_1(e)&&Object.values(e).filter(canTraverse_1).forEach(n.add,n)}))}return this.refs[e]},EntityStore.prototype.makeCacheKey=function(){for(var e=[],t=0;t0;if(f&&!l)throw d.missing[0];return{result:d.result,missing:d.missing,complete:!f}},StoreReader.prototype.isFresh=function(e,t,n,r){if(supportsResultCaching(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r);if(i&&e===i.result)return!0}return!1},StoreReader.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.context;if(Object(u.C)(r)&&!i.policies.rootTypenamesById[r.__ref]&&!i.store.has(r.__ref))return{result:{},missing:[missingFromInvariant(new c.a(4),i)]};var o=i.variables,a=i.policies,s=i.store,l=[],d={result:null},f=s.getFieldValue(r,"__typename");function getMissing(){return d.missing||(d.missing=[])}function handleMissing(e){var t;return e.missing&&(t=getMissing()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof f&&!a.rootIdsByTypename[f]&&l.push({__typename:f});var p=new Set(n.selections);return p.forEach((function(e){var n;if(Object(u.L)(e,o))if(Object(u.z)(e)){var s=a.readField({fieldName:e.name.value,field:e,variables:i.variables,from:r},i),d=Object(u.K)(e);i.path.push(d);var h=i.clientOnly;i.clientOnly=h||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?u.d.added(e)||getMissing().push(missingFromInvariant(new c.a(5),i)):Array.isArray(s)?s=handleMissing(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=handleMissing(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&l.push(((n={})[d]=s,n)),i.clientOnly=h,Object(c.b)(i.path.pop()===d)}else{var v=Object(u.o)(e,i.fragmentMap);v&&a.fragmentMatches(v,f)&&v.selectionSet.selections.forEach(p.add,p)}})),d.result=Object(u.H)(l),this.knownResults.set(d.result,n),d},StoreReader.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.context;function handleMissing(e,n){return e.missing&&(t=t||[]).push.apply(t,e.missing),Object(c.b)(o.path.pop()===n),e.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(o.path.push(t),Array.isArray(e)?handleMissing(n.executeSubSelectedArray({field:r,array:e,context:o}),t):r.selectionSet?handleMissing(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,context:o}),t):(Object(c.b)(o.path.pop()===t),e))})),missing:t}},StoreReader}();var g=function(){function StoreWriter(e,t){this.cache=e,this.reader=t}return StoreWriter.prototype.writeToStore=function(e){var t=e.query,n=e.result,r=e.dataId,i=e.store,a=e.variables,s=Object(u.r)(t),l=Object(f.d)();a=Object(o.__assign)(Object(o.__assign)({},Object(u.m)(s)),a);var d=this.processSelectionSet({result:n||Object.create(null),dataId:r,selectionSet:s.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:Object(u.k)(Object(u.n)(t))}});if(!Object(u.C)(d))throw new c.a(7);return i.retain(d.__ref),d},StoreWriter.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,a=e.mergeTree,s=this.cache.policies,l=s.identify(r,i,o.fragmentMap),d=l[0],f=l[1];if("string"==typeof(n=n||d)){var p=o.written[n]||(o.written[n]=[]),h=Object(u.E)(n);if(p.indexOf(i)>=0)return h;if(p.push(i),this.reader&&this.reader.isFresh(r,h,i,o))return h}var v=Object.create(null);f&&(v=o.merge(v,f));var y=n&&s.rootTypenamesById[n]||Object(u.v)(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof y&&(v.__typename=y);var m=new Set(i.selections);if(m.forEach((function(e){var n;if(Object(u.L)(e,o.variables))if(Object(u.z)(e)){var i=Object(u.K)(e),l=r[i];if(void 0!==l){var d=s.getStoreFieldName({typename:y,fieldName:e.name.value,field:e,variables:o.variables}),f=getChildMergeTree(a,d),p=t.processFieldValue(l,e,o,f),h=e.selectionSet&&o.store.getFieldValue(p,"__typename")||void 0,b=s.getMergeFunction(y,e.name.value,h);b?f.info={field:e,typename:y,merge:b}:maybeRecycleChildMergeTree(a,d),v=o.merge(v,((n={})[d]=p,n))}else if(s.usingPossibleTypes&&!Object(u.y)(["defer","client"],e))throw new c.a(8)}else{var g=Object(u.o)(e,o.fragmentMap);g&&s.fragmentMatches(g,y,r,o.variables)&&g.selectionSet.selections.forEach(m.add,m)}})),"string"==typeof n){var b=Object(u.E)(n);return a.map.size&&(v=this.applyMerges(a,b,v,o)),o.store.merge(n,v),b}return v},StoreWriter.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,getChildMergeTree(r,o));return maybeRecycleChildMergeTree(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):e},StoreWriter.prototype.applyMerges=function(e,t,n,r,i){var a,s=this;if(e.map.size&&!Object(u.C)(n)){var l,d=Array.isArray(n)||!Object(u.C)(t)&&!Object(f.f)(t)?void 0:t,p=n;d&&!i&&(i=[Object(u.C)(d)?d.__ref:d]);var getValue_1=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var n=getValue_1(d,t),o=getValue_1(p,t),a=s.applyMerges(e,n,o,r,i);a!==o&&(l=l||new Map).set(t,a),i&&Object(c.b)(i.pop()===t)})),l&&(n=Array.isArray(p)?p.slice(0):Object(o.__assign)({},p),l.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(a=r.store).getStorage.apply(a,i)):n},StoreWriter}(),_=[];function getChildMergeTree(e,t){var n=e.map;return n.has(t)||n.set(t,_.pop()||{map:new Map}),n.get(t)}function maybeRecycleChildMergeTree(e,t){var n=e.map,r=n.get(t);!r||r.info||r.map.size||(_.push(r),n.delete(t))}new Set;var S=n(35),O=n(51),E={dataIdFromObject:O.b,addTypename:!0,resultCaching:!0,typePolicies:{}},w=function(e){function InMemoryCache(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=S.c,n.txCount=0,n.maybeBroadcastWatch=Object(a.c)((function(e,t){return n.broadcastWatch.call(n,e,!!t)}),{makeCacheKey:function(e){var t=e.optimistic?n.optimisticData:n.data;if(supportsResultCaching(t)){var r=e.optimistic,i=e.rootId,o=e.variables;return t.makeCacheKey(e.query,e.callback,JSON.stringify({optimistic:r,rootId:i,variables:o}))}}}),n.watchDep=Object(a.b)(),n.config=Object(o.__assign)(Object(o.__assign)({},E),t),n.addTypename=!!n.config.addTypename,n.policies=new O.a({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.data=new v.Root({policies:n.policies,resultCaching:n.config.resultCaching}),n.optimisticData=n.data,n.storeWriter=new g(n,n.storeReader=new b({cache:n,addTypename:n.addTypename})),n}return Object(o.__extends)(InMemoryCache,e),InMemoryCache.prototype.restore=function(e){return e&&this.data.replace(e),this},InMemoryCache.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},InMemoryCache.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:e.query,variables:e.variables,rootId:e.rootId,config:this.config,returnPartialData:n}).result||null}catch(e){if(e instanceof l.a)return null;throw e}},InMemoryCache.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore({store:this.data,query:e.query,result:e.result,dataId:e.dataId,variables:e.variables})}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.modify=function(e){if(f.c.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,config:this.config})},InMemoryCache.prototype.watch=function(e){var t=this;return this.watches.size||Object(S.d)(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&Object(S.b)(t),t.watchDep.dirty(e),t.maybeBroadcastWatch.forget(e)}},InMemoryCache.prototype.gc=function(){return this.optimisticData.gc()},InMemoryCache.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},InMemoryCache.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},InMemoryCache.prototype.identify=function(e){return Object(u.C)(e)?e.__ref:this.policies.identify(e)[0]},InMemoryCache.prototype.evict=function(e){if(!e.id){if(f.c.call(e,"id"))return!1;e=Object(o.__assign)(Object(o.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.reset=function(){return this.data.clear(),this.optimisticData=this.data,this.broadcastWatches(),Promise.resolve()},InMemoryCache.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},InMemoryCache.prototype.performTransaction=function(e,t){var n=this,perform=function(t){var r=n,i=r.data,o=r.optimisticData;++n.txCount,t&&(n.data=n.optimisticData=t);try{e(n)}finally{--n.txCount,n.data=i,n.optimisticData=o}},r=!1;"string"==typeof t?(this.optimisticData=this.optimisticData.addLayer(t,perform),r=!0):null===t?perform(this.data):perform(),this.broadcastWatches(r)},InMemoryCache.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Object(u.d)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},InMemoryCache.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},InMemoryCache.prototype.broadcastWatch=function(e,t){this.watchDep.dirty(e),this.watchDep(e);var n=this.diff({query:e.query,variables:e.variables,optimistic:e.optimistic});e.optimistic&&t&&(n.fromOptimisticTransaction=!0),e.callback(n)},InMemoryCache}(s.a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return __extends}));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}Object.create;Object.create},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return visit}));var r=n(62),i=n(16),o={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},a=Object.freeze({});function visit(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,s=void 0,l=Array.isArray(e),u=[e],c=-1,d=[],f=void 0,p=void 0,h=void 0,v=[],y=[],m=e;do{var b=++c===u.length,g=b&&0!==d.length;if(b){if(p=0===y.length?void 0:v[v.length-1],f=h,h=y.pop(),g){if(l)f=f.slice();else{for(var _={},S=0,O=Object.keys(f);S=0)){if(I.push(e),E[e]){var s=P(E[e],!0);try{for(var l=r.__values(s),u=l.next();!u.done;u=l.next()){var c=u.value;addToResults(E[e][c],t)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}if(t.push(e),w[e]){var d=P(w[e],!1);try{for(var f=r.__values(d),p=f.next();!p.done;p=f.next()){c=p.value;addToResults(w[e][c],t)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}}}))};try{for(var k=r.__values(P(S,!1)),R=k.next();!R.done;R=k.next()){var x=R.value;M(S[x],T)}}catch(e){i={error:e}}finally{try{R&&!R.done&&(o=k.return)&&o.call(k)}finally{if(i)throw i.error}}try{for(var D=r.__values(P(_,!0)),N=D.next();!N.done;N=D.next()){x=N.value;M(_[x],C)}}catch(e){a={error:e}}finally{try{N&&!N.done&&(s=D.return)&&s.call(D)}finally{if(a)throw a.error}}try{for(var L=r.__values(P(O,!0)),F=L.next();!F.done;F=L.next()){x=F.value;M(O[x],j)}}catch(e){l={error:e}}finally{try{F&&!F.done&&(u=L.return)&&u.call(L)}finally{if(l)throw l.error}}try{for(var U=r.__values(Object.keys(E)),V=U.next();!V.done;V=U.next()){var B=V.value;if(!(I.indexOf(B)>=0))try{for(var q=(f=void 0,r.__values(P(E[B],!1))),Q=q.next();!Q.done;Q=q.next()){x=Q.value;M(E[B][x],T)}}catch(e){f={error:e}}finally{try{Q&&!Q.done&&(p=q.return)&&p.call(q)}finally{if(f)throw f.error}}}}catch(e){c={error:e}}finally{try{V&&!V.done&&(d=U.return)&&d.call(U)}finally{if(c)throw c.error}}try{for(var $=r.__values(Object.keys(w)),W=$.next();!W.done;W=$.next()){B=W.value;if(!(I.indexOf(B)>=0))try{for(var G=(y=void 0,r.__values(P(w[B],!1))),H=G.next();!H.done;H=G.next()){x=H.value;M(w[B][x],C)}}catch(e){y={error:e}}finally{try{H&&!H.done&&(m=G.return)&&m.call(G)}finally{if(y)throw y.error}}}}catch(e){h={error:e}}finally{try{W&&!W.done&&(v=$.return)&&v.call($)}finally{if(h)throw h.error}}return r.__spread(T,C,j).map((function(e){return g[e]})).map((function(t){return e[t]}))}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(1),i=function(e){function SynchronousMetaRegistry(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(SynchronousMetaRegistry,e),SynchronousMetaRegistry.prototype.set=function(t,n){if("d8a5aa78-978e-11e6-ae22-56b6b6499611"!==n.SERIAL_VERSION_UID)throw new Error("You can only add registries to a meta registry");return e.prototype.set.call(this,t,n)},SynchronousMetaRegistry}(r.__importDefault(n(87)).default);t.default=i},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return a(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=l(n(0)),d=n(0),f=n(159),p=n(6),h=n(4),v=n(164),y=n(169),m=n(170),b=n(171),g=n(7),_=n(109),S=u(n(263)),O=u(n(336)),E=u(n(337)),w=u(n(338)),T=u(n(118)),C=u(n(339)),j=null,I=function(e){function MediaSelectionScreen(t){var n=e.call(this,t)||this;return n.translate=function(e,t,r,i,o){return void 0===i&&(i="Flowpack.Media.Ui"),void 0===o&&(o="Main"),n.props.i18nRegistry.translate(e,t,r,i,o)},n.state={initialLeftSideBarHiddenState:!1,initialNodeCreationDialogOpenState:!1},n}return i(MediaSelectionScreen,e),MediaSelectionScreen.prototype.componentDidMount=function(){var e=this.props,t=e.isLeftSideBarHidden,n=e.isNodeCreationDialogOpen,r=e.toggleSidebar;this.setState({initialLeftSideBarHiddenState:t,initialNodeCreationDialogOpenState:n}),t||n||r()},MediaSelectionScreen.prototype.componentWillUnmount=function(){var e=this.props,t=e.isLeftSideBarHidden,n=e.toggleSidebar,r=this.state,i=r.initialLeftSideBarHiddenState,o=r.initialNodeCreationDialogOpenState;i===t||o||n()},MediaSelectionScreen.prototype.getConfig=function(){return{endpoints:{graphql:"/neos/graphql/media-assets",upload:"/neos/media-ui/upload"},dummyImage:"/_Resources/Static/Packages/Neos.Neos/Images/dummy-image.svg"}},MediaSelectionScreen.prototype.getApolloClient=function(){if(!j){var e=this.getConfig().endpoints,t=_.CacheFactory.createCache(this.props.frontendConfiguration);_.PersistentStateManager.restoreLocalState(t,this.props.constraints),j=new h.ApolloClient({cache:t,link:h.ApolloLink.from([_.ApolloErrorHandler,v.createUploadLink({uri:e.graphql,credentials:"same-origin"})]),typeDefs:[O.default,E.default,w.default],resolvers:[C.default(_.PersistentStateManager.updateLocalState),T.default(_.PersistentStateManager.updateLocalState)]})}return j},MediaSelectionScreen.prototype.render=function(){var e=this.props,t=e.addFlashMessage,n=e.onComplete,r=e.constraints,i=e.type,o=this.getApolloClient(),a=this.getConfig().dummyImage,s=d.createRef(),l=this.props.frontendConfiguration,u={info:function(e){return t(e,e,"info")},ok:function(e){return t(e,e,"success")},notice:function(e){return t(e,e,"info")},warning:function(e,n){return void 0===n&&(n=""),t(e,n,"error")},error:function(e,n){return void 0===n&&(n=""),t(e,n,"error")}},f=this.state.initialNodeCreationDialogOpenState;return c.createElement("div",{style:{transform:"translateZ(0)",height:"100%",padding:f?0:"1rem"}},c.createElement(g.IntlProvider,{translate:this.translate},c.createElement(g.NotifyProvider,{notificationApi:u},c.createElement(h.ApolloProvider,{client:o},c.createElement(p.RecoilRoot,null,c.createElement(g.MediaUiProvider,{dummyImage:a,onAssetSelection:n,selectionMode:!0,isInNodeCreationDialog:f,containerRef:s,featureFlags:l,constraints:r||{},assetType:"images"===i?"image":i},c.createElement(g.MediaUiThemeProvider,null,c.createElement(S.default,null))))))))},MediaSelectionScreen=s([f.connect(y.$transform({isLeftSideBarHidden:y.$get("ui.leftSideBar.isHidden"),isNodeCreationDialogOpen:y.$get("ui.nodeCreationDialog.isOpen")}),{addFlashMessage:b.actions.UI.FlashMessages.add,toggleSidebar:b.actions.UI.LeftSideBar.toggle}),m.neos((function(e){return{i18nRegistry:e.get("i18n"),frontendConfiguration:e.get("frontendConfiguration").get("Flowpack.Media.Ui")}}))],MediaSelectionScreen)}(c.PureComponent);t.default=I},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(31));e.exports=(0,r.default)("vendor")().reactRedux},function(e,t,n){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function concat(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0&&i.splice(e,1),completeIfDone()}});i.push(o)},error:function(e){r.error(e)},complete:function(){completeIfDone()}});function completeIfDone(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))}},{key:i,value:function(){return this}}],[{key:"from",value:function from(e){var t="function"==typeof this?this:Observable;if(null==e)throw new TypeError(e+" is not an object");var n=getMethod(e,i);if(n){var o=n.call(e);if(Object(o)!==o)throw new TypeError(o+" is not an object");return isObservable(o)&&o.constructor===t?o:new t((function(e){return o.subscribe(e)}))}if(hasSymbol("iterator")&&(n=getMethod(e,r)))return new t((function(t){enqueue((function(){if(!t.closed){var r=!0,i=!1,o=void 0;try{for(var a,s=n.call(e)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(t.next(l),t.closed)return}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}t.complete()}}))}));if(Array.isArray(e))return new t((function(t){enqueue((function(){if(!t.closed){for(var n=0;n0&&!f.isMatch(e.file.mediaType,T.mediaTypes))&&!((null===(n=T.assetSources)||void 0===n?void 0:n.length)>0&&!f.isMatch(e.assetSource.id,T.assetSources))}),[T]),B=u.useCallback((function(e){if(S&&e){var t=M.readFragment({fragment:c.gql(s||(s=r(["\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ","\n "],["\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ","\n "])),m.ASSET_FRAGMENT),fragmentName:"LocalAssetData",variables:{includeUsage:!1},id:M.cache.identify({__typename:"Asset",id:e.assetId})});V(t)?t.localId?S(t.localId):R(e).then((function(e){var t=e.data;S(t.importAsset.localId)})):P.notice(I("action.selectAsset.invalidType.message","You can only select any of the following types: {types}",{types:T.mediaTypes.join(", ")}))}}),[M,R,S,V,I,P,T.mediaTypes]);return l.createElement(t.MediaUiContext.Provider,{value:{containerRef:O,dummyImage:i,handleDeleteAsset:U,handleSelectAsset:B,selectionMode:a,isInNodeCreationDialog:g,assets:D,refetchAssets:N,featureFlags:E,constraints:T,assetType:j,isAssetSelectable:V}},n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(17);t.default=function useAssetCollectionsQuery(){var e=r.useQuery(i.ASSET_COLLECTIONS),t=e.data,n=e.loading;return{assetCollections:(null==t?void 0:t.assetCollections)||[],loading:n}}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n asset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ',"\n"],['\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n asset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.IPTC_PROPERTY_FRAGMENT=void 0;var i,o=n(4);t.IPTC_PROPERTY_FRAGMENT=o.gql(i||(i=r(["\n fragment IptcPropertyProps on IptcProperty {\n propertyName\n value\n }\n"],["\n fragment IptcPropertyProps on IptcProperty {\n propertyName\n value\n }\n"])))},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_FRAGMENT=void 0;var i,o=n(4);t.FILE_FRAGMENT=o.gql(i||(i=r(["\n fragment FileProps on File {\n extension\n mediaType\n typeIcon {\n url\n alt\n }\n size\n url\n }\n"],["\n fragment FileProps on File {\n extension\n mediaType\n typeIcon {\n url\n alt\n }\n size\n url\n }\n"])))},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n query ASSETS(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n $limit: Int\n $offset: Int\n $sortBy: SortBy\n $sortDirection: SortDirection\n $includeUsage: Boolean = false\n ) {\n selectedAssetSourceId @client(always: true) @export(as: "assetSourceId")\n includeUsage @client(always: true) @export(as: "includeUsage")\n assets(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n limit: $limit\n offset: $offset\n sortBy: $sortBy\n sortDirection: $sortDirection\n ) {\n ...AssetProps\n }\n }\n ',"\n"],['\n query ASSETS(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n $limit: Int\n $offset: Int\n $sortBy: SortBy\n $sortDirection: SortDirection\n $includeUsage: Boolean = false\n ) {\n selectedAssetSourceId @client(always: true) @export(as: "assetSourceId")\n includeUsage @client(always: true) @export(as: "includeUsage")\n assets(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n limit: $limit\n offset: $offset\n sortBy: $sortBy\n sortDirection: $sortDirection\n ) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(55),s=o.gql(i||(i=r(["\n query ASSET_COLLECTION($id: AssetCollectionId!) {\n assetCollection(id: $id) {\n ...AssetCollectionProps\n }\n }\n ","\n"],["\n query ASSET_COLLECTION($id: AssetCollectionId!) {\n assetCollection(id: $id) {\n ...AssetCollectionProps\n }\n }\n ","\n"])),a.ASSET_COLLECTION_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(55),s=o.gql(i||(i=r(["\n query ASSET_COLLECTIONS {\n assetCollections {\n ...AssetCollectionProps\n }\n }\n ","\n"],["\n query ASSET_COLLECTIONS {\n assetCollections {\n ...AssetCollectionProps\n }\n }\n ","\n"])),a.ASSET_COLLECTION_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(['\n query ASSET_COUNT(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n ) {\n selectedAssetSourceId @client(always: true) @export(as: "assetSourceId")\n assetCount(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n )\n }\n'],['\n query ASSET_COUNT(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n ) {\n selectedAssetSourceId @client(always: true) @export(as: "assetSourceId")\n assetCount(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n )\n }\n'])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(104),s=o.gql(i||(i=r(["\n query ASSET_SOURCES {\n assetSources {\n ...AssetSourceProps\n }\n }\n ","\n"],["\n query ASSET_SOURCES {\n assetSources {\n ...AssetSourceProps\n }\n }\n ","\n"])),a.ASSET_SOURCE_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n query CONFIG {\n config {\n uploadMaxFileSize\n uploadMaxFileUploadLimit\n currentServerTime\n }\n }\n"],["\n query CONFIG {\n config {\n uploadMaxFileSize\n uploadMaxFileUploadLimit\n currentServerTime\n }\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(38),s=o.gql(i||(i=r(["\n query TAG($id: TagId!) {\n tag(id: $id) {\n ...TagProps\n }\n }\n ","\n"],["\n query TAG($id: TagId!) {\n tag(id: $id) {\n ...TagProps\n }\n }\n ","\n"])),a.TAG_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(38),s=o.gql(i||(i=r(["\n query TAGS {\n tags {\n ...TagProps\n }\n }\n ","\n"],["\n query TAGS {\n tags {\n ...TagProps\n }\n }\n ","\n"])),a.TAG_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.SET_SELECTED_ASSET_SOURCE_ID=t.SELECTED_ASSET_SOURCE_ID=void 0;var i,o,a=n(4);t.SELECTED_ASSET_SOURCE_ID=a.gql(i||(i=r(["\n query SelectedAssetSourceId {\n selectedAssetSourceId @client(always: true)\n }\n"],["\n query SelectedAssetSourceId {\n selectedAssetSourceId @client(always: true)\n }\n"]))),t.SET_SELECTED_ASSET_SOURCE_ID=a.gql(o||(o=r(["\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\n }\n"],["\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\n }\n"])))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(6),a=n(17),s=r(n(67)),l=r(n(69)),u=n(14);t.default=function useAssetCountQuery(){var e=o.useRecoilValue(u.searchTermState),t=s.default(),n=l.default(),r=i.useQuery(a.ASSET_COUNT,{variables:{assetCollectionId:null==n?void 0:n.id,tagId:null==t?void 0:t.id,searchTerm:e}}),c=r.data,d=r.loading;return{assetCount:(null==c?void 0:c.assetCount)||0,loading:d}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"currentPageState",default:1});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"initialLoadComplete",default:!1});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"loadingState",default:!1});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"searchTermState",default:""});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"selectedAssetCollectionIdState",default:null});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"selectedMediaTypeState",default:"all"});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"selectedTagIdState",default:null});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(4),o=n(17),a=n(65);t.default=function useAssetSourcesQuery(){var e=a.useMediaUi().constraints,t=i.useQuery(o.ASSET_SOURCES),n=t.data,s=t.loading;return{assetSources:r.useMemo((function(){var t=(null==n?void 0:n.assetSources)||[];return e.assetSources?t.filter((function(t){return e.assetSources.includes(t.id)})):t}),[null==n?void 0:n.assetSources,e.assetSources]),loading:s}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(6),a=n(4),s=r(n(69)),l=r(n(67)),u=n(70),c=n(14),d=n(17);t.default=function(){var e=o.useRecoilValue(c.searchTermState),t=s.default(),n=l.default(),r=o.useRecoilValue(c.selectedMediaTypeState),f=o.useRecoilValue(c.selectedSortOrderState),p=o.useRecoilValue(c.currentPageState),h=o.useRecoilState(c.loadingState),v=h[0],y=h[1],m=o.useSetRecoilState(c.initialLoadCompleteState),b=i.useState([]),g=b[0],_=b[1],S=u.ASSETS_PER_PAGE,O=(p-1)*u.ASSETS_PER_PAGE,E=a.useLazyQuery(d.ASSETS,{notifyOnNetworkStatusChange:!1,variables:{searchTerm:e,assetCollectionId:null==t?void 0:t.id,mediaType:r,tagId:null==n?void 0:n.id,limit:S,offset:O,sortBy:f.sortBy,sortDirection:f.sortDirection}}),w=E[0],T=E[1],C=T.loading,j=T.error,I=T.data,P=T.refetch;return i.useEffect((function(){C||v?I&&!C&&v&&(y(!1),m(!0),_(I.assets)):(w({variables:{searchTerm:e,assetCollectionId:null==t?void 0:t.id,mediaType:r,tagId:null==n?void 0:n.id,limit:S,offset:O,sortBy:f.sortBy,sortDirection:f.sortDirection}}),y(!0))}),[w,I,C,O,S,e,null==t?void 0:t.title,r,null==n?void 0:n.id,f]),{error:j,assets:g,refetch:P}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(17);t.default=function(){var e=r.useQuery(i.CONFIG),t=e.data,n=e.loading;return{config:null==t?void 0:t.config,loading:n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(17),o=n(24);t.default=function useCreateAssetCollection(){var e=r.useMutation(o.CREATE_ASSET_COLLECTION),t=e[0],n=e[1],a=n.error;return{createAssetCollection:function(e){return t({variables:{title:e},update:function(e,t){var n=t.data,r=e.readQuery({query:i.ASSET_COLLECTIONS}).assetCollections;e.writeQuery({query:i.ASSET_COLLECTIONS,data:{assetCollections:r.concat([null==n?void 0:n.createAssetCollection])}})}})},data:n.data,error:a,loading:n.loading}}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(55),s=o.gql(i||(i=r(["\n mutation CreateAssetCollection($title: String!) {\n createAssetCollection(title: $title) {\n ...AssetCollectionProps\n }\n }\n ","\n"],["\n mutation CreateAssetCollection($title: String!) {\n createAssetCollection(title: $title) {\n ...AssetCollectionProps\n }\n }\n ","\n"])),a.ASSET_COLLECTION_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(38),s=o.gql(i||(i=r(["\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\n ...TagProps\n }\n }\n ","\n"],["\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\n ...TagProps\n }\n }\n ","\n"])),a.TAG_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\n }\n"],["\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\n deleteAssetCollection(id: $id) {\n success\n }\n }\n"],["\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\n deleteAssetCollection(id: $id) {\n success\n }\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n mutation DeleteTag($id: TagId!) {\n deleteTag(id: $id)\n }\n"],["\n mutation DeleteTag($id: TagId!) {\n deleteTag(id: $id)\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n importAsset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n importAsset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation SetAssetCollections(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $assetCollectionIds: [AssetCollectionId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation SetAssetCollections(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $assetCollectionIds: [AssetCollectionId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation SetAssetTags(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $tagIds: [TagId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation SetAssetTags(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $tagIds: [TagId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation UpdateAsset(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $label: String\n $caption: String\n $copyrightNotice: String\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n updateAsset(\n id: $id\n assetSourceId: $assetSourceId\n label: $label\n caption: $caption\n copyrightNotice: $copyrightNotice\n ) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation UpdateAsset(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $label: String\n $caption: String\n $copyrightNotice: String\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n updateAsset(\n id: $id\n assetSourceId: $assetSourceId\n label: $label\n caption: $caption\n copyrightNotice: $copyrightNotice\n ) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(55),s=o.gql(i||(i=r(["\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\n ...AssetCollectionProps\n }\n }\n ","\n"],["\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\n ...AssetCollectionProps\n }\n }\n ","\n"])),a.ASSET_COLLECTION_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(38),s=o.gql(i||(i=r(["\n mutation UpdateTag($id: TagId!, $label: String) {\n updateTag(id: $id, label: $label) {\n ...TagProps\n }\n }\n ","\n"],["\n mutation UpdateTag($id: TagId!, $label: String) {\n updateTag(id: $id, label: $label) {\n ...TagProps\n }\n }\n ","\n"])),a.TAG_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?e:"Unknown")}},function(e,t,n){"use strict";n.r(t),t.default=function cachePlugin(){var e=new WeakMap;return{onCreateRule:function onCreateRule(t,n,r){var i=r.parent;return i&&t&&e.get(i.rules.raw[t])||null},onProcessRule:function onProcessRule(t){var n=t.options,r=n.sheet,i=n.parent;if(!(!i||r&&r.options.link)){var o=i.rules.raw[t.key];e.get(o)||e.set(o,t)}}}}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(239),o={spacing:{goldenUnit:"40px",full:"16px",half:"8px",quarter:"4px"},size:{sidebarWidth:"320px"},transition:{fast:".1s",default:".25s",slow:".5s"},zIndex:{secondaryToolbar:["linkIconButtonFlyout"],flashMessageContainer:"6",loadingIndicatorContainer:"5",secondaryInspector:["context","iframe","close"],secondaryInspectorElevated:["context","dropdownContents"],dialog:["context"],fullScreenClose:["context"],drawer:["context"],bar:["context"],primaryToolbar:"4",checkboxInput:["context"],dropdownContents:["context"],selectBoxContents:"3",notInlineEditableOverlay:["context"],calendarFakeInputMirror:["context"],rdtPicker:["context"],sideBar:["dropTargetBefore","dropTargetAfter"],wrapperDropdown:["context"],unappliedChangesOverlay:["context"],nodeToolBar:"2147483646"},fontSize:{base:"14px",small:"12px"},fonts:{headings:{family:"Noto Sans",style:"Regular",cssWeight:"400"},copy:{family:"Noto Sans",style:"Regular",cssWeight:"400"}},colors:{primaryViolet:"#26224C",primaryVioletHover:"#342f5f",primaryBlue:"#00ADEE",primaryBlueHover:"#35c3f8",contrastDarkest:"#141414",contrastDarker:"#222",contrastDark:"#3f3f3f",contrastNeutral:"#323232",contrastBright:"#999",contrastBrighter:"#adadad",contrastBrightest:"#FFF",success:"#00a338",successHover:"#0bb344",warn:"#ff8700",warnHover:"#fda23d",error:"#ff460d",errorHover:"#ff6a3c",uncheckedCheckboxTick:"#5B5B5B"}};e.exports={config:o,generateCssVarsObject:function generateCssVarsObject(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.length,a={};return Object.keys(e).forEach((function(o){var s=e[o],l=i(o),u=n?t+l:o;Array.isArray(s)?s.forEach((function(e,n){a["--"+t+"-"+l+"-"+i(e)]=""+(n+1)})):"object"===(void 0===s?"undefined":r(s))?a=Object.assign({},a,generateCssVarsObject(s,u)):a["--"+t+"-"+l]=s})),a}}},function(e,t,n){(function(t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")"+"?",u="[\\ufe0e\\ufe0f]?"+l+("(?:\\u200d(?:"+[o,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+l+")*"),c="(?:"+[o+r+"?",r,a,s,n].join("|")+")",d=RegExp(i+"(?="+i+")|"+c+u,"g"),f=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),p="object"==typeof t&&t&&t.Object===Object&&t,h="object"==typeof self&&self&&self.Object===Object&&self,v=p||h||Function("return this")();function hasUnicode(e){return f.test(e)}function stringToArray(e){return hasUnicode(e)?function unicodeToArray(e){return e.match(d)||[]}(e):function asciiToArray(e){return e.split("")}(e)}var y=Object.prototype.toString,m=v.Symbol,b=m?m.prototype:void 0,g=b?b.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(function isSymbol(e){return"symbol"==typeof e||function isObjectLike(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==y.call(e)}(e))return g?g.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function castSlice(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function baseSlice(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=n&&i0&&!t.assetSources.includes(r)&&(r=t.assetSources[0]),writeToCache(e,{selectedAssetSourceId:r,viewModeSelection:getItem("viewModeSelection")||a.VIEW_MODES.Thumbnails,clipboard:getItem("clipboard")||{}})},t.resetLocalState=function resetLocalState(e){writeToCache(e,{selectedAssetSourceId:o.NEOS_ASSET_SOURCE,viewModeSelection:a.VIEW_MODES.Thumbnails,clipboard:{}})},t.updateLocalState=function updateLocalState(e,t){Object.keys(e).forEach((function(t){localStorage.setItem("flowpack.mediaui."+t,JSON.stringify(e[t]))})),writeToCache(t,r({},e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_MODES=void 0;var r=n(4),i=n(111);!function(e){e.Thumbnails="thumbnails",e.List="list"}(t.VIEW_MODES||(t.VIEW_MODES={})),t.default=function useViewModeSelection(){var e=r.useQuery(i.VIEW_MODE_SELECTION).data.viewModeSelection,t=r.useMutation(i.SET_VIEW_MODE_SELECTION)[0];return[e,function(e){return t({variables:{viewModeSelection:e}})}]}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.SET_VIEW_MODE_SELECTION=t.VIEW_MODE_SELECTION=void 0;var i,o,a=n(4);t.VIEW_MODE_SELECTION=a.gql(i||(i=r(["\n query ViewModeSelection {\n viewModeSelection @client(always: true)\n }\n"],["\n query ViewModeSelection {\n viewModeSelection @client(always: true)\n }\n"]))),t.SET_VIEW_MODE_SELECTION=a.gql(o||(o=r(["\n mutation SetViewModeSelection($viewModeSelection: String) {\n setViewModeSelection(viewModeSelection: $viewModeSelection) @client\n }\n"],["\n mutation SetViewModeSelection($viewModeSelection: String) {\n setViewModeSelection(viewModeSelection: $viewModeSelection) @client\n }\n"])))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(6),o=n(9),a=n(39),s=n(28);t.default=function(){var e=o.useAssetCountQuery().assetCount,t=i.useRecoilValue(s.mainViewState),n=a.useUnusedAssetCountQuery(),l=n.called,u=n.load,c=n.unusedAssetCount,d=t===s.MainViewState.UNUSED_ASSETS?c:e;return r.useEffect((function(){t!==s.MainViewState.UNUSED_ASSETS||l||u()}),[t,l,u]),d}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UsageDetailsMetadataType=void 0,function(e){e.TEXT="TEXT",e.DATE="DATE",e.DATETIME="DATETIME",e.URL="URL"}(t.UsageDetailsMetadataType||(t.UsageDetailsMetadataType={}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(9),p=a(n(71)),h=a(n(115)),v=a(n(248)),y=d.createUseMediaUiStyles((function(e){return{assetUsage:{padding:e.spacing.full,"& section + section":{marginTop:e.spacing.full}},usageTable:{width:"100%","& th":{fontWeight:"bold"},"& td, & th":{padding:e.spacing.quarter,"&:first-child":{paddingLeft:0},"&:last-child":{paddingRight:0}},".neos & a":{color:e.colors.primary,"&:hover":{color:e.colors.primary,textDecoration:"underline"}}}}}));t.default=s.memo((function(){var e=y(),t=d.useIntl().translate,n=u.useRecoilState(p.default),r=n[0],i=n[1],o=f.useSelectedAsset(),a=h.default(o?{assetId:o.id,assetSourceId:o.assetSource.id}:null),m=a.assetUsageDetails,b=a.loading,g=l.useCallback((function(){return i(!1)}),[i]);return s.createElement(c.Dialog,{isOpen:r,title:t("assetUsage.title","Usage details for "+o.label,{asset:o.label}),onRequestClose:g,style:"wide",actions:[s.createElement(c.Button,{key:"cancel",style:"neutral",hoverStyle:"darken",onClick:g},t("assetUsage.cancel","Cancel"))]},s.createElement("div",{className:e.assetUsage},(null==m?void 0:m.length)>0?m.map((function(e,t){return s.createElement(v.default,{key:t,usageDetailsGroup:e})})):s.createElement("span",null,b?t("assetUsagesModal.loading","Loading..."):t("assetUsagesModal.noResults","No results"))))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7),l=s.createUseMediaUiStyles((function(e){return{usageSection:{"& h2":{fontWeight:"bold"}},usageTable:{width:"100%",marginTop:e.spacing.full,"& th":{fontWeight:"bold"},"& td, & th":{padding:e.spacing.quarter,"&:first-child":{paddingLeft:0},"&:last-child":{paddingRight:0}},".neos & a":{color:e.colors.primary,"&:hover":{color:e.colors.primary,textDecoration:"underline"}}}}}));t.default=a.memo((function(e){var t=e.usageDetailsGroup,n=l(),r=s.useIntl().translate,i=t.label,o=t.usages,u=t.metadataSchema;return a.createElement("section",{className:n.usageSection},a.createElement("h2",null,i),o.length>0&&a.createElement("table",{className:n.usageTable},a.createElement("thead",null,a.createElement("tr",null,a.createElement("th",null,r("assetUsageSection.label","Label")),u.map((function(e,t){return a.createElement("th",{key:t},e.label)})))),a.createElement("tbody",null,o.map((function(e,t){return a.createElement("tr",{key:t},a.createElement("td",null,a.createElement("a",{href:e.url,target:"_blank",rel:"noreferrer"},e.label)),u.map((function(t,n){var r=t.name,i=t.type,o=e.metadata.find((function(e){return e.name==r}));return o?a.createElement("td",{key:n},"DATETIME"==i||"DATE"==i?new Date(o.value).toLocaleString():"URL"==i?a.createElement("a",{href:o.value,target:"_blank",rel:"noreferrer"},r):o.value):null})))})))))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(6),u=n(8),c=n(7),d=a(n(71));t.default=s.memo((function(){var e=l.useRecoilState(d.default),t=e[0],n=e[1],r=c.useIntl().translate;return s.createElement(u.Button,{disabled:!1,size:"regular",style:t?"brand":"lighter",hoverStyle:"brand",onClick:function(){return n(!0)}},r("assetUsageList.toggle","Show usages"))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(6),a=n(4),s=n(14),l=n(70),u=r(n(114)),c=r(n(116));t.default=function(){var e=o.useRecoilValue(s.currentPageState),t=o.useRecoilState(s.loadingState),n=t[0],r=t[1],d=o.useRecoilValue(c.default),f=i.useState([]),p=f[0],h=f[1],v=l.ASSETS_PER_PAGE,y=(e-1)*l.ASSETS_PER_PAGE,m=a.useLazyQuery(u.default,{notifyOnNetworkStatusChange:!1,variables:{limit:v,offset:y}}),b=m[0],g=m[1],_=g.loading,S=g.error,O=g.data,E=g.refetch;return i.useEffect((function(){!d||_||n?O&&!_&&n&&(r(!1),h(O.unusedAssets)):(b({variables:{limit:v,offset:y}}),r(!0))}),[b,O,_,y,v,d]),{error:S,assets:p,refetch:E}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(n(252));t.default=function useUnusedAssetCountQuery(){var e=i.useLazyQuery(o.default),t=e[0],n=e[1],r=n.called,a=n.loading,s=n.data;return{called:r,load:t,unusedAssetCount:(null==s?void 0:s.unusedAssetCount)||0,loading:a}}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n query UNUSED_ASSET_COUNT {\n unusedAssetCount\n }\n"],["\n query UNUSED_ASSET_COUNT {\n unusedAssetCount\n }\n"])));t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"createAssetCollectionDialogState",default:{visible:!1,title:""}});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"createTagDialogState",default:{visible:!1,label:""}});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainViewState=t.mainViewState=void 0;var r,i=n(6),o=n(32),a=n(39);!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.CLIPBOARD=1]="CLIPBOARD",e[e.UNUSED_ASSETS=2]="UNUSED_ASSETS"}(r||(r={})),t.MainViewState=r;var s=i.selector({key:"mainViewState",get:function(e){var t=e.get,n=t(o.clipboardVisibleState),i=t(a.showUnusedAssetsState);return n?r.CLIPBOARD:i?r.UNUSED_ASSETS:r.DEFAULT}});t.mainViewState=s},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(14),p=a(n(117)),h=a(n(74)),v=a(n(72)),y=d.createUseMediaUiStyles({clipboard:{height:"100%",alignSelf:"flex-end",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",margin:"0 -.3rem","& > *":{margin:"0 .3rem"}}});t.default=s.memo((function(){var e=y(),t=d.useIntl().translate,n=h.default().clipboard,r=u.useRecoilState(v.default),i=r[0],o=r[1],a=u.useRecoilValue(f.initialLoadCompleteState),m=l.useCallback((function(){return o((function(e){return!e}))}),[o]),b=Object.keys(n).length;return a?s.createElement("div",{className:e.clipboard},s.createElement(c.Button,{disabled:0===b,size:"regular",style:i?"brand":"lighter",hoverStyle:"brand",onClick:m},t("clipboard.toggle","Clipboard")," (",b,")"),Object.values(n).slice().reverse().slice(0,3).map((function(e){return s.createElement(p.default,{key:e.assetId,assetIdentity:e})}))):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(s){return function step(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] .neos-module-wrap":{paddingLeft:"1rem",paddingRight:"1rem",paddingTop:"3rem",paddingBottom:"0"},'body > [class*="_selectBox__contents_"]':{zIndex:99999}}}}));t.default=s.memo((function(){var e=u.useMediaUi(),t=e.selectionMode,n=e.isInNodeCreationDialog,r=e.containerRef,i=l.useRecoilValue(h.uploadDialogVisibleState).visible,o=l.useRecoilValue(w.createTagDialogState).visible,a=l.useRecoilValue(w.createAssetCollectionDialogState).visible,j=l.useRecoilValue(c.assetUsageDetailsModalState),I=l.useRecoilValue(p.similarAssetsModalState),P=C({selectionMode:t,isInNodeCreationDialog:n});return s.createElement("div",{className:P.container,ref:r},s.createElement(g.default,null),s.createElement("div",{className:P.gridLeft},s.createElement(E.default,null,s.createElement(m.SideBarLeft,null))),s.createElement("div",{className:P.gridTop},s.createElement(S.TopBar,null)),s.createElement("div",{className:P.gridMain},s.createElement(E.default,null,s.createElement(O.Main,null))),s.createElement(_.BottomBar,null),!t&&s.createElement("div",{className:P.gridRight},s.createElement(E.default,null,s.createElement(b.SideBarRight,null))),s.createElement(y.AssetPreview,null),j&&s.createElement(c.AssetUsagesModal,null),i&&s.createElement(v.UploadDialog,null),o&&s.createElement(T.CreateTagDialog,null),a&&s.createElement(T.CreateAssetCollectionDialog,null),I&&s.createElement(p.SimilarAssetsModal,null),s.createElement(d.ClipboardWatcher,null),s.createElement(f.ConcurrentChangeMonitor,null))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetChangeType=t.changedAssets=t.useChangedAssetsQuery=t.ConcurrentChangeMonitor=void 0;var s=a(n(265));t.ConcurrentChangeMonitor=s.default;var l=o(n(119));t.useChangedAssetsQuery=l.default,Object.defineProperty(t,"AssetChangeType",{enumerable:!0,get:function(){return l.AssetChangeType}});var u=a(n(120));t.changedAssets=u.default},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(9),u=n(110),c=n(56),d=o(n(119));t.default=a.memo((function(){var e=d.default(),t=l.useAssetQuery().refetch,n=l.useAssetsQuery().refetch;return s.useEffect((function(){null==e||e.forEach((function(e){switch(e.type){case d.AssetChangeType.ASSET_REPLACED:case d.AssetChangeType.ASSET_UPDATED:t({id:e.assetId,assetSourceId:u.NEOS_ASSET_SOURCE}).then((function(){console.info(e.assetId,e.type,"An asset was updated due to a remote change")})),c.assetUpdatedEvent({assetId:e.assetId,assetSourceId:u.NEOS_ASSET_SOURCE});break;case d.AssetChangeType.ASSET_CREATED:n().then((function(){console.info(e.assetId,e.type,"An asset was created remotely")})),c.assetCreatedEvent({assetId:e.assetId,assetSourceId:u.NEOS_ASSET_SOURCE});break;case d.AssetChangeType.ASSET_REMOVED:n().then((function(){console.info(e.assetId,e.type,"An asset was removed remotely")})),c.assetRemovedEvent({assetId:e.assetId,assetSourceId:u.NEOS_ASSET_SOURCE});break;default:console.debug(e,"unhandled remote change")}}))}),[e,t,n]),null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(6),u=n(8),c=n(7),d=a(n(75));t.default=s.memo((function(){var e=l.useRecoilState(d.default),t=e[0],n=e[1],r=c.useIntl().translate;return s.createElement(u.Button,{size:"regular",style:t?"brand":"lighter",hoverStyle:"brand",onClick:function(){return n(!0)}},r("similarAssetsModal.show","Show similar assets"))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(9),p=a(n(75)),h=a(n(122)),v=a(n(268)),y=d.createUseMediaUiStyles((function(e){return{assetUsage:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridGap:e.spacing.full,padding:e.spacing.full}}}));t.default=s.memo((function(){var e=y(),t=d.useIntl().translate,n=u.useRecoilState(p.default),r=n[0],i=n[1],o=f.useSelectedAsset(),a=h.default(o?{assetId:o.id,assetSourceId:o.assetSource.id}:null),m=a.similarAssets,b=a.loading,g=l.useCallback((function(){return i(!1)}),[i]);return s.createElement(c.Dialog,{isOpen:r,title:t("similarAssetsModal.title","Similar assets to "+o.label,{asset:o.label}),onRequestClose:g,style:"wide",actions:[s.createElement(c.Button,{key:"cancel",style:"neutral",hoverStyle:"darken",onClick:g},t("similarAssetsModal.cancel","Cancel"))]},s.createElement("div",{className:e.assetUsage},(null==m?void 0:m.length)>0?m.map((function(e,t){return s.createElement(v.default,{key:t,asset:e})})):s.createElement("span",null,b?t("similarAssetsModal.loading","Loading..."):t("similarAssetsModal.noResults","No results"))))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7),l=s.createUseMediaUiStyles((function(e){return{similarAsset:{margin:"0",display:"flex",flexDirection:"column",position:"relative"},picture:{backgroundColor:e.colors.assetBackground,"& img":{display:"block",height:"250px",width:"100%",objectFit:"contain"}},caption:{backgroundColor:e.colors.captionBackground,transition:"background-color "+e.transition.fast,padding:e.spacing.half,display:"flex",alignItems:"center",flex:1,"& img":{width:"1.3rem",height:"auto",marginRight:e.spacing.half}}}}));t.default=a.memo((function(e){var t=e.asset,n=l(),r=s.useMediaUi().dummyImage;return a.createElement("figure",{className:n.similarAsset},a.createElement("picture",{className:n.picture},a.createElement("img",{src:t?t.thumbnailUrl:r,alt:null==t?void 0:t.label})),a.createElement("figcaption",{className:n.caption},t&&a.createElement(a.Fragment,null,a.createElement("img",{src:t.file.typeIcon.url,alt:t.file.typeIcon.alt}),a.createElement("span",null,t.label))))}))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?o[e-1]:null,e1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return"";var n=e;return t&&Object.keys(t).forEach((function(e){n=n.replace(e,t[e])})),n}function getWindowWidth(){return void 0!==e.window?e.window.innerWidth:0}var u=27,c=37,d=39,f=function(t){function ReactImageLightbox(e){var t;return function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,ReactImageLightbox),(t=function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}(this,_getPrototypeOf(ReactImageLightbox).call(this,e))).state={isClosing:!e.animationDisabled,shouldAnimate:!1,zoomLevel:0,offsetX:0,offsetY:0,loadErrorStatus:{}},t.outerEl=i.a.createRef(),t.zoomInBtn=i.a.createRef(),t.zoomOutBtn=i.a.createRef(),t.caption=i.a.createRef(),t.closeIfClickInner=t.closeIfClickInner.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleImageDoubleClick=t.handleImageDoubleClick.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleImageMouseWheel=t.handleImageMouseWheel.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleKeyInput=t.handleKeyInput.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleMouseUp=t.handleMouseUp.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleMouseDown=t.handleMouseDown.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleMouseMove=t.handleMouseMove.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleOuterMousewheel=t.handleOuterMousewheel.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleTouchStart=t.handleTouchStart.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleTouchMove=t.handleTouchMove.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleTouchEnd=t.handleTouchEnd.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handlePointerEvent=t.handlePointerEvent.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleCaptionMousewheel=t.handleCaptionMousewheel.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleWindowResize=t.handleWindowResize.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleZoomInButtonClick=t.handleZoomInButtonClick.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleZoomOutButtonClick=t.handleZoomOutButtonClick.bind(_assertThisInitialized(_assertThisInitialized(t))),t.requestClose=t.requestClose.bind(_assertThisInitialized(_assertThisInitialized(t))),t.requestMoveNext=t.requestMoveNext.bind(_assertThisInitialized(_assertThisInitialized(t))),t.requestMovePrev=t.requestMovePrev.bind(_assertThisInitialized(_assertThisInitialized(t))),t}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}(ReactImageLightbox,t),_createClass(ReactImageLightbox,null,[{key:"isTargetMatchImage",value:function isTargetMatchImage(e){return e&&/ril-image-current/.test(e.className)}},{key:"parseMouseEvent",value:function parseMouseEvent(e){return{id:"mouse",source:1,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parseTouchPointer",value:function parseTouchPointer(e){return{id:e.identifier,source:2,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parsePointerEvent",value:function parsePointerEvent(e){return{id:e.pointerId,source:3,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"getTransform",value:function getTransform(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.zoom,a=void 0===o?1:o,s=e.width,l=e.targetWidth,u=n,c=(getWindowWidth(),a*(l/s));return{transform:"translate3d(".concat(u,"px,").concat(i,"px,0) scale3d(").concat(c,",").concat(c,",1)")}}}]),_createClass(ReactImageLightbox,[{key:"componentWillMount",value:function componentWillMount(){this.timeouts=[],this.currentAction=0,this.eventsSource=0,this.pointerList=[],this.preventInnerClose=!1,this.preventInnerCloseTimeout=null,this.keyPressed=!1,this.imageCache={},this.lastKeyDownTime=0,this.resizeTimeout=null,this.wheelActionTimeout=null,this.resetScrollTimeout=null,this.scrollX=0,this.scrollY=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,this.pinchTouchList=null,this.pinchDistance=0,this.keyCounter=0,this.moveRequested=!1,this.props.animationDisabled||this.setState({isClosing:!1})}},{key:"componentDidMount",value:function componentDidMount(){var t=this;this.windowContext=function getHighestSafeWindowContext(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.window.self,n=t.document.referrer;if(t===e.window.top||!n)return t;var r=function getOrigin(e){return e.match(/(.*\/\/.*?)(\/|$)/)[1]};return r(t.location.href)===r(n)?getHighestSafeWindowContext(t.parent):t}(),this.listeners={resize:this.handleWindowResize,mouseup:this.handleMouseUp,touchend:this.handleTouchEnd,touchcancel:this.handleTouchEnd,pointerdown:this.handlePointerEvent,pointermove:this.handlePointerEvent,pointerup:this.handlePointerEvent,pointercancel:this.handlePointerEvent},Object.keys(this.listeners).forEach((function(e){t.windowContext.addEventListener(e,t.listeners[e])})),this.loadAllImages()}},{key:"componentWillReceiveProps",value:function componentWillReceiveProps(e){var t=this,n=!1,r={},i={};this.getSrcTypes().forEach((function(o){t.props[o.name]!==e[o.name]&&(n=!0,r[t.props[o.name]]=!0,i[e[o.name]]=!0)})),(n||this.moveRequested)&&(Object.keys(r).forEach((function(e){!(e in i)&&e in t.imageCache&&(t.imageCache[e].loaded=!1)})),this.moveRequested=!1,this.loadAllImages(e))}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(){return!this.moveRequested}},{key:"componentWillUnmount",value:function componentWillUnmount(){var e=this;this.didUnmount=!0,Object.keys(this.listeners).forEach((function(t){e.windowContext.removeEventListener(t,e.listeners[t])})),this.timeouts.forEach((function(e){return clearTimeout(e)}))}},{key:"setTimeout",value:function(e){function setTimeout(t,n){return e.apply(this,arguments)}return setTimeout.toString=function(){return e.toString()},setTimeout}((function(e,t){var n=this,r=setTimeout((function(){n.timeouts=n.timeouts.filter((function(e){return e!==r})),e()}),t);return this.timeouts.push(r),r}))},{key:"setPreventInnerClose",value:function setPreventInnerClose(){var e=this;this.preventInnerCloseTimeout&&this.clearTimeout(this.preventInnerCloseTimeout),this.preventInnerClose=!0,this.preventInnerCloseTimeout=this.setTimeout((function(){e.preventInnerClose=!1,e.preventInnerCloseTimeout=null}),100)}},{key:"getBestImageForType",value:function getBestImageForType(e){var t=this.props[e],n={};if(this.isImageLoaded(t))n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height);else{if(!this.isImageLoaded(this.props["".concat(e,"Thumbnail")]))return null;t=this.props["".concat(e,"Thumbnail")],n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height,!0)}return{src:t,height:this.imageCache[t].height,width:this.imageCache[t].width,targetHeight:n.height,targetWidth:n.width}}},{key:"getFitSizes",value:function getFitSizes(e,t,n){var r=this.getLightboxRect(),i=r.height-2*this.props.imagePadding,o=r.width-2*this.props.imagePadding;return n||(i=Math.min(i,t),o=Math.min(o,e)),o/i>e/t?{width:e*i/t,height:i}:{width:o,height:t*o/e}}},{key:"getMaxOffsets",value:function getMaxOffsets(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel,t=this.getBestImageForType("mainSrc");if(null===t)return{maxX:0,minX:0,maxY:0,minY:0};var n=this.getLightboxRect(),r=this.getZoomMultiplier(e),i=0,o=0;return{maxX:i=r*t.width-n.width<0?(n.width-r*t.width)/2:(r*t.width-n.width)/2,maxY:o=r*t.height-n.height<0?(n.height-r*t.height)/2:(r*t.height-n.height)/2,minX:-1*i,minY:-1*o}}},{key:"getSrcTypes",value:function getSrcTypes(){return[{name:"mainSrc",keyEnding:"i".concat(this.keyCounter)},{name:"mainSrcThumbnail",keyEnding:"t".concat(this.keyCounter)},{name:"nextSrc",keyEnding:"i".concat(this.keyCounter+1)},{name:"nextSrcThumbnail",keyEnding:"t".concat(this.keyCounter+1)},{name:"prevSrc",keyEnding:"i".concat(this.keyCounter-1)},{name:"prevSrcThumbnail",keyEnding:"t".concat(this.keyCounter-1)}]}},{key:"getZoomMultiplier",value:function getZoomMultiplier(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel;return Math.pow(1.007,e)}},{key:"getLightboxRect",value:function getLightboxRect(){return this.outerEl.current?this.outerEl.current.getBoundingClientRect():{width:getWindowWidth(),height:void 0!==e.window?e.window.innerHeight:0,top:0,right:0,bottom:0,left:0}}},{key:"clearTimeout",value:function(e){function clearTimeout(t){return e.apply(this,arguments)}return clearTimeout.toString=function(){return e.toString()},clearTimeout}((function(e){this.timeouts=this.timeouts.filter((function(t){return t!==e})),clearTimeout(e)}))},{key:"changeZoom",value:function changeZoom(e,t,n){if(this.props.enableZoom){var r=Math.max(0,Math.min(300,e));if(r!==this.state.zoomLevel)if(0!==r){var i=this.getBestImageForType("mainSrc");if(null!==i){var o=this.getZoomMultiplier(),a=this.getZoomMultiplier(r),s=this.getLightboxRect(),l=void 0!==t?t-s.left:s.width/2,u=void 0!==n?n-s.top:s.height/2,c=(s.width-i.width*o)/2,d=(s.height-i.height*o)/2,f=l-(l-(c-this.state.offsetX))/o*a,p=u-(u-(d-this.state.offsetY))/o*a,h=(s.width-i.width*a)/2-f,v=(s.height-i.height*a)/2-p;if(3!==this.currentAction){var y=this.getMaxOffsets();this.state.zoomLevel>r&&(h=Math.max(y.minX,Math.min(y.maxX,h)),v=Math.max(y.minY,Math.min(y.maxY,v)))}this.setState({zoomLevel:r,offsetX:h,offsetY:v})}}else this.setState({zoomLevel:r,offsetX:0,offsetY:0})}}},{key:"closeIfClickInner",value:function closeIfClickInner(e){!this.preventInnerClose&&e.target.className.search(/\bril-inner\b/)>-1&&this.requestClose(e)}},{key:"handleKeyInput",value:function handleKeyInput(e){if(e.stopPropagation(),!this.isAnimating())if("keyup"!==e.type){var t=e.which||e.keyCode,n=new Date;if(!(n.getTime()-this.lastKeyDownTime=200||e.deltaX>=100?(this.requestMoveNext(e),n=500,this.scrollX=0):(this.scrollX<=-200||e.deltaX<=-100)&&(this.requestMovePrev(e),n=500,this.scrollX=0)}0!==n&&(this.wheelActionTimeout=this.setTimeout((function(){t.wheelActionTimeout=null}),n))}}},{key:"handleImageMouseWheel",value:function handleImageMouseWheel(e){if(Math.abs(e.deltaY)>=Math.abs(e.deltaX)){if(e.stopPropagation(),Math.abs(e.deltaY)<1)return;this.scrollX=0,this.scrollY+=e.deltaY,this.changeZoom(this.state.zoomLevel-e.deltaY,e.clientX,e.clientY)}}},{key:"handleImageDoubleClick",value:function handleImageDoubleClick(e){this.state.zoomLevel>0?this.changeZoom(0,e.clientX,e.clientY):this.changeZoom(this.state.zoomLevel+100,e.clientX,e.clientY)}},{key:"shouldHandleEvent",value:function shouldHandleEvent(e){if(this.eventsSource===e)return!0;if(0===this.eventsSource)return this.eventsSource=e,!0;switch(e){case 1:return!1;case 2:return this.eventsSource=2,this.filterPointersBySource(),!0;case 3:return 1===this.eventsSource&&(this.eventsSource=3,this.filterPointersBySource(),!0);default:return!1}}},{key:"addPointer",value:function addPointer(e){this.pointerList.push(e)}},{key:"removePointer",value:function removePointer(e){this.pointerList=this.pointerList.filter((function(t){return t.id!==e.id}))}},{key:"filterPointersBySource",value:function filterPointersBySource(){var e=this;this.pointerList=this.pointerList.filter((function(t){return t.source===e.eventsSource}))}},{key:"handleMouseDown",value:function handleMouseDown(e){this.shouldHandleEvent(1)&&ReactImageLightbox.isTargetMatchImage(e.target)&&(this.addPointer(ReactImageLightbox.parseMouseEvent(e)),this.multiPointerStart(e))}},{key:"handleMouseMove",value:function handleMouseMove(e){this.shouldHandleEvent(1)&&this.multiPointerMove(e,[ReactImageLightbox.parseMouseEvent(e)])}},{key:"handleMouseUp",value:function handleMouseUp(e){this.shouldHandleEvent(1)&&(this.removePointer(ReactImageLightbox.parseMouseEvent(e)),this.multiPointerEnd(e))}},{key:"handlePointerEvent",value:function handlePointerEvent(e){if(this.shouldHandleEvent(3))switch(e.type){case"pointerdown":ReactImageLightbox.isTargetMatchImage(e.target)&&(this.addPointer(ReactImageLightbox.parsePointerEvent(e)),this.multiPointerStart(e));break;case"pointermove":this.multiPointerMove(e,[ReactImageLightbox.parsePointerEvent(e)]);break;case"pointerup":case"pointercancel":this.removePointer(ReactImageLightbox.parsePointerEvent(e)),this.multiPointerEnd(e)}}},{key:"handleTouchStart",value:function handleTouchStart(e){var t=this;this.shouldHandleEvent(2)&&ReactImageLightbox.isTargetMatchImage(e.target)&&([].forEach.call(e.changedTouches,(function(e){return t.addPointer(ReactImageLightbox.parseTouchPointer(e))})),this.multiPointerStart(e))}},{key:"handleTouchMove",value:function handleTouchMove(e){this.shouldHandleEvent(2)&&this.multiPointerMove(e,[].map.call(e.changedTouches,(function(e){return ReactImageLightbox.parseTouchPointer(e)})))}},{key:"handleTouchEnd",value:function handleTouchEnd(e){var t=this;this.shouldHandleEvent(2)&&([].map.call(e.changedTouches,(function(e){return t.removePointer(ReactImageLightbox.parseTouchPointer(e))})),this.multiPointerEnd(e))}},{key:"decideMoveOrSwipe",value:function decideMoveOrSwipe(e){this.state.zoomLevel<=0?this.handleSwipeStart(e):this.handleMoveStart(e)}},{key:"multiPointerStart",value:function multiPointerStart(e){switch(this.handleEnd(null),this.pointerList.length){case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"multiPointerMove",value:function multiPointerMove(e,t){switch(this.currentAction){case 1:e.preventDefault(),this.handleMove(t[0]);break;case 2:e.preventDefault(),this.handleSwipe(t[0]);break;case 3:e.preventDefault(),this.handlePinch(t)}}},{key:"multiPointerEnd",value:function multiPointerEnd(e){switch(0!==this.currentAction&&(this.setPreventInnerClose(),this.handleEnd(e)),this.pointerList.length){case 0:this.eventsSource=0;break;case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"handleEnd",value:function handleEnd(e){switch(this.currentAction){case 1:this.handleMoveEnd(e);break;case 2:this.handleSwipeEnd(e);break;case 3:this.handlePinchEnd(e)}}},{key:"handleMoveStart",value:function handleMoveStart(e){var t=e.x,n=e.y;this.props.enableZoom&&(this.currentAction=1,this.moveStartX=t,this.moveStartY=n,this.moveStartOffsetX=this.state.offsetX,this.moveStartOffsetY=this.state.offsetY)}},{key:"handleMove",value:function handleMove(e){var t=e.x,n=e.y,r=this.moveStartX-t+this.moveStartOffsetX,i=this.moveStartY-n+this.moveStartOffsetY;this.state.offsetX===r&&this.state.offsetY===i||this.setState({offsetX:r,offsetY:i})}},{key:"handleMoveEnd",value:function handleMoveEnd(){var e=this;this.currentAction=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0;var t=this.getMaxOffsets(),n=Math.max(t.minX,Math.min(t.maxX,this.state.offsetX)),r=Math.max(t.minY,Math.min(t.maxY,this.state.offsetY));n===this.state.offsetX&&r===this.state.offsetY||(this.setState({offsetX:n,offsetY:r,shouldAnimate:!0}),this.setTimeout((function(){e.setState({shouldAnimate:!1})}),this.props.animationDuration))}},{key:"handleSwipeStart",value:function handleSwipeStart(e){var t=e.x,n=e.y;this.currentAction=2,this.swipeStartX=t,this.swipeStartY=n,this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipe",value:function handleSwipe(e){var t=e.x,n=e.y;this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipeEnd",value:function handleSwipeEnd(e){var t=this.swipeEndX-this.swipeStartX,n=Math.abs(t),r=Math.abs(this.swipeEndY-this.swipeStartY);if(this.currentAction=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,!(!e||this.isAnimating()||n<1.5*r)){if(n<200)if(n0&&this.props.prevSrc?(e.preventDefault(),this.requestMovePrev()):t<0&&this.props.nextSrc&&(e.preventDefault(),this.requestMoveNext())}}},{key:"calculatePinchDistance",value:function calculatePinchDistance(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,t=_slicedToArray(e,2),n=t[0],r=t[1];return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}},{key:"calculatePinchCenter",value:function calculatePinchCenter(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,t=_slicedToArray(e,2),n=t[0],r=t[1];return{x:n.x-(n.x-r.x)/2,y:n.y-(n.y-r.y)/2}}},{key:"handlePinchStart",value:function handlePinchStart(e){this.props.enableZoom&&(this.currentAction=3,this.pinchTouchList=e.map((function(e){return{id:e.id,x:e.x,y:e.y}})),this.pinchDistance=this.calculatePinchDistance())}},{key:"handlePinch",value:function handlePinch(e){this.pinchTouchList=this.pinchTouchList.map((function(t){for(var n=0;n0&&t+i>=r||e.deltaY<0&&i<=0)&&e.preventDefault()}}},{key:"isAnimating",value:function isAnimating(){return this.state.shouldAnimate||this.state.isClosing}},{key:"isImageLoaded",value:function isImageLoaded(e){return e&&e in this.imageCache&&this.imageCache[e].loaded}},{key:"loadImage",value:function loadImage(t,n,r){var i=this;if(this.isImageLoaded(n))this.setTimeout((function(){r()}),1);else{var o=new e.Image;this.props.imageCrossOrigin&&(o.crossOrigin=this.props.imageCrossOrigin),o.onerror=function(e){i.props.onImageLoadError(n,t,e),i.setState((function(e){return{loadErrorStatus:_objectSpread({},e.loadErrorStatus,_defineProperty({},t,!0))}})),r(e)},o.onload=function(){i.props.onImageLoad(n,t,o),i.imageCache[n]={loaded:!0,width:o.width,height:o.height},r()},o.src=n}}},{key:"loadAllImages",value:function loadAllImages(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=function generateLoadDoneCallback(t,n){return function(r){r||e.props[t]!==n||e.didUnmount||e.forceUpdate()}};this.getSrcTypes().forEach((function(r){var i=r.name;t[i]&&e.state.loadErrorStatus[i]&&e.setState((function(e){return{loadErrorStatus:_objectSpread({},e.loadErrorStatus,_defineProperty({},i,!1))}})),t[i]&&!e.isImageLoaded(t[i])&&e.loadImage(i,t[i],n(i,t[i]))}))}},{key:"requestClose",value:function requestClose(e){var t=this,n=function closeLightbox(){return t.props.onCloseRequest(e)};this.props.animationDisabled||"keydown"===e.type&&!this.props.animationOnKeyInput?n():(this.setState({isClosing:!0}),this.setTimeout(n,this.props.animationDuration))}},{key:"requestMove",value:function requestMove(e,t){var n=this,r={zoomLevel:0,offsetX:0,offsetY:0};this.props.animationDisabled||this.keyPressed&&!this.props.animationOnKeyInput||(r.shouldAnimate=!0,this.setTimeout((function(){return n.setState({shouldAnimate:!1})}),this.props.animationDuration)),this.keyPressed=!1,this.moveRequested=!0,"prev"===e?(this.keyCounter-=1,this.setState(r),this.props.onMovePrevRequest(t)):(this.keyCounter+=1,this.setState(r),this.props.onMoveNextRequest(t))}},{key:"requestMoveNext",value:function requestMoveNext(e){this.requestMove("next",e)}},{key:"requestMovePrev",value:function requestMovePrev(e){this.requestMove("prev",e)}},{key:"render",value:function render(){var t=this,n=this.props,r=n.animationDisabled,o=n.animationDuration,a=n.clickOutsideToClose,s=n.discourageDownloads,u=n.enableZoom,c=n.imageTitle,d=n.nextSrc,f=n.prevSrc,p=n.toolbarButtons,h=n.reactModalStyle,v=n.onAfterOpen,y=n.imageCrossOrigin,m=n.reactModalProps,b=this.state,g=b.zoomLevel,_=b.offsetX,S=b.offsetY,O=b.isClosing,E=b.loadErrorStatus,w=this.getLightboxRect(),T={};!r&&this.isAnimating()&&(T=_objectSpread({},T,{transition:"transform ".concat(o,"ms")}));var C={};this.getSrcTypes().forEach((function(e){var t=e.name,n=e.keyEnding;C[t]=n}));var j=[],I=function addImage(e,n,r){if(t.props[e]){var o=t.getBestImageForType(e),a=_objectSpread({},T,ReactImageLightbox.getTransform(_objectSpread({},r,o)));g>0&&(a.cursor="move");if(null===o&&function hasTrueValue(e){return Object.keys(e).some((function(t){return e[t]}))}(E))j.push(i.a.createElement("div",{className:"".concat(n," ril__image ril-errored"),style:a,key:t.props[e]+C[e]},i.a.createElement("div",{className:"ril__errorContainer"},t.props.imageLoadErrorMessage)));else if(null!==o){var l=o.src;s?(a.backgroundImage="url('".concat(l,"')"),j.push(i.a.createElement("div",{className:"".concat(n," ril__image ril__imageDiscourager"),onDoubleClick:t.handleImageDoubleClick,onWheel:t.handleImageMouseWheel,style:a,key:l+C[e]},i.a.createElement("div",{className:"ril-download-blocker ril__downloadBlocker"})))):j.push(i.a.createElement("img",_extends({},y?{crossOrigin:y}:{},{className:"".concat(n," ril__image"),onDoubleClick:t.handleImageDoubleClick,onWheel:t.handleImageMouseWheel,onDragStart:function onDragStart(e){return e.preventDefault()},style:a,src:l,key:l+C[e],alt:"string"==typeof c?c:translate("Image"),draggable:!1})))}else{var u=i.a.createElement("div",{className:"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon"},_toConsumableArray(new Array(12)).map((function(e,t){return i.a.createElement("div",{key:t,className:"ril-loading-circle-point ril__loadingCirclePoint"})})));j.push(i.a.createElement("div",{className:"".concat(n," ril__image ril-not-loaded"),style:a,key:t.props[e]+C[e]},i.a.createElement("div",{className:"ril__loadingContainer"},u)))}}},P=this.getZoomMultiplier();I("nextSrc","ril-image-next ril__imageNext",{x:w.width}),I("mainSrc","ril-image-current",{x:-1*_,y:-1*S,zoom:P}),I("prevSrc","ril-image-prev ril__imagePrev",{x:-1*w.width});var M={overlay:_objectSpread({zIndex:1e3,backgroundColor:"transparent"},h.overlay),content:_objectSpread({backgroundColor:"transparent",overflow:"hidden",border:"none",borderRadius:0,padding:0,top:0,left:0,right:0,bottom:0},h.content)};return i.a.createElement(l.a,_extends({isOpen:!0,onRequestClose:a?this.requestClose:void 0,onAfterOpen:function onAfterOpen(){t.outerEl.current&&t.outerEl.current.focus(),v()},style:M,contentLabel:translate("Lightbox"),appElement:void 0!==e.window?e.window.document.body:void 0},m),i.a.createElement("div",{className:"ril-outer ril__outer ril__outerAnimating ".concat(this.props.wrapperClassName," ").concat(O?"ril-closing ril__outerClosing":""),style:{transition:"opacity ".concat(o,"ms"),animationDuration:"".concat(o,"ms"),animationDirection:O?"normal":"reverse"},ref:this.outerEl,onWheel:this.handleOuterMousewheel,onMouseMove:this.handleMouseMove,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,tabIndex:"-1",onKeyDown:this.handleKeyInput,onKeyUp:this.handleKeyInput},i.a.createElement("div",{className:"ril-inner ril__inner",onClick:a?this.closeIfClickInner:void 0},j),f&&i.a.createElement("button",{type:"button",className:"ril-prev-button ril__navButtons ril__navButtonPrev",key:"prev","aria-label":this.props.prevLabel,onClick:this.isAnimating()?void 0:this.requestMovePrev}),d&&i.a.createElement("button",{type:"button",className:"ril-next-button ril__navButtons ril__navButtonNext",key:"next","aria-label":this.props.nextLabel,onClick:this.isAnimating()?void 0:this.requestMoveNext}),i.a.createElement("div",{className:"ril-toolbar ril__toolbar"},i.a.createElement("ul",{className:"ril-toolbar-left ril__toolbarSide ril__toolbarLeftSide"},i.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},i.a.createElement("span",{className:"ril-toolbar__item__child ril__toolbarItemChild"},c))),i.a.createElement("ul",{className:"ril-toolbar-right ril__toolbarSide ril__toolbarRightSide"},p&&p.map((function(e,t){return i.a.createElement("li",{key:"button_".concat(t+1),className:"ril-toolbar__item ril__toolbarItem"},e)})),u&&i.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},i.a.createElement("button",{type:"button",key:"zoom-in","aria-label":this.props.zoomInLabel,className:["ril-zoom-in","ril__toolbarItemChild","ril__builtinButton","ril__zoomInButton"].concat(_toConsumableArray(300===g?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomInBtn,disabled:this.isAnimating()||300===g,onClick:this.isAnimating()||300===g?void 0:this.handleZoomInButtonClick})),u&&i.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},i.a.createElement("button",{type:"button",key:"zoom-out","aria-label":this.props.zoomOutLabel,className:["ril-zoom-out","ril__toolbarItemChild","ril__builtinButton","ril__zoomOutButton"].concat(_toConsumableArray(0===g?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomOutBtn,disabled:this.isAnimating()||0===g,onClick:this.isAnimating()||0===g?void 0:this.handleZoomOutButtonClick})),i.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},i.a.createElement("button",{type:"button",key:"close","aria-label":this.props.closeLabel,className:"ril-close ril-toolbar__item__child ril__toolbarItemChild ril__builtinButton ril__closeButton",onClick:this.isAnimating()?void 0:this.requestClose})))),this.props.imageCaption&&i.a.createElement("div",{onWheel:this.handleCaptionMousewheel,onMouseDown:function onMouseDown(e){return e.stopPropagation()},className:"ril-caption ril__caption",ref:this.caption},i.a.createElement("div",{className:"ril-caption-content ril__captionContent"},this.props.imageCaption))))}}]),ReactImageLightbox}(r.Component);f.propTypes={mainSrc:a.a.string.isRequired,prevSrc:a.a.string,nextSrc:a.a.string,mainSrcThumbnail:a.a.string,prevSrcThumbnail:a.a.string,nextSrcThumbnail:a.a.string,onCloseRequest:a.a.func.isRequired,onMovePrevRequest:a.a.func,onMoveNextRequest:a.a.func,onImageLoadError:a.a.func,onImageLoad:a.a.func,onAfterOpen:a.a.func,discourageDownloads:a.a.bool,animationDisabled:a.a.bool,animationOnKeyInput:a.a.bool,animationDuration:a.a.number,keyRepeatLimit:a.a.number,keyRepeatKeyupBonus:a.a.number,imageTitle:a.a.node,imageCaption:a.a.node,imageCrossOrigin:a.a.string,reactModalStyle:a.a.shape({}),imagePadding:a.a.number,wrapperClassName:a.a.string,toolbarButtons:a.a.arrayOf(a.a.node),clickOutsideToClose:a.a.bool,enableZoom:a.a.bool,reactModalProps:a.a.shape({}),nextLabel:a.a.string,prevLabel:a.a.string,zoomInLabel:a.a.string,zoomOutLabel:a.a.string,closeLabel:a.a.string,imageLoadErrorMessage:a.a.node},f.defaultProps={imageTitle:null,imageCaption:null,toolbarButtons:null,reactModalProps:{},animationDisabled:!1,animationDuration:300,animationOnKeyInput:!1,clickOutsideToClose:!0,closeLabel:"Close lightbox",discourageDownloads:!1,enableZoom:!0,imagePadding:10,imageCrossOrigin:null,keyRepeatKeyupBonus:40,keyRepeatLimit:180,mainSrcThumbnail:null,nextLabel:"Next image",nextSrc:null,nextSrcThumbnail:null,onAfterOpen:function onAfterOpen(){},onImageLoadError:function onImageLoadError(){},onImageLoad:function onImageLoad(){},onMoveNextRequest:function onMoveNextRequest(){},onMovePrevRequest:function onMovePrevRequest(){},prevLabel:"Previous image",prevSrc:null,prevSrcThumbnail:null,reactModalStyle:{},wrapperClassName:"",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",imageLoadErrorMessage:"This image failed to load"},t.default=f}.call(this,n(53))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t0&&0===(y-=1)&&c.show(n),t.props.shouldFocusAfterRender&&(t.props.shouldReturnFocusAfterClose?(l.returnFocus(t.props.preventScroll),l.teardownScopedFocus()):l.popWithoutFocus()),t.props.onAfterClose&&t.props.onAfterClose(),h.default.deregister(t)},t.open=function(){t.beforeOpen(),t.state.afterOpen&&t.state.beforeClose?(clearTimeout(t.closeTimer),t.setState({beforeClose:!1})):(t.props.shouldFocusAfterRender&&(l.setupScopedFocus(t.node),l.markForFocusLater()),t.setState({isOpen:!0},(function(){t.setState({afterOpen:!0}),t.props.isOpen&&t.props.onAfterOpen&&t.props.onAfterOpen({overlayEl:t.overlay,contentEl:t.content})})))},t.close=function(){t.props.closeTimeoutMS>0?t.closeWithTimeout():t.closeWithoutTimeout()},t.focusContent=function(){return t.content&&!t.contentHasFocus()&&t.content.focus({preventScroll:!0})},t.closeWithTimeout=function(){var e=Date.now()+t.props.closeTimeoutMS;t.setState({beforeClose:!0,closesAt:e},(function(){t.closeTimer=setTimeout(t.closeWithoutTimeout,t.state.closesAt-Date.now())}))},t.closeWithoutTimeout=function(){t.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},t.afterClose)},t.handleKeyDown=function(e){9===e.keyCode&&(0,u.default)(t.content,e),t.props.shouldCloseOnEsc&&27===e.keyCode&&(e.stopPropagation(),t.requestClose(e))},t.handleOverlayOnClick=function(e){null===t.shouldClose&&(t.shouldClose=!0),t.shouldClose&&t.props.shouldCloseOnOverlayClick&&(t.ownerHandlesClose()?t.requestClose(e):t.focusContent()),t.shouldClose=null},t.handleContentOnMouseUp=function(){t.shouldClose=!1},t.handleOverlayOnMouseDown=function(e){t.props.shouldCloseOnOverlayClick||e.target!=t.overlay||e.preventDefault()},t.handleContentOnClick=function(){t.shouldClose=!1},t.handleContentOnMouseDown=function(){t.shouldClose=!1},t.requestClose=function(e){return t.ownerHandlesClose()&&t.props.onRequestClose(e)},t.ownerHandlesClose=function(){return t.props.onRequestClose},t.shouldBeClosed=function(){return!t.state.isOpen&&!t.state.beforeClose},t.contentHasFocus=function(){return document.activeElement===t.content||t.content.contains(document.activeElement)},t.buildClassName=function(e,n){var r="object"===(void 0===n?"undefined":i(n))?n:{base:v[e],afterOpen:v[e]+"--after-open",beforeClose:v[e]+"--before-close"},o=r.base;return t.state.afterOpen&&(o=o+" "+r.afterOpen),t.state.beforeClose&&(o=o+" "+r.beforeClose),"string"==typeof n&&n?o+" "+n:o},t.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,r){return n[e+"-"+r]=t[r],n}),{})},t.state={afterOpen:!1,beforeClose:!1},t.shouldClose=null,t.moveFromContentToOverlay=null,t}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(ModalPortal,e),o(ModalPortal,[{key:"componentDidMount",value:function componentDidMount(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function componentDidUpdate(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer)}},{key:"beforeOpen",value:function beforeOpen(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,i=e.bodyOpenClassName;i&&d.add(document.body,i),r&&d.add(document.getElementsByTagName("html")[0],r),n&&(y+=1,c.hide(t)),h.default.register(this)}},{key:"render",value:function render(){var e=this.props,t=e.id,n=e.className,i=e.overlayClassName,o=e.defaultStyles,a=e.children,s=n?{}:o.content,l=i?{}:o.overlay;if(this.shouldBeClosed())return null;var u={ref:this.setOverlayRef,className:this.buildClassName("overlay",i),style:r({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},c=r({id:t,ref:this.setContentRef,style:r({},s,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(c,a);return this.props.overlayElement(u,d)}}]),ModalPortal}(a.Component);m.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},m.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(p.default),s.default.instanceOf(f.SafeHTMLCollection),s.default.instanceOf(f.SafeNodeList),s.default.arrayOf(s.default.instanceOf(p.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=m,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlur=handleBlur,t.handleFocus=handleFocus,t.markForFocusLater=function markForFocusLater(){i.push(document.activeElement)},t.returnFocus=function returnFocus(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==i.length&&(t=i.pop()).focus({preventScroll:e}))}catch(e){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function popWithoutFocus(){i.length>0&&i.pop()},t.setupScopedFocus=function setupScopedFocus(e){o=e,window.addEventListener?(window.addEventListener("blur",handleBlur,!1),document.addEventListener("focus",handleFocus,!0)):(window.attachEvent("onBlur",handleBlur),document.attachEvent("onFocus",handleFocus))},t.teardownScopedFocus=function teardownScopedFocus(){o=null,window.addEventListener?(window.removeEventListener("blur",handleBlur),document.removeEventListener("focus",handleFocus)):(window.detachEvent("onBlur",handleBlur),document.detachEvent("onFocus",handleFocus))};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(128));var i=[],o=null,a=!1;function handleBlur(){a=!0}function handleFocus(){if(a){if(a=!1,!o)return;setTimeout((function(){o.contains(document.activeElement)||((0,r.default)(o)[0]||o).focus()}),0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function scopeTab(e,t){var n=(0,r.default)(e);if(!n.length)return void t.preventDefault();var i=void 0,o=t.shiftKey,a=n[0],s=n[n.length-1];if(e===document.activeElement){if(!o)return;i=s}s!==document.activeElement||o||(i=a);a===document.activeElement&&o&&(i=s);if(i)return t.preventDefault(),void i.focus();var l=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null==l||"Chrome"==l[1]||null!=/\biPod\b|\biPad\b/g.exec(navigator.userAgent))return;var u=n.indexOf(document.activeElement);u>-1&&(u+=o?-1:1);if(void 0===(i=n[u]))return t.preventDefault(),void(i=o?s:a).focus();t.preventDefault(),i.focus()};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(128));e.exports=t.default},function(e,t,n){"use strict";var warning=function(){};e.exports=warning},function(e,t,n){var r;!function(){"use strict";var i=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:i,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:i&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:i&&!!window.screen};void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dumpClassLists=function dumpClassLists(){0};var r={},i={};t.add=function add(e,t){return function trackClass(e,t,n){n.forEach((function(n){!function incrementReference(e,t){e[t]||(e[t]=0),e[t]+=1}(t,n),e.add(n)}))}(e.classList,"html"==e.nodeName.toLowerCase()?r:i,t.split(" "))},t.remove=function remove(e,t){return function untrackClass(e,t,n){n.forEach((function(n){!function decrementReference(e,t){e[t]&&(e[t]-=1)}(t,n),0===t[n]&&e.remove(n)}))}(e.classList,"html"==e.nodeName.toLowerCase()?r:i,t.split(" "))}},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(130));var i=void 0,o=void 0,a=[];function focusContent(){0!==a.length&&a[a.length-1].focusContent()}r.default.subscribe((function bodyTrap(e,t){i&&o||((i=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),i.style.position="absolute",i.style.opacity="0",i.setAttribute("tabindex","0"),i.addEventListener("focus",focusContent),(o=i.cloneNode()).addEventListener("focus",focusContent)),(a=t).length>0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==o&&document.body.appendChild(o)):(i.parentElement&&i.parentElement.removeChild(i),o.parentElement&&o.parentElement.removeChild(o))}))},function(e,t,n){"use strict";function componentWillMount(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function componentWillReceiveProps(e){this.setState(function updater(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function componentWillUpdate(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function polyfill(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,r=null,i=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?r="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(r="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?i="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(i="UNSAFE_componentWillUpdate"),null!==n||null!==r||null!==i){var o=e.displayName||e.name,a="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+o+" uses "+a+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==r?"\n "+r:"")+(null!==i?"\n "+i:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=componentWillMount,t.componentWillReceiveProps=componentWillReceiveProps),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=componentWillUpdate;var s=t.componentDidUpdate;t.componentDidUpdate=function componentDidUpdatePolyfill(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",(function(){return polyfill})),componentWillMount.__suppressDeprecationWarning=!0,componentWillReceiveProps.__suppressDeprecationWarning=!0,componentWillUpdate.__suppressDeprecationWarning=!0},function(e,t,n){e.exports={ril__outer:"style__ril__outer___1zYzZ",ril__outerClosing:"style__ril__outerClosing___3n_rB",ril__inner:"style__ril__inner___dYbbg",ril__image:"style__ril__image___ohhGk",ril__imagePrev:"style__ril__imagePrev___1TitV",ril__imageNext:"style__ril__imageNext___qIMp_",ril__imageDiscourager:"style__ril__imageDiscourager___1loUi",ril__navButtons:"style__ril__navButtons___rD-18",ril__navButtonPrev:"style__ril__navButtonPrev___3XfSU",ril__navButtonNext:"style__ril__navButtonNext___lV26z",ril__downloadBlocker:"style__ril__downloadBlocker___2Jwql",ril__caption:"style__ril__caption___20juT",ril__toolbar:"style__ril__toolbar___10lYy",ril__captionContent:"style__ril__captionContent___6dnIh",ril__toolbarSide:"style__ril__toolbarSide___1-5RY",ril__toolbarLeftSide:"style__ril__toolbarLeftSide___33kts",ril__toolbarRightSide:"style__ril__toolbarRightSide___3xRiA",ril__toolbarItem:"style__ril__toolbarItem___33nhp",ril__toolbarItemChild:"style__ril__toolbarItemChild___1uo52",ril__builtinButton:"style__ril__builtinButton___2ew22",ril__builtinButtonDisabled:"style__ril__builtinButtonDisabled___3xK7K",ril__closeButton:"style__ril__closeButton___2Ge8S",ril__zoomInButton:"style__ril__zoomInButton___2okkJ",ril__zoomOutButton:"style__ril__zoomOutButton___2U6Nk",ril__outerAnimating:"style__ril__outerAnimating___2Z5fK",closeWindow:"style__closeWindow___2YNOe",ril__loadingCircle:"style__ril__loadingCircle___23cHC",ril__loadingCirclePoint:"style__ril__loadingCirclePoint___3pCVl",pointFade:"style__pointFade___2ppwA",ril__loadingContainer:"style__ril__loadingContainer___38L0C",ril__errorContainer:"style__ril__errorContainer___3sKjX",ril__loadingContainer__icon:"style__ril__loadingContainer__icon___2nrVt"}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(9),c=n(27),d=l.createUseMediaUiStyles((function(e){return{assetSourceList:{border:"1px solid "+e.colors.border,padding:"0 "+e.spacing.full},item:{display:"flex",alignItems:"center","& a":{fontWeight:"normal",cursor:"pointer",userSelect:"none","&:hover":{color:e.colors.primary}}},itemSelected:{"&, .neos.neos-module &":{color:e.colors.primary}}}}));t.default=function AssetSourceList(){var e=d(),t=u.useAssetSourcesQuery().assetSources,n=l.useIntl().translate,r=u.useSelectAssetSource(),i=r[0],o=r[1];return!t||t.length<2?null:a.createElement("nav",{className:e.assetSourceList},a.createElement(s.Headline,{type:"h2"},a.createElement(c.IconLabel,{icon:"box",label:n("assetSourceList.header","Media sources")})),null==t?void 0:t.map((function(t){return a.createElement(c.IconLabel,{key:t.id,label:t.label,iconUri:t.iconUri,className:e.item},a.createElement("a",{className:(null==i?void 0:i.id)===t.id?e.itemSelected:null,onClick:function(){return o(t)}},"neos"===t.id?n("assetsource.local","Local"):t.label))})))}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7).createUseMediaUiStyles({assetLabel:{display:"inline-block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}});t.default=a.memo((function(e){var t=e.label,n=s();return a.createElement("span",{className:n.assetLabel},t)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7).createUseMediaUiStyles((function(e){return{column:{display:"grid",gridAutoRows:"min-content",gridGap:e.spacing.full,overflowY:"auto",overflowX:"hidden",height:"100%"}}}));t.default=function Column(e){var t=e.children,n=s();return a.createElement("div",{className:n.column},t)}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7).createUseMediaUiStyles((function(e){return{iconWrap:{verticalAlign:"middle"},label:{fontWeight:"bold",lineHeight:e.spacing.goldenUnit,paddingLeft:e.spacing.half,userSelect:"none"},imgIcon:{width:"auto",height:"18px"}}}));t.default=a.memo((function(e){var t=e.icon,n=void 0===t?"question":t,r=e.iconUri,i=void 0===r?"":r,o=e.label,u=void 0===o?"":o,c=e.className,d=void 0===c?"":c,f=e.children,p=void 0===f?null:f,h=l();return a.createElement("div",{className:d},a.createElement("span",{className:h.iconWrap},i?a.createElement("img",{src:i,alt:u,className:h.imgIcon}):a.createElement(s.Icon,{icon:n})),a.createElement("span",{className:h.label},p||u||""))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7).createUseMediaUiStyles((function(e){return{propertyList:{overflow:"hidden",width:"100%",maxWidth:"100%","& dt":{backgroundColor:e.colors.alternatingBackground,color:"white",fontWeight:"bold",padding:e.spacing.half+" "+e.spacing.half+" 0",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"calc("+e.size.sidebarWidth+" - "+e.spacing.full+")"},"& dd":{backgroundColor:e.colors.alternatingBackground,color:e.colors.inactive,margin:"0 0 1px",padding:e.spacing.half,textOverflow:"ellipsis",overflowX:"hidden",whiteSpace:"nowrap",width:"calc("+e.size.sidebarWidth+" - "+e.spacing.full+")"}}}}));t.default=a.memo((function(e){var t=e.children,n=s();return a.createElement("dl",{className:n.propertyList},t)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0));t.default=a.memo((function(e){var t=e.label,n=e.value;return a.createElement(a.Fragment,null,a.createElement("dt",null,t),a.createElement("dd",null,n))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(9),c=n(27),d=l.createUseMediaUiStyles((function(e){return{assetSourceDescription:{border:"1px solid "+e.colors.border,"& .ReactCollapse--collapse":{transition:"height "+e.transition.slow}},panelHeader:{"& button":{position:"absolute"}}}}));t.default=function AssetSourceDescription(){var e=d(),t=l.useIntl().translate,n=u.useSelectAssetSource()[0];return(null==n?void 0:n.description)?a.createElement(s.ToggablePanel,{closesToBottom:!0,className:e.assetSourceDescription},a.createElement(s.ToggablePanel.Header,{className:e.panelHeader},a.createElement(c.IconLabel,{icon:"info-circle",label:t("assetSourceDescription.header","Media source description")})),a.createElement(s.ToggablePanel.Contents,null,a.createElement("p",null,n.description))):null}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(133),l=n(132),u=n(27),c=n(7),d=n(76);t.default=a.memo((function(){var e=[!c.useMediaUi().selectionMode&&d.UploadButton,l.AssetSourceList,s.AssetCollectionTree,l.AssetSourceDescription].filter(Boolean);return a.createElement(u.Column,null,e.map((function(e,t){return a.createElement(e,{key:t})})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(14),f=n(7),p=n(9),h=a(n(300)),v=a(n(301)),y=n(27),m=a(n(302)),b=a(n(303)),g=f.createUseMediaUiStyles((function(e){return{assetCollectionTree:{border:"1px solid "+e.colors.border},headline:{padding:"0 "+e.spacing.full},iconWrap:{width:e.spacing.goldenUnit,display:"inline-flex",justifyContent:"center"},toolbar:{borderTop:"1px solid "+e.colors.border},tree:{borderTop:"1px solid "+e.colors.border}}}));t.default=s.memo((function(){var e=g(),t=f.useIntl().translate,n=f.useNotify(),r=p.useSelectAssetCollection(),i=p.useSelectTag(),o=u.useSetRecoilState(d.selectedAssetCollectionIdState),a=p.useSelectedAssetCollection(),_=p.useSelectedTag(),S=u.useSetRecoilState(d.selectedAssetIdState),O=u.useSetRecoilState(d.selectedTagIdState),E=p.useTagsQuery().tags,w=p.useAssetCollectionsQuery().assetCollections,T=p.useSelectAssetSource()[0],C=p.useDeleteTag().deleteTag,j=p.useDeleteAssetCollection().deleteAssetCollection,I=l.useCallback((function(){if(_){if(!window.confirm(t("action.deleteTag.confirm","Do you really want to delete the tag "+_.label,[_.label])))return;C(_.id).then((function(){n.ok(t("action.deleteTag.success","The tag has been deleted"))})).catch((function(e){var r=e.message;n.error(t("action.deleteTag.error","Error while trying to delete the tag"),r)})),O(null),o(null),S(null)}else if(a){if(!window.confirm(t("action.deleteAssetCollection.confirm","Do you really want to delete the asset collection "+a.title,[a.title])))return;j(a.id).then((function(){n.ok(t("assetCollectionActions.delete.success","Asset collection was successfully deleted"))})).catch((function(e){n.error(t("assetCollectionActions.delete.error","Failed to delete asset collection"),e.message)})),O(null),o(null),S(null)}}),[_,a,t,C,O,o,S,n,j]);return(null==T?void 0:T.supportsCollections)?s.createElement("nav",{className:e.assetCollectionTree},s.createElement(c.Headline,{type:"h2",className:e.headline},s.createElement(y.IconLabel,{icon:"folder",label:t("assetCollectionList.header","Collections")})),s.createElement("div",{className:e.toolbar},s.createElement(m.default,null),s.createElement(b.default,null),s.createElement(c.IconButton,{icon:"trash-alt",size:"regular",style:"transparent",hoverStyle:"brand",disabled:!a&&!_,title:t("assetCollectionTree.toolbar.delete","Delete"),onClick:I})),s.createElement(c.Tree,{className:e.tree},s.createElement(h.default,{isActive:!a&&!_,label:t("assetCollectionList.showAll","All"),title:t("assetCollectionList.showAll.title","Show assets for all collections"),level:1,onClick:r,assetCollection:null,collapsedByDefault:!1},null==E?void 0:E.map((function(e){return s.createElement(v.default,{key:e.id,tag:e,isActive:!a&&e.id==(null==_?void 0:_.id),level:2,onClick:i})}))),w.map((function(e,t){var n;return s.createElement(h.default,{key:t,assetCollection:e,onClick:r,level:1,isActive:e.title==(null==a?void 0:a.title)&&!_},null===(n=e.tags)||void 0===n?void 0:n.map((function(t){return s.createElement(v.default,{key:t.id,tag:t,assetCollection:e,isActive:e.id==(null==a?void 0:a.id)&&t.id==(null==_?void 0:_.id),level:2,onClick:i})})))})))):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(8),c=a(n(134));t.default=s.memo((function(e){var t=e.isActive,n=e.assetCollection,r=e.label,i=e.title,o=e.children,a=e.level,d=e.onClick,f=e.collapsedByDefault,p=void 0===f||f,h=l.useState(p),v=h[0],y=h[1],m=l.useCallback((function(){return y(!v)}),[v]),b=l.useCallback((function(){return d(n)}),[d,n]);return s.createElement(u.Tree.Node,null,s.createElement(u.Tree.Node.Header,{isActive:t,isCollapsed:0===o.length||v,isFocused:t,isLoading:!1,hasError:!1,label:r||n.title,title:i||n.title,icon:"folder",nodeDndType:c.default.COLLECTION,level:a,onToggle:m,onClick:b,hasChildren:o.length>0}),!v&&o)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(8),c=a(n(134));t.default=s.memo((function(e){var t=e.tag,n=e.isActive,r=e.assetCollection,i=e.label,o=e.title,a=e.onClick,d=e.level,f=l.useCallback((function(){return a(t,r)}),[a,t,r]);return s.createElement(u.Tree.Node,null,s.createElement(u.Tree.Node.Header,{isActive:n,isCollapsed:!0,isFocused:n,isLoading:!1,hasError:!1,label:i||t.label,title:o||t.label,icon:"tag",nodeDndType:c.default.TAG,level:d,onClick:f,hasChildren:!1}))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(8),c=n(7),d=n(28),f=c.createUseMediaUiStyles({plusIcon:{top:"15px !important",left:"13px !important",width:"9px !important"}});t.default=a.memo((function(){var e=f(),t=c.useIntl().translate,n=l.useSetRecoilState(d.createAssetCollectionDialogState),r=s.useCallback((function(){n({title:"",visible:!0})}),[n]);return a.createElement(u.Button,{size:"regular",style:"transparent",hoverStyle:"brand",title:t("assetCollectionTree.toolbar.createAssetCollection","Create new asset collection"),onClick:r},a.createElement("span",{className:"fa-layers fa-fw"},a.createElement(u.Icon,{icon:"folder"}),a.createElement(u.Icon,{icon:"plus",color:"primaryBlue",className:e.plusIcon})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(8),c=n(7),d=n(28),f=c.createUseMediaUiStyles({plusIcon:{top:"13px !important",left:"11px !important",width:"9px !important"}});t.default=a.memo((function(){var e=f(),t=c.useIntl().translate,n=l.useSetRecoilState(d.createTagDialogState),r=s.useCallback((function(){n({label:"",visible:!0})}),[n]);return a.createElement(u.Button,{size:"regular",style:"transparent",hoverStyle:"brand",title:t("assetCollectionTree.toolbar.createTag","Create new tag"),onClick:r},a.createElement("span",{className:"fa-layers fa-fw"},a.createElement(u.Icon,{icon:"tag"}),a.createElement(u.Icon,{icon:"plus",color:"primaryBlue",className:e.plusIcon})))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentSelection=t.SideBarRight=void 0;var i=r(n(305));t.SideBarRight=i.default;var o=r(n(135));t.CurrentSelection=o.default},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(49),u=a(n(135)),c=n(27);t.default=s.memo((function(){var e=[u.default,l.AssetInspector,l.AssetCollectionInspector,l.TagInspector,l.IptcMetadataInspector];return s.createElement(c.Column,null,e.map((function(e,t){return s.createElement(e,{key:t})})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(8),c=n(39),d=n(7),f=n(9),p=n(14),h=n(121),v=n(76),y=n(49),m=n(6),b=a(n(81)),g=a(n(82)),_=a(n(83)),S=d.createUseMediaUiStyles((function(e){return{textArea:{".neos textarea&":{padding:e.spacing.half}}}}));t.default=s.memo((function(){var e=S(),t=f.useSelectedAsset(),n=d.useNotify(),r=d.useIntl().translate,i=d.useMediaUi().featureFlags,o=l.useState(null),a=o[0],O=o[1],E=l.useState(null),w=E[0],T=E[1],C=l.useState(null),j=C[0],I=C[1],P=m.useRecoilValue(p.selectedInspectorViewState),M=f.useUpdateAsset(),k=M.updateAsset,R=M.loading,x=(null==t?void 0:t.localId)&&!R,D=t&&(a!==t.label||w!==t.caption||j!==t.copyrightNotice),N=l.useCallback((function(){t&&(O(t.label),T(t.caption),I(t.copyrightNotice))}),[t,O,T,I]),L=l.useCallback((function(){a===t.label&&w===t.caption&&j===t.copyrightNotice||k({asset:t,label:a,caption:w,copyrightNotice:j}).then((function(){n.ok(r("actions.updateAsset.success","The asset has been updated"))})).catch((function(e){var t=e.message;n.error(r("actions.deleteAsset.error","Error while updating the asset"),t)}))}),[n,r,w,j,a,t,k]);return l.useEffect((function(){N()}),[null==t?void 0:t.id]),t&&"asset"===P?s.createElement(_.default,null,s.createElement(b.default,{label:r("inspector.title","Title")},s.createElement(u.TextInput,{disabled:!x,type:"text",value:a||"",onChange:O,onEnterKey:L})),s.createElement(b.default,{label:r("inspector.caption","Caption")},s.createElement(u.TextArea,{className:e.textArea,disabled:!x,minRows:3,expandedRows:6,value:w||"",onChange:T})),s.createElement(b.default,{label:r("inspector.copyrightNotice","Copyright notice")},s.createElement(u.TextArea,{className:e.textArea,disabled:!x,minRows:2,expandedRows:4,value:j||"",onChange:I})),x&&s.createElement(g.default,{handleApply:L,handleDiscard:N,hasUnpublishedChanges:D}),t.assetSource.supportsCollections&&s.createElement(y.CollectionSelectBox,null),t.assetSource.supportsTagging&&s.createElement(y.TagSelectBoxAsset,null),s.createElement(c.AssetUsagesToggleButton,null),i.showSimilarAssets&&s.createElement(h.SimilarAssetsToggleButton,null),!t.assetSource.readOnly&&s.createElement(v.AssetReplacementButton,null),s.createElement(y.MetadataView,null)):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(8),c=n(7),d=n(9),f=n(14),p=n(49),h=n(6),v=a(n(82)),y=a(n(81)),m=a(n(83));t.default=s.memo((function(){var e=d.useSelectedAssetCollection(),t=h.useRecoilValue(f.selectedInspectorViewState),n=c.useNotify(),r=c.useIntl().translate,i=l.useState(null),o=i[0],a=i[1],b=d.useUpdateAssetCollection().updateAssetCollection,g=e&&o!==e.title,_=l.useCallback((function(){e&&a(e.title)}),[e,a]),S=l.useCallback((function(){o!==e.title&&b({assetCollection:e,title:o}).then((function(){n.ok(r("actions.updateAssetCollection.success","The asset collection has been updated"))})).catch((function(e){var t=e.message;n.error(r("actions.deleteAssetCollection.error","Error while updating the asset collection"),t)}))}),[n,r,e,b,o]);return l.useEffect((function(){_()}),[null==e?void 0:e.id]),e&&"assetCollection"===t?s.createElement(m.default,null,s.createElement(y.default,{label:r("inspector.title","Title")},s.createElement(u.TextInput,{type:"text",value:o||"",onChange:a,onEnterKey:S})),s.createElement(v.default,{handleApply:S,handleDiscard:_,hasUnpublishedChanges:g}),s.createElement(p.TagSelectBoxAssetCollection,null)):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(9),c=n(27),d=l.createUseMediaUiStyles((function(e){return{iptcData:{"& dl":{"& dt":{backgroundColor:e.colors.alternatingBackground,fontWeight:"bold",color:"white",padding:"8px 8px 0"},"& dd":{backgroundColor:e.colors.alternatingBackground,marginBottom:"1px",padding:"8px",color:e.colors.inactive}}}}}));t.default=a.memo((function(){var e,t=d(),n=u.useSelectedAsset(),r=l.useIntl().translate;return(null===(e=null==n?void 0:n.iptcProperties)||void 0===e?void 0:e.length)?a.createElement("div",{className:t.iptcData},a.createElement(s.Headline,{type:"h2"},a.createElement(c.IconLabel,{icon:"camera",label:r("inspector.iptcMetadata","IPTC Metadata")})),a.createElement(c.PropertyList,null,n.iptcProperties.map((function(e){return a.createElement(c.PropertyListItem,{key:e.propertyName,label:e.propertyName,value:e.value})})))):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(9),c=n(57),d=n(27);t.default=a.memo((function(){var e=l.useIntl().translate,t=u.useSelectedAsset();return t?a.createElement("div",null,a.createElement(s.Headline,{type:"h2"},a.createElement(d.IconLabel,{icon:"info-circle",label:e("inspector.metadata","Metadata")})),a.createElement(d.PropertyList,null,t.file.size>0&&a.createElement(d.PropertyListItem,{label:e("inspector.property.fileSize","Size"),value:c.humanFileSize(t.file.size)}),a.createElement(d.PropertyListItem,{label:e("inspector.property.lastModified","Last modified"),value:new Date(t.lastModified).toLocaleString()}),a.createElement(d.PropertyListItem,{label:e("inspector.property.dimensions","Dimensions"),value:t.width+"px x "+t.height+"px"}),a.createElement(d.PropertyListItem,{label:e("inspector.property.mediaType","MIME type"),value:t.file.mediaType}),a.createElement(d.PropertyListItem,{label:e("inspector.property.filename","Filename"),value:t.filename}))):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(14),p=n(9),h=a(n(82)),v=a(n(81)),y=a(n(83));t.default=s.memo((function(){var e=p.useSelectedTag(),t=u.useRecoilValue(f.selectedInspectorViewState),n=d.useNotify(),r=d.useIntl().translate,i=l.useState(null),o=i[0],a=i[1],m=p.useUpdateTag().updateTag,b=e&&o!==e.label,g=l.useCallback((function(){e&&a(e.label)}),[e,a]),_=l.useCallback((function(){o!==e.label&&m({tag:e,label:o}).then((function(){n.ok(r("actions.updateTag.success","The tag has been updated"))})).catch((function(e){var t=e.message;n.error(r("actions.updateTag.error","Error while updating the tag"),t)}))}),[n,r,e,m,o]);return l.useEffect((function(){g()}),[null==e?void 0:e.id]),e&&"tag"===t?s.createElement(y.default,null,s.createElement(v.default,{label:r("inspector.label","Label")},s.createElement(c.TextInput,{type:"text",value:o||"",onChange:a,onEnterKey:_})),s.createElement(h.default,{handleApply:_,handleDiscard:g,hasUnpublishedChanges:b})):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(27),c=l.createUseMediaUiStyles({tagSelectBox:{},tagSelection:{}});t.default=a.memo((function(e){var t=e.values,n=e.options,r=e.onChange,i=e.disabled,o=void 0!==i&&i,d=c(),f=l.useIntl().translate;return a.createElement("div",{className:d.tagSelectBox},a.createElement(s.Headline,{type:"h2"},a.createElement(u.IconLabel,{icon:"tags",label:f("inspector.tags","Tags")})),a.createElement(s.MultiSelectBox,{className:d.tagSelection,disabled:o,placeholder:f("inspector.tags.placeholder","Select a tag"),noMatchesFoundLabel:f("general.noMatchesFound","No matches found"),values:t,optionValueField:"id",options:n,searchOptions:n,onValuesChange:function(e){return r(e.map((function(e){return n.find((function(t){return t.id===e}))})))}}))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(7),u=n(9),c=n(49);t.default=a.memo((function(){var e=l.useNotify(),t=l.useIntl().translate,n=u.useTagsQuery().tags,r=u.useSetAssetTags(),i=r.setAssetTags,o=r.loading,d=u.useSelectedAsset(),f=s.useMemo((function(){return null==d?void 0:d.tags.map((function(e){return e.id})).sort()}),[null==d?void 0:d.tags]),p=s.useCallback((function(n){var r;r=d,n.map((function(e){return e.id})).sort().join(",")!==r.tags.map((function(e){return e.id})).sort().join(",")&&i({asset:d,tags:n}).then((function(){e.ok(t("actions.setAssetTags.success","The asset has been tagged"))})).catch((function(n){var r=n.message;e.error(t("actions.setAssetTags.error","Error while tagging the asset"),r)}))}),[e,d,i,t]);return d?a.createElement(c.TagSelectBox,{values:f,options:n,onChange:p,disabled:o||d.assetSource.readOnly}):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(7),u=n(9),c=n(49);t.default=a.memo((function(){var e=l.useNotify(),t=l.useIntl().translate,n=u.useTagsQuery().tags,r=u.useUpdateAssetCollection().updateAssetCollection,i=u.useSelectedAssetCollection(),o=s.useMemo((function(){return null==i?void 0:i.tags.map((function(e){return e.id})).sort()}),[null==i?void 0:i.tags]),d=s.useCallback((function(n){var o;o=i,n.map((function(e){return e.id})).sort().join(",")!==o.tags.map((function(e){return e.id})).sort().join(",")&&r({assetCollection:i,tags:n}).then((function(){e.ok(t("actions.tagAssetCollection.success","The asset collection has been tagged"))})).catch((function(n){var r=n.message;e.error(t("actions.tagAssetCollection.error","Error while tagging the asset collection"),r)}))}),[e,i,r,t]);return i?a.createElement(c.TagSelectBox,{values:o,options:n,onChange:d}):null}))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1&&"+"!==e.substr(-1)){var t=e.split("+",2);this.subtype=t[0],this.subtypeFacets=t[0].split("."),this.suffix=t[1]}else this.subtypeFacets=e.split(".")},MediaType.prototype.hasSuffix=function(){return!!this.suffix},MediaType.prototype._firstSubtypeFacetEquals=function(e){return this.subtypeFacets.length>0&&this.subtypeFacets[0]===e},MediaType.prototype.isVendor=function(){return this._firstSubtypeFacetEquals("vnd")},MediaType.prototype.isPersonal=function(){return this._firstSubtypeFacetEquals("prs")},MediaType.prototype.isExperimental=function(){return this._firstSubtypeFacetEquals("x")||"x-"===this.subtype.substring(0,2).toLowerCase()},MediaType.prototype.asString=function(){var e="";if(this.isValid()){e=e+this.type+"/"+this.subtype,this.hasSuffix()&&(e=e+"+"+this.suffix);var t=Object.keys(this.parameters);if(t.length>0){var n=[],r=this;t.sort((function(e,t){return e.localeCompare(t)})).forEach((function(e){n.push(e+"="+wrapQuotes(r.parameters[e]))})),e=e+";"+n.join(";")}}return e};var wrapQuotes=function(e){return e.indexOf(";")>-1?'"'+e+'"':e},n=/^(application|audio|font|image|message|model|multipart|text|video|\*)\/([a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]{1,127})(;.*)?$/,r=/;(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/;t.fromString=function(e){var t=new MediaType;if(e){var i=e.match(n);!i||"*"===i[1]&&"*"!==i[2]||(t.type=i[1],t._setSubtypeAndSuffix(i[2]),i[3]&&i[3].substr(1).split(r).forEach((function(e){var n=e.split("=",2);2===n.length&&(t.parameters[n[0].toLowerCase().trim()]=function(e){return'"'===e.substr(0,1)&&'"'===e.substr(-1)?e.substr(1,e.length-2):e}(n[1].trim()))})))}return t}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(6),l=n(7),u=n(14),c=l.createUseMediaUiStyles((function(e){return{"@keyframes cssloadWidth":{"0%, 100%":{transitionTimingFunction:"cubic-bezier(1, 0, .65, .85)"},"0%":{width:0},"100%":{width:"100%"}},container:{left:0,top:0,height:"2px",position:"fixed",width:"100vw",zIndex:e.loadingIndicatorZIndex},indicator:{height:"2px",position:"relative",width:"100%"},bar:{height:"100%",position:"relative",backgroundColor:e.colors.warn,animation:"$cssloadWidth 2s cubic-bezier(.45, 0, 1, 1) infinite"}}}));t.default=function LoadingIndicator(){var e=c(),t=s.useRecoilValue(u.loadingState);return a.createElement(a.Fragment,null,t&&a.createElement("div",{className:e.container},a.createElement("div",{className:e.indicator},a.createElement("div",{className:e.bar}))))}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BottomBar=t.Pagination=t.AssetCount=void 0;var i=r(n(318));t.BottomBar=i.default;var o=r(n(137));t.Pagination=o.default;var a=r(n(136));t.AssetCount=a.default},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(7),c=n(32),d=a(n(136)),f=a(n(137)),p=u.createUseMediaUiStyles((function(e){return{bottomBar:function(t){var n=t.isInNodeCreationDialog,r=t.selectionMode;return{display:"grid",gridTemplateColumns:n||r?"repeat(3, 1fr)":"350px 1fr 350px",gridGap:e.spacing.goldenUnit,position:"fixed",bottom:n?-16:0,left:n?-16:0,right:n?-16:0,borderTop:"1px solid "+e.colors.border,backgroundColor:e.colors.moduleBackground,zIndex:e.paginationZIndex}}}}));t.default=s.memo((function(){var e=u.useMediaUi(),t=e.isInNodeCreationDialog,n=e.selectionMode,r=p({isInNodeCreationDialog:t,selectionMode:n}),i=l.useMemo((function(){return[d.default,f.default,c.ClipboardToggle]}),[]);return s.createElement("div",{className:r.bottomBar},i.map((function(e,t){return s.createElement(e,{key:t})})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7).createUseMediaUiStyles({item:{userSelect:"none","& button":{display:"flex",justifyContent:"center",alignItems:"center"}}});t.default=a.memo((function(e){var t=e.title,n=e.label,r=e.onClick,i=e.page,o=void 0===i?null:i,u=e.selected,c=void 0!==u&&u,d=e.disabled,f=void 0!==d&&d,p=e.icon,h=l();return a.createElement("li",{className:[h.item,c?h.selected:""].join(" ")},p?a.createElement(s.IconButton,{icon:p,disabled:f,size:"regular",style:"transparent",hoverStyle:"brand",title:t,onClick:function(){return r(o)}}):a.createElement(s.Button,{icon:p,disabled:f,size:"regular",style:c?"brand":"transparent",hoverStyle:"brand",title:t,onClick:function(){return r(o)}},n||o))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(8),c=n(7),d=n(14),f=n(28),p=c.createUseMediaUiStyles({searchBox:{flex:1,'& input[type="search"]':{"-webkit-appearance":"auto",width:"100%","&::-webkit-search-cancel-button":{"-webkit-appearance":"searchfield-cancel-button",cursor:"pointer"}}}});t.default=a.memo((function(){var e=p(),t=l.useRecoilState(d.searchTermState),n=t[0],r=t[1],i=l.useSetRecoilState(d.currentPageState),o=s.useState(n),h=o[0],v=o[1],y=c.useIntl().translate,m=l.useRecoilValue(f.mainViewState),b=s.useCallback((function(){r(h),i(1)}),[h,i,r]);return m!==f.MainViewState.DEFAULT?null:a.createElement("div",{className:e.searchBox},a.createElement(u.TextInput,{value:h,type:"search",onChange:function(e){return v(e)},onEnterKey:b,placeholder:y("searchBox.placeholder","Search")}))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(7),c=n(32),d=n(138),f=a(n(322)),p=u.createUseMediaUiStyles((function(e){return{topBar:{display:"flex",flexWrap:"nowrap",justifyContent:"flex-end",margin:"0 -"+e.spacing.half,paddingRight:function(t){return t.selectionMode?e.spacing.goldenUnit:null},"& > *":{margin:"0 "+e.spacing.half}}}}));t.default=s.memo((function(){var e=u.useMediaUi().selectionMode,t=p({selectionMode:e}),n=l.useMemo((function(){return[c.ClipboardActions,d.SearchBox,d.TypeFilter,f.default,d.ViewModeSelector]}),[]);return s.createElement("div",{className:t.topBar},n.map((function(e,t){return s.createElement(e,{key:t})})))}))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n *":{verticalAlign:"middle"}},previewColumn:{minWidth:e.spacing.goldenUnit,width:e.spacing.goldenUnit,cursor:"pointer","& picture":{display:"block",width:"100%",height:e.spacing.goldenUnit,textAlign:"center","& img, & svg":{display:"inline-block",width:"100%",height:"100%",objectFit:"contain"}}},labelColumn:{extend:"textColumn",display:"table",tableLayout:"fixed",width:"100%",lineHeight:e.spacing.goldenUnit,userSelect:"text","& > *":{width:"100%"}},lastModifiedColumn:{extend:"textColumn"},fileSizeColumn:{extend:"textColumn"},mediaTypeColumn:{extend:"textColumn",maxWidth:"100px",overflow:"hidden",textOverflow:"ellipsis"},actionsColumn:{extend:"textColumn",textAlign:"right"}}})),g={weekday:"short",year:"numeric",month:"short",day:"numeric"};t.default=s.memo((function(e){var t=e.assetIdentity,n=e.onSelect,r=b(),i=d.useMediaUi(),o=i.dummyImage,a=i.isAssetSelectable,_=f.useAssetQuery(t),S=_.asset,O=_.loading,E=u.useRecoilState(p.selectedAssetIdState)[0],w=(null==E?void 0:E.assetId)===t.assetId,T=l.useMemo((function(){return a(S)}),[S,a]),C=l.useCallback((function(){return n(t,w)}),[n,t,w]);return s.createElement("tr",{className:[r.listViewItem,w?r.selected:""].join(" ")},s.createElement("td",{className:r.previewColumn,onClick:C},s.createElement("picture",null,T?s.createElement("img",{src:(null==S?void 0:S.thumbnailUrl)||o,alt:null==S?void 0:S.label,width:40,height:36}):s.createElement(c.Icon,{icon:"ban",color:"error"}))),s.createElement("td",{className:r.labelColumn,onClick:C},S&&s.createElement(y.AssetLabel,{label:S.label})),s.createElement("td",{className:r.lastModifiedColumn,onClick:C},S&&new Date(S.lastModified).toLocaleString([],g)),s.createElement("td",{className:r.fileSizeColumn,onClick:C},S&&h.humanFileSize(S.file.size)),s.createElement("td",{className:r.mediaTypeColumn,onClick:C,title:null==S?void 0:S.file.mediaType},null==S?void 0:S.file.mediaType),s.createElement("td",{className:r.actionsColumn},!O&&(S?s.createElement(v.AssetActions,{asset:S}):s.createElement(m.default,{assetIdentity:t}))))}),(function(e,t){return e.assetIdentity.assetId===t.assetIdentity.assetId}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(32),p=n(39),h=n(46),v=n(40),y=a(n(329)),m=n(28),b=d.createUseMediaUiStyles({emptyStateWrapper:{display:"flex",alignItems:"center",justifyContent:"center",height:"inherit"}});t.default=s.memo((function(){var e=b(),t=h.useViewModeSelection()[0],n=d.useMediaUi().assets,r=p.useUnusedAssetsQuery().assets,i=f.useClipboard().clipboard,o=u.useRecoilValue(m.mainViewState),a=u.useSetRecoilState(f.clipboardVisibleState),g=d.useIntl().translate,_=l.useState([]),S=_[0],O=_[1],E=l.useMemo((function(){return n.filter((function(e){return null==e?void 0:e.id})).map((function(e){return{assetId:e.id,assetSourceId:e.assetSource.id}}))}),[n]),w=l.useMemo((function(){return r.filter((function(e){return null==e?void 0:e.id})).map((function(e){return{assetId:e.id,assetSourceId:e.assetSource.id}}))}),[r]);return l.useEffect((function(){o===m.MainViewState.CLIPBOARD?O(Object.values(i)):o===m.MainViewState.UNUSED_ASSETS?O(w):O(E)}),[o,E,w,i,O]),S.length>0?t===h.VIEW_MODES.List?s.createElement(v.ListView,{assetIdentities:S}):s.createElement(v.ThumbnailView,{assetIdentities:S}):s.createElement("div",{className:e.emptyStateWrapper},o===m.MainViewState.CLIPBOARD?s.createElement(c.Button,{size:"regular",style:"brand",hoverStyle:"brand",onClick:function(){return a(!1)}},g("clipboard.close","Close clipboard")):s.createElement(y.default,{loadingText:g("assetList.loading","Loading assets"),emptyText:g("assetList.empty","No assets found")}))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(6),l=n(7),u=n(14),c=l.createUseMediaUiStyles({loadingLabel:{}});t.default=a.memo((function(e){var t=e.loadingText,n=e.emptyText,r=c(),i=s.useRecoilValue(u.loadingState);return a.createElement("div",{className:r.loadingLabel},i?t:n)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(9),p=n(14),h=n(40),v=n(27),y=a(n(139)),m=d.createUseMediaUiStyles((function(e){return{thumbnail:{margin:"0",display:"flex",flexDirection:"column",position:"relative","&:hover $caption":{backgroundColor:e.colors.primary},"&:hover $toolBar":{pointerEvents:"all",backgroundColor:"rgba(0.15, 0.15, 0.15, 0.25)","& button":{opacity:1,"&[disabled]":{opacity:.5},"&.button--active":{"& svg":{color:"white"}}}}},picture:{cursor:"pointer",height:"250px",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"center",backgroundColor:e.colors.assetBackground,"& img":{display:"block",backgroundImage:"repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)",backgroundPosition:"0 0, 10px 10px",backgroundSize:"20px 20px",maxHeight:"250px"}},caption:{backgroundColor:e.colors.captionBackground,transition:"background-color "+e.transition.fast,padding:e.spacing.half,display:"flex",alignItems:"center",flex:1,"& img, & svg":{width:"1.3rem",height:"auto",marginRight:e.spacing.half}},selected:{backgroundColor:e.colors.primary},toolBar:{display:"flex",position:"absolute",top:e.spacing.quarter,right:e.spacing.quarter,pointerEvents:"none",backgroundColor:"transparent",transition:"background-color .1s ease-in","& button, & button[disabled]":{transition:"opacity .1s ease-in",opacity:0,"&.button--active":{opacity:1,"& svg":{color:e.colors.primary}}}},label:{position:"absolute",top:e.spacing.quarter,left:e.spacing.quarter,fontSize:e.fontSize.small,borderRadius:"3px",padding:"2px 4px",userSelect:"none"},disabled:{"& $picture":{filter:"grayscale(1)",cursor:"not-allowed"}}}}));t.default=s.memo((function(e){var t=e.assetIdentity,n=e.onSelect,r=m(),i=d.useIntl().translate,o=d.useMediaUi(),a=o.dummyImage,b=o.isAssetSelectable,g=f.useAssetQuery(t),_=g.asset,S=g.loading,O=u.useRecoilValue(p.selectedAssetIdState),E=(null==O?void 0:O.assetId)===t.assetId,w=l.useMemo((function(){return b(_)}),[_,b]);return s.createElement("figure",{className:[r.thumbnail,!w&&r.disabled].join(" "),title:null==_?void 0:_.label},(null==_?void 0:_.imported)&&s.createElement("span",{className:r.label},i("asset.label.imported","Imported")),s.createElement("picture",{onClick:function(){return n(t,E)},className:r.picture},s.createElement("img",{src:S||!_?a:_.thumbnailUrl,alt:null==_?void 0:_.label})),s.createElement("figcaption",{className:[r.caption,E?r.selected:""].join(" ")},_&&s.createElement(s.Fragment,null,w&&_.file?s.createElement("img",{src:_.file.typeIcon.url,alt:_.file.typeIcon.alt}):s.createElement(c.Icon,{icon:"ban",color:"error"}),s.createElement(v.AssetLabel,{label:_.label}))),s.createElement("div",{className:r.toolBar},!S&&(_?s.createElement(h.AssetActions,{asset:_}):s.createElement(y.default,{assetIdentity:t}))))}),(function(e,t){return e.assetIdentity.assetId===t.assetIdentity.assetId}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(7),c=n(9),d=n(58),f=n(40),p=u.createUseMediaUiStyles((function(e){return{thumbnailView:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridGap:e.spacing.full}}}));t.default=a.memo((function(e){var t=e.assetIdentities,n=p(),r=l.useSetRecoilState(d.selectedAssetForPreviewState),i=c.useSelectAsset(),o=s.useCallback((function(e,t){void 0===t&&(t=!1),t?r(e):i(e)}),[r,i]);return a.createElement("section",{className:n.thumbnailView},t.map((function(e,t){return a.createElement(f.Thumbnail,{key:t,assetIdentity:e,onSelect:o})})))}))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(66),l=function(e){function ErrorBoundary(t){var n=e.call(this,t)||this;return n.state={hasError:!1},n}return i(ErrorBoundary,e),ErrorBoundary.getDerivedStateFromError=function(){return{hasError:!0}},ErrorBoundary.prototype.componentDidCatch=function(e){this.context.error(e.name,e.message)},ErrorBoundary.prototype.render=function(){return this.state.hasError?a.default.createElement(a.default.Fragment,null,a.default.createElement("p",{style:{color:"red"}},"Something went wrong."),a.default.createElement("br",null),a.default.createElement("button",{className:"neos-button",onClick:function(){return window.location.reload()}},"Reload")):this.props.children},ErrorBoundary.contextType=s.NotifyContext,ErrorBoundary}(a.default.Component);t.default=l},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CreateAssetCollectionDialog=t.CreateTagDialog=void 0;var i=r(n(334));t.CreateTagDialog=i.default;var o=r(n(335));t.CreateAssetCollectionDialog=o.default},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1)return registerClass(e,t.split(" "));var r=e.options.parent;if("$"===t[0]){var i=r.getRule(t.substr(1));return!!i&&(i!==e&&(r.classes[e.key]+=" "+r.classes[i.key],!0))}return r.classes[e.key]+=" "+t,!0}(t,e.composes),delete e.composes,e):e}}},q=/[A-Z]/g,Q=/^ms-/,$={};function toHyphenLower(e){return"-"+e.toLowerCase()}var W=function hyphenateStyleName(e){if($.hasOwnProperty(e))return $[e];var t=e.replace(q,toHyphenLower);return $[e]=Q.test(t)?"-"+t:t};function convertCase(e){var t={};for(var n in e){t[0===n.indexOf("--")?n:W(n)]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(convertCase):t.fallbacks=convertCase(e.fallbacks)),t}var G=function camelCase(){return{onProcessStyle:function onProcessStyle(e){if(Array.isArray(e)){for(var t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var i=Ne[e];if(!Array.isArray(i))return pe+pascalize(i)in t&&he+i;if(!r)return!1;for(var o=0;ot?1:-1:e.length-t.length};return{onProcessStyle:function onProcessStyle(t,n){if("style"!==n.type)return t;for(var r={},i=Object.keys(t).sort(e),o=0;o1e4)&&(t=e.createStyleSheet().attach()),t};function css(){var e=arguments,t=JSON.stringify(e),o=n.get(t);if(o)return o.className;var a=[];for(var s in e){var l=e[s];if(Array.isArray(l))for(var u=0;u1&&(a.scd=function(e){for(var t={},r=0;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;var s=new Map([["avi","video/avi"],["gif","image/gif"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["mkv","video/x-matroska"],["mov","video/quicktime"],["mp4","video/mp4"],["pdf","application/pdf"],["png","image/png"],["zip","application/zip"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]]);function toFileWithPath(e,t){var n=function withMimeType(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=s.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!=typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"==typeof t?t:"string"==typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var l=[".DS_Store","Thumbs.db"];function getInputFiles(e){return(function isInput(e){return null!==e}(e.target)&&e.target.files?fromList(e.target.files):[]).map((function(e){return toFileWithPath(e)}))}function getDataTransferFiles(e,t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:return e.items?(n=fromList(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(toFilePromises))]):[3,2];case 1:return[2,noIgnoredFiles(flatten(r.sent()))];case 2:return[2,noIgnoredFiles(fromList(e.files).map((function(e){return toFileWithPath(e)})))]}}))}))}function noIgnoredFiles(e){return e.filter((function(e){return-1===l.indexOf(e.name)}))}function fromList(e){for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,f(n)];if(e.sizen)return[!1,f(n)]}return[!0,null]}function isDefined(e){return null!=e}function allFilesAccepted(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles;return!(!o&&t.length>1||o&&a>=1&&t.length>a)&&t.every((function(e){var t=_slicedToArray(fileAccepted(e,n),1)[0],o=_slicedToArray(fileMatchSize(e,r,i),1)[0];return t&&o}))}function isPropagationStopped(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function isEvtWithFiles(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function onDocumentDragOver(e){e.preventDefault()}function isIe(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function isEdge(e){return-1!==e.indexOf("Edge/")}function isIeOrEdge(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return isIe(e)||isEdge(e)}function composeEventHandlers(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),i=1;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var v=Object(r.forwardRef)((function(e,t){var n=e.children,o=useDropzone(_objectWithoutProperties(e,["children"])),a=o.open,s=_objectWithoutProperties(o,["open"]);return Object(r.useImperativeHandle)(t,(function(){return{open:a}}),[a]),i.a.createElement(r.Fragment,null,n(_objectSpread(_objectSpread({},s),{},{open:a})))}));v.displayName="Dropzone";var y={disabled:!1,getFilesFromEvent:function fromEvent(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,(n=e,n.dataTransfer&&e.dataTransfer?getDataTransferFiles(e.dataTransfer,e.type):getInputFiles(e))];var n}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null};v.defaultProps=y,v.propTypes={children:a.a.func,accept:a.a.oneOfType([a.a.string,a.a.arrayOf(a.a.string)]),multiple:a.a.bool,preventDropOnDocument:a.a.bool,noClick:a.a.bool,noKeyboard:a.a.bool,noDrag:a.a.bool,noDragEventsBubbling:a.a.bool,minSize:a.a.number,maxSize:a.a.number,maxFiles:a.a.number,disabled:a.a.bool,getFilesFromEvent:a.a.func,onFileDialogCancel:a.a.func,onDragEnter:a.a.func,onDragLeave:a.a.func,onDragOver:a.a.func,onDrop:a.a.func,onDropAccepted:a.a.func,onDropRejected:a.a.func,validator:a.a.func};t.default=v;var m={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function useDropzone(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_objectSpread(_objectSpread({},y),e),n=t.accept,i=t.disabled,o=t.getFilesFromEvent,a=t.maxSize,s=t.minSize,l=t.multiple,u=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,f=t.onDragOver,p=t.onDrop,v=t.onDropAccepted,b=t.onDropRejected,g=t.onFileDialogCancel,_=t.preventDropOnDocument,S=t.noClick,O=t.noKeyboard,E=t.noDrag,w=t.noDragEventsBubbling,T=t.validator,C=Object(r.useRef)(null),j=Object(r.useRef)(null),I=Object(r.useReducer)(reducer,m),P=es_slicedToArray(I,2),M=P[0],k=P[1],R=M.isFocused,x=M.isFileDialogActive,D=M.draggedFiles,N=Object(r.useCallback)((function(){j.current&&(k({type:"openDialog"}),j.current.value=null,j.current.click())}),[k]),L=function onWindowFocus(){x&&setTimeout((function(){j.current&&(j.current.files.length||(k({type:"closeDialog"}),"function"==typeof g&&g()))}),300)};Object(r.useEffect)((function(){return window.addEventListener("focus",L,!1),function(){window.removeEventListener("focus",L,!1)}}),[j,x,g]);var F=Object(r.useCallback)((function(e){C.current&&C.current.isEqualNode(e.target)&&(32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),N()))}),[C,j]),U=Object(r.useCallback)((function(){k({type:"focus"})}),[]),V=Object(r.useCallback)((function(){k({type:"blur"})}),[]),B=Object(r.useCallback)((function(){S||(isIeOrEdge()?setTimeout(N,0):N())}),[j,S]),q=Object(r.useRef)([]),Q=function onDocumentDrop(e){C.current&&C.current.contains(e.target)||(e.preventDefault(),q.current=[])};Object(r.useEffect)((function(){return _&&(document.addEventListener("dragover",onDocumentDragOver,!1),document.addEventListener("drop",Q,!1)),function(){_&&(document.removeEventListener("dragover",onDocumentDragOver),document.removeEventListener("drop",Q))}}),[C,_]);var $=Object(r.useCallback)((function(e){e.preventDefault(),e.persist(),Z(e),q.current=[].concat(_toConsumableArray(q.current),[e.target]),isEvtWithFiles(e)&&Promise.resolve(o(e)).then((function(t){isPropagationStopped(e)&&!w||(k({draggedFiles:t,isDragActive:!0,type:"setDraggedFiles"}),c&&c(e))}))}),[o,c,w]),W=Object(r.useCallback)((function(e){e.preventDefault(),e.persist(),Z(e);var t=isEvtWithFiles(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return t&&f&&f(e),!1}),[f,w]),G=Object(r.useCallback)((function(e){e.preventDefault(),e.persist(),Z(e);var t=q.current.filter((function(e){return C.current&&C.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),q.current=t,t.length>0||(k({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),isEvtWithFiles(e)&&d&&d(e))}),[C,d,w]),H=Object(r.useCallback)((function(e){e.preventDefault(),e.persist(),Z(e),q.current=[],isEvtWithFiles(e)&&Promise.resolve(o(e)).then((function(t){if(!isPropagationStopped(e)||w){var r=[],i=[];t.forEach((function(e){var t=es_slicedToArray(fileAccepted(e,n),2),o=t[0],l=t[1],u=es_slicedToArray(fileMatchSize(e,s,a),2),c=u[0],d=u[1],f=T?T(e):null;if(o&&c&&!f)r.push(e);else{var p=[l,d];f&&(p=p.concat(f)),i.push({file:e,errors:p.filter((function(e){return e}))})}})),(!l&&r.length>1||l&&u>=1&&r.length>u)&&(r.forEach((function(e){i.push({file:e,errors:[h]})})),r.splice(0)),k({acceptedFiles:r,fileRejections:i,type:"setFiles"}),p&&p(r,i,e),i.length>0&&b&&b(i,e),r.length>0&&v&&v(r,e)}})),k({type:"reset"})}),[l,n,s,a,u,o,p,v,b,w]),K=function composeHandler(e){return i?null:e},Y=function composeKeyboardHandler(e){return O?null:K(e)},X=function composeDragHandler(e){return E?null:K(e)},Z=function stopPropagation(e){w&&e.stopPropagation()},J=Object(r.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.onKeyDown,o=e.onFocus,a=e.onBlur,s=e.onClick,l=e.onDragEnter,u=e.onDragOver,c=e.onDragLeave,d=e.onDrop,f=_objectWithoutProperties(e,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return _objectSpread(_objectSpread(_defineProperty({onKeyDown:Y(composeEventHandlers(r,F)),onFocus:Y(composeEventHandlers(o,U)),onBlur:Y(composeEventHandlers(a,V)),onClick:K(composeEventHandlers(s,B)),onDragEnter:X(composeEventHandlers(l,$)),onDragOver:X(composeEventHandlers(u,W)),onDragLeave:X(composeEventHandlers(c,G)),onDrop:X(composeEventHandlers(d,H))},n,C),i||O?{}:{tabIndex:0}),f)}}),[C,F,U,V,B,$,W,G,H,O,E,i]),ee=Object(r.useCallback)((function(e){e.stopPropagation()}),[]),te=Object(r.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,r=void 0===t?"ref":t,i=e.onChange,o=e.onClick,a=_objectWithoutProperties(e,["refKey","onChange","onClick"]),s=_defineProperty({accept:n,multiple:l,type:"file",style:{display:"none"},onChange:K(composeEventHandlers(i,H)),onClick:K(composeEventHandlers(o,ee)),autoComplete:"off",tabIndex:-1},r,j);return _objectSpread(_objectSpread({},s),a)}}),[j,n,l,H,i]),ne=D.length,re=ne>0&&allFilesAccepted({files:D,accept:n,minSize:s,maxSize:a,multiple:l,maxFiles:u}),ie=ne>0&&!re;return _objectSpread(_objectSpread({},M),{},{isDragAccept:re,isDragReject:ie,isFocused:R&&!i,getRootProps:J,getInputProps:te,rootRef:C,inputRef:j,open:K(N)})}function reducer(e,t){switch(t.type){case"focus":return _objectSpread(_objectSpread({},e),{},{isFocused:!0});case"blur":return _objectSpread(_objectSpread({},e),{},{isFocused:!1});case"openDialog":return _objectSpread(_objectSpread({},e),{},{isFileDialogActive:!0});case"closeDialog":return _objectSpread(_objectSpread({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return _objectSpread(_objectSpread({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return _objectSpread(_objectSpread({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _objectSpread(_objectSpread({},e),{},{isFileDialogActive:!1,isDragActive:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]});default:return e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"matcher",(function(){return matcher})),n.d(t,"isMatch",(function(){return isMatch}));const r=new Map,sanitizeArray=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(e=>{if("string"!=typeof e){if(void 0===e)return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0})},makeRegexp=(e,t)=>{t={caseSensitive:!1,...t};const n=e+JSON.stringify(t);if(r.has(n))return r.get(n);const i="!"===e[0];i&&(e=e.slice(1)),e=function escapeStringRegexp(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e).replace(/\\\*/g,"[\\s\\S]*");const o=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return o.negated=i,r.set(n,o),o},baseMatcher=(e,t,n,r)=>{if(e=sanitizeArray(e,"inputs"),0===(t=sanitizeArray(t,"patterns")).length)return[];t=t.map(e=>makeRegexp(e,n));const{allPatterns:i}=n||{},o=[];for(const n of e){let e;const a=[...t].fill(!1);for(const[r,i]of t.entries())if(i.test(n)&&(a[r]=!0,e=!i.negated,!e))break;if(!(!1===e||void 0===e&&t.some(e=>!e.negated)||i&&a.some((e,n)=>!e&&!t[n].negated))&&(o.push(n),r))break}return o};function matcher(e,t,n){return baseMatcher(e,t,n,!1)}function isMatch(e,t,n){return baseMatcher(e,t,n,!0).length>0}}]); +!function(e){var t={};function __webpack_require__(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)__webpack_require__.d(n,r,function(t){return e[t]}.bind(null,r));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=150)}([function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(31));e.exports=(0,r.default)("vendor")().React},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return __extends})),n.d(t,"__assign",(function(){return __assign})),n.d(t,"__rest",(function(){return __rest})),n.d(t,"__decorate",(function(){return __decorate})),n.d(t,"__param",(function(){return __param})),n.d(t,"__metadata",(function(){return __metadata})),n.d(t,"__awaiter",(function(){return __awaiter})),n.d(t,"__generator",(function(){return __generator})),n.d(t,"__createBinding",(function(){return __createBinding})),n.d(t,"__exportStar",(function(){return __exportStar})),n.d(t,"__values",(function(){return __values})),n.d(t,"__read",(function(){return __read})),n.d(t,"__spread",(function(){return __spread})),n.d(t,"__spreadArrays",(function(){return __spreadArrays})),n.d(t,"__await",(function(){return __await})),n.d(t,"__asyncGenerator",(function(){return __asyncGenerator})),n.d(t,"__asyncDelegator",(function(){return __asyncDelegator})),n.d(t,"__asyncValues",(function(){return __asyncValues})),n.d(t,"__makeTemplateObject",(function(){return __makeTemplateObject})),n.d(t,"__importStar",(function(){return __importStar})),n.d(t,"__importDefault",(function(){return __importDefault})),n.d(t,"__classPrivateFieldGet",(function(){return __classPrivateFieldGet})),n.d(t,"__classPrivateFieldSet",(function(){return __classPrivateFieldSet}));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return(__assign=Object.assign||function __assign(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function __param(e,t){return function(n,r){t(n,r,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(i,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(s){return function step(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function __spread(){for(var e=[],t=0;t1||resume(e,t)}))})}function resume(e,t){try{!function step(e){e.value instanceof __await?Promise.resolve(e.value.v).then(fulfill,reject):settle(o[0][2],e)}(i[e](t))}catch(e){settle(o[0][3],e)}}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){e(t),o.shift(),o.length&&resume(o[0][0],o[0][1])}}function __asyncDelegator(e){var t,n;return t={},verb("next"),verb("throw",(function(e){throw e})),verb("return"),t[Symbol.iterator]=function(){return this},t;function verb(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:__await(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=__values(e),t={},verb("next"),verb("throw"),verb("return"),t[Symbol.asyncIterator]=function(){return this},t);function verb(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function settle(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";n.d(t,"L",(function(){return shouldInclude})),n.d(t,"y",(function(){return hasDirectives})),n.d(t,"x",(function(){return hasClientExports})),n.d(t,"k",(function(){return createFragmentMap})),n.d(t,"p",(function(){return getFragmentQueryDocument})),n.d(t,"o",(function(){return getFragmentFromSelection})),n.d(t,"r",(function(){return getOperationDefinition})),n.d(t,"s",(function(){return getOperationName})),n.d(t,"n",(function(){return getFragmentDefinitions})),n.d(t,"t",(function(){return getQueryDefinition})),n.d(t,"q",(function(){return getMainDefinition})),n.d(t,"m",(function(){return getDefaultValues})),n.d(t,"E",(function(){return makeReference})),n.d(t,"C",(function(){return storeUtils_isReference})),n.d(t,"z",(function(){return isField})),n.d(t,"A",(function(){return isInlineFragment})),n.d(t,"M",(function(){return storeKeyNameFromField})),n.d(t,"e",(function(){return argumentsObjectFromField})),n.d(t,"K",(function(){return resultKeyNameFromField})),n.d(t,"u",(function(){return getStoreKeyName})),n.d(t,"v",(function(){return getTypenameFromResult})),n.d(t,"d",(function(){return addTypenameToDocument})),n.d(t,"g",(function(){return buildQueryFromSelectionSet})),n.d(t,"J",(function(){return removeConnectionDirectiveFromDocument})),n.d(t,"I",(function(){return removeClientSetsFromDocument})),n.d(t,"c",(function(){return h.a})),n.d(t,"G",(function(){return mergeDeep})),n.d(t,"H",(function(){return mergeDeepArray})),n.d(t,"b",(function(){return f})),n.d(t,"i",(function(){return cloneDeep})),n.d(t,"F",(function(){return maybeDeepFreeze})),n.d(t,"D",(function(){return iterateObserversSafely})),n.d(t,"f",(function(){return asyncMap})),n.d(t,"a",(function(){return m})),n.d(t,"l",(function(){return fixObservableSubclass})),n.d(t,"B",(function(){return isNonEmptyArray})),n.d(t,"w",(function(){return graphQLResultHasError})),n.d(t,"h",(function(){return b})),n.d(t,"j",(function(){return compact}));var r=n(144),i=n(3);function shouldInclude(e,t){var n=e.directives;return!n||!n.length||function getInclusionDirectives(e){var t=[];e&&e.length&&e.forEach((function(e){if(function isInclusionDirective(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments;e.name.value;Object(i.b)(n&&1===n.length,39);var r=n[0];Object(i.b)(r.name&&"if"===r.name.value,40);var o=r.value;Object(i.b)(o&&("Variable"===o.kind||"BooleanValue"===o.kind),41),t.push({directive:e,ifArgument:r})}}));return t}(n).every((function(e){var n=e.directive,r=e.ifArgument,o=!1;return"Variable"===r.value.kind?(o=t&&t[r.value.name.value],Object(i.b)(void 0!==o,38)):o=r.value.value,"skip"===n.name.value?!o:o}))}function hasDirectives(e,t){return function getDirectiveNames(e){var t=[];return Object(r.b)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function hasClientExports(e){return e&&hasDirectives(["client"],e)&&hasDirectives(["export"],e)}var o=n(1);function getFragmentQueryDocument(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.a(42);"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(Object(i.b)(1===r.length,43),n=r[0].name.value),Object(o.__assign)(Object(o.__assign)({},e),{definitions:Object(o.__spreadArrays)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions)})}function createFragmentMap(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function getFragmentFromSelection(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=t&&t[e.name.value];return Object(i.b)(n,44),n;default:return null}}var a=n(145),s=n.n(a);function makeReference(e){return{__ref:String(e)}}function storeUtils_isReference(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function valueToObjectRepresentation(e,t,n,r){if(function isIntValue(e){return"IntValue"===e.kind}(n)||function isFloatValue(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function isBooleanValue(e){return"BooleanValue"===e.kind}(n)||function isStringValue(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function isObjectValue(e){return"ObjectValue"===e.kind}(n)){var o={};n.fields.map((function(e){return valueToObjectRepresentation(o,e.name,e.value,r)})),e[t.value]=o}else if(function isVariable(e){return"Variable"===e.kind}(n)){var a=(r||{})[n.name.value];e[t.value]=a}else if(function isListValue(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return valueToObjectRepresentation(n,t,e,r),n[t.value]}));else if(function isEnumValue(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function isNullValue(e){return"NullValue"===e.kind}(n))throw new i.a(53);e[t.value]=null}}function storeKeyNameFromField(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var i=r.name,o=r.value;return valueToObjectRepresentation(n[e.name.value],i,o,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,i=e.value;return valueToObjectRepresentation(r,n,i,t)}))),getStoreKeyName(e.name.value,r,n)}var l=["connection","include","skip","client","rest","export"];function getStoreKeyName(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),n.connection.key+"("+JSON.stringify(i)+")"}return n.connection.key}var o=e;if(t){var a=s()(t);o+="("+a+")"}return n&&Object.keys(n).forEach((function(e){-1===l.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@"+e+"("+JSON.stringify(n[e])+")":o+="@"+e)})),o}function argumentsObjectFromField(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return valueToObjectRepresentation(n,r,i,t)})),n}return null}function resultKeyNameFromField(e){return e.alias?e.alias.value:e.name.value}function getTypenameFromResult(e,t,n){if("string"==typeof e.__typename)return e.__typename;for(var r=0,i=t.selections;r1)for(var r=new f,i=1;i0}function graphQLResultHasError(e){return e.errors&&e.errors.length>0||!1}fixObservableSubclass(m);var b="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function compact(){for(var e=[],t=0;t=l)return console[e].apply(console,arguments)}}function setVerbosity(e){var t=s[l];return l=Math.max(0,s.indexOf(e)),t}!function(e){e.log=wrapConsoleMethod("log"),e.warn=wrapConsoleMethod("warn"),e.error=wrapConsoleMethod("error")}(invariant||(invariant={}));"object"==typeof e&&e.env}).call(this,n(88))},function(e,t,n){"use strict";n.r(t);var r=n(30);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);var o=n(98);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i)},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(31));e.exports=(0,r.default)("vendor")().PropTypes},function(e,t,n){"use strict";n.r(t),n.d(t,"DefaultValue",(function(){return Jr})),n.d(t,"RecoilRoot",(function(){return ei})),n.d(t,"atom",(function(){return ni})),n.d(t,"atomFamily",(function(){return oi})),n.d(t,"batchUpdates",(function(){return Pi})),n.d(t,"constSelector",(function(){return si})),n.d(t,"errorSelector",(function(){return li})),n.d(t,"isRecoilValue",(function(){return Ii})),n.d(t,"noWait",(function(){return wi})),n.d(t,"readOnlySelector",(function(){return ui})),n.d(t,"retentionZone",(function(){return ii})),n.d(t,"selector",(function(){return ri})),n.d(t,"selectorFamily",(function(){return ai})),n.d(t,"setBatcher",(function(){return Mi})),n.d(t,"snapshot_UNSTABLE",(function(){return ki})),n.d(t,"useGetRecoilValueInfo_UNSTABLE",(function(){return yi})),n.d(t,"useGotoRecoilSnapshot",(function(){return gi})),n.d(t,"useRecoilBridgeAcrossReactRoots_UNSTABLE",(function(){return ti})),n.d(t,"useRecoilCallback",(function(){return bi})),n.d(t,"useRecoilSnapshot",(function(){return _i})),n.d(t,"useRecoilState",(function(){return fi})),n.d(t,"useRecoilStateLoadable",(function(){return pi})),n.d(t,"useRecoilTransactionObserver_UNSTABLE",(function(){return Si})),n.d(t,"useRecoilValue",(function(){return ci})),n.d(t,"useRecoilValueLoadable",(function(){return di})),n.d(t,"useResetRecoilState",(function(){return vi})),n.d(t,"useRetain",(function(){return mi})),n.d(t,"useSetRecoilState",(function(){return hi})),n.d(t,"useSetUnvalidatedAtomValues_UNSTABLE",(function(){return Ei})),n.d(t,"useTransactionObservation_UNSTABLE",(function(){return Oi})),n.d(t,"waitForAll",(function(){return Ai})),n.d(t,"waitForAllSettled",(function(){return ji})),n.d(t,"waitForAny",(function(){return Ci})),n.d(t,"waitForNone",(function(){return Ti}));var r=n(59),i=n.n(r),o=n(0),a=n.n(o);var s=function nullthrows(e,t){if(null!=e)return e;throw new Error(null!=t?t:"Got unexpected null or undefined")};var l=function recoverableViolation(e,t,{error:n}={}){return null};var u={setByAddingToSet:function setByAddingToSet(e,t){const n=new Set(e);return n.add(t),n},setByDeletingFromSet:function setByDeletingFromSet(e,t){const n=new Set(e);return n.delete(t),n},mapBySettingInMap:function mapBySettingInMap(e,t,n){const r=new Map(e);return r.set(t,n),r},mapByUpdatingInMap:function mapByUpdatingInMap(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r},mapByDeletingFromMap:function mapByDeletingFromMap(e,t){const n=new Map(e);return n.delete(t),n},mapByDeletingMultipleFromMap:function mapByDeletingMultipleFromMap(e,t){const n=new Map(e);return t.forEach(e=>n.delete(e)),n}};var c=function*filterIterable(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)};const d=(new Map).set("recoil_hamt_2020",!0);function Recoil_gkx(e){var t;return null!==(t=d.get(e))&&void 0!==t&&t}Recoil_gkx.setPass=e=>{d.set(e,!0)},Recoil_gkx.setFail=e=>{d.set(e,!1)};var f=Recoil_gkx;var p=function mapIterable(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()};var h=function expectationViolation(e,...t){0};function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class AbstractRecoilValue{constructor(e){_defineProperty(this,"key",void 0),this.key=e}}class RecoilState extends AbstractRecoilValue{}class RecoilValueReadOnly extends AbstractRecoilValue{}var v={AbstractRecoilValue:AbstractRecoilValue,RecoilState:RecoilState,RecoilValueReadOnly:RecoilValueReadOnly,isRecoilValue:function isRecoilValue(e){return e instanceof RecoilState||e instanceof RecoilValueReadOnly}},y=v.AbstractRecoilValue,m=v.RecoilState,b=v.RecoilValueReadOnly,g=v.isRecoilValue,_=Object.freeze({__proto__:null,AbstractRecoilValue:y,RecoilState:m,RecoilValueReadOnly:b,isRecoilValue:g});class DefaultValue{}const S=new DefaultValue;class RecoilValueNotReady extends Error{constructor(e){super(`Tried to set the value of Recoil selector ${e} using an updater function, but it is an async selector in a pending or error state; this is not supported.`)}}const O=new Map,E=new Map;class NodeMissingError extends Error{}const w=new Map;function getConfigDeletionHandler(e){return w.get(e)}var T={nodes:O,recoilValues:E,registerNode:function registerNode(e){if(O.has(e.key)){const t=`Duplicate atom key "${e.key}". This is a FATAL ERROR in\n production. But it is safe to ignore this warning if it occurred because of\n hot module replacement.`;console.warn(t)}O.set(e.key,e);const t=null==e.set?new _.RecoilValueReadOnly(e.key):new _.RecoilState(e.key);return E.set(e.key,t),t},getNode:function getNode(e){const t=O.get(e);if(null==t)throw new NodeMissingError(`Missing definition for RecoilValue: "${e}""`);return t},getNodeMaybe:function getNodeMaybe(e){return O.get(e)},deleteNodeConfigIfPossible:function deleteNodeConfigIfPossible(e){var t;if(!f("recoil_memory_managament_2020"))return;const n=O.get(e);var r;(null==n||null===(t=n.shouldDeleteConfigOnRelease)||void 0===t?void 0:t.call(n))&&(O.delete(e),null===(r=getConfigDeletionHandler(e))||void 0===r||r(),w.delete(e))},setConfigDeletionHandler:function setConfigDeletionHandler(e,t){f("recoil_memory_managament_2020")&&(void 0===t?w.delete(e):w.set(e,t))},getConfigDeletionHandler:getConfigDeletionHandler,recoilValuesForKeys:function recoilValuesForKeys(e){return p(e,e=>s(E.get(e)))},NodeMissingError:NodeMissingError,DefaultValue:DefaultValue,DEFAULT_VALUE:S,RecoilValueNotReady:RecoilValueNotReady};class RetentionZone{}var C={RetentionZone:RetentionZone,retentionZone:function retentionZone(){return new RetentionZone}};const{setByAddingToSet:j}=u,{getNode:I,getNodeMaybe:P,recoilValuesForKeys:M}=T,{RetentionZone:k}=C,R=Object.freeze(new Set);class ReadOnlyRecoilValueError extends Error{}function initializeNodeIfNewToStore(e,t,n,r){const i=e.getState();if(i.nodeCleanupFunctions.has(n))return;const o=I(n),a=function initializeRetentionForNode(e,t,n){if(!f("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function addToZone(e){let n=r.get(e);n||r.set(e,n=new Set),n.add(t)}if(n instanceof k)addToZone(n);else if(Array.isArray(n))for(const e of n)addToZone(e);return()=>{if(!f("recoil_memory_managament_2020"))return;const r=e.getState().retention.nodesRetainedByZone;function deleteFromZone(e){const n=r.get(e);n&&n.delete(t),n&&0===n.size&&r.delete(e)}if(n instanceof k)deleteFromZone(n);else if(Array.isArray(n))for(const e of n)deleteFromZone(e)}}(e,n,o.retainedBy),s=o.init(e,t,r);i.nodeCleanupFunctions.set(n,()=>{s(),a()})}function peekNodeLoadable(e,t,n){return I(n).peek(e,t)}function getDownstreamNodes(e,t,n){const r=new Set,i=Array.from(n),o=e.getGraph(t.version);for(let e=i.pop();e;e=i.pop()){var a;r.add(e);const t=null!==(a=o.nodeToNodeSubscriptions.get(e))&&void 0!==a?a:R;for(const e of t)r.has(e)||i.push(e)}return r}var x={getNodeLoadable:function getNodeLoadable(e,t,n){return initializeNodeIfNewToStore(e,t,n,"get"),I(n).get(e,t)},peekNodeLoadable:peekNodeLoadable,setNodeValue:function setNodeValue(e,t,n,r){const i=I(n);if(null==i.set)throw new ReadOnlyRecoilValueError("Attempt to set read-only RecoilValue: "+n);const o=i.set;return initializeNodeIfNewToStore(e,t,n,"set"),o(e,t,r)},cleanUpNode:function cleanUpNode(e,t){var n;const r=e.getState();null===(n=r.nodeCleanupFunctions.get(t))||void 0===n||n(),r.nodeCleanupFunctions.delete(t)},setUnvalidatedAtomValue_DEPRECATED:function setUnvalidatedAtomValue_DEPRECATED(e,t,n){var r;const i=P(t);return null==i||null===(r=i.invalidate)||void 0===r||r.call(i,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:j(e.dirtyAtoms,t)}},peekNodeInfo:function peekNodeInfo(e,t,n){var r,i,o;const a=e.getState(),s=e.getGraph(t.version),l=a.knownAtoms.has(n)?"atom":a.knownSelectors.has(n)?"selector":void 0,u=c(getDownstreamNodes(e,t,new Set([n])),e=>e!==n);return{loadable:peekNodeLoadable(e,t,n),isActive:a.knownAtoms.has(n)||a.knownSelectors.has(n),isSet:"selector"!==l&&t.atomValues.has(n),isModified:t.dirtyAtoms.has(n),type:l,deps:M(null!==(r=s.nodeDeps.get(n))&&void 0!==r?r:[]),subscribers:{nodes:M(u),components:p(null!==(i=null===(o=a.nodeToComponentSubscriptions.get(n))||void 0===o?void 0:o.values())&&void 0!==i?i:[],([e])=>({name:e}))}}},getDownstreamNodes:getDownstreamNodes,initializeNodeIfNewToStore:initializeNodeIfNewToStore};const{getDownstreamNodes:D,getNodeLoadable:N,setNodeValue:L}=x,{getNodeMaybe:F}=T,{DefaultValue:U,RecoilValueNotReady:V}=T,{AbstractRecoilValue:B,RecoilState:q,RecoilValueReadOnly:Q,isRecoilValue:$}=_;function applyAction(e,t,n){if("set"===n.type){const{recoilValue:r,valueOrUpdater:i}=n,o=function valueFromValueOrUpdater(e,t,{key:n},r){if("function"==typeof r){const i=N(e,t,n);if("loading"===i.state)throw new V(n);if("hasError"===i.state)throw i.contents;return r(i.contents)}return r}(e,t,r,i),a=L(e,t,r.key,o);for(const[e,n]of a.entries())writeLoadableToTreeState(t,e,n)}else if("setLoadable"===n.type){const{recoilValue:{key:e},loadable:r}=n;writeLoadableToTreeState(t,e,r)}else if("markModified"===n.type){const{recoilValue:{key:e}}=n;t.dirtyAtoms.add(e)}else if("setUnvalidated"===n.type){var r;const{recoilValue:{key:e},unvalidatedValue:i}=n,o=F(e);null==o||null===(r=o.invalidate)||void 0===r||r.call(o,t),t.atomValues.delete(e),t.nonvalidatedAtoms.set(e,i),t.dirtyAtoms.add(e)}else l("Unknown action "+n.type)}function writeLoadableToTreeState(e,t,n){"hasValue"===n.state&&n.contents instanceof U?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function applyActionsToStore(e,t){e.replaceState(n=>{const r=function copyTreeState(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}(n);for(const n of t)applyAction(e,r,n);return invalidateDownstreams(e,r),r})}function queueOrPerformStateUpdate(e,t){if(W.length){const n=W[W.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else applyActionsToStore(e,[t])}const W=[];function invalidateDownstreams(e,t){const n=D(e,t,t.dirtyAtoms);for(const e of n){var r,i;null===(r=F(e))||void 0===r||null===(i=r.invalidate)||void 0===i||i.call(r,t)}}function setRecoilValue(e,t,n){queueOrPerformStateUpdate(e,{type:"set",recoilValue:t,valueOrUpdater:n})}let G=0;var H={RecoilValueReadOnly:Q,AbstractRecoilValue:B,RecoilState:q,getRecoilValueAsLoadable:function getRecoilValueAsLoadable(e,{key:t},n=e.getState().currentTree){var r,i;const o=e.getState();return n.version!==o.currentTree.version&&n.version!==(null===(r=o.nextTree)||void 0===r?void 0:r.version)&&n.version!==(null===(i=o.previousTree)||void 0===i?void 0:i.version)&&l("Tried to read from a discarded tree"),N(e,n,t)},setRecoilValue:setRecoilValue,setRecoilValueLoadable:function setRecoilValueLoadable(e,t,n){if(n instanceof U)return setRecoilValue(e,t,n);queueOrPerformStateUpdate(e,{type:"setLoadable",recoilValue:t,loadable:n})},markRecoilValueModified:function markRecoilValueModified(e,t){queueOrPerformStateUpdate(e,{type:"markModified",recoilValue:t})},setUnvalidatedRecoilValue:function setUnvalidatedRecoilValue(e,t,n){queueOrPerformStateUpdate(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})},subscribeToRecoilValue:function subscribeToRecoilValue(e,{key:t},n,r=null){const i=G++,o=e.getState();return o.nodeToComponentSubscriptions.has(t)||o.nodeToComponentSubscriptions.set(t,new Map),s(o.nodeToComponentSubscriptions.get(t)).set(i,[null!=r?r:"",n]),{release:()=>{const n=e.getState(),r=n.nodeToComponentSubscriptions.get(t);void 0!==r&&r.has(i)?(r.delete(i),0===r.size&&n.nodeToComponentSubscriptions.delete(t)):l(`Subscription missing at release time for atom ${t}. This is a bug in Recoil.`)}}},isRecoilValue:$,applyAtomValueWrites:function applyAtomValueWrites(e,t){const n=e.clone();return t.forEach((e,t)=>{"hasValue"===e.state&&e.contents instanceof U?n.delete(t):n.set(t,e)}),n},batchStart:function batchStart(){const e=new Map;return W.push(e),()=>{for(const[t,n]of e)applyActionsToStore(t,n);W.pop()!==e&&l("Incorrect order of batch popping")}},invalidateDownstreams_FOR_TESTING:invalidateDownstreams};const{unstable_batchedUpdates:K}=i.a;var Y={unstable_batchedUpdates:K};const{unstable_batchedUpdates:X}=Y;var Z={unstable_batchedUpdates:X};const{batchStart:J}=H,{unstable_batchedUpdates:ee}=Z;let te=ee;var ne={getBatcher:()=>te,setBatcher:e=>{te=e},batchUpdates:e=>{te(()=>{let batchEnd=()=>{};try{batchEnd=J(),e()}finally{batchEnd()}})}};var re={enqueueExecution:function enqueueExecution(e,t){t()}};var ie=function differenceSets(e,...t){const n=new Set;e:for(const r of e){for(const e of t)if(e.has(r))continue e;n.add(r)}return n};var oe=function mapMap(e,t){const n=new Map;return e.forEach((e,r)=>{n.set(r,t(e,r))}),n};function mergeDependencyMapIntoGraph(e,t,n){const{nodeDeps:r,nodeToNodeSubscriptions:i}=t;e.forEach((e,t)=>{const o=r.get(t);if(o&&n&&o!==n.nodeDeps.get(t))return;r.set(t,new Set(e));if((null==o?e:ie(e,o)).forEach(e=>{i.has(e)||i.set(e,new Set);s(i.get(e)).add(t)}),o){ie(o,e).forEach(e=>{if(!i.has(e))return;const n=s(i.get(e));n.delete(t),0===n.size&&i.delete(e)})}})}var ae={addToDependencyMap:function addToDependencyMap(e,t,n){n.has(e)||n.set(e,new Set),s(n.get(e)).add(t)},cloneGraph:function cloneGraph(e){return{nodeDeps:oe(e.nodeDeps,e=>new Set(e)),nodeToNodeSubscriptions:oe(e.nodeToNodeSubscriptions,e=>new Set(e))}},graph:function graph(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}},mergeDepsIntoDependencyMap:function mergeDepsIntoDependencyMap(e,t){e.forEach((e,n)=>{t.has(n)||t.set(n,new Set);const r=s(t.get(n));e.forEach(e=>r.add(e))})},saveDependencyMapToStore:function saveDependencyMapToStore(e,t,n){var r,i,o,a;const s=t.getState();n!==s.currentTree.version&&n!==(null===(r=s.nextTree)||void 0===r?void 0:r.version)&&n!==(null===(i=s.previousTree)||void 0===i?void 0:i.version)&&l("Tried to save dependencies to a discarded tree");const u=t.getGraph(n);if(mergeDependencyMapIntoGraph(e,u),n===(null===(o=s.previousTree)||void 0===o?void 0:o.version)){mergeDependencyMapIntoGraph(e,t.getGraph(s.currentTree.version),u)}if(n===(null===(a=s.previousTree)||void 0===a?void 0:a.version)||n===s.currentTree.version){var c;const n=null===(c=s.nextTree)||void 0===c?void 0:c.version;if(void 0!==n){mergeDependencyMapIntoGraph(e,t.getGraph(n),u)}}}};var se=function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n={},r=Math.pow(2,5),i=r-1,o=r/2,a=r/4,s={},l=function constant(e){return function(){return e}},u=n.hash=function(e){var n=void 0===e?"undefined":t(e);if("number"===n)return e;"string"!==n&&(e+="");for(var r=0,i=0,o=e.length;i>>e&i},d=function toBitmap(e){return 1<>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}(e&t-1)},p=function arrayUpdate(e,t,n,r){var i=r;if(!e){var o=r.length;i=new Array(o);for(var a=0;a1?b(e,this.hash,l):l[0]}var u=r();return u===s?this:(++a.value,S(e,n,this.hash,this,i,m(e,i,o,u)))},T=function IndexedNode__modify(e,t,n,r,i,a,s){var l=this.mask,u=this.children,m=c(n,i),b=d(m),S=f(l,b),E=l&b,w=E?u[S]:v,T=w._modify(e,t,n+5,r,i,a,s);if(w===T)return this;var C=O(e,this),j=l,I=void 0;if(E&&y(T)){if(!(j&=~b))return v;if(u.length<=2&&function isLeaf(e){return e===v||1===e.type||2===e.type}(u[1^S]))return u[1^S];I=h(C,S,u)}else if(E||y(T))I=p(C,S,T,u);else{if(u.length>=o)return function expand(e,t,n,r,i){for(var o=[],a=r,s=0,l=0;a;++l)1&a&&(o[l]=i[s++]),a>>>=1;return o[t]=n,_(e,s+1,o)}(e,m,T,l,u);j|=b,I=function arraySpliceIn(e,t,n,r){var i=r.length;if(e){for(var o=i;o>=t;)r[o--]=r[o];return r[t]=n,r}for(var a=0,s=0,l=new Array(i+1);afe++;function makeEmptyTreeState(){const e=getNextTreeStateVersion();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:de(),nonvalidatedAtoms:de()}}var pe={makeEmptyTreeState:makeEmptyTreeState,makeEmptyStoreState:function makeEmptyStoreState(){const e=makeEmptyTreeState();return{currentTree:e,nextTree:null,previousTree:null,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:(new Map).set(e.version,ce()),versionsUsedByComponent:new Map,retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}},getNextTreeStateVersion:getNextTreeStateVersion};var he=function unionSets(...e){const t=new Set;for(const n of e)for(const e of n)t.add(e);return t};var ve=function someSet(e,t,n){const r=e.entries();let i=r.next();for(;!i.done;){const o=i.value;if(t.call(n,o[1],o[0],e))return!0;i=r.next()}return!1};const{cleanUpNode:ye}=x,{deleteNodeConfigIfPossible:me,getNode:be}=T,{RetentionZone:ge}=C,_e=new Set;function releaseRetainablesNowOnCurrentTree(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return void l("releaseNodesNowOnCurrentTree should only be called at the end of a batch");const i=new Set;for(const e of t)if(e instanceof ge)for(const t of nodesRetainedByZone(n,e))i.add(t);else i.add(e);const o=function findReleasableNodes(e,t){const n=e.getState(),r=n.currentTree,i=e.getGraph(r.version),o=new Set,a=new Set;return findReleasableNodesInner(t),o;function findReleasableNodesInner(t){const l=new Set,u=function getDownstreamNodesInTopologicalOrder(e,t,n,r,i){const o=e.getGraph(t.version),a=[],l=new Set;for(;n.size>0;)visit(s(n.values().next().value));return a;function visit(e){if(r.has(e)||i.has(e))return void n.delete(e);if(l.has(e))return;const t=o.nodeToNodeSubscriptions.get(e);if(t)for(const e of t)visit(e);l.add(e),n.delete(e),a.push(e)}}(e,r,t,o,a);for(const e of u){var c;if("recoilRoot"===be(e).retainedBy){a.add(e);continue}if((null!==(c=n.retention.referenceCounts.get(e))&&void 0!==c?c:0)>0){a.add(e);continue}if(zonesThatCouldRetainNode(e).some(e=>n.retention.referenceCounts.get(e))){a.add(e);continue}const t=i.nodeToNodeSubscriptions.get(e);t&&ve(t,e=>a.has(e))?a.add(e):(o.add(e),l.add(e))}const d=new Set;for(const e of l)for(const t of null!==(f=i.nodeDeps.get(e))&&void 0!==f?f:_e){var f;o.has(t)||d.add(t)}d.size&&findReleasableNodesInner(d)}}(e,i);for(const t of o)releaseNode(e,r,t)}function releaseNode(e,t,n){if(!f("recoil_memory_managament_2020"))return;ye(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const i=zonesThatCouldRetainNode(n);for(const e of i){var o;null===(o=r.retention.nodesRetainedByZone.get(e))||void 0===o||o.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const a=r.graphsByVersion.get(t.version);if(a){const e=a.nodeDeps.get(n);if(void 0!==e){a.nodeDeps.delete(n);for(const t of e){var s;null===(s=a.nodeToNodeSubscriptions.get(t))||void 0===s||s.delete(n)}}a.nodeToNodeSubscriptions.delete(n)}me(n)}function nodesRetainedByZone(e,t){var n;return null!==(n=e.retention.nodesRetainedByZone.get(t))&&void 0!==n?n:_e}function zonesThatCouldRetainNode(e){const t=be(e).retainedBy;return void 0===t||"components"===t||"recoilRoot"===t?[]:t instanceof ge?[t]:t}var Se={updateRetainCount:function updateRetainCount(e,t,n){var r;if(!f("recoil_memory_managament_2020"))return;const i=e.getState().retention.referenceCounts,o=(null!==(r=i.get(t))&&void 0!==r?r:0)+n;0===o?(i.delete(t),function scheduleOrPerformPossibleReleaseOfRetainable(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):releaseRetainablesNowOnCurrentTree(e,new Set([t]))}(e,t)):i.set(t,o)},releaseScheduledRetainablesNow:function releaseScheduledRetainablesNow(e){if(!f("recoil_memory_managament_2020"))return;const t=e.getState();releaseRetainablesNowOnCurrentTree(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()},retainedByOptionWithDefault:function retainedByOptionWithDefault(e){return void 0===e?"recoilRoot":e}};var Oe=function*concatIterables(e){for(const t of e)for(const e of t)yield e};var Ee={isSSR:"undefined"==typeof window,isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product};const{isSSR:we}=Ee,{batchUpdates:Te}=ne,{initializeNodeIfNewToStore:Ce,peekNodeInfo:Ae}=x,{graph:je}=ae,{DEFAULT_VALUE:Ie,recoilValues:Pe,recoilValuesForKeys:Me}=T,{AbstractRecoilValue:ke,getRecoilValueAsLoadable:Re,setRecoilValue:xe,setUnvalidatedRecoilValue:De}=H,{getNextTreeStateVersion:Ne,makeEmptyStoreState:Le}=pe;class Snapshot{constructor(e){_defineProperty(this,"_store",void 0),_defineProperty(this,"_refCount",0),_defineProperty(this,"getLoadable",e=>(this.checkRefCount_INTERNAL(),Re(this._store,e))),_defineProperty(this,"getPromise",e=>(this.checkRefCount_INTERNAL(),this.getLoadable(e).toPromise())),_defineProperty(this,"getNodes_UNSTABLE",e=>{if(this.checkRefCount_INTERNAL(),!0===(null==e?void 0:e.isModified)){if(!1===(null==e?void 0:e.isInitialized))return[];const t=this._store.getState().currentTree;return Me(t.dirtyAtoms)}const t=this._store.getState().knownAtoms,n=this._store.getState().knownSelectors;return null==(null==e?void 0:e.isInitialized)?Pe.values():!0===e.isInitialized?Me(Oe([this._store.getState().knownAtoms,this._store.getState().knownSelectors])):c(Pe.values(),({key:e})=>!t.has(e)&&!n.has(e))}),_defineProperty(this,"getInfo_UNSTABLE",({key:e})=>(this.checkRefCount_INTERNAL(),Ae(this._store,this._store.getState().currentTree,e))),_defineProperty(this,"map",e=>{this.checkRefCount_INTERNAL();const t=new MutableSnapshot(this);return e(t),cloneSnapshot(t.getStore_INTERNAL())}),_defineProperty(this,"asyncMap",async e=>{this.checkRefCount_INTERNAL();const t=new MutableSnapshot(this);return await e(t),cloneSnapshot(t.getStore_INTERNAL())}),this._store={getState:()=>e,replaceState:t=>{e.currentTree=t(e.currentTree)},getGraph:t=>{const n=e.graphsByVersion;if(n.has(t))return s(n.get(t));const r=je();return n.set(t,r),r},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw new Error("Cannot subscribe to Snapshots")}};for(const t of this._store.getState().nodeCleanupFunctions.keys())Ce(this._store,e.currentTree,t,"get");this.retain(),this.autorelease()}retain(){if(!f("recoil_memory_managament_2020"))return()=>{};this._refCount++;let e=!1;return()=>{e||(e=!0,this.release())}}autorelease(){f("recoil_memory_managament_2020")&&(we||window.setTimeout(()=>this.release(),0))}release(){f("recoil_memory_managament_2020")&&(this._refCount--,this._refCount)}checkRefCount_INTERNAL(){f("recoil_memory_managament_2020")&&this._refCount}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this.getID_INTERNAL()}getID_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}}function cloneStoreState(e,t,n=!1){const r=e.getState(),i=n?Ne():t.version;return{currentTree:n?{version:i,stateID:i,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()}:t,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:(new Map).set(i,e.getGraph(t.version)),versionsUsedByComponent:new Map,retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}function cloneSnapshot(e,t="current"){const n=e.getState(),r="current"===t?n.currentTree:s(n.previousTree);return new Snapshot(cloneStoreState(e,r))}class MutableSnapshot extends Snapshot{constructor(e){super(cloneStoreState(e.getStore_INTERNAL(),e.getStore_INTERNAL().getState().currentTree,!0)),_defineProperty(this,"set",(e,t)=>{this.checkRefCount_INTERNAL(),Te(()=>{xe(this.getStore_INTERNAL(),e,t)})}),_defineProperty(this,"reset",e=>{this.checkRefCount_INTERNAL(),Te(()=>xe(this.getStore_INTERNAL(),e,Ie))}),_defineProperty(this,"setUnvalidatedAtomValues_DEPRECATED",e=>{this.checkRefCount_INTERNAL();const t=this.getStore_INTERNAL();Te(()=>{for(const[n,r]of e.entries())De(t,new ke(n),r)})})}}var Fe={Snapshot:Snapshot,MutableSnapshot:MutableSnapshot,freshSnapshot:function freshSnapshot(e){const t=new Snapshot(Le());return null!=e?t.map(e):t},cloneSnapshot:cloneSnapshot},Ue=Fe.Snapshot,Ve=Fe.MutableSnapshot,Be=Fe.freshSnapshot,qe=Fe.cloneSnapshot,ze=Object.freeze({__proto__:null,Snapshot:Ue,MutableSnapshot:Ve,freshSnapshot:Be,cloneSnapshot:qe});const{getNextTreeStateVersion:Qe,makeEmptyStoreState:$e}=pe,{cleanUpNode:We,getDownstreamNodes:Ge,setNodeValue:He,setUnvalidatedAtomValue_DEPRECATED:Ke}=x,{graph:Ye}=ae,{cloneGraph:Xe}=ae,{applyAtomValueWrites:Ze}=H,{releaseScheduledRetainablesNow:Je}=Se,{freshSnapshot:et}=ze,{useCallback:tt,useContext:nt,useEffect:rt,useMemo:it,useRef:ot,useState:at}=a.a;function notInAContext(){throw new Error("This component must be used inside a component.")}const st=Object.freeze({getState:notInAContext,replaceState:notInAContext,getGraph:notInAContext,subscribeToTransactions:notInAContext,addTransactionMetadata:notInAContext});let lt=!1;function startNextTreeIfNeeded(e){if(lt)throw new Error("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");if(null===e.nextTree){const t=e.currentTree.version,n=Qe();e.nextTree={...e.currentTree,version:n,stateID:n,dirtyAtoms:new Set,transactionMetadata:{}},e.graphsByVersion.set(n,Xe(s(e.graphsByVersion.get(t))))}}const ut=a.a.createContext({current:st}),useStoreRef=()=>nt(ut),ct=a.a.createContext(null);function sendEndOfBatchNotifications(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[n,i]of t.nodeTransactionSubscriptions)if(r.has(n))for(const[t,n]of i)n(e);for(const[n,r]of t.transactionSubscriptions)r(e);const i=Ge(e,n,r);for(const e of i){const r=t.nodeToComponentSubscriptions.get(e);if(r)for(const[e,[t,i]]of r)i(n)}t.suspendedComponentResolvers.forEach(e=>e())}t.queuedComponentCallbacks_DEPRECATED.forEach(e=>e(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function Batcher({setNotifyBatcherOfChange:e}){const t=useStoreRef(),[n,r]=at([]);return e(()=>r({})),rt(()=>{re.enqueueExecution("Batcher",()=>{const e=t.current.getState(),{nextTree:n}=e;if(null===n)return;e.previousTree=e.currentTree,e.currentTree=n,e.nextTree=null,sendEndOfBatchNotifications(t.current);const r=s(e.previousTree).version;e.graphsByVersion.delete(r),e.previousTree=null,f("recoil_memory_managament_2020")&&Je(t.current)})}),rt(()=>()=>{e(()=>{})},[e]),null}let dt=0;var ft={useStoreRef:useStoreRef,useRecoilMutableSource:function useRecoilMutableSource(){const e=nt(ct);return null==e&&h("Attempted to use a Recoil hook outside of a . must be an ancestor of any component that uses Recoil hooks."),e},RecoilRoot:function RecoilRoot({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){var i;let o;const l=ot(null),u=tt(e=>{l.current=e},[l]),c=null!==(i=a.a.createMutableSource)&&void 0!==i?i:a.a.unstable_createMutableSource,d=null!=n?n:{getState:()=>o.current,replaceState:e=>{const t=f.current.getState();startNextTreeIfNeeded(t);const n=s(t.nextTree);let r;try{lt=!0,r=e(n)}finally{lt=!1}r!==n&&(t.nextTree=r,s(l.current)())},getGraph:e=>{const t=o.current.graphsByVersion;if(t.has(e))return s(t.get(e));const n=Ye();return t.set(e,n),n},subscribeToTransactions:(e,t)=>{if(null==t){const{transactionSubscriptions:t}=f.current.getState(),n=dt++;return t.set(n,e),{release:()=>{t.delete(n)}}}{const{nodeTransactionSubscriptions:n}=f.current.getState();n.has(t)||n.set(t,new Map);const r=dt++;return s(n.get(t)).set(r,e),{release:()=>{const e=n.get(t);e&&(e.delete(r),0===e.size&&n.delete(t))}}}},addTransactionMetadata:e=>{startNextTreeIfNeeded(f.current.getState());for(const t of Object.keys(e))s(f.current.getState().nextTree).transactionMetadata[t]=e[t]}},f=ot(d);o=ot(null!=e?function initialStoreState_DEPRECATED(e,t){const n=$e();return t({set:(t,r)=>{const i=n.currentTree,o=He(e,i,t.key,r),a=new Set(o.keys()),s=i.nonvalidatedAtoms.clone();for(const e of a)s.delete(e);n.currentTree={...i,dirtyAtoms:he(i.dirtyAtoms,a),atomValues:Ze(i.atomValues,o),nonvalidatedAtoms:s}},setUnvalidatedAtomValues:e=>{e.forEach((e,t)=>{n.currentTree=Ke(n.currentTree,t,e)})}}),n}(d,e):null!=t?function initialStoreState(e){return et().map(e).getStore_INTERNAL().getState()}(t):$e());const p=it(()=>c?c(o,()=>o.current.currentTree.version):null,[c,o]);return rt(()=>()=>{for(const e of f.current.getState().knownAtoms)We(f.current,e)},[]),a.a.createElement(ut.Provider,{value:f},a.a.createElement(ct.Provider,{value:p},a.a.createElement(Batcher,{setNotifyBatcherOfChange:u}),r))},sendEndOfBatchNotifications_FOR_TESTING:sendEndOfBatchNotifications};var pt=function filterMap(e,t){const n=new Map;for(const[r,i]of e)t(i,r)&&n.set(r,i);return n};var ht=function filterSet(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n};var vt=function invariant(e,t){if(!e)throw new Error(t)};var yt,mt=function mergeMaps(...e){const t=new Map;for(let n=0;n"};const{batchUpdates:Et}=ne,{DEFAULT_VALUE:wt,getNode:Tt,nodes:Ct}=T,{useRecoilMutableSource:At,useStoreRef:jt}=ft,{isRecoilValue:It}=_,{AbstractRecoilValue:Pt,getRecoilValueAsLoadable:Mt,setRecoilValue:kt,setRecoilValueLoadable:Rt,setUnvalidatedRecoilValue:xt,subscribeToRecoilValue:Dt}=H,{updateRetainCount:Nt}=Se,{RetentionZone:Lt}=C,{Snapshot:Ft,cloneSnapshot:Ut}=ze,{setByAddingToSet:Vt}=u,{isSSR:Bt}=Ee,{mutableSourceExists:qt,useMutableSource:zt}=gt,{useCallback:Qt,useEffect:$t,useMemo:Wt,useRef:Gt,useState:Ht}=a.a;function handleLoadable(e,t,n){if("hasValue"===e.state)return e.contents;if("loading"===e.state){throw new Promise(e=>{n.current.getState().suspendedComponentResolvers.add(e)})}throw"hasError"===e.state?e.contents:new Error(`Invalid value of loadable atom "${t.key}"`)}function useRecoilValueLoadable(e){return f("recoil_memory_managament_2020")&&useRetain(e),qt()?function useRecoilValueLoadable_MUTABLESOURCE(e){const t=jt(),n=Qt(()=>{const n=t.current,r=n.getState().currentTree;return Mt(n,e,r)},[t,e]),r=Qt(()=>n(),[n]),i=Ot(),o=Qt((r,o)=>{const a=t.current;return Dt(a,e,()=>{if(!f("recoil_suppress_rerender_in_callback"))return o();const e=n();l.current.is(e)||o()},i).release},[t,e,i,n]),a=At(),s=zt(a,r,o),l=Gt(s);return $t(()=>{l.current=s}),s}(e):function useRecoilValueLoadable_LEGACY(e){const t=jt(),[n,r]=Ht([]),i=Ot();$t(()=>{const n=t.current,o=n.getState(),s=Dt(n,e,t=>{var i;if(!f("recoil_suppress_rerender_in_callback"))return r([]);const o=Mt(n,e,n.getState().currentTree);(null===(i=a.current)||void 0===i?void 0:i.is(o))||r(o)},i);if(o.nextTree)n.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a.current=null,r([])});else{var l;if(!f("recoil_suppress_rerender_in_callback"))return r([]);const t=Mt(n,e,n.getState().currentTree);(null===(l=a.current)||void 0===l?void 0:l.is(t))||r(t)}return s.release},[i,e,t]);const o=Mt(t.current,e),a=Gt(o);return $t(()=>{a.current=o}),o}(e)}function useRecoilValue(e){const t=jt();return handleLoadable(useRecoilValueLoadable(e),e,t)}function useSetRecoilState(e){const t=jt();return Qt(n=>{kt(t.current,e,n)},[t,e])}function useTransactionSubscription(e){const t=jt();$t(()=>t.current.subscribeToTransactions(e).release,[e,t])}function externallyVisibleAtomValuesInState(e){const t=e.atomValues.toMap(),n=oe(pt(t,(e,t)=>{const n=Tt(t).persistence_UNSTABLE;return null!=n&&"none"!==n.type&&"hasValue"===e.state}),e=>e.contents);return mt(e.nonvalidatedAtoms.toMap(),n)}function usePrevious(e){const t=Gt();return $t(()=>{t.current=e}),t.current}function useGotoRecoilSnapshot(){const e=jt();return Qt(t=>{var n;const r=e.current.getState(),i=null!==(n=r.nextTree)&&void 0!==n?n:r.currentTree,o=t.getStore_INTERNAL().getState().currentTree;Et(()=>{const n=new Set;for(const e of[i.atomValues.keys(),o.atomValues.keys()])for(const t of e){var r,a;(null===(r=i.atomValues.get(t))||void 0===r?void 0:r.contents)!==(null===(a=o.atomValues.get(t))||void 0===a?void 0:a.contents)&&Tt(t).shouldRestoreFromSnapshots&&n.add(t)}n.forEach(t=>{Rt(e.current,new Pt(t),o.atomValues.has(t)?s(o.atomValues.get(t)):wt)}),e.current.replaceState(e=>({...e,stateID:t.getID_INTERNAL()}))})},[e])}class Sentinel{}const Kt=new Sentinel;function useRetain(e){if(f("recoil_memory_managament_2020"))return function useRetain_ACTUAL(e){const t=(Array.isArray(e)?e:[e]).map(e=>e instanceof Lt?e:e.key),n=jt();$t(()=>{if(!f("recoil_memory_managament_2020"))return;const e=n.current;if(r.current&&!Bt)window.clearTimeout(r.current),r.current=null;else{l("Did not retain recoil value on render, or committed after timeout elapsed. This is fine, but odd.");for(const n of t)Nt(e,n,1)}return()=>{for(const n of t)Nt(e,n,-1)}},[n,...t]);const r=Gt(),i=usePrevious(t);if(!(Bt||void 0!==i&&_t(i,t))){const e=n.current;for(const n of t)Nt(e,n,1);if(i)for(const t of i)Nt(e,t,-1);r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{r.current=null;for(const n of t)Nt(e,n,-1)},12e4)}}(e)}var Yt={recoilComponentGetRecoilValueCount_FOR_TESTING:{current:0},useGotoRecoilSnapshot:useGotoRecoilSnapshot,useRecoilCallback:function useRecoilCallback(e,t){const n=jt(),r=useGotoRecoilSnapshot();return Qt((...t)=>{function set(e,t){kt(n.current,e,t)}function reset(e){kt(n.current,e,wt)}const i=Ut(n.current);let o=Kt;return Et(()=>{const n="useRecoilCallback expects a function that returns a function: it accepts a function of the type (RecoilInterface) => T = R and returns a callback function T => R, where RecoilInterface is an object {snapshot, set, ...} and T and R are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if("function"!=typeof e)throw new Error(n);const a=e({set:set,reset:reset,snapshot:i,gotoSnapshot:r});if("function"!=typeof a)throw new Error(n);o=a(...t)}),o instanceof Sentinel&&vt(!1),o},null!=t?[...t,n]:void 0)},useRecoilInterface:function useRecoilInterface_DEPRECATED(){const e=jt(),[t,n]=Ht([]),r=Gt(new Set);r.current=new Set;const i=Gt(new Set),o=Gt(new Map),a=Qt(e=>{const t=o.current.get(e);t&&(t.release(),o.current.delete(e))},[o]),s=Ot();return $t(()=>{const t=e.current;function updateState(e,t){o.current.has(t)&&n([])}ie(r.current,i.current).forEach(e=>{if(o.current.has(e))return void h(`Double subscription to RecoilValue "${e}"`);const n=Dt(t,new Pt(e),t=>{updateState(0,e)},s);o.current.set(e,n);t.getState().nextTree?t.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{updateState(t.getState(),e)}):updateState(t.getState(),e)}),ie(i.current,r.current).forEach(e=>{a(e)}),i.current=r.current}),$t(()=>{const e=o.current;return()=>e.forEach((e,t)=>a(t))},[a]),Wt(()=>{function useSetRecoilState(t){return n=>{kt(e.current,t,n)}}function useRecoilValueLoadable(t){return r.current.has(t.key)||(r.current=Vt(r.current,t.key)),Mt(e.current,t)}function useRecoilValue(t){return handleLoadable(useRecoilValueLoadable(t),t,e)}return{getRecoilValue:useRecoilValue,getRecoilValueLoadable:useRecoilValueLoadable,getRecoilState:function useRecoilState(e){return[useRecoilValue(e),useSetRecoilState(e)]},getRecoilStateLoadable:function useRecoilStateLoadable(e){return[useRecoilValueLoadable(e),useSetRecoilState(e)]},getSetRecoilState:useSetRecoilState,getResetRecoilState:function useResetRecoilState(t){return()=>kt(e.current,t,wt)}}},[r,e])},useRecoilSnapshot:function useRecoilSnapshot(){const e=jt(),[t,n]=Ht(()=>Ut(e.current)),r=usePrevious(t),i=Gt();return $t(()=>(i.current&&!Bt&&window.clearTimeout(i.current),t.retain()),[t]),useTransactionSubscription(Qt(e=>n(Ut(e)),[])),r===t||Bt||(i.current&&(null==r||r.release(),window.clearTimeout(i.current)),t.retain(),i.current=window.setTimeout(()=>{t.release(),i.current=null},12e4)),t},useRecoilState:function useRecoilState(e){return[useRecoilValue(e),useSetRecoilState(e)]},useRecoilStateLoadable:function useRecoilStateLoadable(e){return[useRecoilValueLoadable(e),useSetRecoilState(e)]},useRecoilTransactionObserver:function useRecoilTransactionObserver(e){useTransactionSubscription(Qt(t=>{const n=Ut(t,"current"),r=Ut(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))},useRecoilValue:useRecoilValue,useRecoilValueLoadable:useRecoilValueLoadable,useRetain:useRetain,useResetRecoilState:function useResetRecoilState(e){const t=jt();return Qt(()=>{kt(t.current,e,wt)},[t,e])},useSetRecoilState:useSetRecoilState,useSetUnvalidatedAtomValues:function useSetUnvalidatedAtomValues(){const e=jt();return(t,n={})=>{Et(()=>{e.current.addTransactionMetadata(n),t.forEach((t,n)=>xt(e.current,new Pt(n),t))})}},useTransactionObservation_DEPRECATED:function useTransactionObservation_DEPRECATED(e){useTransactionSubscription(Qt(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(l("Transaction subscribers notified without a previous tree being present -- this is a bug in Recoil"),n=t.getState().currentTree);const i=externallyVisibleAtomValuesInState(r),o=externallyVisibleAtomValuesInState(n),a=oe(Ct,e=>{var t,n,r,i;return{persistence_UNSTABLE:{type:null!==(t=null===(n=e.persistence_UNSTABLE)||void 0===n?void 0:n.type)&&void 0!==t?t:"none",backButton:null!==(r=null===(i=e.persistence_UNSTABLE)||void 0===i?void 0:i.backButton)&&void 0!==r&&r}}}),s=ht(r.dirtyAtoms,e=>i.has(e)||o.has(e));e({atomValues:i,previousAtomValues:o,atomInfo:a,modifiedAtoms:s,transactionMetadata:{...r.transactionMetadata}})},[e]))},useTransactionSubscription_DEPRECATED:useTransactionSubscription};const{peekNodeInfo:Xt}=x,{useStoreRef:Zt}=ft;var Jt=function useGetRecoilValueInfo(){const e=Zt();return({key:t})=>Xt(e.current,e.current.getState().currentTree,t)};const{RecoilRoot:en,useStoreRef:tn}=ft,{useMemo:nn}=a.a;var rn=function useRecoilBridgeAcrossReactRoots(){const e=tn().current;return nn(()=>function RecoilBridge({children:t}){return a.a.createElement(en,{store_INTERNAL:e},t)},[e])};var on=function isPromise(e){return!!e&&"function"==typeof e.then};class Canceled{}const an=new Canceled,sn={getValue(){if("loading"===this.state)throw this.contents.then(({__value:e})=>e);if("hasValue"!==this.state)throw this.contents;return this.contents},toPromise(){return"hasValue"===this.state?Promise.resolve(this.contents):"hasError"===this.state?Promise.reject(this.contents):this.contents.then(({__value:e})=>e)},valueMaybe(){return"hasValue"===this.state?this.contents:void 0},valueOrThrow(){if("hasValue"!==this.state){throw new Error(`Loadable expected value, but in "${this.state}" state`)}return this.contents},errorMaybe(){return"hasError"===this.state?this.contents:void 0},errorOrThrow(){if("hasError"!==this.state){throw new Error(`Loadable expected error, but in "${this.state}" state`)}return this.contents},promiseMaybe(){return"loading"===this.state?this.contents.then(({__value:e})=>e):void 0},promiseOrThrow(){if("loading"!==this.state){throw new Error(`Loadable expected promise, but in "${this.state}" state`)}return this.contents.then(({__value:e})=>e)},is(e){return e.state===this.state&&e.contents===this.contents},map(e){if("hasError"===this.state)return this;if("hasValue"===this.state)try{const t=e(this.contents);return on(t)?loadableWithPromise(t):loadableWithValue(t)}catch(t){return on(t)?loadableWithPromise(t.next(()=>e(this.contents))):loadableWithError(t)}if("loading"===this.state)return loadableWithPromise(this.contents.then(e).catch(t=>{if(on(t))return t.then(()=>e(this.contents));throw t}));throw new Error("Invalid Loadable state")}};function loadableWithValue(e){return Object.freeze({state:"hasValue",contents:e,...sn})}function loadableWithError(e){return Object.freeze({state:"hasError",contents:e,...sn})}function loadableWithPromise(e){return Object.freeze({state:"loading",contents:e,...sn})}var ln={loadableWithValue:loadableWithValue,loadableWithError:loadableWithError,loadableWithPromise:loadableWithPromise,loadableLoading:function loadableLoading(){return loadableWithPromise(new Promise(()=>{}))},loadableAll:function loadableAll(e){return e.every(e=>"hasValue"===e.state)?loadableWithValue(e.map(e=>e.contents)):e.some(e=>"hasError"===e.state)?loadableWithError(s(e.find(e=>"hasError"===e.state),"Invalid loadable passed to loadableAll").contents):loadableWithPromise(Promise.all(e.map(e=>e.contents)).then(e=>({__value:e})))},Canceled:Canceled,CANCELED:an};const{isReactNative:un,isSSR:cn}=Ee;var dn=function stableStringify(e,t={allowFunctions:!1}){return function stringify(e,t,n){if("string"==typeof e&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if(!0!==(null==t?void 0:t.allowFunctions))throw new Error("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(null===e)return"null";var r;if("object"!=typeof e)return null!==(r=JSON.stringify(e))&&void 0!==r?r:"";if(on(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((e,n)=>stringify(e,t,n.toString()))}]`;if("function"==typeof e.toJSON)return stringify(e.toJSON(n),t,n);if(e instanceof Map){const r={};for(const[n,i]of e)r["string"==typeof n?n:stringify(n,t)]=i;return stringify(r,t,n)}return e instanceof Set?stringify(Array.from(e).sort((e,n)=>stringify(e,t).localeCompare(stringify(n,t))),t,n):void 0!==Symbol&&null!=e[Symbol.iterator]&&"function"==typeof e[Symbol.iterator]?stringify(Array.from(e),t,n):`{${Object.keys(e).filter(t=>void 0!==e[t]).sort().map(n=>`${stringify(n,t)}:${stringify(e[n],t,n)}`).join(",")}}`}(e,t)};const findLeaf=(e,t,n)=>{var r;if(null==e)return;if(null==n||null===(r=n.onNodeVisit)||void 0===r||r.call(n,e),"leaf"===e.type)return e;const i=t(e.nodeKey);return findLeaf(e.branches.get(i),t,n)},addLeaf=(e,t,n,r,i,o)=>{var a;let s;if(null==e)if(0===t.length)s={type:"leaf",value:r,parent:n,branchKey:i};else{const[e,...a]=t,[l,u]=e;s={type:"branch",nodeKey:l,parent:n,branches:new Map,branchKey:i},s.branches.set(u,addLeaf(null,a,s,r,u,o))}else if(s=e,t.length){const[n,...i]=t,[a,s]=n;("branch"!==e.type||e.nodeKey!==a)&&vt(!1),e.branches.set(s,addLeaf(e.branches.get(s),i,e,r,s,o))}return null==o||null===(a=o.onNodeVisit)||void 0===a||a.call(o,s),s},pruneNodeFromTree=(e,t,n)=>n?(n.branches.delete(t.branchKey),pruneUpstreamBranches(e,n,n.parent)):e===t,pruneUpstreamBranches=(e,t,n)=>n?(0===t.branches.size&&n.branches.delete(t.branchKey),pruneUpstreamBranches(e,n,n.parent)):e===t,countDownstreamLeaves=e=>"leaf"===e.type?1:Array.from(e.branches.values()).reduce((e,t)=>e+countDownstreamLeaves(t),0);var fn=class TreeCache{constructor(e){var t,n,r;_defineProperty(this,"_numLeafs",void 0),_defineProperty(this,"_root",void 0),_defineProperty(this,"_onHit",void 0),_defineProperty(this,"_onSet",void 0),_defineProperty(this,"_mapNodeValue",void 0),this._numLeafs=0,this._root=null,this._onHit=null!==(t=null==e?void 0:e.onHit)&&void 0!==t?t:()=>{},this._onSet=null!==(n=null==e?void 0:e.onSet)&&void 0!==n?n:()=>{},this._mapNodeValue=null!==(r=null==e?void 0:e.mapNodeValue)&&void 0!==r?r:e=>e}size(){return this._numLeafs}root(){return this._root}get(e,t){var n;return null===(n=this.getLeafNode(e,t))||void 0===n?void 0:n.value}getLeafNode(e,t){return findLeaf(this.root(),t=>this._mapNodeValue(e(t)),{onNodeVisit:e=>{null==t||t.onNodeVisit(e),"leaf"===e.type&&this._onHit(e)}})}set(e,t,n){let r;const i=addLeaf(this.root(),e.map(([e,t])=>[e,this._mapNodeValue(t)]),null,t,null,{onNodeVisit:e=>{null==n||n.onNodeVisit(e),"leaf"===e.type&&(r=e)}});this.root()||(this._root=i),this._numLeafs++,this._onSet(s(r))}delete(e){if(!this.root())return!1;const t=s(this.root());return!!pruneNodeFromTree(t,e,e.parent)&&(e===t||"branch"===t.type&&!t.branches.size?(this._root=null,this._numLeafs=0,!0):(this._numLeafs-=countDownstreamLeaves(e),!0))}clear(){this._numLeafs=0,this._root=null}},pn=Object.freeze({__proto__:null,TreeCache:fn});var hn=class LRUCache{constructor(e){var t;_defineProperty(this,"_maxSize",void 0),_defineProperty(this,"_size",void 0),_defineProperty(this,"_head",void 0),_defineProperty(this,"_tail",void 0),_defineProperty(this,"_map",void 0),_defineProperty(this,"_keyMapper",void 0),this._maxSize=e.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=null!==(t=e.mapKey)&&void 0!==t?t:e=>e}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(e){return this._map.has(this._keyMapper(e))}get(e){const t=this._keyMapper(e),n=this._map.get(t);if(n)return this.set(e,n.value),n.value}set(e,t){const n=this._keyMapper(e);this._map.get(n)&&this.delete(e);const r=this.head(),i={key:e,right:r,left:null,value:t};r?r.left=i:this._tail=i,this._map.set(n,i),this._head=i,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const e=this.tail();e&&this.delete(e.key)}delete(e){const t=this._keyMapper(e);if(!this._size||!this._map.has(t))return;const n=s(this._map.get(t)),r=n.right,i=n.left;r&&(r.left=n.left),i&&(i.right=n.right),n===this.head()&&(this._head=r),n===this.tail()&&(this._tail=i),this._map.delete(t),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}},vn=Object.freeze({__proto__:null,LRUCache:hn});const{LRUCache:yn}=vn,{TreeCache:mn}=pn;var bn=function treeCacheLRU(e,t=(e=>e)){const n=new yn({maxSize:e}),r=new mn({mapNodeValue:t,onHit:e=>{n.set(e,!0)},onSet:t=>{const i=n.tail();n.set(t,!0),i&&r.size()>e&&r.delete(i.key)}});return r};const{TreeCache:gn}=pn,_n={equality:"reference",eviction:"none",maxSize:1/0};var Sn=function treeCacheFromPolicy({equality:e=_n.equality,eviction:t=_n.eviction,maxSize:n=_n.maxSize}=_n){return function getTreeCache(e,t,n){switch(e){case"none":return new gn({mapNodeValue:n});case"lru":return bn(s(t),n)}throw new Error("Unrecognized eviction policy "+e)}(t,n,function getValueMapper(e){switch(e){case"reference":return e=>e;case"value":return e=>dn(e)}throw new Error("Unrecognized equality policy "+e)}(e))};var On={startPerfBlock:function startPerfBlock(e){return()=>null}};const{CANCELED:En,Canceled:wn,loadableWithError:Tn,loadableWithPromise:Cn,loadableWithValue:An}=ln,{getNodeLoadable:jn,peekNodeLoadable:In,setNodeValue:Pn}=x,{saveDependencyMapToStore:Mn}=ae,{DEFAULT_VALUE:kn,RecoilValueNotReady:Rn,getConfigDeletionHandler:xn,registerNode:Dn}=T,{isRecoilValue:Nn}=_,{AbstractRecoilValue:Ln}=_,{setRecoilValueLoadable:Fn}=H,{retainedByOptionWithDefault:Un}=Se,{startPerfBlock:Vn}=On,Bn=[],qn=new Map,zn=(()=>{let e=0;return()=>e++})();var Qn=function selector(e){const{key:t,get:n,cachePolicy_UNSTABLE:r}=e,i=null!=e.set?e.set:void 0,o=Sn(null!=r?r:{equality:"reference",eviction:"none"}),a=Un(e.retainedBy_UNSTABLE),u=new Map;let c=0;function selectorIsLive(){return!f("recoil_memory_managament_2020")||c>0}function getExecutionInfo(e){return u.has(e)||u.set(e,{depValuesDiscoveredSoFarDuringAsyncWork:null,latestLoadable:null,latestExecutionId:null,stateVersion:null}),s(u.get(e))}function selectorInit(e){return c++,e.getState().knownSelectors.add(t),()=>{c--,e.getState().knownSelectors.delete(t),u.delete(e)}}function selectorShouldDeleteConfigOnRelease(){return void 0!==xn(t)&&!selectorIsLive()}function notifyStoreWhenAsyncSettles(e,t,n){if("loading"===t.state){let t=qn.get(n);null==t&&qn.set(n,t=new Set),t.add(e)}}function getCachedNodeLoadable(e,t,n){if(t.atomValues.has(n))return s(t.atomValues.get(n));const r=jn(e,t,n),i=e.getState().knownSelectors.has(n);return"loading"!==r.state&&i&&t.atomValues.set(n,r),r}function wrapPendingDependencyPromise(e,n,r,i,o){return n.then(n=>{if(!selectorIsLive())return clearExecutionInfo(e,o),En;if(n instanceof wn)return l("Selector was released while it had dependencies"),En;const{__key:i,__value:a}=null!=n?n:{};let s=!0;null!=i&&(r.atomValues.set(i,An(a)),s=!1);const[u,c]=evaluateSelectorGetter(e,r,o,s);if(isLatestExecution(e,o)&&updateExecutionInfoDepValues(c,e,o),maybeFreezeLoadableContents(u),"loading"!==u.state&&(setCache(r,depValuesToDepRoute(c),u),setDepsInStore(e,r,new Set(c.keys()),o),setLoadableInStoreToNotifyDeps(e,u,o)),"hasError"===u.state)throw u.contents;return"hasValue"===u.state?{__value:u.contents,__key:t}:u.contents}).catch(t=>{if(!selectorIsLive())return clearExecutionInfo(e,o),En;const n=Tn(t);throw maybeFreezeValue(t),setCache(r,depValuesToDepRoute(i),Tn(t)),setDepsInStore(e,r,new Set(i.keys()),o),setLoadableInStoreToNotifyDeps(e,n,o),t})}function setLoadableInStoreToNotifyDeps(e,n,r){isLatestExecution(e,r)&&(setExecutionInfo(n,e),function notifyStoresOfSettledAsync(e,n){const r=qn.get(n);if(void 0!==r){for(const n of r)Fn(n,new Ln(t),e);qn.delete(n)}}(n,r))}function setDepsInStore(e,n,r,i){var o,a,s,l,u,c,d;(isLatestExecution(e,i)||n.version===(null===(o=e.getState())||void 0===o||null===(a=o.currentTree)||void 0===a?void 0:a.version)||n.version===(null===(s=e.getState())||void 0===s||null===(l=s.nextTree)||void 0===l?void 0:l.version))&&Mn(new Map([[t,r]]),e,null!==(u=null===(c=e.getState())||void 0===c||null===(d=c.nextTree)||void 0===d?void 0:d.version)&&void 0!==u?u:e.getState().currentTree.version)}function evaluateSelectorGetter(e,r,i,o=!1){const a=Vn(t);let s,l,u=!1;const c=new Map,d=new Set;function getRecoilValue(t){const{key:n}=t;!function setNewDepInStore(e,t,n,r,i){n.add(r),setDepsInStore(e,t,n,i)}(e,r,d,n,i);const a=o?jn(e,r,n):getCachedNodeLoadable(e,r,n);if(c.set(n,a),"hasValue"===a.state)return a.contents;throw a.contents}setDepsInStore(e,r,d,i);try{s=n({get:getRecoilValue}),s=Nn(s)?getRecoilValue(s):s,on(s)?s=function wrapPendingPromise(e,n,r,i,o){return n.then(n=>{if(!selectorIsLive())return clearExecutionInfo(e,o),En;const a=An(n);return maybeFreezeValue(n),setCache(r,depValuesToDepRoute(i),a),setDepsInStore(e,r,new Set(i.keys()),o),setLoadableInStoreToNotifyDeps(e,a,o),{__value:n,__key:t}}).catch(t=>{if(!selectorIsLive())return clearExecutionInfo(e,o),En;if(isLatestExecution(e,o)&&updateExecutionInfoDepValues(i,e,o),on(t))return wrapPendingDependencyPromise(e,t,r,i,o);const n=Tn(t);throw maybeFreezeValue(t),setCache(r,depValuesToDepRoute(i),n),setDepsInStore(e,r,new Set(i.keys()),o),setLoadableInStoreToNotifyDeps(e,n,o),t})}(e,s,r,c,i).finally(a):a()}catch(t){s=t,on(s)?s=wrapPendingDependencyPromise(e,s,r,c,i).finally(a):(u=!0,a())}return l=u?Tn(s):on(s)?Cn(s):An(s),maybeFreezeLoadableContents(l),[l,c]}function depValuesToDepRoute(e){return Array.from(e.entries()).map(([e,t])=>[e,t.contents])}function getValFromRunningNewExecutionAndUpdatedDeps(e,t){const n=zn(),[r,i]=evaluateSelectorGetter(e,t,n);return setExecutionInfo(r,e,i,n,t),function maybeSetCacheWithLoadable(e,t,n){"loading"!==n.state&&setCache(e,t,n)}(t,depValuesToDepRoute(i),r),notifyStoreWhenAsyncSettles(e,r,n),r}function getSelectorValAndUpdatedDeps(e,n){const r=function getValFromCacheAndUpdatedDownstreamDeps(e,n){const r=new Set,i=getExecutionInfo(e),a=o.get(t=>{"string"!=typeof t&&vt(!1);return getCachedNodeLoadable(e,n,t).contents},{onNodeVisit:e=>{"branch"===e.type&&e.nodeKey!==t&&"string"==typeof e.nodeKey&&r.add(e.nodeKey)}});return a&&setDepsInStore(e,n,r,i.latestExecutionId),a}(e,n);if(null!=r)return setExecutionInfo(r,e),r;const i=function getExecutionInfoOfInProgressExecution(e,t){var n;const[,r]=null!==(n=Array.from(u.entries()).find(([,n])=>null!=n.latestLoadable&&null!=n.latestExecutionId&&!function haveAsyncDepsChanged(e,t){var n,r;const i=getExecutionInfo(e),o=null!==(n=i.depValuesDiscoveredSoFarDuringAsyncWork)&&void 0!==n?n:new Map,a=Array((null!==(r=d.get(t.version))&&void 0!==r?r:new Map).entries()),s=d.has(t.version)&&a.length===o.size&&a.every(([e,t])=>o.get(e)===t);if(null==o||t.version===i.stateVersion||s)return!1;return d.set(t.version,new Map(o)),Array.from(o).some(([n,r])=>{const i=getCachedNodeLoadable(e,t,n);return i.contents!==r.contents&&!("loading"===r.state&&"loading"!==i.state)})}(e,t)))&&void 0!==n?n:[];return r}(e,n);if(i){const t=i;return notifyStoreWhenAsyncSettles(e,s(t.latestLoadable),s(t.latestExecutionId)),s(t.latestLoadable)}return getValFromRunningNewExecutionAndUpdatedDeps(e,n)}const d=new Map;function setExecutionInfo(e,t,n,r,i){const o=getExecutionInfo(t);"loading"===e.state?(o.depValuesDiscoveredSoFarDuringAsyncWork=n,o.latestExecutionId=r,o.latestLoadable=e,o.stateVersion=null==i?void 0:i.version):(o.depValuesDiscoveredSoFarDuringAsyncWork=null,o.latestExecutionId=null,o.latestLoadable=null,o.stateVersion=null)}function updateExecutionInfoDepValues(e,t,n){const r=getExecutionInfo(t);isLatestExecution(t,n)&&(r.depValuesDiscoveredSoFarDuringAsyncWork=e)}function clearExecutionInfo(e,t){isLatestExecution(e,t)&&u.delete(e)}function isLatestExecution(e,t){return t===getExecutionInfo(e).latestExecutionId}function maybeFreezeLoadableContents(e){"loading"!==e.state&&maybeFreezeValue(e.contents)}function maybeFreezeValue(e){0}function setCache(e,n,r){e.atomValues.set(t,r),o.set(n,r)}function selectorPeek(e,t){return o.get(n=>{"string"!=typeof n&&vt(!1);const r=In(e,t,n);return null==r?void 0:r.contents})}function selectorGet(e,n){return function detectCircularDependencies(e){if(Bn.includes(t)){const e="Recoil selector has circular dependencies: "+Bn.slice(Bn.indexOf(t)).join(" → ");return Tn(new Error(e))}Bn.push(t);try{return e()}finally{Bn.pop()}}(()=>getSelectorValAndUpdatedDeps(e,n))}function invalidateSelector(e){e.atomValues.delete(t)}if(null!=i){return Dn({key:t,peek:selectorPeek,get:selectorGet,set:function selectorSet(e,t,n){let r=!1;const o=new Map;function getRecoilValue({key:n}){if(r)throw new Error("Recoil: Async selector sets are not currently supported.");const i=getCachedNodeLoadable(e,t,n);if("hasValue"===i.state)return i.contents;throw"loading"===i.state?new Rn(n):i.contents}function setRecoilState(n,i){if(r)throw new Error("Recoil: Async selector sets are not currently supported.");const a="function"==typeof i?i(getRecoilValue(n)):i;Pn(e,t,n.key,a).forEach((e,t)=>o.set(t,e))}const a=i({set:setRecoilState,get:getRecoilValue,reset:function resetRecoilState(e){setRecoilState(e,kn)}},n);if(void 0!==a)throw on(a)?new Error("Recoil: Async selector sets are not currently supported."):new Error("Recoil: selector set should be a void function.");return r=!0,o},init:selectorInit,invalidate:invalidateSelector,shouldDeleteConfigOnRelease:selectorShouldDeleteConfigOnRelease,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:a})}return Dn({key:t,peek:selectorPeek,get:selectorGet,init:selectorInit,invalidate:invalidateSelector,shouldDeleteConfigOnRelease:selectorShouldDeleteConfigOnRelease,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:a})};const{loadableWithError:$n,loadableWithPromise:Wn,loadableWithValue:Gn}=ln,{DEFAULT_VALUE:Hn,DefaultValue:Kn,getConfigDeletionHandler:Yn,registerNode:Xn,setConfigDeletionHandler:Zn}=T,{isRecoilValue:Jn}=_,{markRecoilValueModified:er,setRecoilValue:tr,setRecoilValueLoadable:nr}=H,{retainedByOptionWithDefault:rr}=Se;function baseAtom(e){const{key:t,persistence_UNSTABLE:n}=e,r=rr(e.retainedBy_UNSTABLE);let i=0,o=on(e.default)?Wn(e.default.then(e=>{o=Gn(e);return{__key:t,__value:e}}).catch(e=>{throw o=$n(e),e})):Gn(e.default),a=void 0;const u=new Map;const c=Xn({key:t,peek:function peekAtom(e,n){var r,i,s;return null!==(r=null!==(i=n.atomValues.get(t))&&void 0!==i?i:null===(s=a)||void 0===s?void 0:s[1])&&void 0!==r?r:o},get:function getAtom(e,r){if(r.atomValues.has(t))return s(r.atomValues.get(t));if(r.nonvalidatedAtoms.has(t)){if(null!=a)return a;if(null==n)return h(`Tried to restore a persisted value for atom ${t} but it has no persistence settings.`),o;const e=r.nonvalidatedAtoms.get(t),i=n.validator(e,Hn),s=i instanceof Kn?o:Gn(i);return a=s,a}return o},set:function setAtom(e,n,r){if(n.atomValues.has(t)){const e=s(n.atomValues.get(t));if("hasValue"===e.state&&r===e.contents)return new Map}else if(!n.nonvalidatedAtoms.has(t)&&r instanceof Kn)return new Map;return a=void 0,(new Map).set(t,Gn(r))},init:function initAtom(n,r,a){i++;const s=n.getState().knownAtoms.has(t);if(n.getState().knownAtoms.add(t),"loading"===o.state){const notifyDefaultSubscribers=()=>{var e;(null!==(e=n.getState().nextTree)&&void 0!==e?e:n.getState().currentTree).atomValues.has(t)||er(n,c)};o.contents.then(notifyDefaultSubscribers).catch(notifyDefaultSubscribers)}let d=Hn,f=null;if(null!=e.effects_UNSTABLE&&!s){let r=!0;const setSelf=e=>t=>{if(r){const e=d instanceof Kn||on(d)?"hasValue"===o.state?o.contents:Hn:d;d="function"==typeof t?t(e):t}else{if(on(t))throw new Error("Setting atoms to async values is not implemented.");"function"!=typeof t&&(f={effect:e,value:t}),tr(n,c,"function"==typeof t?n=>{const r=t(n);return f={effect:e,value:r},r}:t)}},resetSelf=e=>()=>setSelf(e)(Hn),onSet=e=>r=>{n.subscribeToTransactions(n=>{var i;let{currentTree:a,previousTree:s}=n.getState();s||(l("Transaction subscribers notified without a next tree being present -- this is a bug in Recoil"),s=a);const u=a.atomValues.get(t);if(null==u||"hasValue"===u.state){var c,d,p;const n=null!=u?u.contents:Hn,i=null!==(c=s.atomValues.get(t))&&void 0!==c?c:o,a="hasValue"===i.state?i.contents:Hn;(null===(d=f)||void 0===d?void 0:d.effect)===e&&(null===(p=f)||void 0===p?void 0:p.value)===n||r(n,a)}(null===(i=f)||void 0===i?void 0:i.effect)===e&&(f=null)},t)};for(const t of null!==(p=e.effects_UNSTABLE)&&void 0!==p?p:[]){var p;const e=t({node:c,trigger:a,setSelf:setSelf(t),resetSelf:resetSelf(t),onSet:onSet(t)});null!=e&&u.set(n,e)}r=!1}if(!(d instanceof Kn)){var h;const e=on(d)?Wn(function wrapPendingPromise(e,n){const r=n.then(n=>{var i,o;return(null===(o=(null!==(i=e.getState().nextTree)&&void 0!==i?i:e.getState().currentTree).atomValues.get(t))||void 0===o?void 0:o.contents)===r&&tr(e,c,n),{__key:t,__value:n}}).catch(n=>{var i,o;throw(null===(o=(null!==(i=e.getState().nextTree)&&void 0!==i?i:e.getState().currentTree).atomValues.get(t))||void 0===o?void 0:o.contents)===r&&nr(e,c,$n(n)),n});return r}(n,d)):Gn(d);r.atomValues.set(t,e),null===(h=n.getState().nextTree)||void 0===h||h.atomValues.set(t,e)}return()=>{var e;i--,null===(e=u.get(n))||void 0===e||e(),u.delete(n),n.getState().knownAtoms.delete(t)}},invalidate:function invalidateAtom(){a=void 0},shouldDeleteConfigOnRelease:function shouldDeleteConfigOnReleaseAtom(){return void 0!==Yn(t)&&i<=0},dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return c}function atom(e){const{default:t,...n}=e;return Jn(t)?function atomWithFallback(e){const t=atom({...e,default:Hn,persistence_UNSTABLE:void 0===e.persistence_UNSTABLE?void 0:{...e.persistence_UNSTABLE,validator:t=>t instanceof Kn?t:s(e.persistence_UNSTABLE).validator(t,Hn)},effects_UNSTABLE:e.effects_UNSTABLE}),n=Qn({key:e.key+"__withFallback",get:({get:n})=>{const r=n(t);return r instanceof Kn?e.default:r},set:({set:e},n)=>e(t,n),dangerouslyAllowMutability:e.dangerouslyAllowMutability});return Zn(n.key,Yn(e.key)),n}({...n,default:t}):baseAtom({...n,default:t})}var ir=atom;var or=class MapCache{constructor(e){var t;_defineProperty(this,"_map",void 0),_defineProperty(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=null!==(t=null==e?void 0:e.mapKey)&&void 0!==t?t:e=>e}size(){return this._map.size}has(e){return this._map.has(this._keyMapper(e))}get(e){return this._map.get(this._keyMapper(e))}set(e,t){this._map.set(this._keyMapper(e),t)}delete(e){this._map.delete(this._keyMapper(e))}clear(){this._map.clear()}},ar=Object.freeze({__proto__:null,MapCache:or});const{LRUCache:sr}=vn,{MapCache:lr}=ar,ur={equality:"reference",eviction:"none",maxSize:1/0};var cr=function cacheFromPolicy({equality:e=ur.equality,eviction:t=ur.eviction,maxSize:n=ur.maxSize}=ur){return function getCache(e,t,n){switch(e){case"none":return new lr({mapKey:n});case"lru":return new sr({mapKey:n,maxSize:s(t)})}throw new Error("Unrecognized eviction policy "+e)}(t,n,function getValueMapper$1(e){switch(e){case"reference":return e=>e;case"value":return e=>dn(e)}throw new Error("Unrecognized equality policy "+e)}(e))};const{setConfigDeletionHandler:dr}=T;let fr=0;var pr=function selectorFamily(e){var t;const n=cr(null!==(t=e.cachePolicyForParams_UNSTABLE)&&void 0!==t?t:{equality:"value",eviction:"none"});return t=>{var r;const i=n.get(t);if(null!=i)return i;const o=`${e.key}__selectorFamily/${null!==(r=dn(t,{allowFunctions:!0}))&&void 0!==r?r:"void"}/${fr++}`,myGet=n=>e.get(t)(n),a=e.cachePolicy_UNSTABLE,s="function"==typeof e.retainedBy_UNSTABLE?e.retainedBy_UNSTABLE(t):e.retainedBy_UNSTABLE;let l;if(null!=e.set){const n=e.set;l=Qn({key:o,get:myGet,set:(e,r)=>n(t)(e,r),cachePolicy_UNSTABLE:a,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:s})}else l=Qn({key:o,get:myGet,cachePolicy_UNSTABLE:a,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:s});return n.set(t,l),dr(l.key,()=>{n.delete(t)}),l}};const{DEFAULT_VALUE:hr,DefaultValue:vr,setConfigDeletionHandler:yr}=T;var mr=function atomFamily(e){var t;const n=cr(null!==(t=e.cachePolicyForParams_UNSTABLE)&&void 0!==t?t:{equality:"value",eviction:"none"}),r={key:e.key,default:hr,persistence_UNSTABLE:e.persistence_UNSTABLE};let i;i=ir(r);const o=pr({key:e.key+"__atomFamily/Default",get:t=>({get:n})=>{const r=n("function"==typeof i?i(t):i);return r instanceof vr?"function"==typeof e.default?e.default(t):e.default:r},dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:e.retainedBy_UNSTABLE});return t=>{var r;const i=n.get(t);if(null!=i)return i;const{cachePolicyForParams_UNSTABLE:a,...s}=e,l=ir({...s,key:`${e.key}__${null!==(r=dn(t))&&void 0!==r?r:"void"}`,default:o(t),retainedBy_UNSTABLE:"function"==typeof e.retainedBy_UNSTABLE?e.retainedBy_UNSTABLE(t):e.retainedBy_UNSTABLE,effects_UNSTABLE:"function"==typeof e.effects_UNSTABLE?e.effects_UNSTABLE(t):e.effects_UNSTABLE});return n.set(t,l),yr(l.key,()=>{n.delete(t)}),l}};const br=pr({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});var gr=function constSelector(e){return br(e)};const _r=pr({key:"__error",get:e=>()=>{throw new Error(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});var Sr=function errorSelector(e){return _r(e)};var Or=function readOnlySelector(e){return e};const{loadableWithError:Er,loadableWithPromise:wr,loadableWithValue:Tr}=ln;function concurrentRequests(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[i,o]of t.entries())try{n[i]=e(o)}catch(e){r[i]=e}return[n,r]}function isError(e){return null!=e&&!on(e)}function unwrapDependencies(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function getValueFromLoadablePromiseResult(e){return null!=e&&"object"==typeof e&&e.hasOwnProperty("__value")?e.__value:e}function wrapResults(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((e,n,r)=>({...e,[n]:t[r]}),{})}function wrapLoadables(e,t,n){return wrapResults(e,n.map((e,n)=>null==e?Tr(t[n]):on(e)?wr(e):Er(e)))}var Cr={waitForNone:pr({key:"__waitForNone",get:e=>({get:t})=>{const n=unwrapDependencies(e),[r,i]=concurrentRequests(t,n);return wrapLoadables(e,r,i)}}),waitForAny:pr({key:"__waitForAny",get:e=>({get:t})=>{const n=unwrapDependencies(e),[r,i]=concurrentRequests(t,n);return i.some(e=>!on(e))?wrapLoadables(e,r,i):new Promise(t=>{for(const[n,o]of i.entries())on(o)&&o.then(o=>{r[n]=getValueFromLoadablePromiseResult(o),i[n]=void 0,t(wrapLoadables(e,r,i))}).catch(o=>{i[n]=o,t(wrapLoadables(e,r,i))})})}}),waitForAll:pr({key:"__waitForAll",get:e=>({get:t})=>{const n=unwrapDependencies(e),[r,i]=concurrentRequests(t,n);if(i.every(e=>null==e))return wrapResults(e,r);const o=i.find(isError);if(null!=o)throw o;return Promise.all(i).then(t=>wrapResults(e,function combineAsyncResultsWithSyncResults(e,t){return t.map((t,n)=>void 0===t?e[n]:t)}(r,t).map(getValueFromLoadablePromiseResult)))}}),waitForAllSettled:pr({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=unwrapDependencies(e),[r,i]=concurrentRequests(t,n);return i.every(e=>!on(e))?wrapLoadables(e,r,i):Promise.all(i.map((e,t)=>on(e)?e.then(e=>{r[t]=getValueFromLoadablePromiseResult(e),i[t]=void 0}).catch(e=>{r[t]=void 0,i[t]=e}):null)).then(()=>wrapLoadables(e,r,i))}}),noWait:pr({key:"__noWait",get:e=>({get:t})=>{try{return Tr(t(e))}catch(e){return on(e)?wr(e):Er(e)}}})};const{batchUpdates:Ar,setBatcher:jr}=ne,{DefaultValue:Ir}=T,{RecoilRoot:Pr}=ft,{isRecoilValue:Mr}=_,{retentionZone:kr}=C,{freshSnapshot:Rr}=ze,{useGotoRecoilSnapshot:xr,useRecoilCallback:Dr,useRecoilSnapshot:Nr,useRecoilState:Lr,useRecoilStateLoadable:Fr,useRecoilTransactionObserver:Ur,useRecoilValue:Vr,useRecoilValueLoadable:Br,useResetRecoilState:qr,useRetain:zr,useSetRecoilState:Qr,useSetUnvalidatedAtomValues:$r,useTransactionObservation_DEPRECATED:Wr}=Yt,{noWait:Gr,waitForAll:Hr,waitForAllSettled:Kr,waitForAny:Yr,waitForNone:Xr}=Cr;var Zr={DefaultValue:Ir,RecoilRoot:Pr,useRecoilBridgeAcrossReactRoots_UNSTABLE:rn,atom:ir,selector:Qn,retentionZone:kr,atomFamily:mr,selectorFamily:pr,constSelector:gr,errorSelector:Sr,readOnlySelector:Or,useRecoilValue:Vr,useRecoilValueLoadable:Br,useRecoilState:Lr,useRecoilStateLoadable:Fr,useSetRecoilState:Qr,useResetRecoilState:qr,useGetRecoilValueInfo_UNSTABLE:Jt,useRetain:zr,useRecoilCallback:Dr,useGotoRecoilSnapshot:xr,useRecoilSnapshot:Nr,useRecoilTransactionObserver_UNSTABLE:Ur,useTransactionObservation_UNSTABLE:Wr,useSetUnvalidatedAtomValues_UNSTABLE:$r,noWait:Gr,waitForNone:Xr,waitForAny:Yr,waitForAll:Hr,waitForAllSettled:Kr,isRecoilValue:Mr,batchUpdates:Ar,setBatcher:jr,snapshot_UNSTABLE:Rr},Jr=Zr.DefaultValue,ei=Zr.RecoilRoot,ti=Zr.useRecoilBridgeAcrossReactRoots_UNSTABLE,ni=Zr.atom,ri=Zr.selector,ii=Zr.retentionZone,oi=Zr.atomFamily,ai=Zr.selectorFamily,si=Zr.constSelector,li=Zr.errorSelector,ui=Zr.readOnlySelector,ci=Zr.useRecoilValue,di=Zr.useRecoilValueLoadable,fi=Zr.useRecoilState,pi=Zr.useRecoilStateLoadable,hi=Zr.useSetRecoilState,vi=Zr.useResetRecoilState,yi=Zr.useGetRecoilValueInfo_UNSTABLE,mi=Zr.useRetain,bi=Zr.useRecoilCallback,gi=Zr.useGotoRecoilSnapshot,_i=Zr.useRecoilSnapshot,Si=Zr.useRecoilTransactionObserver_UNSTABLE,Oi=Zr.useTransactionObservation_UNSTABLE,Ei=Zr.useSetUnvalidatedAtomValues_UNSTABLE,wi=Zr.noWait,Ti=Zr.waitForNone,Ci=Zr.waitForAny,Ai=Zr.waitForAll,ji=Zr.waitForAllSettled,Ii=Zr.isRecoilValue,Pi=Zr.batchUpdates,Mi=Zr.setBatcher,ki=Zr.snapshot_UNSTABLE;t.default=Zr},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useNotify=t.useMediaUiTheme=t.useMediaUi=t.useIntl=t.createUseMediaUiStyles=t.NotifyProvider=t.MediaUiThemeProvider=t.MediaUiProvider=t.IntlProvider=t.Helper=t.Events=t.Components=void 0;var a=n(65);Object.defineProperty(t,"IntlProvider",{enumerable:!0,get:function(){return a.IntlProvider}}),Object.defineProperty(t,"MediaUiProvider",{enumerable:!0,get:function(){return a.MediaUiProvider}}),Object.defineProperty(t,"MediaUiThemeProvider",{enumerable:!0,get:function(){return a.MediaUiThemeProvider}}),Object.defineProperty(t,"NotifyProvider",{enumerable:!0,get:function(){return a.NotifyProvider}}),Object.defineProperty(t,"createUseMediaUiStyles",{enumerable:!0,get:function(){return a.createUseMediaUiStyles}}),Object.defineProperty(t,"useIntl",{enumerable:!0,get:function(){return a.useIntl}}),Object.defineProperty(t,"useMediaUi",{enumerable:!0,get:function(){return a.useMediaUi}}),Object.defineProperty(t,"useMediaUiTheme",{enumerable:!0,get:function(){return a.useMediaUiTheme}}),Object.defineProperty(t,"useNotify",{enumerable:!0,get:function(){return a.useNotify}});var s=o(n(56));t.Events=s;var l=o(n(45));t.Components=l;var u=o(n(57));t.Helper=u},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(31));e.exports=(0,r.default)("NeosProjectPackages")().ReactUiComponents},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useUpdateTag=t.useUpdateAssetCollection=t.useUpdateAsset=t.useUntagAsset=t.useTagsQuery=t.useSetAssetTags=t.useSetAssetCollections=t.useSelectedTag=t.useSelectedAssetCollection=t.useSelectedAsset=t.useSelectTag=t.useSelectAssetSource=t.useSelectAssetCollection=t.useSelectAsset=t.useImportAsset=t.useEvent=t.useDeleteTag=t.useDeleteAssetCollection=t.useDeleteAsset=t.useCreateTag=t.useCreateAssetCollection=t.useConfigQuery=t.useAssetsQuery=t.useAssetSourcesQuery=t.useAssetQuery=t.useAssetCountQuery=t.useAssetCollectionsQuery=void 0;var i=r(n(174));t.useAssetCollectionsQuery=i.default;var o=r(n(187));t.useAssetCountQuery=o.default;var a=r(n(107));t.useAssetQuery=a.default;var s=r(n(195));t.useAssetSourcesQuery=s.default;var l=r(n(196));t.useAssetsQuery=l.default;var u=r(n(197));t.useConfigQuery=u.default;var c=r(n(198));t.useCreateAssetCollection=c.default;var d=r(n(212));t.useCreateTag=d.default;var f=r(n(213));t.useDeleteAsset=f.default;var p=r(n(217));t.useDeleteAssetCollection=p.default;var h=r(n(218));t.useDeleteTag=h.default;var v=r(n(219));t.useEvent=v.default;var y=r(n(220));t.useImportAsset=y.default;var m=r(n(221));t.useSelectAsset=m.default;var b=r(n(222));t.useSelectAssetCollection=b.default;var g=r(n(223));t.useSelectAssetSource=g.default;var _=r(n(224));t.useSelectTag=_.default;var S=r(n(225));t.useSelectedAsset=S.default;var O=r(n(69));t.useSelectedAssetCollection=O.default;var E=r(n(67));t.useSelectedTag=E.default;var w=r(n(226));t.useSetAssetCollections=w.default;var T=r(n(227));t.useSetAssetTags=T.default;var C=r(n(228));t.useTagsQuery=C.default;var j=r(n(229));t.useUntagAsset=j.default;var I=r(n(230));t.useUpdateAsset=I.default;var P=r(n(231));t.useUpdateAssetCollection=P.default;var M=r(n(232));t.useUpdateTag=M.default},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return fieldNameFromStoreName})),n.d(t,"e",(function(){return selectionSetMatchesResult})),n.d(t,"f",(function(){return storeValueIsStoreObject})),n.d(t,"d",(function(){return makeProcessedFieldsMerger}));var r=n(2),i=Object.prototype.hasOwnProperty;var o=/^[_a-z][_0-9a-z]*/i;function fieldNameFromStoreName(e){var t=e.match(o);return t?t[0]:e}function selectionSetMatchesResult(e,t,n){return!(!t||"object"!=typeof t)&&(Array.isArray(t)?t.every((function(t){return selectionSetMatchesResult(e,t,n)})):e.selections.every((function(e){if(Object(r.z)(e)&&Object(r.L)(e,n)){var o=Object(r.K)(e);return i.call(t,o)&&(!e.selectionSet||selectionSetMatchesResult(e.selectionSet,t[o],n))}return!0})))}function storeValueIsStoreObject(e){return null!==e&&"object"==typeof e&&!Object(r.C)(e)&&!Array.isArray(e)}function makeProcessedFieldsMerger(){return new r.b}},function(e,t,n){"use strict";n.d(t,"a",(function(){return equal}));var r=Object.prototype,i=r.toString,o=r.hasOwnProperty,a=Function.prototype.toString,s=new Map;function equal(e,t){try{return function check(e,t){if(e===t)return!0;var n=i.call(e),r=i.call(t);if(n!==r)return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(previouslyCompared(e,t))return!0;var s=definedKeys(e),u=definedKeys(t),c=s.length;if(c!==u.length)return!1;for(var d=0;d=0&&e.indexOf(t,n)===n}(g,l)}return!1}(e,t)}finally{s.clear()}}function definedKeys(e){return Object.keys(e).filter(isDefinedKey,e)}function isDefinedKey(e){return void 0!==this[e]}var l="{ [native code] }";function previouslyCompared(e,t){var n=s.get(e);if(n){if(n.has(t))return!0}else s.set(e,n=new Set);return n.add(t),!1}},function(e,t,n){"use strict";function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<+~=|^:(),"'`\s])/g,f="undefined"!=typeof CSS&&CSS.escape,jss_esm_escape=function(e){return f?f(e):e.replace(d,"\\$1")},p=function(){function BaseStyleRule(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return BaseStyleRule.prototype.prop=function prop(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},BaseStyleRule}(),h=function(e){function StyleRule(t,n,r){var i;(i=e.call(this,t,n,r)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var o=r.selector,a=r.scoped,s=r.sheet,l=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=l(_assertThisInitialized(_assertThisInitialized(i)),s),i.selectorText="."+jss_esm_escape(i.id)),i}Object(a.a)(StyleRule,e);var t=StyleRule.prototype;return t.applyTo=function applyTo(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},t.toJSON=function toJSON(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=c(n))}return e},t.toString=function toString(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(r.a)({},e,{allowEmpty:!0}):e;return toCss(this.selectorText,this.style,n)},_createClass(StyleRule,[{key:"selector",set:function set(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function get(){return this.selectorText}}]),StyleRule}(p),v={onCreateRule:function onCreateRule(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new h(e,t,n)}},y={indent:1,children:!0},m=/@([\w-]+)/,b=function(){function ConditionalRule(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e;var i=e.match(m);for(var o in this.at=i?i[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new q(Object(r.a)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var e=ConditionalRule.prototype;return e.getRule=function getRule(e){return this.rules.get(e)},e.indexOf=function indexOf(e){return this.rules.indexOf(e)},e.addRule=function addRule(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},e.toString=function toString(e){if(void 0===e&&(e=y),null==e.indent&&(e.indent=y.indent),null==e.children&&(e.children=y.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},ConditionalRule}(),g=/@media|@supports\s+/,_={onCreateRule:function onCreateRule(e,t,n){return g.test(e)?new b(e,t,n):null}},S={indent:1,children:!0},O=/@keyframes\s+([\w-]+)/,E=function(){function KeyframesRule(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=e.match(O);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var l in this.id=!1===o?this.name:jss_esm_escape(s(this,a)),this.rules=new q(Object(r.a)({},n,{parent:this})),t)this.rules.add(l,t[l],Object(r.a)({},n,{parent:this}));this.rules.process()}return KeyframesRule.prototype.toString=function toString(e){if(void 0===e&&(e=S),null==e.indent&&(e.indent=S.indent),null==e.children&&(e.children=S.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},KeyframesRule}(),w=/@keyframes\s+/,T=/\$([\w-]+)/g,C=function findReferencedKeyframe(e,t){return"string"==typeof e?e.replace(T,(function(e,n){return n in t?t[n]:e})):e},j=function replaceRef(e,t,n){var r=e[t],i=C(r,n);i!==r&&(e[t]=i)},I={onCreateRule:function onCreateRule(e,t,n){return"string"==typeof e&&w.test(e)?new E(e,t,n):null},onProcessStyle:function onProcessStyle(e,t,n){return"style"===t.type&&n?("animation-name"in e&&j(e,"animation-name",n.keyframes),"animation"in e&&j(e,"animation",n.keyframes),e):e},onChangeValue:function onChangeValue(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return C(e,r.keyframes);default:return e}}},P=function(e){function KeyframeRule(){for(var t,n=arguments.length,r=new Array(n),i=0;i=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},e.reset=function reset(){this.registry=[]},e.remove=function remove(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},e.toString=function toString(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(s.a)(t,["attached"]),i="",o=0;o0){var n=function findHigherSheet(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function findHighestSheet(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function findCommentNode(e){for(var t=re(),n=0;nn?n:t},se=function(){function DomRenderer(e){this.getPropertyValue=J,this.setProperty=ee,this.removeProperty=te,this.setSelector=ne,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,this.cssRules=[],e&&G.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,i=t.element;this.element=i||function createStyle(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var o=ie();o&&this.element.setAttribute("nonce",o)}var e=DomRenderer.prototype;return e.attach=function attach(){if(!this.element.parentNode&&this.sheet){!function insertStyle(e,t){var n=t.insertionPoint,r=findPrevNode(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else re().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function detach(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},e.deploy=function deploy(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},e.insertRules=function insertRules(e,t){for(var n=0;n0&&(t.refs--,0===t.refs&&t.sheet.detach()):Object(o.a)(!1,"SheetsManager: can't find sheet to unmanage")},_createClass(SheetsManager,[{key:"size",get:function get(){return this.length}}]),SheetsManager}(),de="object"==typeof CSS&&null!=CSS&&"number"in CSS,fe=function create(e){return new ue(e)},pe=fe();t.default=pe},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return isNode}));var r=n(52);function defineInspect(e){var t=e.prototype.toJSON;"function"==typeof t||function invariant(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,r.a&&(e.prototype[r.a]=t)}var i=function(){function Location(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return Location.prototype.toJSON=function toJSON(){return{start:this.start,end:this.end}},Location}();defineInspect(i);var o=function(){function Token(e,t,n,r,i,o,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}return Token.prototype.toJSON=function toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},Token}();function isNode(e){return null!=e&&"string"==typeof e.kind}defineInspect(o)},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS=t.TAG=t.SET_SELECTED_ASSET_SOURCE_ID=t.SELECTED_ASSET_SOURCE_ID=t.CONFIG=t.ASSET_SOURCES=t.ASSET_COUNT=t.ASSET_COLLECTIONS=t.ASSET_COLLECTION=t.ASSETS=t.ASSET=void 0;var i=r(n(175));t.ASSET=i.default;var o=r(n(178));t.ASSETS=o.default;var a=r(n(179));t.ASSET_COLLECTION=a.default;var s=r(n(180));t.ASSET_COLLECTIONS=s.default;var l=r(n(181));t.ASSET_COUNT=l.default;var u=r(n(182));t.ASSET_SOURCES=u.default;var c=r(n(183));t.CONFIG=c.default;var d=r(n(184));t.TAG=d.default;var f=r(n(185));t.TAGS=f.default;var p=n(186);Object.defineProperty(t,"SELECTED_ASSET_SOURCE_ID",{enumerable:!0,get:function(){return p.SELECTED_ASSET_SOURCE_ID}}),Object.defineProperty(t,"SET_SELECTED_ASSET_SOURCE_ID",{enumerable:!0,get:function(){return p.SET_SELECTED_ASSET_SOURCE_ID}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return dep})),n.d(t,"c",(function(){return wrap}));var defaultMakeData=function(){return Object.create(null)},r=Array.prototype,i=r.forEach,o=r.slice,a=function(){function Trie(e,t){void 0===e&&(e=!0),void 0===t&&(t=defaultMakeData),this.weakness=e,this.makeData=t}return Trie.prototype.lookup=function(){for(var e=[],t=0;tthis.max;)this.delete(this.oldest.key)},Cache.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},Cache}(),u=new s.a;function maybeUnsubscribe(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var c=[];function assert(e,t){if(!e)throw new Error(t||"assertion failure")}function valueGet(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var d=function(){function Entry(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++Entry.count}return Entry.prototype.peek=function(){if(1===this.value.length&&!mightBeDirty(this))return this.value[0]},Entry.prototype.recompute=function(e){return assert(!this.recomputing,"already recomputing"),function rememberParent(e){var t=u.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),mightBeDirty(e)?reportDirtyChild(t,e):reportCleanChild(t,e),t}(this),mightBeDirty(this)?function reallyRecompute(e,t){forgetChildren(e),u.withValue(e,recomputeNewValue,[e,t]),function maybeSubscribe(e,t){if("function"==typeof e.subscribe)try{maybeUnsubscribe(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function setClean(e){if(e.dirty=!1,mightBeDirty(e))return;reportClean(e)}(e);return valueGet(e.value)}(this,e):valueGet(this.value)},Entry.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,reportDirty(this),forgetChildren(this),maybeUnsubscribe(this))},Entry.prototype.dispose=function(){var e=this;forgetChildren(this),maybeUnsubscribe(this),this.parents.forEach((function(t){t.setDirty(),forgetChild(t,e)}))},Entry.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=c.pop()||new Set),this.deps.add(e)},Entry.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),c.push(this.deps),this.deps=null)},Entry.count=0,Entry}();function recomputeNewValue(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function mightBeDirty(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function reportDirty(e){e.parents.forEach((function(t){return reportDirtyChild(t,e)}))}function reportClean(e){e.parents.forEach((function(t){return reportCleanChild(t,e)}))}function reportDirtyChild(e,t){if(assert(e.childValues.has(t)),assert(mightBeDirty(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=c.pop()||new Set;e.dirtyChildren.add(t),reportDirty(e)}function reportCleanChild(e,t){assert(e.childValues.has(t)),assert(!mightBeDirty(t));var n=e.childValues.get(t);0===n.length?e.childValues.set(t,function valueCopy(e){return e.slice(0)}(t.value)):function valueIs(e,t){var n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}(n,t.value)||e.setDirty(),removeDirtyChild(e,t),mightBeDirty(e)||reportClean(e)}function removeDirtyChild(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(c.length<100&&c.push(n),e.dirtyChildren=null))}function forgetChildren(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){forgetChild(e,n)})),e.forgetDeps(),assert(null===e.dirtyChildren)}function forgetChild(e,t){t.parents.delete(e),e.childValues.delete(t),removeDirtyChild(e,t)}function dep(e){var t=new Map,n=e&&e.subscribe;function depend(e){var r=u.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(maybeUnsubscribe(i),i.unsubscribe=n(e))}}return depend.dirty=function dirty(e){var n=t.get(e);n&&(n.forEach((function(e){return e.setDirty()})),t.delete(e),maybeUnsubscribe(n))},depend}var f=new a("function"==typeof WeakMap);function defaultMakeCacheKey(){for(var e=[],t=0;t0)e!==o&&(e=o,t.forEach((function(e){getCacheInfo(e).dep.dirty(rv),broadcast(e)})),consumeAndIterate(n,(function(t){return t(e)})));else{var a=i.getValue();a&&(r(a),getCacheInfo(a).dep(rv))}return e};rv.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var r=rv.attachCache=function(e){return t.add(e),getCacheInfo(e).vars.add(rv),rv};return rv.forgetCache=function(e){return t.delete(e)},rv}function broadcast(e){e.broadcastWatches&&e.broadcastWatches()}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType;t.a=i},function(e,t,n){"use strict";function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return _objectWithoutPropertiesLoose}))},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.TAG_FRAGMENT=void 0;var i,o=n(4);t.TAG_FRAGMENT=o.gql(i||(i=r(["\n fragment TagProps on Tag {\n id\n label\n }\n"],["\n fragment TagProps on Tag {\n id\n label\n }\n"])))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useUnusedAssetCountQuery=t.useUnusedAssetsQuery=t.useAssetUsagesQuery=t.showUnusedAssetsState=t.assetUsageDetailsModalState=t.UsageDetailsMetadataType=t.USAGE_DETAILS_GROUP_FRAGMENT=t.UNUSED_ASSETS=t.AssetUsagesToggleButton=t.AssetUsagesModal=t.ASSET_USAGE_DETAILS=void 0;var i=r(n(112));t.ASSET_USAGE_DETAILS=i.default;var o=r(n(114));t.UNUSED_ASSETS=o.default;var a=r(n(113));t.USAGE_DETAILS_GROUP_FRAGMENT=a.default;var s=n(247);Object.defineProperty(t,"UsageDetailsMetadataType",{enumerable:!0,get:function(){return s.UsageDetailsMetadataType}});var l=r(n(248));t.AssetUsagesModal=l.default;var u=r(n(250));t.AssetUsagesToggleButton=u.default;var c=r(n(71));t.assetUsageDetailsModalState=c.default;var d=r(n(116));t.showUnusedAssetsState=d.default;var f=r(n(115));t.useAssetUsagesQuery=f.default;var p=r(n(251));t.useUnusedAssetsQuery=p.default;var h=r(n(252));t.useUnusedAssetCountQuery=h.default},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Main=t.AssetActions=t.ListViewItem=t.ListView=t.Thumbnail=t.ThumbnailView=void 0;var i=r(n(331));t.AssetActions=i.default;var o=r(n(332));t.ListView=o.default;var a=r(n(333));t.ListViewItem=a.default;var s=r(n(334));t.Main=s.default;var l=r(n(336));t.Thumbnail=l.default;var u=r(n(337));t.ThumbnailView=u.default},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function r(e,t,n,i,o){this.message=e,this.path=t,this.query=n,this.clientOnly=i,this.variables=o}},function(e,t,n){"use strict";var __assign=function(){return(__assign=Object.assign||function __assign(e){for(var t,n=1,r=arguments.length;n120){for(var f=Math.floor(l/80),p=l%80,h=[],v=0;v",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),l=n(62);function devAssert(e,t){if(!Boolean(e))throw new Error(t)}var u=function instanceOf(e,t){return e instanceof t};function source_defineProperties(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||devAssert(0,"Body must be a string. Received: ".concat(Object(l.a)(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||devAssert(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||devAssert(0,"column in locationOffset is 1-indexed and must be positive.")}return function source_createClass(e,t,n){return t&&source_defineProperties(e.prototype,t),n&&source_defineProperties(e,n),e}(Source,[{key:r,get:function get(){return"Source"}}]),Source}();var d=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),f=n(63),p=function(){function Lexer(e){var t=new a.b(s.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var e=Lexer.prototype;return e.advance=function advance(){return this.lastToken=this.token,this.token=this.lookahead()},e.lookahead=function lookahead(){var e=this.token;if(e.kind!==s.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=readToken(this,e)}while(e.kind===s.COMMENT);return e},Lexer}();function printCharCode(e){return isNaN(e)?s.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function readToken(e,t){for(var n=e.source,r=n.body,i=r.length,o=t.end;o31||9===o));return new a.b(s.COMMENT,t,u,n,r,i,l.slice(t+1,u))}function readNumber(e,t,n,r,i,o){var l=e.body,u=n,c=t,d=!1;if(45===u&&(u=l.charCodeAt(++c)),48===u){if((u=l.charCodeAt(++c))>=48&&u<=57)throw syntaxError(e,c,"Invalid number, unexpected digit after 0: ".concat(printCharCode(u),"."))}else c=readDigits(e,c,u),u=l.charCodeAt(c);if(46===u&&(d=!0,u=l.charCodeAt(++c),c=readDigits(e,c,u),u=l.charCodeAt(c)),69!==u&&101!==u||(d=!0,43!==(u=l.charCodeAt(++c))&&45!==u||(u=l.charCodeAt(++c)),c=readDigits(e,c,u),u=l.charCodeAt(c)),46===u||function isNameStart(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(u))throw syntaxError(e,c,"Invalid number, expected digit but got: ".concat(printCharCode(u),"."));return new a.b(d?s.FLOAT:s.INT,t,c,r,i,o,l.slice(t,c))}function readDigits(e,t,n){var r=e.body,i=t,o=n;if(o>=48&&o<=57){do{o=r.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw syntaxError(e,i,"Invalid number, expected digit but got: ".concat(printCharCode(o),"."))}function readString(e,t,n,r,i){for(var o,l,u,c,d=e.body,f=t+1,p=f,h=0,v="";f=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function readName(e,t,n,r,i){for(var o=e.body,l=o.length,u=t+1,c=0;u!==l&&!isNaN(c=o.charCodeAt(u))&&(95===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++u;return new a.b(s.NAME,t,u,n,r,i,o.slice(t,u))}var h=function(){function Parser(e,t){var n=function isSource(e){return u(e,c)}(e)?e:new c(e);this._lexer=new p(n),this._options=t}var e=Parser.prototype;return e.parseName=function parseName(){var e=this.expectToken(s.NAME);return{kind:o.NAME,value:e.value,loc:this.loc(e)}},e.parseDocument=function parseDocument(){var e=this._lexer.token;return{kind:o.DOCUMENT,definitions:this.many(s.SOF,this.parseDefinition,s.EOF),loc:this.loc(e)}},e.parseDefinition=function parseDefinition(){if(this.peek(s.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(s.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function parseOperationDefinition(){var e=this._lexer.token;if(this.peek(s.BRACE_L))return{kind:o.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(s.NAME)&&(t=this.parseName()),{kind:o.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},e.parseOperationType=function parseOperationType(){var e=this.expectToken(s.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},e.parseVariableDefinitions=function parseVariableDefinitions(){return this.optionalMany(s.PAREN_L,this.parseVariableDefinition,s.PAREN_R)},e.parseVariableDefinition=function parseVariableDefinition(){var e=this._lexer.token;return{kind:o.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(s.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(s.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},e.parseVariable=function parseVariable(){var e=this._lexer.token;return this.expectToken(s.DOLLAR),{kind:o.VARIABLE,name:this.parseName(),loc:this.loc(e)}},e.parseSelectionSet=function parseSelectionSet(){var e=this._lexer.token;return{kind:o.SELECTION_SET,selections:this.many(s.BRACE_L,this.parseSelection,s.BRACE_R),loc:this.loc(e)}},e.parseSelection=function parseSelection(){return this.peek(s.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function parseField(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(s.COLON)?(e=r,t=this.parseName()):t=r,{kind:o.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(s.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function parseArguments(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(s.PAREN_L,t,s.PAREN_R)},e.parseArgument=function parseArgument(){var e=this._lexer.token,t=this.parseName();return this.expectToken(s.COLON),{kind:o.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},e.parseConstArgument=function parseConstArgument(){var e=this._lexer.token;return{kind:o.ARGUMENT,name:this.parseName(),value:(this.expectToken(s.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},e.parseFragment=function parseFragment(){var e=this._lexer.token;this.expectToken(s.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(s.NAME)?{kind:o.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:o.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},e.parseFragmentDefinition=function parseFragmentDefinition(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:o.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:o.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},e.parseFragmentName=function parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},e.parseValueLiteral=function parseValueLiteral(e){var t=this._lexer.token;switch(t.kind){case s.BRACKET_L:return this.parseList(e);case s.BRACE_L:return this.parseObject(e);case s.INT:return this._lexer.advance(),{kind:o.INT,value:t.value,loc:this.loc(t)};case s.FLOAT:return this._lexer.advance(),{kind:o.FLOAT,value:t.value,loc:this.loc(t)};case s.STRING:case s.BLOCK_STRING:return this.parseStringLiteral();case s.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:o.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:o.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:o.NULL,loc:this.loc(t)};default:return{kind:o.ENUM,value:t.value,loc:this.loc(t)}}case s.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},e.parseStringLiteral=function parseStringLiteral(){var e=this._lexer.token;return this._lexer.advance(),{kind:o.STRING,value:e.value,block:e.kind===s.BLOCK_STRING,loc:this.loc(e)}},e.parseList=function parseList(e){var t=this,n=this._lexer.token;return{kind:o.LIST,values:this.any(s.BRACKET_L,(function item(){return t.parseValueLiteral(e)}),s.BRACKET_R),loc:this.loc(n)}},e.parseObject=function parseObject(e){var t=this,n=this._lexer.token;return{kind:o.OBJECT,fields:this.any(s.BRACE_L,(function item(){return t.parseObjectField(e)}),s.BRACE_R),loc:this.loc(n)}},e.parseObjectField=function parseObjectField(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(s.COLON),{kind:o.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},e.parseDirectives=function parseDirectives(e){for(var t=[];this.peek(s.AT);)t.push(this.parseDirective(e));return t},e.parseDirective=function parseDirective(e){var t=this._lexer.token;return this.expectToken(s.AT),{kind:o.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},e.parseTypeReference=function parseTypeReference(){var e,t=this._lexer.token;return this.expectOptionalToken(s.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(s.BRACKET_R),e={kind:o.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(s.BANG)?{kind:o.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},e.parseNamedType=function parseNamedType(){var e=this._lexer.token;return{kind:o.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},e.parseTypeSystemDefinition=function parseTypeSystemDefinition(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===s.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},e.peekDescription=function peekDescription(){return this.peek(s.STRING)||this.peek(s.BLOCK_STRING)},e.parseDescription=function parseDescription(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function parseSchemaDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(s.BRACE_L,this.parseOperationTypeDefinition,s.BRACE_R);return{kind:o.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},e.parseOperationTypeDefinition=function parseOperationTypeDefinition(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(s.COLON);var n=this.parseNamedType();return{kind:o.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},e.parseScalarTypeDefinition=function parseScalarTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:o.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},e.parseObjectTypeDefinition=function parseObjectTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:o.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},e.parseImplementsInterfaces=function parseImplementsInterfaces(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(s.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(s.AMP)||this.peek(s.NAME));return t}return this.delimitedMany(s.AMP,this.parseNamedType)},e.parseFieldsDefinition=function parseFieldsDefinition(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(s.BRACE_L)&&this._lexer.lookahead().kind===s.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(s.BRACE_L,this.parseFieldDefinition,s.BRACE_R)},e.parseFieldDefinition=function parseFieldDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(s.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:o.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a,loc:this.loc(e)}},e.parseArgumentDefs=function parseArgumentDefs(){return this.optionalMany(s.PAREN_L,this.parseInputValueDef,s.PAREN_R)},e.parseInputValueDef=function parseInputValueDef(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(s.COLON);var r,i=this.parseTypeReference();this.expectOptionalToken(s.EQUALS)&&(r=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:o.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:a,loc:this.loc(e)}},e.parseInterfaceTypeDefinition=function parseInterfaceTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:o.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},e.parseUnionTypeDefinition=function parseUnionTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:o.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},e.parseUnionMemberTypes=function parseUnionMemberTypes(){return this.expectOptionalToken(s.EQUALS)?this.delimitedMany(s.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function parseEnumTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:o.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},e.parseEnumValuesDefinition=function parseEnumValuesDefinition(){return this.optionalMany(s.BRACE_L,this.parseEnumValueDefinition,s.BRACE_R)},e.parseEnumValueDefinition=function parseEnumValueDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:o.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},e.parseInputObjectTypeDefinition=function parseInputObjectTypeDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:o.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},e.parseInputFieldsDefinition=function parseInputFieldsDefinition(){return this.optionalMany(s.BRACE_L,this.parseInputValueDef,s.BRACE_R)},e.parseTypeSystemExtension=function parseTypeSystemExtension(){var e=this._lexer.lookahead();if(e.kind===s.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},e.parseSchemaExtension=function parseSchemaExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(s.BRACE_L,this.parseOperationTypeDefinition,s.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:o.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},e.parseScalarTypeExtension=function parseScalarTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:o.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},e.parseObjectTypeExtension=function parseObjectTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:o.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},e.parseInterfaceTypeExtension=function parseInterfaceTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:o.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},e.parseUnionTypeExtension=function parseUnionTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:o.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},e.parseEnumTypeExtension=function parseEnumTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:o.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},e.parseInputObjectTypeExtension=function parseInputObjectTypeExtension(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:o.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},e.parseDirectiveDefinition=function parseDirectiveDefinition(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(s.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:o.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a,loc:this.loc(e)}},e.parseDirectiveLocations=function parseDirectiveLocations(){return this.delimitedMany(s.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function parseDirectiveLocation(){var e=this._lexer.token,t=this.parseName();if(void 0!==d[t.value])return t;throw this.unexpected(e)},e.loc=function loc(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new a.a(e,this._lexer.lastToken,this._lexer.source)},e.peek=function peek(e){return this._lexer.token.kind===e},e.expectToken=function expectToken(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw syntaxError(this._lexer.source,t.start,"Expected ".concat(getTokenKindDesc(e),", found ").concat(getTokenDesc(t),"."))},e.expectOptionalToken=function expectOptionalToken(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},e.expectKeyword=function expectKeyword(e){var t=this._lexer.token;if(t.kind!==s.NAME||t.value!==e)throw syntaxError(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(getTokenDesc(t),"."));this._lexer.advance()},e.expectOptionalKeyword=function expectOptionalKeyword(e){var t=this._lexer.token;return t.kind===s.NAME&&t.value===e&&(this._lexer.advance(),!0)},e.unexpected=function unexpected(e){var t=null!=e?e:this._lexer.token;return syntaxError(this._lexer.source,t.start,"Unexpected ".concat(getTokenDesc(t),"."))},e.any=function any(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},e.optionalMany=function optionalMany(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},e.many=function many(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},e.delimitedMany=function delimitedMany(e,t){this.expectOptionalToken(e);var n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n},Parser}();function getTokenDesc(e){var t=e.value;return getTokenKindDesc(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function getTokenKindDesc(e){return function isPunctuatorTokenKind(e){return e===s.BANG||e===s.DOLLAR||e===s.AMP||e===s.PAREN_L||e===s.PAREN_R||e===s.SPREAD||e===s.COLON||e===s.EQUALS||e===s.AT||e===s.BRACKET_L||e===s.BRACKET_R||e===s.BRACE_L||e===s.PIPE||e===s.BRACE_R}(e)?'"'.concat(e,'"'):e}var v=new Map,y=new Map,m=!0,b=!1;function normalize(e){return e.replace(/[\s,]+/g," ").trim()}function processFragments(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=function cacheKeyFromLoc(e){return normalize(e.source.body.substring(e.start,e.end))}(e.loc),o=y.get(r);o&&!o.has(i)?m&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||y.set(r,o=new Set),o.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e)})),__assign(__assign({},e),{definitions:n})}function lib_parseDocument(e){var t=normalize(e);if(!v.has(t)){var n=function parse(e,t){return new h(e,t).parseDocument()}(e,{experimentalFragmentVariables:b});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");v.set(t,function stripLoc(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(processFragments(n)))}return v.get(t)}function gql(e){for(var t=[],n=1;n=300&&Object(r.d)(t,n,"Response not successful: Received status code "+t.status),Array.isArray(n)||i.call(n,"data")||i.call(n,"errors")||Object(r.d)(t,n,"Server response was missing for query '"+(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName)+"'."),n}))}}var o=n(3),serializeFetchParameter=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=new o.a(23);throw r.parseError=e,r}return n},a=n(1),s=n(144),l=n(63);function print(e){return Object(s.b)(e,{leave:u})}var u={Name:function Name(e){return e.value},Variable:function Variable(e){return"$"+e.name},Document:function Document(e){return join(e.definitions,"\n\n")+"\n"},OperationDefinition:function OperationDefinition(e){var t=e.operation,n=e.name,r=wrap("(",join(e.variableDefinitions,", "),")"),i=join(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?join([t,join([n,r]),i,o]," "):o},VariableDefinition:function VariableDefinition(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+wrap(" = ",r)+wrap(" ",join(i," "))},SelectionSet:function SelectionSet(e){return block(e.selections)},Field:function Field(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet,a=wrap("",t,": ")+n,s=a+wrap("(",join(r,", "),")");return s.length>80&&(s=a+wrap("(\n",indent(join(r,"\n")),"\n)")),join([s,join(i," "),o]," ")},Argument:function Argument(e){return e.name+": "+e.value},FragmentSpread:function FragmentSpread(e){return"..."+e.name+wrap(" ",join(e.directives," "))},InlineFragment:function InlineFragment(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return join(["...",wrap("on ",t),join(n," "),r]," ")},FragmentDefinition:function FragmentDefinition(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(wrap("(",join(r,", "),")")," ")+"on ".concat(n," ").concat(wrap("",join(i," ")," "))+o},IntValue:function IntValue(e){return e.value},FloatValue:function FloatValue(e){return e.value},StringValue:function StringValue(e,t){var n=e.value;return e.block?Object(l.b)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function BooleanValue(e){return e.value?"true":"false"},NullValue:function NullValue(){return"null"},EnumValue:function EnumValue(e){return e.value},ListValue:function ListValue(e){return"["+join(e.values,", ")+"]"},ObjectValue:function ObjectValue(e){return"{"+join(e.fields,", ")+"}"},ObjectField:function ObjectField(e){return e.name+": "+e.value},Directive:function Directive(e){return"@"+e.name+wrap("(",join(e.arguments,", "),")")},NamedType:function NamedType(e){return e.name},ListType:function ListType(e){return"["+e.type+"]"},NonNullType:function NonNullType(e){return e.type+"!"},SchemaDefinition:addDescription((function(e){var t=e.directives,n=e.operationTypes;return join(["schema",join(t," "),block(n)]," ")})),OperationTypeDefinition:function OperationTypeDefinition(e){return e.operation+": "+e.type},ScalarTypeDefinition:addDescription((function(e){return join(["scalar",e.name,join(e.directives," ")]," ")})),ObjectTypeDefinition:addDescription((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return join(["type",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")})),FieldDefinition:addDescription((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(hasMultilineItems(n)?wrap("(\n",indent(join(n,"\n")),"\n)"):wrap("(",join(n,", "),")"))+": "+r+wrap(" ",join(i," "))})),InputValueDefinition:addDescription((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return join([t+": "+n,wrap("= ",r),join(i," ")]," ")})),InterfaceTypeDefinition:addDescription((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return join(["interface",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")})),UnionTypeDefinition:addDescription((function(e){var t=e.name,n=e.directives,r=e.types;return join(["union",t,join(n," "),r&&0!==r.length?"= "+join(r," | "):""]," ")})),EnumTypeDefinition:addDescription((function(e){var t=e.name,n=e.directives,r=e.values;return join(["enum",t,join(n," "),block(r)]," ")})),EnumValueDefinition:addDescription((function(e){return join([e.name,join(e.directives," ")]," ")})),InputObjectTypeDefinition:addDescription((function(e){var t=e.name,n=e.directives,r=e.fields;return join(["input",t,join(n," "),block(r)]," ")})),DirectiveDefinition:addDescription((function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(hasMultilineItems(n)?wrap("(\n",indent(join(n,"\n")),"\n)"):wrap("(",join(n,", "),")"))+(r?" repeatable":"")+" on "+join(i," | ")})),SchemaExtension:function SchemaExtension(e){var t=e.directives,n=e.operationTypes;return join(["extend schema",join(t," "),block(n)]," ")},ScalarTypeExtension:function ScalarTypeExtension(e){return join(["extend scalar",e.name,join(e.directives," ")]," ")},ObjectTypeExtension:function ObjectTypeExtension(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return join(["extend type",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")},InterfaceTypeExtension:function InterfaceTypeExtension(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return join(["extend interface",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")},UnionTypeExtension:function UnionTypeExtension(e){var t=e.name,n=e.directives,r=e.types;return join(["extend union",t,join(n," "),r&&0!==r.length?"= "+join(r," | "):""]," ")},EnumTypeExtension:function EnumTypeExtension(e){var t=e.name,n=e.directives,r=e.values;return join(["extend enum",t,join(n," "),block(r)]," ")},InputObjectTypeExtension:function InputObjectTypeExtension(e){var t=e.name,n=e.directives,r=e.fields;return join(["extend input",t,join(n," "),block(r)]," ")}};function addDescription(e){return function(t){return join([t.description,e(t)],"\n")}}function join(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(n))&&void 0!==t?t:""}function block(e){return wrap("{\n",indent(join(e,"\n")),"\n}")}function wrap(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function indent(e){return wrap(" ",e.replace(/\n/g,"\n "))}function isMultiline(e){return-1!==e.indexOf("\n")}function hasMultilineItems(e){return null!=e&&e.some(isMultiline)}var c={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},selectHttpOptionsAndBody=function(e,t){for(var n=[],r=2;r0},ObservableQuery.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},ObservableQuery}(s.c);function defaultSubscriptionObserverErrorCallback(e){}Object(s.l)(u)},function(e,t,n){"use strict";n.d(t,"a",(function(){return inspect}));var r=n(52);function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function inspect(e){return formatValue(e,[])}function formatValue(e,t){switch(_typeof(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function formatObjectValue(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),i=function getCustomFn(e){var t=e[String(r.a)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var o=i.call(e);if(o!==e)return"string"==typeof o?o:formatValue(o,n)}else if(Array.isArray(e))return function formatArray(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,i=[],o=0;o1&&i.push("... ".concat(r," more items"));return"["+i.join(", ")+"]"}(e,n);return function formatObject(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>2)return"["+function getObjectTag(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]";return"{ "+n.map((function(n){return n+": "+formatValue(e[n],t)})).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}},function(e,t,n){"use strict";function dedentBlockStringValue(e){var t=e.split(/\r\n|[\n\r]/g),n=function getBlockStringIndentation(e){for(var t,n=!0,r=!0,i=0,o=null,a=0;ai&&isBlank(t[o-1]);)--o;return t.slice(i,o).join("\n")}function isBlank(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!r||o||a||n,l="";return!s||r&&i||(l+="\n"+t),l+=t?e.replace(/\n/g,"\n"+t):e,s&&(l+="\n"),'"""'+l.replace(/"""/g,'\\"""')+'"""'}n.d(t,"a",(function(){return dedentBlockStringValue})),n.d(t,"b",(function(){return printBlockString}))},function(e,t,n){"use strict";var r=n(235),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function getStatics(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function hoistNonReactStatics(e,t,n){if("string"!=typeof t){if(p){var r=f(t);r&&r!==p&&hoistNonReactStatics(e,r,n)}var i=u(t);c&&(i=i.concat(c(t)));for(var a=getStatics(e),s=getStatics(t),h=0;ht&&h.error(p("uploadDialog.warning.maxFiles","You can only upload a maximum of {limit} files. {rejected} File(s) rejected",{limit:m,rejected:e.length-t})),0!==t){var r=(e.length1,preventDropOnDocument:!0,accept:t}),g=b.getRootProps,_=b.getInputProps,S=b.isDragAccept,O=b.isDragActive,E=b.isDragReject,w=f({isDragAccept:S,isDragActive:O,isDragReject:E});return s.createElement("section",null,s.createElement("div",r({},g({className:w.dropzone})),s.createElement("input",r({},_())),s.createElement("p",null,p("uploadDialog.dropzone.caption","Drag 'n' drop some files here, or click to select files")),(null==y?void 0:y.uploadMaxFileSize)>0&&s.createElement("p",null,p("uploadDialog.maxFileSize","Maximum file size is {size} and file limit is {limit}",{size:d.humanFileSize(y.uploadMaxFileSize),limit:m}))),i&&s.createElement("p",null,p("uploadDialog.label.uploading","Uploading…")))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(7),u=a(n(125)),c=l.createUseMediaUiStyles((function(e){return{fileList:{marginTop:e.spacing.full,display:"flex",flexDirection:"row",flexWrap:"wrap"},fileListHeader:{flex:"1 1 100%",marginBottom:e.spacing.full,fontSize:e.fontSize}}}));t.default=s.memo((function(e){var t=e.files,n=e.loading,r=e.uploadState,i=l.useIntl().translate,o=c();return s.createElement("aside",{className:o.fileList},t.selected.length>0&&s.createElement(s.Fragment,null,s.createElement("h4",{className:o.fileListHeader},i("uploadDialog.fileList.header","Selected files")),t.selected.map((function(e){return s.createElement(u.default,{file:e,loading:n,fileState:r.find((function(t){return t.filename===e.name})),key:e.id})}))),t.rejected.length>0&&s.createElement(s.Fragment,null,s.createElement("h4",{className:o.fileListHeader},i("uploadDialog.fileList.uploadedHeader","Failed uploads")),t.rejected.map((function(e){return s.createElement(u.default,{file:e,fileState:r.find((function(t){return t.filename===e.name})),key:e.id})}))),t.finished.length>0&&s.createElement(s.Fragment,null,s.createElement("h4",{className:o.fileListHeader},i("uploadDialog.fileList.uploadedHeader","Successful uploads")),t.finished.map((function(e){return s.createElement(u.default,{file:e,fileState:r.find((function(t){return t.filename===e.name})),key:e.id})}))))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.REPLACE_ASSET=t.UPLOAD_FILE=t.UPLOAD_FILES=void 0;var i=r(n(272));t.REPLACE_ASSET=i.default;var o=r(n(273));t.UPLOAD_FILES=o.default;var a=r(n(274));t.UPLOAD_FILE=a.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(287)).default,i=r.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=r.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=r.canUseDOM?window.NodeList:{},t.canUseDOM=r.canUseDOM;t.default=i},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7).createUseMediaUiStyles({propertyGroup:{}});t.default=function(e){var t=e.children,n=e.label,r=l();return a.createElement("div",{className:r.propertyGroup},a.createElement(s.Label,null,n),t)}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=l.createUseMediaUiStyles((function(e){return{actions:{display:"flex",position:"sticky",backgroundColor:e.colors.mainBackground,bottom:0,"& > *":{flex:1}}}}));t.default=function(e){var t=e.hasUnpublishedChanges,n=e.handleApply,r=e.handleDiscard,i=u(),o=l.useIntl().translate;return a.createElement("div",{className:i.actions},a.createElement(s.Button,{disabled:!t,size:"regular",style:"lighter",hoverStyle:"brand",onClick:r},o("inspector.actions.discard","Discard")),a.createElement(s.Button,{disabled:!t,size:"regular",style:"success",hoverStyle:"success",onClick:n},o("inspector.actions.apply","Apply")))}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7).createUseMediaUiStyles((function(e){return{inspector:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridAutoRows:"auto",gridGap:e.spacing.full,"& input, & textarea":{width:"100%"}}}}));t.default=function(e){var t=e.children,n=s();return a.createElement("div",{className:n.inspector},t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return mergeOptions})),n.d(t,"a",(function(){return g}));var r=n(1),i=n(3),o=n(20),a=n(2),s=n(50),l=n(11),u=n(21),c=n(61),d=n(13),f=n(144),p=n(33),h=function(){function LocalState(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return LocalState.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Object(a.G)(t.resolvers,e)})):this.resolvers=Object(a.G)(this.resolvers,e)},LocalState.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},LocalState.prototype.getResolvers=function(){return this.resolvers||{}},LocalState.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,o=e.variables,a=e.onlyRunForcedResolvers,s=void 0!==a&&a;return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(e){return t?[2,this.resolveDocument(t,n.data,i,o,this.fragmentMatcher,s).then((function(e){return Object(r.__assign)(Object(r.__assign)({},n),{data:e.result})}))]:[2,n]}))}))},LocalState.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},LocalState.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},LocalState.prototype.clientQuery=function(e){return Object(a.y)(["client"],e)&&this.resolvers?e:null},LocalState.prototype.serverQuery=function(e){return Object(a.I)(e)},LocalState.prototype.prepareContext=function(e){var t=this.cache;return Object(r.__assign)(Object(r.__assign)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},LocalState.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return Object(r.__assign)(Object(r.__assign)({},t),e.exportedVariables)}))]:[2,Object(r.__assign)({},t)]}))}))},LocalState.prototype.shouldForceResolvers=function(e){var t=!1;return Object(f.b)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return f.a}}}),t},LocalState.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Object(a.g)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},LocalState.prototype.resolveDocument=function(e,t,n,i,o,s){return void 0===n&&(n={}),void 0===i&&(i={}),void 0===o&&(o=function(){return!0}),void 0===s&&(s=!1),Object(r.__awaiter)(this,void 0,void 0,(function(){var l,u,c,d,f,p,h,v,y;return Object(r.__generator)(this,(function(m){return l=Object(a.q)(e),u=Object(a.n)(e),c=Object(a.k)(u),d=l.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",h=(p=this).cache,v=p.client,y={fragmentMap:c,context:Object(r.__assign)(Object(r.__assign)({},n),{cache:h,client:v}),variables:i,fragmentMatcher:o,defaultOperationType:f,exportedVariables:{},onlyRunForcedResolvers:s},[2,this.resolveSelectionSet(l.selectionSet,t,y).then((function(e){return{result:e,exportedVariables:y.exportedVariables}}))]}))}))},LocalState.prototype.resolveSelectionSet=function(e,t,n){return Object(r.__awaiter)(this,void 0,void 0,(function(){var o,s,l,u,c,d=this;return Object(r.__generator)(this,(function(f){return o=n.fragmentMap,s=n.context,l=n.variables,u=[t],c=function(e){return Object(r.__awaiter)(d,void 0,void 0,(function(){var c,d;return Object(r.__generator)(this,(function(r){return Object(a.L)(e,l)?Object(a.z)(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&u.push(((n={})[Object(a.K)(e)]=t,n))}))]:(Object(a.A)(e)?c=e:(c=o[e.name.value],Object(i.b)(c,11)),c&&c.typeCondition&&(d=c.typeCondition.name.value,n.fragmentMatcher(t,d,s))?[2,this.resolveSelectionSet(c.selectionSet,t,n).then((function(e){u.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(c)).then((function(){return Object(a.H)(u)}))]}))}))},LocalState.prototype.resolveField=function(e,t,n){return Object(r.__awaiter)(this,void 0,void 0,(function(){var i,o,s,l,u,c,d,f,h,v=this;return Object(r.__generator)(this,(function(r){return i=n.variables,o=e.name.value,s=Object(a.K)(e),l=o!==s,u=t[s]||t[o],c=Promise.resolve(u),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(d=t.__typename||n.defaultOperationType,(f=this.resolvers&&this.resolvers[d])&&(h=f[l?o:s])&&(c=Promise.resolve(p.cacheSlot.withValue(this.cache,h,[t,Object(a.e)(e,i),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,c.then((function(t){return void 0===t&&(t=u),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?v.resolveSubSelectedArray(e,t,n):e.selectionSet?v.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},LocalState.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},LocalState}(),v=new(a.h?WeakMap:Map);function wrapDestructiveCacheMethod(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return v.set(e,(v.get(e)+1)%1e15),n.apply(this,arguments)})}function cancelNotifyTimeout(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var y=function(){function QueryInfo(e){this.cache=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.diff=null,this.observableQuery=null,v.has(e)||(v.set(e,0),wrapDestructiveCacheMethod(e,"evict"),wrapDestructiveCacheMethod(e,"modify"),wrapDestructiveCacheMethod(e,"reset"))}return QueryInfo.prototype.init=function(e){var t=e.networkStatus||d.a.loading;return this.variables&&this.networkStatus!==d.a.loading&&!Object(l.a)(this.variables,e.variables)&&(t=d.a.setVariables),Object(l.a)(e.variables,this.variables)||(this.diff=null),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},QueryInfo.prototype.reset=function(){cancelNotifyTimeout(this),this.diff=null,this.dirty=!1},QueryInfo.prototype.getDiff=function(e){return void 0===e&&(e=this.variables),this.diff&&Object(l.a)(e,this.variables)?this.diff:(this.updateWatch(this.variables=e),this.diff=this.cache.diff({query:this.document,variables:e,returnPartialData:!0,optimistic:!0}))},QueryInfo.prototype.setDiff=function(e){var t=this,n=this.diff;this.diff=e,this.dirty||(e&&e.result)===(n&&n.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},QueryInfo.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},QueryInfo.prototype.notify=function(){var e=this;cancelNotifyTimeout(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},QueryInfo.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Object(d.b)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},QueryInfo.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),delete this.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var e=this.observableQuery;e&&e.stopPolling()}},QueryInfo.prototype.cancel=function(){},QueryInfo.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;n&&"no-cache"===n.options.fetchPolicy||this.lastWatch&&this.lastWatch.query===this.document&&Object(l.a)(e,this.lastWatch.variables)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch={query:this.document,variables:e,optimistic:!0,callback:function(e){return t.setDiff(e)}}))},QueryInfo.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===v.get(this.cache)&&Object(l.a)(t,n.variables)&&Object(l.a)(e.data,n.result.data))},QueryInfo.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Object(a.B)(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.diff={result:e.data,complete:!0}:!this.stopped&&n&&(shouldWriteResult(e,t.errorPolicy)?this.cache.performTransaction((function(n){if(r.shouldWrite(e,t.variables))n.writeQuery({query:r.document,data:e.data,variables:t.variables}),r.lastWrite={result:e,variables:t.variables,dmCount:v.get(r.cache)};else if(r.diff&&r.diff.complete)return void(e.data=r.diff.result);var i=n.diff({query:r.document,variables:t.variables,returnPartialData:!0,optimistic:!0});r.stopped||r.updateWatch(t.variables),r.diff=i,i.complete&&(e.data=i.result)})):this.lastWrite=void 0)},QueryInfo.prototype.markReady=function(){return this.networkError=null,this.networkStatus=d.a.ready},QueryInfo.prototype.markError=function(e){return this.networkStatus=d.a.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},QueryInfo}();function shouldWriteResult(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Object(a.w)(e);return!r&&n&&e.data&&(r=!0),r}var m=Object.prototype.hasOwnProperty,b=function(){function QueryManager(e){var t=e.cache,n=e.link,r=e.queryDeduplication,i=void 0!==r&&r,o=e.onBroadcast,s=e.ssrMode,l=void 0!==s&&s,u=e.clientAwareness,c=void 0===u?{}:u,d=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(a.h?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.queryDeduplication=i,this.clientAwareness=c,this.localState=d||new h({cache:t}),this.ssrMode=l,this.assumeImmutableResults=!!f,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return QueryManager.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(new i.a(12))},QueryManager.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},QueryManager.prototype.mutate=function(e){var t=e.mutation,n=e.variables,o=e.optimisticResponse,s=e.updateQueries,l=e.refetchQueries,c=void 0===l?[]:l,d=e.awaitRefetchQueries,f=void 0!==d&&d,p=e.update,h=e.errorPolicy,v=void 0===h?"none":h,y=e.fetchPolicy,m=e.context,b=void 0===m?{}:m;return Object(r.__awaiter)(this,void 0,void 0,(function(){var e,l,d;return Object(r.__generator)(this,(function(h){switch(h.label){case 0:return Object(i.b)(t,13),Object(i.b)(!y||"no-cache"===y,14),e=this.generateMutationId(),t=this.transform(t).document,n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,b)]:[3,2];case 1:n=h.sent(),h.label=2;case 2:return l=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:n,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:e,document:t,variables:n,errorPolicy:v,updateQueries:s,update:p}),this.broadcastQueries(),d=this,[2,new Promise((function(i,h){var m,g;d.getObservableFromLink(t,Object(r.__assign)(Object(r.__assign)({},b),{optimisticResponse:o}),n,!1).subscribe({next:function(r){if(Object(a.w)(r)&&"none"===v)g=new u.a({graphQLErrors:r.errors});else{if(l&&(l.loading=!1,l.error=null),"no-cache"!==y)try{d.markMutationResult({mutationId:e,result:r,document:t,variables:n,errorPolicy:v,updateQueries:s,update:p})}catch(e){return void(g=new u.a({networkError:e}))}m=r}},error:function(t){l&&(l.loading=!1,l.error=t),o&&d.cache.removeOptimistic(e),d.broadcastQueries(),h(new u.a({networkError:t}))},complete:function(){if(g&&l&&(l.loading=!1,l.error=g),o&&d.cache.removeOptimistic(e),d.broadcastQueries(),g)h(g);else{"function"==typeof c&&(c=c(m));var t=[];Object(a.B)(c)&&c.forEach((function(e){if("string"==typeof e)d.queries.forEach((function(n){var r=n.observableQuery;r&&r.hasObservers()&&r.queryName===e&&t.push(r.refetch())}));else{var n={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(n.context=e.context),t.push(d.query(n))}})),Promise.all(f?t:[]).then((function(){"ignore"===v&&m&&Object(a.w)(m)&&delete m.errors,i(m)}),h)}}})}))]}}))}))},QueryManager.prototype.markMutationResult=function(e,t){var n=this;if(void 0===t&&(t=this.cache),shouldWriteResult(e.result,e.errorPolicy)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],i=e.updateQueries;i&&this.queries.forEach((function(o,s){var l=o.observableQuery,u=l&&l.queryName;if(u&&m.call(i,u)){var c=i[u],d=n.queries.get(s),f=d.document,p=d.variables,h=t.diff({query:f,variables:p,returnPartialData:!0,optimistic:!1}),v=h.result;if(h.complete&&v){var y=c(v,{mutationResult:e.result,queryName:f&&Object(a.s)(f)||void 0,queryVariables:p});y&&r.push({result:y,dataId:"ROOT_QUERY",query:f,variables:p})}}})),t.performTransaction((function(t){r.forEach((function(e){return t.write(e)}));var n=e.update;n&&n(t,e.result)}),null)}},QueryManager.prototype.markMutationOptimistic=function(e,t){var n=this,i="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(Object(r.__assign)(Object(r.__assign)({},t),{result:{data:i}}),e)}catch(e){}}),t.mutationId)},QueryManager.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},QueryManager.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},QueryManager.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},QueryManager.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),r=Object(a.J)(this.cache.transformForLink(n)),i=this.localState.clientQuery(n),o=r&&this.localState.serverQuery(r),s={document:n,hasClientExports:Object(a.x)(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:i,serverQuery:o,defaultVars:Object(a.m)(Object(a.r)(n))},add=function(e){e&&!t.has(e)&&t.set(e,s)};add(e),add(n),add(i),add(o)}return t.get(e)},QueryManager.prototype.getVariables=function(e,t){return Object(r.__assign)(Object(r.__assign)({},this.transform(e).defaultVars),t)},QueryManager.prototype.watchQuery=function(e){void 0===(e=Object(r.__assign)(Object(r.__assign)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new y(this.cache),n=new c.a({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:e.query,observableQuery:n,variables:e.variables}),n},QueryManager.prototype.query=function(e){var t=this;Object(i.b)(e.query,15),Object(i.b)("Document"===e.query.kind,16),Object(i.b)(!e.returnPartialData,17),Object(i.b)(!e.pollInterval,18);var n=this.generateQueryId();return this.fetchQuery(n,e).finally((function(){return t.stopQuery(n)}))},QueryManager.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},QueryManager.prototype.generateRequestId=function(){return this.requestIdCounter++},QueryManager.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},QueryManager.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},QueryManager.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},QueryManager.prototype.clearStore=function(){return this.cancelPendingFetches(new i.a(19)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=d.a.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset()},QueryManager.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},QueryManager.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.queries.forEach((function(r,i){var o=r.observableQuery;if(o&&o.hasObservers()){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||n.push(o.refetch()),t.getQuery(i).setDiff(null)}})),this.broadcastQueries(),Promise.all(n)},QueryManager.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},QueryManager.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=e.variables,s=e.context,l=void 0===s?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var makeObservable=function(e){return t.getObservableFromLink(n,l,e,!1).map((function(o){if("no-cache"!==r&&(shouldWriteResult(o,i)&&t.cache.write({query:n,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),Object(a.w)(o))throw new u.a({graphQLErrors:o.errors});return o}))};if(this.transform(n).hasClientExports){var c=this.localState.addExportedVariables(n,o,l).then(makeObservable);return new a.c((function(e){var t=null;return c.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return makeObservable(o)},QueryManager.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},QueryManager.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},QueryManager.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},QueryManager.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},QueryManager.prototype.getLocalState=function(){return this.localState},QueryManager.prototype.getObservableFromLink=function(e,t,n,i){var s,l,u=this;void 0===i&&(i=null!==(s=null==t?void 0:t.queryDeduplication)&&void 0!==s?s:this.queryDeduplication);var c=this.transform(e).serverQuery;if(c){var d=this.inFlightLinkObservables,f=this.link,p={query:c,variables:n,operationName:Object(a.s)(c)||void 0,context:this.prepareContext(Object(r.__assign)(Object(r.__assign)({},t),{forceFetch:!i}))};if(t=p.context,i){var h=d.get(c)||new Map;d.set(c,h);var v=JSON.stringify(n);if(!(l=h.get(v))){var y=new a.a([Object(o.execute)(f,p)]);h.set(v,l=y),y.cleanup((function(){h.delete(v)&&h.size<1&&d.delete(c)}))}}else l=new a.a([Object(o.execute)(f,p)])}else l=new a.a([a.c.of({data:{}})]),t=this.prepareContext(t);var m=this.transform(e).clientQuery;return m&&(l=Object(a.f)(l,(function(e){return u.localState.runResolvers({document:m,remoteResult:e,context:t,variables:n})}))),l},QueryManager.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return Object(a.f)(this.getObservableFromLink(e.document,n.context,n.variables),(function(i){var o=Object(a.B)(i.errors);if(r>=e.lastRequestId){if(o&&"none"===n.errorPolicy)throw e.markError(new u.a({graphQLErrors:i.errors}));e.markResult(i,n,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||d.a.ready};return o&&"ignore"!==n.errorPolicy&&(s.errors=i.errors),s}),(function(t){var n=Object(u.b)(t)?t:new u.a({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},QueryManager.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=d.a.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),s=this.getQuery(e),l=s.networkStatus,u=t.fetchPolicy,c=void 0===u?"cache-first":u,f=t.errorPolicy,p=void 0===f?"none":f,h=t.returnPartialData,v=void 0!==h&&h,y=t.notifyOnNetworkStatusChange,m=void 0!==y&&y,b=t.context,g=void 0===b?{}:b;("cache-first"===c||"cache-and-network"===c||"network-only"===c||"no-cache"===c)&&m&&"number"==typeof l&&l!==n&&Object(d.b)(n)&&("cache-first"!==c&&(c="cache-and-network"),v=!0);var _=Object.assign({},t,{query:i,variables:o,fetchPolicy:c,errorPolicy:p,returnPartialData:v,notifyOnNetworkStatusChange:m,context:g}),fromVariables=function(e){return _.variables=e,r.fetchQueryByPolicy(s,_,n)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return S.cancel(e)}))}));var S=new a.a(this.transform(_.query).hasClientExports?this.localState.addExportedVariables(_.query,_.variables,_.context).then(fromVariables):fromVariables(_.variables));return S.cleanup((function(){r.fetchCancelFns.delete(e);var n=t.nextFetchPolicy;n&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof n?n.call(t,t.fetchPolicy||"cache-first"):n)})),S},QueryManager.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,o=t.query,s=t.variables,l=t.fetchPolicy,u=t.errorPolicy,c=t.returnPartialData,f=t.context;e.init({document:o,variables:s,networkStatus:n});var readCache=function(){return e.getDiff(s)},resultsFromCache=function(t,n){void 0===n&&(n=e.networkStatus||d.a.loading);var l=t.result;var fromData=function(e){return a.c.of(Object(r.__assign)({data:e,loading:Object(d.b)(n),networkStatus:n},t.complete?null:{partial:!0}))};return i.transform(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:l},context:f,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return fromData(e.data)})):fromData(l)},resultsFromLink=function(t){return i.getResultsFromLink(e,t,{variables:s,context:f,fetchPolicy:l,errorPolicy:u})};switch(l){default:case"cache-first":return(p=readCache()).complete?[resultsFromCache(p,e.markReady())]:c?[resultsFromCache(p),resultsFromLink(!0)]:[resultsFromLink(!0)];case"cache-and-network":var p;return(p=readCache()).complete||c?[resultsFromCache(p),resultsFromLink(!0)]:[resultsFromLink(!0)];case"cache-only":return[resultsFromCache(readCache(),e.markReady())];case"network-only":return[resultsFromLink(!0)];case"no-cache":return[resultsFromLink(!1)];case"standby":return[]}},QueryManager.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new y(this.cache)),this.queries.get(e)},QueryManager.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Object(r.__assign)(Object(r.__assign)({},t),{clientAwareness:this.clientAwareness})},QueryManager}();function mergeOptions(e,t){return Object(a.j)(e,t,t.variables&&{variables:Object(r.__assign)(Object(r.__assign)({},e.variables),t.variables)})}var g=function(){function ApolloClient(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,a=e.headers,l=e.cache,u=e.ssrMode,c=void 0!==u&&u,d=e.ssrForceFetchDelay,f=void 0===d?0:d,p=e.connectToDevTools,v=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,y=e.queryDeduplication,m=void 0===y||y,g=e.defaultOptions,_=e.assumeImmutableResults,S=void 0!==_&&_,O=e.resolvers,E=e.typeDefs,w=e.fragmentMatcher,T=e.name,C=e.version,j=e.link;if(j||(j=n?new s.HttpLink({uri:n,credentials:r,headers:a}):o.ApolloLink.empty()),!l)throw new i.a(9);this.link=j,this.cache=l,this.disableNetworkFetches=c||f>0,this.queryDeduplication=m,this.defaultOptions=g||{},this.typeDefs=E,f&&setTimeout((function(){return t.disableNetworkFetches=!1}),f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),v&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.15",this.localState=new h({cache:l,client:this,resolvers:O,fragmentMatcher:w}),this.queryManager=new b({cache:this.cache,link:this.link,queryDeduplication:m,ssrMode:c,clientAwareness:{name:T,version:C},localState:this.localState,assumeImmutableResults:S,onBroadcast:v?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return ApolloClient.prototype.stop=function(){this.queryManager.stop()},ApolloClient.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=mergeOptions(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Object(r.__assign)(Object(r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},ApolloClient.prototype.query=function(e){return this.defaultOptions.query&&(e=mergeOptions(this.defaultOptions.query,e)),Object(i.b)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Object(r.__assign)(Object(r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},ApolloClient.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=mergeOptions(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},ApolloClient.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},ApolloClient.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},ApolloClient.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},ApolloClient.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},ApolloClient.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},ApolloClient.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},ApolloClient.prototype.__requestRaw=function(e){return Object(o.execute)(this.link,e)},ApolloClient.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},ApolloClient.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},ApolloClient.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},ApolloClient.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},ApolloClient.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},ApolloClient.prototype.extract=function(e){return this.cache.extract(e)},ApolloClient.prototype.restore=function(e){return this.cache.restore(e)},ApolloClient.prototype.addResolvers=function(e){this.localState.addResolvers(e)},ApolloClient.prototype.setResolvers=function(e){this.localState.setResolvers(e)},ApolloClient.prototype.getResolvers=function(){return this.localState.getResolvers()},ApolloClient.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},ApolloClient.prototype.setLink=function(e){this.link=this.queryManager.link=e},ApolloClient}()},function(e,t,n){e.exports=n(161).Observable},function(e,t,n){"use strict";(function(e,r){var i,o=n(147);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(o.a)(i);t.a=a}).call(this,n(53),n(90)(e))},function(e,t,n){"use strict";t.__esModule=!0;var r=n(1),i=r.__importDefault(n(156)),o=r.__importDefault(n(157)),a=function(e){function SynchronousRegistry(t){var n=e.call(this,t)||this;return n._registry=[],n}return r.__extends(SynchronousRegistry,e),SynchronousRegistry.prototype.set=function(e,t,n){if(void 0===n&&(n=0),"string"!=typeof e)throw new Error("Key must be a string");if("string"!=typeof n&&"number"!=typeof n)throw new Error("Position must be a string or a number");var r={key:e,value:t};n&&(r.position=n);var i=this._registry.findIndex((function(t){return t.key===e}));return-1===i?this._registry.push(r):this._registry[i]=r,t},SynchronousRegistry.prototype.get=function(e){if("string"!=typeof e)return console.error("Key must be a string"),null;var t=this._registry.find((function(t){return t.key===e}));return t?t.value:null},SynchronousRegistry.prototype._getChildrenWrapped=function(e){var t=this._registry.filter((function(t){return 0===t.key.indexOf(e+"/")}));return o.default(t)},SynchronousRegistry.prototype.getChildrenAsObject=function(e){var t={};return this._getChildrenWrapped(e).forEach((function(e){t[e.key]=e.value})),t},SynchronousRegistry.prototype.getChildren=function(e){return this._getChildrenWrapped(e).map((function(e){return e.value}))},SynchronousRegistry.prototype.has=function(e){return"string"!=typeof e?(console.error("Key must be a string"),!1):Boolean(this._registry.find((function(t){return t.key===e})))},SynchronousRegistry.prototype._getAllWrapped=function(){return o.default(this._registry)},SynchronousRegistry.prototype.getAllAsObject=function(){var e={};return this._getAllWrapped().forEach((function(t){e[t.key]=t.value})),e},SynchronousRegistry.prototype.getAllAsList=function(){return this._getAllWrapped().map((function(e){return Object.assign({id:e.key},e.value)}))},SynchronousRegistry}(i.default);t.default=a},function(e,t){var n,r,i=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(n===setTimeout)return setTimeout(e,0);if((n===defaultSetTimout||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){n=defaultSetTimout}try{r="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){r=defaultClearTimeout}}();var o,a=[],s=!1,l=-1;function cleanUpNextTick(){s&&o&&(s=!1,o.length?a=o.concat(a):l=-1,a.length&&drainQueue())}function drainQueue(){if(!s){var e=runTimeout(cleanUpNextTick);s=!0;for(var t=a.length;t;){for(o=a,a=[];++l1)for(var n=1;n0,E=m(),w=c.useCallback((function(){i(b.files.selected).then((function(n){var r=n.data.uploadFiles;_((function(e){return{selected:[],finished:s(e.finished,e.selected.filter((function(e){return r.find((function(t){return t.success&&t.filename===e.name}))}))),rejected:s(e.rejected,e.selected.filter((function(e){return r.find((function(t){return!t.success&&t.filename===e.name}))})))}})),r.some((function(e){return!e.success}))?t.warning(e("uploadDialog.uploadFinishedWithErrors","Some files could not be uploaded")):t.ok(e("uploadDialog.uploadFinished","Upload finished")),r.some((function(e){return e.success}))&&S()})).catch((function(n){t.error(e("fileUpload.error","Upload failed"),n)}))}),[i,b.files.selected,_,t,e,S]),T=c.useCallback((function(e){_((function(t){return r(r({},t),{selected:e})}))}),[_]);return u.createElement(p.Dialog,{isOpen:b.visible,title:e("uploadDialog.title","Upload assets"),onRequestClose:g,actions:[u.createElement(d.Button,{key:"cancel",style:"neutral",hoverStyle:"darken",onClick:g},o?e("uploadDialog.close","Close"):e("uploadDialog.cancel","Cancel")),u.createElement(d.Button,{key:"upload",style:"success",hoverStyle:"success",disabled:!O,onClick:w},e("uploadDialog.upload","Upload"))],style:"wide"},u.createElement("section",{className:E.uploadArea},u.createElement(h.default,{files:b.files.selected,loading:a,onSetFiles:T}),u.createElement(v.default,{files:b.files,loading:a,uploadState:o})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7).createUseMediaUiStyles((function(e){return{fileList:{marginTop:e.spacing.full,display:"flex",flexDirection:"row",flexWrap:"wrap"},fileListHeader:{flex:"1 1 100%",marginBottom:e.spacing.full,fontSize:e.fontSize},thumb:{display:"inline-flex",borderRadius:2,border:"1px solid #eaeaea",marginBottom:e.spacing.half,marginRight:e.spacing.half,width:100,height:100,padding:e.spacing.quarter,boxSizing:"border-box"},thumbInner:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center","& span":{marginLeft:e.spacing.half,userSelect:"none"}},img:{position:"absolute",display:"block",width:"100%",height:"100%",objectFit:"cover",left:0,top:0,zIndex:-1},stateOverlay:{position:"absolute",content:'""',left:0,top:0,right:0,bottom:0,backgroundColor:e.colors.alternatingBackground,opacity:.3,zIndex:-1},loading:{borderColor:e.colors.border,"& $thumbInner:after":{extend:"stateOverlay"}},success:{borderColor:e.colors.success,"& $thumbInner:after":{extend:"stateOverlay",backgroundColor:e.colors.success}},error:{borderColor:e.colors.error,"& $thumbInner:after":{extend:"stateOverlay",backgroundColor:e.colors.error}},warning:{color:e.colors.warn}}}));t.default=a.memo((function(e){var t,n=e.file,r=e.loading,i=void 0!==r&&r,o=e.fileState,u=l(),c=null==o?void 0:o.success,d=o&&!c;return d?t=u.error:c?t=u.success:i&&(t=u.loading),a.createElement("div",{className:[u.thumb,t].join(" "),title:n.name},a.createElement("div",{className:u.thumbInner},a.createElement("img",{src:n.preview,alt:n.name,className:u.img}),i&&a.createElement(s.Icon,{icon:"spinner",spin:!0}),c&&a.createElement(s.Icon,{icon:"check"}),d&&a.createElement(s.Icon,{icon:"exclamation-circle"}),(null==o?void 0:o.result)&&a.createElement("span",null,o.result)))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useUploadFile=t.useUploadFiles=t.useUploadDialogState=void 0;var i=r(n(270));t.useUploadDialogState=i.default;var o=r(n(271));t.useUploadFile=o.default;var a=r(n(275));t.useUploadFiles=a.default},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0,I=b(),P=u.useMemo((function(){var e,t,r=null===(t=null===(e=(null==n?void 0:n.file.mediaType).match(/^(?(?:[.!#%&'`^~$*+\-|\w]+))\//))||void 0===e?void 0:e.groups)||void 0===t?void 0:t.type;return r?r+"/*":""}),[n]),M=u.useCallback((function(){if(0!==S.files.selected.length){var r=S.files.selected[0];o({asset:n,file:r,options:T}).then((function(){t.ok(e("uploadDialog.replacementFinished","Replacement finished")),O(),g()})).catch((function(n){t.error(e("assetReplacement.error","Replacement failed"),n)}))}}),[o,t,e,S,T,g,n,O]),k=u.useCallback((function(e){E((function(t){return r(r({},t),{selected:e})}))}),[E]);return l.createElement(p.Dialog,{isOpen:S.visible,title:e("uploadDialog.replaceAsset","Replace Asset"),onRequestClose:O,actions:[l.createElement(c.Button,{key:"cancel",style:"neutral",hoverStyle:"darken",onClick:O},a?e("uploadDialog.close","Close"):e("uploadDialog.cancel","Cancel")),l.createElement(c.Button,{key:"upload",style:"success",hoverStyle:"success",disabled:!j,onClick:M},e("uploadDialog.replace","Replace"))],style:"wide"},l.createElement("section",{className:I.uploadArea},l.createElement(h.default,{files:S.files.selected,loading:s,onSetFiles:k,maxFiles:1,acceptedFileTypes:P}),l.createElement("section",{className:I.optionSection},l.createElement("div",{className:I.option},l.createElement(c.Label,null,l.createElement(c.CheckBox,{isChecked:T.generateRedirects,onChange:function(e){return C(r(r({},T),{generateRedirects:e}))}}),l.createElement("span",null,e("uploadDialog.generateRedirects","Generate redirects")))),l.createElement("div",{className:I.option},l.createElement(c.Label,null,l.createElement(c.CheckBox,{isChecked:T.keepOriginalFilename,onChange:function(e){return C(r(r({},T),{keepOriginalFilename:e}))}}),l.createElement("span",null,e("uploadDialog.keepOriginalFilename","Keep original filename"))))),l.createElement(v.default,{files:S.files,loading:s,uploadState:a?[a]:[]})))}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function findTabbableDescendants(e){return[].slice.call(e.querySelectorAll("*"),0).filter(tabbable)};var r=/input|select|textarea|button|object/;function hidesContents(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;var n=window.getComputedStyle(e);return t?"visible"!==n.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0:"none"==n.getPropertyValue("display")}function focusable(e,t){var n=e.nodeName.toLowerCase();return(r.test(n)&&!e.disabled||"a"===n&&e.href||t)&&function visible(e){for(var t=e;t&&t!==document.body;){if(hidesContents(t))return!1;t=t.parentNode}return!0}(e)}function tabbable(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&focusable(e,!n)}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNodeList=assertNodeList,t.setElement=function setElement(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);assertNodeList(n,t),t=n}return o=t||o},t.validateElement=validateElement,t.hide=function hide(e){var t=!0,n=!1,r=void 0;try{for(var i,o=validateElement(e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.setAttribute("aria-hidden","true")}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}},t.show=function show(e){var t=!0,n=!1,r=void 0;try{for(var i,o=validateElement(e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.removeAttribute("aria-hidden")}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function documentNotReadyOrSSRTesting(){o=null},t.resetForTesting=function resetForTesting(){o=null};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(286)),i=n(80);var o=null;function assertNodeList(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function validateElement(e){var t=e||o;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,r.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=new function PortalOpenInstances(){var e=this;!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,PortalOpenInstances),this.register=function(t){-1===e.openInstances.indexOf(t)&&(e.openInstances.push(t),e.emit("register"))},this.deregister=function(t){var n=e.openInstances.indexOf(t);-1!==n&&(e.openInstances.splice(n,1),e.emit("deregister"))},this.subscribe=function(t){e.subscribers.push(t)},this.emit=function(t){e.subscribers.forEach((function(n){return n(t,e.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]};t.default=r,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"selectedAssetForPreviewState",default:null});t.default=r},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetCollectionTree=t.SideBarLeft=t.AssetSourceDescription=t.AssetSourceList=void 0;var i=r(n(292));t.AssetSourceList=i.default;var o=r(n(298));t.AssetSourceDescription=o.default;var a=r(n(299));t.SideBarLeft=a.default;var s=n(133);Object.defineProperty(t,"AssetCollectionTree",{enumerable:!0,get:function(){return s.AssetCollectionTree}})},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetCollectionTree=void 0;var i=r(n(300));t.AssetCollectionTree=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={TAG:"neos-tree-tag",COLLECTION:"neos-tree-collection"}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(8),c=n(39),d=n(7),f=n(9),p=n(121),h=n(76),v=n(49),y=a(n(81)),m=a(n(82)),b=a(n(83)),g=d.createUseMediaUiStyles((function(e){return{textArea:{".neos textarea&":{padding:e.spacing.half}}}}));t.default=s.memo((function(){var e=g(),t=f.useSelectedAsset(),n=d.useNotify(),r=d.useIntl().translate,i=d.useMediaUi().featureFlags,o=l.useState(null),a=o[0],_=o[1],S=l.useState(null),O=S[0],E=S[1],w=l.useState(null),T=w[0],C=w[1],j=f.useUpdateAsset(),I=j.updateAsset,P=j.loading,M=(null==t?void 0:t.localId)&&!P,k=t&&(a!==t.label||O!==t.caption||T!==t.copyrightNotice),R=l.useCallback((function(){t&&(_(t.label),E(t.caption),C(t.copyrightNotice))}),[t,_,E,C]),x=l.useCallback((function(){a===t.label&&O===t.caption&&T===t.copyrightNotice||I({asset:t,label:a,caption:O,copyrightNotice:T}).then((function(){n.ok(r("actions.updateAsset.success","The asset has been updated"))})).catch((function(e){var t=e.message;n.error(r("actions.deleteAsset.error","Error while updating the asset"),t)}))}),[n,r,O,T,a,t,I]);return l.useEffect((function(){R()}),[null==t?void 0:t.id]),s.createElement(b.default,null,s.createElement(y.default,{label:r("inspector.title","Title")},s.createElement(u.TextInput,{disabled:!M,type:"text",value:a||"",onChange:_,onEnterKey:x})),s.createElement(y.default,{label:r("inspector.caption","Caption")},s.createElement(u.TextArea,{className:e.textArea,disabled:!M,minRows:3,expandedRows:6,value:O||"",onChange:E})),s.createElement(y.default,{label:r("inspector.copyrightNotice","Copyright notice")},s.createElement(u.TextArea,{className:e.textArea,disabled:!M,minRows:2,expandedRows:4,value:T||"",onChange:C})),M&&s.createElement(m.default,{handleApply:x,handleDiscard:R,hasUnpublishedChanges:k}),t.assetSource.supportsCollections&&s.createElement(v.CollectionSelectBox,null),t.assetSource.supportsTagging&&s.createElement(v.TagSelectBoxAsset,null),s.createElement(c.AssetUsagesToggleButton,null),i.showSimilarAssets&&s.createElement(p.SimilarAssetsToggleButton,null),!t.assetSource.readOnly&&s.createElement(h.AssetReplacementButton,null),s.createElement(v.MetadataView,null))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(321),c=n(8),d=n(7),f=n(9),p=n(14),h=d.createUseMediaUiStyles((function(e){return{currentSelection:{display:"flex",flexWrap:"wrap",alignItems:"center",overflow:"hidden"},headline:{userSelect:"none",flex:"1 1 100%",fontWeight:"bold",lineHeight:e.spacing.goldenUnit},label:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","& svg":{marginRight:e.spacing.half}}}}));t.default=a.memo((function(){var e=h(),t=f.useSelectedAsset(),n=f.useSelectedAssetCollection(),r=f.useSelectedTag(),i=l.useRecoilValue(p.selectedInspectorViewState),o=d.useIntl().translate,v=s.useMemo((function(){var e="question",o=null;if("asset"===i){if(null==t?void 0:t.file.mediaType){var a=u.fromString(t.file.mediaType);"audio"===a.type&&(e="file-audio"),"video"===a.type&&(e="file-video"),"image"===a.type&&(e="file-image")}else e="file";o=null==t?void 0:t.label}else"assetCollection"===i?(e="folder",o=null==n?void 0:n.title):"tag"===i&&(e="tag",o=null==r?void 0:r.label);return{icon:e,label:o}}),[t,r,n,i]);return v.label?a.createElement("div",{className:e.currentSelection},a.createElement(c.Headline,{type:"h2",className:e.headline},o("currentSelection.headline","Selected element")),a.createElement("div",{className:e.label,title:v.label},a.createElement(c.Icon,{icon:v.icon}),v.label)):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7),l=n(46),u=s.createUseMediaUiStyles({assetCount:{height:"100%",alignSelf:"flex-start",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none"}});t.default=a.memo((function(){var e=u(),t=s.useIntl().translate,n=l.useAssetCount();return a.createElement("div",{className:e.assetCount},n," ",t("pagination.assetCount","assets"))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;tg&&(r-=i-g),r=Math.max(r,1),i=Math.min(i,g);var o=a(Array(i-r+1)).map((function(e,t){return t+r}));O({start:r,end:i,hasLessPages:r>2,hasMorePages:i+10&&l.createElement("ol",{className:e.list},l.createElement(h.default,{icon:"angle-left",title:o("pagination.previousPageTitle","Go to previous page"),onClick:w,disabled:b||n<=1}),S.start>1&&l.createElement(h.default,{title:o("pagination.firstPageTitle","Go to first page"),onClick:E,disabled:b,page:1}),S.hasLessPages&&l.createElement("li",{className:e.ellipsis},"…"),S.pages.map((function(e){return l.createElement(h.default,{key:e,selected:n===e,onClick:E,disabled:b,title:o("pagination.page","Go to page "+e,[e]),page:e})})),S.hasMorePages&&l.createElement("li",{className:e.ellipsis},"…"),S.end0&&(this.previousOptions.subscription!==this.getOptions().subscription||!Object(l.a)(this.previousOptions.variables,this.getOptions().variables)||this.previousOptions.skip!==this.getOptions().skip)&&(this.cleanup(),t=this.getLoadingResult()),this.initialize(this.getOptions()),this.startSubscription(),this.previousOptions=this.getOptions(),Object(s.__assign)(Object(s.__assign)({},t),{variables:this.getOptions().variables})},SubscriptionData.prototype.afterExecute=function(){this.isMounted=!0},SubscriptionData.prototype.cleanup=function(){this.endSubscription(),delete this.currentObservable.query},SubscriptionData.prototype.initialize=function(e){this.currentObservable.query||!0===this.getOptions().skip||(this.currentObservable.query=this.refreshClient().client.subscribe({query:e.subscription,variables:e.variables,fetchPolicy:e.fetchPolicy,context:e.context}))},SubscriptionData.prototype.startSubscription=function(){this.currentObservable.subscription||(this.currentObservable.subscription=this.currentObservable.query.subscribe({next:this.updateCurrentData.bind(this),error:this.updateError.bind(this),complete:this.completeSubscription.bind(this)}))},SubscriptionData.prototype.getLoadingResult=function(){return{loading:!0,error:void 0,data:void 0}},SubscriptionData.prototype.updateResult=function(e){this.isMounted&&this.setResult(e)},SubscriptionData.prototype.updateCurrentData=function(e){var t=this.getOptions().onSubscriptionData;this.updateResult({data:e.data,loading:!1,error:void 0}),t&&t({client:this.refreshClient().client,subscriptionData:e})},SubscriptionData.prototype.updateError=function(e){this.updateResult({error:e,loading:!1})},SubscriptionData.prototype.completeSubscription=function(){var e=this;Promise.resolve().then((function(){var t=e.getOptions().onSubscriptionComplete;t&&t(),e.endSubscription()}))},SubscriptionData.prototype.endSubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},SubscriptionData}(c),f=n(21),p=n(30),h=function(e){function MutationData(t){var n=t.options,r=t.context,i=t.result,o=t.setResult,a=e.call(this,n,r)||this;return a.runMutation=function(e){void 0===e&&(e={}),a.onMutationStart();var t=a.generateNewMutationId();return a.mutate(e).then((function(e){return a.onMutationCompleted(e,t),e})).catch((function(e){if(a.onMutationError(e,t),!a.getOptions().onError)throw e}))},a.verifyDocumentType(n.mutation,u.a.Mutation),a.result=i,a.setResult=o,a.mostRecentMutationId=0,a}return Object(s.__extends)(MutationData,e),MutationData.prototype.execute=function(e){return this.isMounted=!0,this.verifyDocumentType(this.getOptions().mutation,u.a.Mutation),[this.runMutation,Object(s.__assign)(Object(s.__assign)({},e),{client:this.refreshClient().client})]},MutationData.prototype.afterExecute=function(){return this.isMounted=!0,this.unmount.bind(this)},MutationData.prototype.cleanup=function(){},MutationData.prototype.mutate=function(e){return this.refreshClient().client.mutate(Object(p.mergeOptions)(this.getOptions(),e))},MutationData.prototype.onMutationStart=function(){this.result.loading||this.getOptions().ignoreResults||this.updateResult({loading:!0,error:void 0,data:void 0,called:!0})},MutationData.prototype.onMutationCompleted=function(e,t){var n=this.getOptions(),r=n.onCompleted,i=n.ignoreResults,o=e.data,a=e.errors,s=a&&a.length>0?new f.a({graphQLErrors:a}):void 0;this.isMostRecentMutation(t)&&!i&&this.updateResult({called:!0,loading:!1,data:o,error:s}),r&&r(o)},MutationData.prototype.onMutationError=function(e,t){var n=this.getOptions().onError;this.isMostRecentMutation(t)&&this.updateResult({loading:!1,error:e,data:void 0,called:!0}),n&&n(e)},MutationData.prototype.generateNewMutationId=function(){return++this.mostRecentMutationId},MutationData.prototype.isMostRecentMutation=function(e){return this.mostRecentMutationId===e},MutationData.prototype.updateResult=function(e){!this.isMounted||this.previousResult&&Object(l.a)(this.previousResult,e)||(this.setResult(e),this.previousResult=e)},MutationData}(c),v=function(e){function QueryData(t){var n=t.options,r=t.context,i=t.onNewData,o=e.call(this,n,r)||this;return o.runLazy=!1,o.previous=Object.create(null),o.runLazyQuery=function(e){o.cleanup(),o.runLazy=!0,o.lazyOptions=e,o.onNewData()},o.getQueryResult=function(){var e=o.observableQueryFields(),t=o.getOptions();if(t.skip)e=Object(s.__assign)(Object(s.__assign)({},e),{data:void 0,error:void 0,loading:!1,networkStatus:p.NetworkStatus.ready,called:!0});else if(o.currentObservable){var n=o.currentObservable.getCurrentResult(),r=n.data,i=n.loading,a=n.partial,l=n.networkStatus,u=n.errors,c=n.error;if(u&&u.length>0&&(c=new f.a({graphQLErrors:u})),e=Object(s.__assign)(Object(s.__assign)({},e),{data:r,loading:i,networkStatus:l,error:c,called:!0}),i);else if(c)Object.assign(e,{data:(o.currentObservable.getLastResult()||{}).data});else{var d=o.currentObservable.options.fetchPolicy;if(t.partialRefetch&&a&&(!r||0===Object.keys(r).length)&&"cache-only"!==d)return Object.assign(e,{loading:!0,networkStatus:p.NetworkStatus.loading}),e.refetch(),e}}e.client=o.client,o.setOptions(t,!0);var h=o.previous.result;return o.previous.loading=h&&h.loading||!1,e.previousData=h&&(h.data||h.previousData),o.previous.result=e,o.currentObservable&&o.currentObservable.resetQueryStoreErrors(),e},o.obsRefetch=function(e){var t;return null===(t=o.currentObservable)||void 0===t?void 0:t.refetch(e)},o.obsFetchMore=function(e){return o.currentObservable.fetchMore(e)},o.obsUpdateQuery=function(e){return o.currentObservable.updateQuery(e)},o.obsStartPolling=function(e){var t;null===(t=o.currentObservable)||void 0===t||t.startPolling(e)},o.obsStopPolling=function(){var e;null===(e=o.currentObservable)||void 0===e||e.stopPolling()},o.obsSubscribeToMore=function(e){return o.currentObservable.subscribeToMore(e)},o.onNewData=i,o}return Object(s.__extends)(QueryData,e),QueryData.prototype.execute=function(){this.refreshClient();var e=this.getOptions(),t=e.skip,n=e.query;return(t||n!==this.previous.query)&&(this.removeQuerySubscription(),this.removeObservable(!t),this.previous.query=n),this.updateObservableQuery(),this.isMounted&&this.startQuerySubscription(),this.getExecuteSsrResult()||this.getExecuteResult()},QueryData.prototype.executeLazy=function(){return this.runLazy?[this.runLazyQuery,this.execute()]:[this.runLazyQuery,{loading:!1,networkStatus:p.NetworkStatus.ready,called:!1,data:void 0}]},QueryData.prototype.fetchData=function(){var e=this,t=this.getOptions();return!t.skip&&!1!==t.ssr&&new Promise((function(t){return e.startQuerySubscription(t)}))},QueryData.prototype.afterExecute=function(e){var t=(void 0===e?{}:e).lazy,n=void 0!==t&&t;return this.isMounted=!0,n&&!this.runLazy||this.handleErrorOrCompleted(),this.previousOptions=this.getOptions(),this.unmount.bind(this)},QueryData.prototype.cleanup=function(){this.removeQuerySubscription(),this.removeObservable(!0),delete this.previous.result},QueryData.prototype.getOptions=function(){var t=e.prototype.getOptions.call(this);return this.lazyOptions&&(t.variables=Object(s.__assign)(Object(s.__assign)({},t.variables),this.lazyOptions.variables),t.context=Object(s.__assign)(Object(s.__assign)({},t.context),this.lazyOptions.context)),this.runLazy&&delete t.skip,t},QueryData.prototype.ssrInitiated=function(){return this.context&&this.context.renderPromises},QueryData.prototype.getExecuteResult=function(){var e=this.getQueryResult();return this.startQuerySubscription(),e},QueryData.prototype.getExecuteSsrResult=function(){var e=this.getOptions(),t=e.ssr,n=e.skip,r=!1===t,i=this.refreshClient().client.disableNetworkFetches,o=Object(s.__assign)({loading:!0,networkStatus:p.NetworkStatus.loading,called:!0,data:void 0,stale:!1,client:this.client},this.observableQueryFields());if(r&&(this.ssrInitiated()||i))return this.previous.result=o,o;if(this.ssrInitiated()){var a=this.getQueryResult()||o;return a.loading&&!n&&this.context.renderPromises.addQueryPromise(this,(function(){return null})),a}},QueryData.prototype.prepareObservableQueryOptions=function(){var e=this.getOptions();this.verifyDocumentType(e.query,u.a.Query);var t=e.displayName||"Query";return!this.ssrInitiated()||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e.fetchPolicy="cache-first"),Object(s.__assign)(Object(s.__assign)({},e),{displayName:t,context:e.context})},QueryData.prototype.initializeObservableQuery=function(){if(this.ssrInitiated()&&(this.currentObservable=this.context.renderPromises.getSSRObservable(this.getOptions())),!this.currentObservable){var e=this.prepareObservableQueryOptions();this.previous.observableQueryOptions=Object(s.__assign)(Object(s.__assign)({},e),{children:null}),this.currentObservable=this.refreshClient().client.watchQuery(Object(s.__assign)({},e)),this.ssrInitiated()&&this.context.renderPromises.registerSSRObservable(this.currentObservable,e)}},QueryData.prototype.updateObservableQuery=function(){if(this.currentObservable){if(!this.getOptions().skip){var e=Object(s.__assign)(Object(s.__assign)({},this.prepareObservableQueryOptions()),{children:null});Object(l.a)(e,this.previous.observableQueryOptions)||(this.previous.observableQueryOptions=e,this.currentObservable.setOptions(e).catch((function(){})))}}else this.initializeObservableQuery()},QueryData.prototype.startQuerySubscription=function(e){var t=this;void 0===e&&(e=this.onNewData),this.currentSubscription||this.getOptions().skip||(this.currentSubscription=this.currentObservable.subscribe({next:function(n){var r=n.loading,i=n.networkStatus,o=n.data,a=t.previous.result;a&&a.loading===r&&a.networkStatus===i&&Object(l.a)(a.data,o)||e()},error:function(n){if(t.resubscribeToQuery(),!n.hasOwnProperty("graphQLErrors"))throw n;var r=t.previous.result;(r&&r.loading||!Object(l.a)(n,t.previous.error))&&(t.previous.error=n,e())}}))},QueryData.prototype.resubscribeToQuery=function(){this.removeQuerySubscription();var e=this.currentObservable;if(e){var t=e.getLastError(),n=e.getLastResult();e.resetLastResults(),this.startQuerySubscription(),Object.assign(e,{lastError:t,lastResult:n})}},QueryData.prototype.handleErrorOrCompleted=function(){if(this.currentObservable&&this.previous.result){var e=this.previous.result,t=e.data,n=e.loading,r=e.error;if(!n){var i=this.getOptions(),o=i.query,a=i.variables,s=i.onCompleted,u=i.onError,c=i.skip;if(this.previousOptions&&!this.previous.loading&&Object(l.a)(this.previousOptions.query,o)&&Object(l.a)(this.previousOptions.variables,a))return;!s||r||c?u&&r&&u(r):s(t)}}},QueryData.prototype.removeQuerySubscription=function(){this.currentSubscription&&(this.currentSubscription.unsubscribe(),delete this.currentSubscription)},QueryData.prototype.removeObservable=function(e){this.currentObservable&&(this.currentObservable.tearDownQuery(),e&&delete this.currentObservable)},QueryData.prototype.observableQueryFields=function(){var e;return{variables:null===(e=this.currentObservable)||void 0===e?void 0:e.variables,refetch:this.obsRefetch,fetchMore:this.obsFetchMore,updateQuery:this.obsUpdateQuery,startPolling:this.obsStartPolling,stopPolling:this.obsStopPolling,subscribeToMore:this.obsSubscribeToMore}},QueryData}(c);function useBaseQuery(e,t,n){void 0===n&&(n=!1);var i=Object(r.useContext)(Object(a.c)()),o=Object(r.useReducer)((function(e){return e+1}),0),u=o[0],c=o[1],d=t?Object(s.__assign)(Object(s.__assign)({},t),{query:e}):{query:e},f=Object(r.useRef)(),p=f.current||(f.current=new v({options:d,context:i,onNewData:function(){p.ssrInitiated()?c():Promise.resolve().then((function(){return f.current&&c()}))}}));p.setOptions(d),p.context=i;var h=function useDeepMemo(e,t){var n=Object(r.useRef)();return n.current&&Object(l.a)(t,n.current.key)||(n.current={key:t,value:e()}),n.current.value}((function(){return n?p.executeLazy():p.execute()}),{options:Object(s.__assign)(Object(s.__assign)({},d),{onError:void 0,onCompleted:void 0}),context:i,tick:u}),y=n?h[1]:h;return Object(r.useEffect)((function(){return function(){return p.cleanup()}}),[]),Object(r.useEffect)((function(){return p.afterExecute({lazy:n})}),[y.loading,y.networkStatus,y.error,y.data]),h}function useLazyQuery(e,t){return useBaseQuery(e,t,!0)}function useMutation(e,t){var n=Object(r.useContext)(Object(a.c)()),i=Object(r.useState)({called:!1,loading:!1}),o=i[0],l=i[1],u=t?Object(s.__assign)(Object(s.__assign)({},t),{mutation:e}):{mutation:e},c=Object(r.useRef)();var d=function getMutationDataRef(){return c.current||(c.current=new h({options:u,context:n,result:o,setResult:l})),c.current}();return d.setOptions(u),d.context=n,Object(r.useEffect)((function(){return d.afterExecute()})),d.execute(o)}function useQuery(e,t){return useBaseQuery(e,t,!1)}function useSubscription(e,t){var n=Object(r.useContext)(Object(a.c)()),i=t?Object(s.__assign)(Object(s.__assign)({},t),{subscription:e}):{subscription:e},o=Object(r.useState)({loading:!i.skip,error:void 0,data:void 0}),l=o[0],u=o[1],c=Object(r.useRef)();var f=function getSubscriptionDataRef(){return c.current||(c.current=new d({options:i,context:n,setResult:u})),c.current}();return f.setOptions(i,!0),f.context=n,Object(r.useEffect)((function(){return f.afterExecute()})),Object(r.useEffect)((function(){return f.cleanup.bind(f)}),[]),f.execute(l)}function useReactiveVar(e){var t=e(),n=Object(r.useState)(t)[1];return Object(r.useEffect)((function(){return e.onNextChange(n)}),[t]),Object(r.useEffect)((function(){n(e())}),[]),t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r,i,o=n(1),a=(n(164),n(18)),s=n(60),l=n(41),u=n(2),c=n(3),d=n(11),f=n(10),p=Object.create(null),delModifier=function(){return p},h=Object.create(null),v=function(){function EntityStore(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Object(u.F)(Object(u.C)(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return Object(u.C)(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Object(u.E)(e);if(Object(u.C)(e))return e;var r=n.policies.identify(e)[0];if(r){var i=Object(u.E)(r);return t&&n.merge(r,e),i}}}return EntityStore.prototype.toObject=function(){return Object(o.__assign)({},this.data)},EntityStore.prototype.has=function(e){return void 0!==this.lookup(e,!0)},EntityStore.prototype.get=function(e,t){if(this.group.depend(e,t),f.c.call(this.data,e)){var n=this.data[e];if(n&&f.c.call(n,t))return n[t]}return"__typename"===t&&f.c.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof m?this.parent.get(e,t):void 0},EntityStore.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),f.c.call(this.data,e)?this.data[e]:this instanceof m?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},EntityStore.prototype.merge=function(e,t){var n=this,r=this.lookup(e),i=new u.b(storeObjectReconciler).merge(r,t);if(this.data[e]=i,i!==r&&(delete this.refs[e],this.group.caching)){var o=Object.create(null);r||(o.__exists=1),Object.keys(t).forEach((function(e){if(!r||r[e]!==i[e]){o[e]=1;var t=Object(f.b)(e);t===e||n.policies.hasKeyArgs(i.__typename,t)||(o[t]=1),void 0!==i[e]||n instanceof m||delete i[e]}})),Object.keys(o).forEach((function(t){return n.group.dirty(e,t)}))}},EntityStore.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),a=!1,s=!0,l={DELETE:p,INVALIDATE:h,isReference:u.C,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||Object(u.E)(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(c){var d=Object(f.b)(c),v=r[c];if(void 0!==v){var y="function"==typeof t?t:t[c]||t[d];if(y){var m=y===delModifier?p:y(Object(u.F)(v),Object(o.__assign)(Object(o.__assign)({},l),{fieldName:d,storeFieldName:c,storage:n.getStorage(e,c)}));m===h?n.group.dirty(e,c):(m===p&&(m=void 0),m!==v&&(i[c]=m,a=!0,v=m))}void 0!==v&&(s=!1)}})),a)return this.merge(e,i),s&&(this instanceof m?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},EntityStore.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=delModifier,r):delModifier)}return!1},EntityStore.prototype.evict=function(e){var t=!1;return e.id&&(f.c.call(this.data,e.id)&&(t=this.delete(e.id,e.fieldName,e.args)),this instanceof m&&(t=this.parent.evict(e)||t),(e.fieldName||t)&&this.group.dirty(e.id,e.fieldName||"__exists")),t},EntityStore.prototype.clear=function(){this.replace(null)},EntityStore.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){f.c.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},EntityStore.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&f.c.call(e,n)||t.delete(n)})),e){var n=e.__META,r=Object(o.__rest)(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},EntityStore.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},EntityStore.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},EntityStore.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof m?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},EntityStore.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){f.c.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof m;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},EntityStore.prototype.findChildRefIds=function(e){if(!f.c.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=new Set([this.data[e]]),canTraverse_1=function(e){return null!==e&&"object"==typeof e};n.forEach((function(e){Object(u.C)(e)?t[e.__ref]=!0:canTraverse_1(e)&&Object.values(e).filter(canTraverse_1).forEach(n.add,n)}))}return this.refs[e]},EntityStore.prototype.makeCacheKey=function(){for(var e=[],t=0;t0;if(f&&!l)throw d.missing[0];return{result:d.result,missing:d.missing,complete:!f}},StoreReader.prototype.isFresh=function(e,t,n,r){if(supportsResultCaching(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r);if(i&&e===i.result)return!0}return!1},StoreReader.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.context;if(Object(u.C)(r)&&!i.policies.rootTypenamesById[r.__ref]&&!i.store.has(r.__ref))return{result:{},missing:[missingFromInvariant(new c.a(4),i)]};var o=i.variables,a=i.policies,s=i.store,l=[],d={result:null},f=s.getFieldValue(r,"__typename");function getMissing(){return d.missing||(d.missing=[])}function handleMissing(e){var t;return e.missing&&(t=getMissing()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof f&&!a.rootIdsByTypename[f]&&l.push({__typename:f});var p=new Set(n.selections);return p.forEach((function(e){var n;if(Object(u.L)(e,o))if(Object(u.z)(e)){var s=a.readField({fieldName:e.name.value,field:e,variables:i.variables,from:r},i),d=Object(u.K)(e);i.path.push(d);var h=i.clientOnly;i.clientOnly=h||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?u.d.added(e)||getMissing().push(missingFromInvariant(new c.a(5),i)):Array.isArray(s)?s=handleMissing(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=handleMissing(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&l.push(((n={})[d]=s,n)),i.clientOnly=h,Object(c.b)(i.path.pop()===d)}else{var v=Object(u.o)(e,i.fragmentMap);v&&a.fragmentMatches(v,f)&&v.selectionSet.selections.forEach(p.add,p)}})),d.result=Object(u.H)(l),this.knownResults.set(d.result,n),d},StoreReader.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.context;function handleMissing(e,n){return e.missing&&(t=t||[]).push.apply(t,e.missing),Object(c.b)(o.path.pop()===n),e.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(o.path.push(t),Array.isArray(e)?handleMissing(n.executeSubSelectedArray({field:r,array:e,context:o}),t):r.selectionSet?handleMissing(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,context:o}),t):(Object(c.b)(o.path.pop()===t),e))})),missing:t}},StoreReader}();var g=function(){function StoreWriter(e,t){this.cache=e,this.reader=t}return StoreWriter.prototype.writeToStore=function(e){var t=e.query,n=e.result,r=e.dataId,i=e.store,a=e.variables,s=Object(u.r)(t),l=Object(f.d)();a=Object(o.__assign)(Object(o.__assign)({},Object(u.m)(s)),a);var d=this.processSelectionSet({result:n||Object.create(null),dataId:r,selectionSet:s.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:Object(u.k)(Object(u.n)(t))}});if(!Object(u.C)(d))throw new c.a(7);return i.retain(d.__ref),d},StoreWriter.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,a=e.mergeTree,s=this.cache.policies,l=s.identify(r,i,o.fragmentMap),d=l[0],f=l[1];if("string"==typeof(n=n||d)){var p=o.written[n]||(o.written[n]=[]),h=Object(u.E)(n);if(p.indexOf(i)>=0)return h;if(p.push(i),this.reader&&this.reader.isFresh(r,h,i,o))return h}var v=Object.create(null);f&&(v=o.merge(v,f));var y=n&&s.rootTypenamesById[n]||Object(u.v)(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof y&&(v.__typename=y);var m=new Set(i.selections);if(m.forEach((function(e){var n;if(Object(u.L)(e,o.variables))if(Object(u.z)(e)){var i=Object(u.K)(e),l=r[i];if(void 0!==l){var d=s.getStoreFieldName({typename:y,fieldName:e.name.value,field:e,variables:o.variables}),f=getChildMergeTree(a,d),p=t.processFieldValue(l,e,o,f),h=e.selectionSet&&o.store.getFieldValue(p,"__typename")||void 0,b=s.getMergeFunction(y,e.name.value,h);b?f.info={field:e,typename:y,merge:b}:maybeRecycleChildMergeTree(a,d),v=o.merge(v,((n={})[d]=p,n))}else if(s.usingPossibleTypes&&!Object(u.y)(["defer","client"],e))throw new c.a(8)}else{var g=Object(u.o)(e,o.fragmentMap);g&&s.fragmentMatches(g,y,r,o.variables)&&g.selectionSet.selections.forEach(m.add,m)}})),"string"==typeof n){var b=Object(u.E)(n);return a.map.size&&(v=this.applyMerges(a,b,v,o)),o.store.merge(n,v),b}return v},StoreWriter.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,getChildMergeTree(r,o));return maybeRecycleChildMergeTree(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):e},StoreWriter.prototype.applyMerges=function(e,t,n,r,i){var a,s=this;if(e.map.size&&!Object(u.C)(n)){var l,d=Array.isArray(n)||!Object(u.C)(t)&&!Object(f.f)(t)?void 0:t,p=n;d&&!i&&(i=[Object(u.C)(d)?d.__ref:d]);var getValue_1=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var n=getValue_1(d,t),o=getValue_1(p,t),a=s.applyMerges(e,n,o,r,i);a!==o&&(l=l||new Map).set(t,a),i&&Object(c.b)(i.pop()===t)})),l&&(n=Array.isArray(p)?p.slice(0):Object(o.__assign)({},p),l.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(a=r.store).getStorage.apply(a,i)):n},StoreWriter}(),_=[];function getChildMergeTree(e,t){var n=e.map;return n.has(t)||n.set(t,_.pop()||{map:new Map}),n.get(t)}function maybeRecycleChildMergeTree(e,t){var n=e.map,r=n.get(t);!r||r.info||r.map.size||(_.push(r),n.delete(t))}new Set;var S=n(35),O=n(51),E={dataIdFromObject:O.b,addTypename:!0,resultCaching:!0,typePolicies:{}},w=function(e){function InMemoryCache(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=S.c,n.txCount=0,n.maybeBroadcastWatch=Object(a.c)((function(e,t){return n.broadcastWatch.call(n,e,!!t)}),{makeCacheKey:function(e){var t=e.optimistic?n.optimisticData:n.data;if(supportsResultCaching(t)){var r=e.optimistic,i=e.rootId,o=e.variables;return t.makeCacheKey(e.query,e.callback,JSON.stringify({optimistic:r,rootId:i,variables:o}))}}}),n.watchDep=Object(a.b)(),n.config=Object(o.__assign)(Object(o.__assign)({},E),t),n.addTypename=!!n.config.addTypename,n.policies=new O.a({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.data=new v.Root({policies:n.policies,resultCaching:n.config.resultCaching}),n.optimisticData=n.data,n.storeWriter=new g(n,n.storeReader=new b({cache:n,addTypename:n.addTypename})),n}return Object(o.__extends)(InMemoryCache,e),InMemoryCache.prototype.restore=function(e){return e&&this.data.replace(e),this},InMemoryCache.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},InMemoryCache.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:e.query,variables:e.variables,rootId:e.rootId,config:this.config,returnPartialData:n}).result||null}catch(e){if(e instanceof l.a)return null;throw e}},InMemoryCache.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore({store:this.data,query:e.query,result:e.result,dataId:e.dataId,variables:e.variables})}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.modify=function(e){if(f.c.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,config:this.config})},InMemoryCache.prototype.watch=function(e){var t=this;return this.watches.size||Object(S.d)(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&Object(S.b)(t),t.watchDep.dirty(e),t.maybeBroadcastWatch.forget(e)}},InMemoryCache.prototype.gc=function(){return this.optimisticData.gc()},InMemoryCache.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},InMemoryCache.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},InMemoryCache.prototype.identify=function(e){return Object(u.C)(e)?e.__ref:this.policies.identify(e)[0]},InMemoryCache.prototype.evict=function(e){if(!e.id){if(f.c.call(e,"id"))return!1;e=Object(o.__assign)(Object(o.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.reset=function(){return this.data.clear(),this.optimisticData=this.data,this.broadcastWatches(),Promise.resolve()},InMemoryCache.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},InMemoryCache.prototype.performTransaction=function(e,t){var n=this,perform=function(t){var r=n,i=r.data,o=r.optimisticData;++n.txCount,t&&(n.data=n.optimisticData=t);try{e(n)}finally{--n.txCount,n.data=i,n.optimisticData=o}},r=!1;"string"==typeof t?(this.optimisticData=this.optimisticData.addLayer(t,perform),r=!0):null===t?perform(this.data):perform(),this.broadcastWatches(r)},InMemoryCache.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Object(u.d)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},InMemoryCache.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},InMemoryCache.prototype.broadcastWatch=function(e,t){this.watchDep.dirty(e),this.watchDep(e);var n=this.diff({query:e.query,variables:e.variables,optimistic:e.optimistic});e.optimistic&&t&&(n.fromOptimisticTransaction=!0),e.callback(n)},InMemoryCache}(s.a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return __extends}));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}Object.create;Object.create},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return visit}));var r=n(62),i=n(16),o={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},a=Object.freeze({});function visit(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,s=void 0,l=Array.isArray(e),u=[e],c=-1,d=[],f=void 0,p=void 0,h=void 0,v=[],y=[],m=e;do{var b=++c===u.length,g=b&&0!==d.length;if(b){if(p=0===y.length?void 0:v[v.length-1],f=h,h=y.pop(),g){if(l)f=f.slice();else{for(var _={},S=0,O=Object.keys(f);S=0)){if(I.push(e),E[e]){var s=P(E[e],!0);try{for(var l=r.__values(s),u=l.next();!u.done;u=l.next()){var c=u.value;addToResults(E[e][c],t)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}if(t.push(e),w[e]){var d=P(w[e],!1);try{for(var f=r.__values(d),p=f.next();!p.done;p=f.next()){c=p.value;addToResults(w[e][c],t)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}}}))};try{for(var k=r.__values(P(S,!1)),R=k.next();!R.done;R=k.next()){var x=R.value;M(S[x],T)}}catch(e){i={error:e}}finally{try{R&&!R.done&&(o=k.return)&&o.call(k)}finally{if(i)throw i.error}}try{for(var D=r.__values(P(_,!0)),N=D.next();!N.done;N=D.next()){x=N.value;M(_[x],C)}}catch(e){a={error:e}}finally{try{N&&!N.done&&(s=D.return)&&s.call(D)}finally{if(a)throw a.error}}try{for(var L=r.__values(P(O,!0)),F=L.next();!F.done;F=L.next()){x=F.value;M(O[x],j)}}catch(e){l={error:e}}finally{try{F&&!F.done&&(u=L.return)&&u.call(L)}finally{if(l)throw l.error}}try{for(var U=r.__values(Object.keys(E)),V=U.next();!V.done;V=U.next()){var B=V.value;if(!(I.indexOf(B)>=0))try{for(var q=(f=void 0,r.__values(P(E[B],!1))),Q=q.next();!Q.done;Q=q.next()){x=Q.value;M(E[B][x],T)}}catch(e){f={error:e}}finally{try{Q&&!Q.done&&(p=q.return)&&p.call(q)}finally{if(f)throw f.error}}}}catch(e){c={error:e}}finally{try{V&&!V.done&&(d=U.return)&&d.call(U)}finally{if(c)throw c.error}}try{for(var $=r.__values(Object.keys(w)),W=$.next();!W.done;W=$.next()){B=W.value;if(!(I.indexOf(B)>=0))try{for(var G=(y=void 0,r.__values(P(w[B],!1))),H=G.next();!H.done;H=G.next()){x=H.value;M(w[B][x],C)}}catch(e){y={error:e}}finally{try{H&&!H.done&&(m=G.return)&&m.call(G)}finally{if(y)throw y.error}}}}catch(e){h={error:e}}finally{try{W&&!W.done&&(v=$.return)&&v.call($)}finally{if(h)throw h.error}}return r.__spread(T,C,j).map((function(e){return g[e]})).map((function(t){return e[t]}))}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(1),i=function(e){function SynchronousMetaRegistry(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(SynchronousMetaRegistry,e),SynchronousMetaRegistry.prototype.set=function(t,n){if("d8a5aa78-978e-11e6-ae22-56b6b6499611"!==n.SERIAL_VERSION_UID)throw new Error("You can only add registries to a meta registry");return e.prototype.set.call(this,t,n)},SynchronousMetaRegistry}(r.__importDefault(n(87)).default);t.default=i},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return a(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=l(n(0)),d=n(0),f=n(160),p=n(6),h=n(4),v=n(165),y=n(170),m=n(171),b=n(172),g=n(7),_=n(109),S=u(n(264)),O=u(n(342)),E=u(n(343)),w=u(n(344)),T=u(n(118)),C=u(n(345)),j=null,I=function(e){function MediaSelectionScreen(t){var n=e.call(this,t)||this;return n.translate=function(e,t,r,i,o){return void 0===i&&(i="Flowpack.Media.Ui"),void 0===o&&(o="Main"),n.props.i18nRegistry.translate(e,t,r,i,o)},n.state={initialLeftSideBarHiddenState:!1,initialNodeCreationDialogOpenState:!1},n}return i(MediaSelectionScreen,e),MediaSelectionScreen.prototype.componentDidMount=function(){var e=this.props,t=e.isLeftSideBarHidden,n=e.isNodeCreationDialogOpen,r=e.toggleSidebar;this.setState({initialLeftSideBarHiddenState:t,initialNodeCreationDialogOpenState:n}),t||n||r()},MediaSelectionScreen.prototype.componentWillUnmount=function(){var e=this.props,t=e.isLeftSideBarHidden,n=e.toggleSidebar,r=this.state,i=r.initialLeftSideBarHiddenState,o=r.initialNodeCreationDialogOpenState;i===t||o||n()},MediaSelectionScreen.prototype.getConfig=function(){return{endpoints:{graphql:"/neos/graphql/media-assets",upload:"/neos/media-ui/upload"},dummyImage:"/_Resources/Static/Packages/Neos.Neos/Images/dummy-image.svg"}},MediaSelectionScreen.prototype.getApolloClient=function(){if(!j){var e=this.getConfig().endpoints,t=_.CacheFactory.createCache(this.props.frontendConfiguration);_.PersistentStateManager.restoreLocalState(t,this.props.constraints),j=new h.ApolloClient({cache:t,link:h.ApolloLink.from([_.ApolloErrorHandler,v.createUploadLink({uri:e.graphql,credentials:"same-origin"})]),typeDefs:[O.default,E.default,w.default],resolvers:[C.default(_.PersistentStateManager.updateLocalState),T.default(_.PersistentStateManager.updateLocalState)]})}return j},MediaSelectionScreen.prototype.render=function(){var e=this.props,t=e.addFlashMessage,n=e.onComplete,r=e.constraints,i=e.type,o=this.getApolloClient(),a=this.getConfig().dummyImage,s=d.createRef(),l=this.props.frontendConfiguration,u={info:function(e){return t(e,e,"info")},ok:function(e){return t(e,e,"success")},notice:function(e){return t(e,e,"info")},warning:function(e,n){return void 0===n&&(n=""),t(e,n,"error")},error:function(e,n){return void 0===n&&(n=""),t(e,n,"error")}},f=this.state.initialNodeCreationDialogOpenState;return c.createElement("div",{style:{transform:"translateZ(0)",height:"100%",padding:f?0:"1rem"}},c.createElement(g.IntlProvider,{translate:this.translate},c.createElement(g.NotifyProvider,{notificationApi:u},c.createElement(h.ApolloProvider,{client:o},c.createElement(p.RecoilRoot,null,c.createElement(g.MediaUiProvider,{dummyImage:a,onAssetSelection:n,selectionMode:!0,isInNodeCreationDialog:f,containerRef:s,featureFlags:l,constraints:r||{},assetType:"images"===i?"image":i},c.createElement(g.MediaUiThemeProvider,null,c.createElement(S.default,null))))))))},MediaSelectionScreen=s([f.connect(y.$transform({isLeftSideBarHidden:y.$get("ui.leftSideBar.isHidden"),isNodeCreationDialogOpen:y.$get("ui.nodeCreationDialog.isOpen")}),{addFlashMessage:b.actions.UI.FlashMessages.add,toggleSidebar:b.actions.UI.LeftSideBar.toggle}),m.neos((function(e){return{i18nRegistry:e.get("i18n"),frontendConfiguration:e.get("frontendConfiguration").get("Flowpack.Media.Ui")}}))],MediaSelectionScreen)}(c.PureComponent);t.default=I},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(31));e.exports=(0,r.default)("vendor")().reactRedux},function(e,t,n){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function concat(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0&&i.splice(e,1),completeIfDone()}});i.push(o)},error:function(e){r.error(e)},complete:function(){completeIfDone()}});function completeIfDone(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))}},{key:i,value:function(){return this}}],[{key:"from",value:function from(e){var t="function"==typeof this?this:Observable;if(null==e)throw new TypeError(e+" is not an object");var n=getMethod(e,i);if(n){var o=n.call(e);if(Object(o)!==o)throw new TypeError(o+" is not an object");return isObservable(o)&&o.constructor===t?o:new t((function(e){return o.subscribe(e)}))}if(hasSymbol("iterator")&&(n=getMethod(e,r)))return new t((function(t){enqueue((function(){if(!t.closed){var r=!0,i=!1,o=void 0;try{for(var a,s=n.call(e)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(t.next(l),t.closed)return}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}t.complete()}}))}));if(Array.isArray(e))return new t((function(t){enqueue((function(){if(!t.closed){for(var n=0;n0&&!f.isMatch(e.file.mediaType,T.mediaTypes))&&!((null===(n=T.assetSources)||void 0===n?void 0:n.length)>0&&!f.isMatch(e.assetSource.id,T.assetSources))}),[T]),V=u.useCallback((function(e){if(S&&e){var t=M.readFragment({fragment:c.gql(s||(s=r(["\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ","\n "],["\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ","\n "])),m.ASSET_FRAGMENT),fragmentName:"LocalAssetData",variables:{includeUsage:!1},id:M.cache.identify({__typename:"Asset",id:e.assetId})});U(t)?t.localId?S(t.localId):R(e).then((function(e){var t=e.data;S(t.importAsset.localId)})):P.notice(I("action.selectAsset.invalidType.message","You can only select any of the following types: {types}",{types:T.mediaTypes.join(", ")}))}}),[M,R,S,U,I,P,T.mediaTypes]);return l.createElement(t.MediaUiContext.Provider,{value:{containerRef:O,dummyImage:i,handleDeleteAsset:F,handleSelectAsset:V,selectionMode:a,isInNodeCreationDialog:g,assets:D,refetchAssets:N,featureFlags:E,constraints:T,assetType:j,isAssetSelectable:U}},n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(17);t.default=function useAssetCollectionsQuery(){var e=r.useQuery(i.ASSET_COLLECTIONS),t=e.data,n=e.loading;return{assetCollections:(null==t?void 0:t.assetCollections)||[],loading:n}}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n asset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ',"\n"],['\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n asset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.IPTC_PROPERTY_FRAGMENT=void 0;var i,o=n(4);t.IPTC_PROPERTY_FRAGMENT=o.gql(i||(i=r(["\n fragment IptcPropertyProps on IptcProperty {\n propertyName\n value\n }\n"],["\n fragment IptcPropertyProps on IptcProperty {\n propertyName\n value\n }\n"])))},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_FRAGMENT=void 0;var i,o=n(4);t.FILE_FRAGMENT=o.gql(i||(i=r(["\n fragment FileProps on File {\n extension\n mediaType\n typeIcon {\n url\n alt\n }\n size\n url\n }\n"],["\n fragment FileProps on File {\n extension\n mediaType\n typeIcon {\n url\n alt\n }\n size\n url\n }\n"])))},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n query ASSETS(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n $limit: Int\n $offset: Int\n $sortBy: SortBy\n $sortDirection: SortDirection\n $includeUsage: Boolean = false\n ) {\n selectedAssetSourceId @client(always: true) @export(as: "assetSourceId")\n includeUsage @client(always: true) @export(as: "includeUsage")\n assets(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n limit: $limit\n offset: $offset\n sortBy: $sortBy\n sortDirection: $sortDirection\n ) {\n ...AssetProps\n }\n }\n ',"\n"],['\n query ASSETS(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n $limit: Int\n $offset: Int\n $sortBy: SortBy\n $sortDirection: SortDirection\n $includeUsage: Boolean = false\n ) {\n selectedAssetSourceId @client(always: true) @export(as: "assetSourceId")\n includeUsage @client(always: true) @export(as: "includeUsage")\n assets(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n limit: $limit\n offset: $offset\n sortBy: $sortBy\n sortDirection: $sortDirection\n ) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(55),s=o.gql(i||(i=r(["\n query ASSET_COLLECTION($id: AssetCollectionId!) {\n assetCollection(id: $id) {\n ...AssetCollectionProps\n }\n }\n ","\n"],["\n query ASSET_COLLECTION($id: AssetCollectionId!) {\n assetCollection(id: $id) {\n ...AssetCollectionProps\n }\n }\n ","\n"])),a.ASSET_COLLECTION_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(55),s=o.gql(i||(i=r(["\n query ASSET_COLLECTIONS {\n assetCollections {\n ...AssetCollectionProps\n }\n }\n ","\n"],["\n query ASSET_COLLECTIONS {\n assetCollections {\n ...AssetCollectionProps\n }\n }\n ","\n"])),a.ASSET_COLLECTION_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(['\n query ASSET_COUNT(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n ) {\n selectedAssetSourceId @client(always: true) @export(as: "assetSourceId")\n assetCount(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n )\n }\n'],['\n query ASSET_COUNT(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n ) {\n selectedAssetSourceId @client(always: true) @export(as: "assetSourceId")\n assetCount(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n )\n }\n'])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(104),s=o.gql(i||(i=r(["\n query ASSET_SOURCES {\n assetSources {\n ...AssetSourceProps\n }\n }\n ","\n"],["\n query ASSET_SOURCES {\n assetSources {\n ...AssetSourceProps\n }\n }\n ","\n"])),a.ASSET_SOURCE_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n query CONFIG {\n config {\n uploadMaxFileSize\n uploadMaxFileUploadLimit\n currentServerTime\n }\n }\n"],["\n query CONFIG {\n config {\n uploadMaxFileSize\n uploadMaxFileUploadLimit\n currentServerTime\n }\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(38),s=o.gql(i||(i=r(["\n query TAG($id: TagId!) {\n tag(id: $id) {\n ...TagProps\n }\n }\n ","\n"],["\n query TAG($id: TagId!) {\n tag(id: $id) {\n ...TagProps\n }\n }\n ","\n"])),a.TAG_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(38),s=o.gql(i||(i=r(["\n query TAGS {\n tags {\n ...TagProps\n }\n }\n ","\n"],["\n query TAGS {\n tags {\n ...TagProps\n }\n }\n ","\n"])),a.TAG_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.SET_SELECTED_ASSET_SOURCE_ID=t.SELECTED_ASSET_SOURCE_ID=void 0;var i,o,a=n(4);t.SELECTED_ASSET_SOURCE_ID=a.gql(i||(i=r(["\n query SelectedAssetSourceId {\n selectedAssetSourceId @client(always: true)\n }\n"],["\n query SelectedAssetSourceId {\n selectedAssetSourceId @client(always: true)\n }\n"]))),t.SET_SELECTED_ASSET_SOURCE_ID=a.gql(o||(o=r(["\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\n }\n"],["\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\n }\n"])))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(6),a=n(17),s=r(n(67)),l=r(n(69)),u=n(14);t.default=function useAssetCountQuery(){var e=o.useRecoilValue(u.searchTermState),t=s.default(),n=l.default(),r=i.useQuery(a.ASSET_COUNT,{variables:{assetCollectionId:null==n?void 0:n.id,tagId:null==t?void 0:t.id,searchTerm:e}}),c=r.data,d=r.loading;return{assetCount:(null==c?void 0:c.assetCount)||0,loading:d}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"currentPageState",default:1});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"initialLoadComplete",default:!1});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"loadingState",default:!1});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"searchTermState",default:""});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"selectedAssetCollectionIdState",default:null});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"selectedMediaTypeState",default:"all"});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"selectedTagIdState",default:null});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(4),o=n(17),a=n(65);t.default=function useAssetSourcesQuery(){var e=a.useMediaUi().constraints,t=i.useQuery(o.ASSET_SOURCES),n=t.data,s=t.loading;return{assetSources:r.useMemo((function(){var t=(null==n?void 0:n.assetSources)||[];return e.assetSources?t.filter((function(t){return e.assetSources.includes(t.id)})):t}),[null==n?void 0:n.assetSources,e.assetSources]),loading:s}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(6),a=n(4),s=r(n(69)),l=r(n(67)),u=n(70),c=n(14),d=n(17);t.default=function(){var e=o.useRecoilValue(c.searchTermState),t=s.default(),n=l.default(),r=o.useRecoilValue(c.selectedMediaTypeState),f=o.useRecoilValue(c.selectedSortOrderState),p=o.useRecoilValue(c.currentPageState),h=o.useRecoilState(c.loadingState),v=h[0],y=h[1],m=o.useSetRecoilState(c.initialLoadCompleteState),b=i.useState([]),g=b[0],_=b[1],S=u.ASSETS_PER_PAGE,O=(p-1)*u.ASSETS_PER_PAGE,E=a.useLazyQuery(d.ASSETS,{notifyOnNetworkStatusChange:!1,variables:{searchTerm:e,assetCollectionId:null==t?void 0:t.id,mediaType:r,tagId:null==n?void 0:n.id,limit:S,offset:O,sortBy:f.sortBy,sortDirection:f.sortDirection}}),w=E[0],T=E[1],C=T.loading,j=T.error,I=T.data,P=T.refetch;return i.useEffect((function(){C||v?I&&!C&&v&&(y(!1),m(!0),_(I.assets)):(w({variables:{searchTerm:e,assetCollectionId:null==t?void 0:t.id,mediaType:r,tagId:null==n?void 0:n.id,limit:S,offset:O,sortBy:f.sortBy,sortDirection:f.sortDirection}}),y(!0))}),[w,I,C,O,S,e,null==t?void 0:t.title,r,null==n?void 0:n.id,f]),{error:j,assets:g,refetch:P}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(17);t.default=function(){var e=r.useQuery(i.CONFIG),t=e.data,n=e.loading;return{config:null==t?void 0:t.config,loading:n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(17),o=n(24);t.default=function useCreateAssetCollection(){var e=r.useMutation(o.CREATE_ASSET_COLLECTION),t=e[0],n=e[1],a=n.error;return{createAssetCollection:function(e){return t({variables:{title:e},update:function(e,t){var n=t.data,r=e.readQuery({query:i.ASSET_COLLECTIONS}).assetCollections;e.writeQuery({query:i.ASSET_COLLECTIONS,data:{assetCollections:r.concat([null==n?void 0:n.createAssetCollection])}})}})},data:n.data,error:a,loading:n.loading}}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(55),s=o.gql(i||(i=r(["\n mutation CreateAssetCollection($title: String!) {\n createAssetCollection(title: $title) {\n ...AssetCollectionProps\n }\n }\n ","\n"],["\n mutation CreateAssetCollection($title: String!) {\n createAssetCollection(title: $title) {\n ...AssetCollectionProps\n }\n }\n ","\n"])),a.ASSET_COLLECTION_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(38),s=o.gql(i||(i=r(["\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\n ...TagProps\n }\n }\n ","\n"],["\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\n ...TagProps\n }\n }\n ","\n"])),a.TAG_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\n }\n"],["\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\n deleteAssetCollection(id: $id) {\n success\n }\n }\n"],["\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\n deleteAssetCollection(id: $id) {\n success\n }\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n mutation DeleteTag($id: TagId!) {\n deleteTag(id: $id)\n }\n"],["\n mutation DeleteTag($id: TagId!) {\n deleteTag(id: $id)\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n importAsset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n importAsset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation SetAssetCollections(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $assetCollectionIds: [AssetCollectionId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation SetAssetCollections(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $assetCollectionIds: [AssetCollectionId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation SetAssetTags(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $tagIds: [TagId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation SetAssetTags(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $tagIds: [TagId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(26),s=o.gql(i||(i=r(['\n mutation UpdateAsset(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $label: String\n $caption: String\n $copyrightNotice: String\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n updateAsset(\n id: $id\n assetSourceId: $assetSourceId\n label: $label\n caption: $caption\n copyrightNotice: $copyrightNotice\n ) {\n ...AssetProps\n }\n }\n ',"\n"],['\n mutation UpdateAsset(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $label: String\n $caption: String\n $copyrightNotice: String\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: "includeUsage")\n updateAsset(\n id: $id\n assetSourceId: $assetSourceId\n label: $label\n caption: $caption\n copyrightNotice: $copyrightNotice\n ) {\n ...AssetProps\n }\n }\n ',"\n"])),a.ASSET_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(55),s=o.gql(i||(i=r(["\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\n ...AssetCollectionProps\n }\n }\n ","\n"],["\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\n ...AssetCollectionProps\n }\n }\n ","\n"])),a.ASSET_COLLECTION_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(38),s=o.gql(i||(i=r(["\n mutation UpdateTag($id: TagId!, $label: String) {\n updateTag(id: $id, label: $label) {\n ...TagProps\n }\n }\n ","\n"],["\n mutation UpdateTag($id: TagId!, $label: String) {\n updateTag(id: $id, label: $label) {\n ...TagProps\n }\n }\n ","\n"])),a.TAG_FRAGMENT);t.default=s},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?e:"Unknown")}},function(e,t,n){"use strict";n.r(t),t.default=function cachePlugin(){var e=new WeakMap;return{onCreateRule:function onCreateRule(t,n,r){var i=r.parent;return i&&t&&e.get(i.rules.raw[t])||null},onProcessRule:function onProcessRule(t){var n=t.options,r=n.sheet,i=n.parent;if(!(!i||r&&r.options.link)){var o=i.rules.raw[t.key];e.get(o)||e.set(o,t)}}}}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(240),o={spacing:{goldenUnit:"40px",full:"16px",half:"8px",quarter:"4px"},size:{sidebarWidth:"320px"},transition:{fast:".1s",default:".25s",slow:".5s"},zIndex:{secondaryToolbar:["linkIconButtonFlyout"],flashMessageContainer:"6",loadingIndicatorContainer:"5",secondaryInspector:["context","iframe","close"],secondaryInspectorElevated:["context","dropdownContents"],dialog:["context"],fullScreenClose:["context"],drawer:["context"],bar:["context"],primaryToolbar:"4",checkboxInput:["context"],dropdownContents:["context"],selectBoxContents:"3",notInlineEditableOverlay:["context"],calendarFakeInputMirror:["context"],rdtPicker:["context"],sideBar:["dropTargetBefore","dropTargetAfter"],wrapperDropdown:["context"],unappliedChangesOverlay:["context"],nodeToolBar:"2147483646"},fontSize:{base:"14px",small:"12px"},fonts:{headings:{family:"Noto Sans",style:"Regular",cssWeight:"400"},copy:{family:"Noto Sans",style:"Regular",cssWeight:"400"}},colors:{primaryViolet:"#26224C",primaryVioletHover:"#342f5f",primaryBlue:"#00ADEE",primaryBlueHover:"#35c3f8",contrastDarkest:"#141414",contrastDarker:"#222",contrastDark:"#3f3f3f",contrastNeutral:"#323232",contrastBright:"#999",contrastBrighter:"#adadad",contrastBrightest:"#FFF",success:"#00a338",successHover:"#0bb344",warn:"#ff8700",warnHover:"#fda23d",error:"#ff460d",errorHover:"#ff6a3c",uncheckedCheckboxTick:"#5B5B5B"}};e.exports={config:o,generateCssVarsObject:function generateCssVarsObject(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.length,a={};return Object.keys(e).forEach((function(o){var s=e[o],l=i(o),u=n?t+l:o;Array.isArray(s)?s.forEach((function(e,n){a["--"+t+"-"+l+"-"+i(e)]=""+(n+1)})):"object"===(void 0===s?"undefined":r(s))?a=Object.assign({},a,generateCssVarsObject(s,u)):a["--"+t+"-"+l]=s})),a}}},function(e,t,n){(function(t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")"+"?",u="[\\ufe0e\\ufe0f]?"+l+("(?:\\u200d(?:"+[o,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+l+")*"),c="(?:"+[o+r+"?",r,a,s,n].join("|")+")",d=RegExp(i+"(?="+i+")|"+c+u,"g"),f=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),p="object"==typeof t&&t&&t.Object===Object&&t,h="object"==typeof self&&self&&self.Object===Object&&self,v=p||h||Function("return this")();function hasUnicode(e){return f.test(e)}function stringToArray(e){return hasUnicode(e)?function unicodeToArray(e){return e.match(d)||[]}(e):function asciiToArray(e){return e.split("")}(e)}var y=Object.prototype.toString,m=v.Symbol,b=m?m.prototype:void 0,g=b?b.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(function isSymbol(e){return"symbol"==typeof e||function isObjectLike(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==y.call(e)}(e))return g?g.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function castSlice(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function baseSlice(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=n&&i0&&!t.assetSources.includes(r)&&(r=t.assetSources[0]),writeToCache(e,{selectedAssetSourceId:r,viewModeSelection:getItem("viewModeSelection")||a.VIEW_MODES.Thumbnails,clipboard:getItem("clipboard")||{}})},t.resetLocalState=function resetLocalState(e){writeToCache(e,{selectedAssetSourceId:o.NEOS_ASSET_SOURCE,viewModeSelection:a.VIEW_MODES.Thumbnails,clipboard:{}})},t.updateLocalState=function updateLocalState(e,t){Object.keys(e).forEach((function(t){localStorage.setItem("flowpack.mediaui."+t,JSON.stringify(e[t]))})),writeToCache(t,r({},e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_MODES=void 0;var r=n(4),i=n(111);!function(e){e.Thumbnails="thumbnails",e.List="list"}(t.VIEW_MODES||(t.VIEW_MODES={})),t.default=function useViewModeSelection(){var e=r.useQuery(i.VIEW_MODE_SELECTION).data.viewModeSelection,t=r.useMutation(i.SET_VIEW_MODE_SELECTION)[0];return[e,function(e){return t({variables:{viewModeSelection:e}})}]}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.SET_VIEW_MODE_SELECTION=t.VIEW_MODE_SELECTION=void 0;var i,o,a=n(4);t.VIEW_MODE_SELECTION=a.gql(i||(i=r(["\n query ViewModeSelection {\n viewModeSelection @client(always: true)\n }\n"],["\n query ViewModeSelection {\n viewModeSelection @client(always: true)\n }\n"]))),t.SET_VIEW_MODE_SELECTION=a.gql(o||(o=r(["\n mutation SetViewModeSelection($viewModeSelection: String) {\n setViewModeSelection(viewModeSelection: $viewModeSelection) @client\n }\n"],["\n mutation SetViewModeSelection($viewModeSelection: String) {\n setViewModeSelection(viewModeSelection: $viewModeSelection) @client\n }\n"])))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(6),o=n(9),a=n(39),s=n(28);t.default=function(){var e=o.useAssetCountQuery().assetCount,t=i.useRecoilValue(s.mainViewState),n=a.useUnusedAssetCountQuery(),l=n.called,u=n.load,c=n.unusedAssetCount,d=t===s.MainViewState.UNUSED_ASSETS?c:e;return r.useEffect((function(){t!==s.MainViewState.UNUSED_ASSETS||l||u()}),[t,l,u]),d}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UsageDetailsMetadataType=void 0,function(e){e.TEXT="TEXT",e.DATE="DATE",e.DATETIME="DATETIME",e.URL="URL"}(t.UsageDetailsMetadataType||(t.UsageDetailsMetadataType={}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(9),p=a(n(71)),h=a(n(115)),v=a(n(249)),y=d.createUseMediaUiStyles((function(e){return{assetUsage:{padding:e.spacing.full,"& section + section":{marginTop:e.spacing.full}},usageTable:{width:"100%","& th":{fontWeight:"bold"},"& td, & th":{padding:e.spacing.quarter,"&:first-child":{paddingLeft:0},"&:last-child":{paddingRight:0}},".neos & a":{color:e.colors.primary,"&:hover":{color:e.colors.primary,textDecoration:"underline"}}}}}));t.default=s.memo((function(){var e=y(),t=d.useIntl().translate,n=u.useRecoilState(p.default),r=n[0],i=n[1],o=f.useSelectedAsset(),a=h.default(o?{assetId:o.id,assetSourceId:o.assetSource.id}:null),m=a.assetUsageDetails,b=a.loading,g=l.useCallback((function(){return i(!1)}),[i]);return s.createElement(c.Dialog,{isOpen:r,title:t("assetUsage.title","Usage details for "+o.label,{asset:o.label}),onRequestClose:g,style:"wide",actions:[s.createElement(c.Button,{key:"cancel",style:"neutral",hoverStyle:"darken",onClick:g},t("assetUsage.cancel","Cancel"))]},s.createElement("div",{className:e.assetUsage},(null==m?void 0:m.length)>0?m.map((function(e,t){return s.createElement(v.default,{key:t,usageDetailsGroup:e})})):s.createElement("span",null,b?t("assetUsagesModal.loading","Loading..."):t("assetUsagesModal.noResults","No results"))))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7),l=s.createUseMediaUiStyles((function(e){return{usageSection:{"& h2":{fontWeight:"bold"}},usageTable:{width:"100%",marginTop:e.spacing.full,"& th":{fontWeight:"bold"},"& td, & th":{padding:e.spacing.quarter,"&:first-child":{paddingLeft:0},"&:last-child":{paddingRight:0}},".neos & a":{color:e.colors.primary,"&:hover":{color:e.colors.primary,textDecoration:"underline"}}}}}));t.default=a.memo((function(e){var t=e.usageDetailsGroup,n=l(),r=s.useIntl().translate,i=t.label,o=t.usages,u=t.metadataSchema;return a.createElement("section",{className:n.usageSection},a.createElement("h2",null,i),o.length>0&&a.createElement("table",{className:n.usageTable},a.createElement("thead",null,a.createElement("tr",null,a.createElement("th",null,r("assetUsageSection.label","Label")),u.map((function(e,t){return a.createElement("th",{key:t},e.label)})))),a.createElement("tbody",null,o.map((function(e,t){return a.createElement("tr",{key:t},a.createElement("td",null,a.createElement("a",{href:e.url,target:"_blank",rel:"noreferrer"},e.label)),u.map((function(t,n){var r=t.name,i=t.type,o=e.metadata.find((function(e){return e.name==r}));return o?a.createElement("td",{key:n},"DATETIME"==i||"DATE"==i?new Date(o.value).toLocaleString():"URL"==i?a.createElement("a",{href:o.value,target:"_blank",rel:"noreferrer"},r):o.value):null})))})))))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(6),u=n(8),c=n(7),d=a(n(71));t.default=s.memo((function(){var e=l.useRecoilState(d.default),t=e[0],n=e[1],r=c.useIntl().translate;return s.createElement(u.Button,{disabled:!1,size:"regular",style:t?"brand":"lighter",hoverStyle:"brand",onClick:function(){return n(!0)}},r("assetUsageList.toggle","Show usages"))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(6),a=n(4),s=n(14),l=n(70),u=r(n(114)),c=r(n(116));t.default=function(){var e=o.useRecoilValue(s.currentPageState),t=o.useRecoilState(s.loadingState),n=t[0],r=t[1],d=o.useRecoilValue(c.default),f=i.useState([]),p=f[0],h=f[1],v=l.ASSETS_PER_PAGE,y=(e-1)*l.ASSETS_PER_PAGE,m=a.useLazyQuery(u.default,{notifyOnNetworkStatusChange:!1,variables:{limit:v,offset:y}}),b=m[0],g=m[1],_=g.loading,S=g.error,O=g.data,E=g.refetch;return i.useEffect((function(){!d||_||n?O&&!_&&n&&(r(!1),h(O.unusedAssets)):(b({variables:{limit:v,offset:y}}),r(!0))}),[b,O,_,y,v,d]),{error:S,assets:p,refetch:E}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(n(253));t.default=function useUnusedAssetCountQuery(){var e=i.useLazyQuery(o.default),t=e[0],n=e[1],r=n.called,a=n.loading,s=n.data;return{called:r,load:t,unusedAssetCount:(null==s?void 0:s.unusedAssetCount)||0,loading:a}}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n query UNUSED_ASSET_COUNT {\n unusedAssetCount\n }\n"],["\n query UNUSED_ASSET_COUNT {\n unusedAssetCount\n }\n"])));t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"createAssetCollectionDialogState",default:{visible:!1,title:""}});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6).atom({key:"createTagDialogState",default:{visible:!1,label:""}});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainViewState=t.mainViewState=void 0;var r,i=n(6),o=n(32),a=n(39);!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.CLIPBOARD=1]="CLIPBOARD",e[e.UNUSED_ASSETS=2]="UNUSED_ASSETS"}(r||(r={})),t.MainViewState=r;var s=i.selector({key:"mainViewState",get:function(e){var t=e.get,n=t(o.clipboardVisibleState),i=t(a.showUnusedAssetsState);return n?r.CLIPBOARD:i?r.UNUSED_ASSETS:r.DEFAULT}});t.mainViewState=s},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(14),p=a(n(117)),h=a(n(74)),v=a(n(72)),y=d.createUseMediaUiStyles({clipboard:{height:"100%",alignSelf:"flex-end",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",margin:"0 -.3rem","& > *":{margin:"0 .3rem"}}});t.default=s.memo((function(){var e=y(),t=d.useIntl().translate,n=h.default().clipboard,r=u.useRecoilState(v.default),i=r[0],o=r[1],a=u.useRecoilValue(f.initialLoadCompleteState),m=l.useCallback((function(){return o((function(e){return!e}))}),[o]),b=Object.keys(n).length;return a?s.createElement("div",{className:e.clipboard},s.createElement(c.Button,{disabled:0===b,size:"regular",style:i?"brand":"lighter",hoverStyle:"brand",onClick:m},t("clipboard.toggle","Clipboard")," (",b,")"),Object.values(n).slice().reverse().slice(0,3).map((function(e){return s.createElement(p.default,{key:e.assetId,assetIdentity:e})}))):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(s){return function step(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] .neos-module-wrap":{paddingLeft:"1rem",paddingRight:"1rem",paddingTop:"3rem",paddingBottom:"0"},'body > [class*="_selectBox__contents_"]':{zIndex:99999}}}}));t.default=s.memo((function(){var e=u.useMediaUi(),t=e.selectionMode,n=e.isInNodeCreationDialog,r=e.containerRef,i=l.useRecoilValue(h.uploadDialogVisibleState).visible,o=l.useRecoilValue(w.createTagDialogState).visible,a=l.useRecoilValue(w.createAssetCollectionDialogState).visible,j=l.useRecoilValue(c.assetUsageDetailsModalState),I=l.useRecoilValue(p.similarAssetsModalState),P=C({selectionMode:t,isInNodeCreationDialog:n});return s.createElement("div",{className:P.container,ref:r},s.createElement(g.default,null),s.createElement("div",{className:P.gridLeft},s.createElement(E.default,null,s.createElement(m.SideBarLeft,null))),s.createElement("div",{className:P.gridTop},s.createElement(S.TopBar,null)),s.createElement("div",{className:P.gridMain},s.createElement(E.default,null,s.createElement(O.Main,null))),s.createElement(_.BottomBar,null),!t&&s.createElement("div",{className:P.gridRight},s.createElement(E.default,null,s.createElement(b.SideBarRight,null))),s.createElement(y.AssetPreview,null),j&&s.createElement(c.AssetUsagesModal,null),i&&s.createElement(v.UploadDialog,null),o&&s.createElement(T.CreateTagDialog,null),a&&s.createElement(T.CreateAssetCollectionDialog,null),I&&s.createElement(p.SimilarAssetsModal,null),s.createElement(d.ClipboardWatcher,null),s.createElement(f.ConcurrentChangeMonitor,null))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetChangeType=t.changedAssets=t.useChangedAssetsQuery=t.ConcurrentChangeMonitor=void 0;var s=a(n(266));t.ConcurrentChangeMonitor=s.default;var l=o(n(119));t.useChangedAssetsQuery=l.default,Object.defineProperty(t,"AssetChangeType",{enumerable:!0,get:function(){return l.AssetChangeType}});var u=a(n(120));t.changedAssets=u.default},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(9),u=n(110),c=n(56),d=o(n(119));t.default=a.memo((function(){var e=d.default(),t=l.useAssetQuery().refetch,n=l.useAssetsQuery().refetch;return s.useEffect((function(){null==e||e.forEach((function(e){switch(e.type){case d.AssetChangeType.ASSET_REPLACED:case d.AssetChangeType.ASSET_UPDATED:t({id:e.assetId,assetSourceId:u.NEOS_ASSET_SOURCE}).then((function(){console.info(e.assetId,e.type,"An asset was updated due to a remote change")})),c.assetUpdatedEvent({assetId:e.assetId,assetSourceId:u.NEOS_ASSET_SOURCE});break;case d.AssetChangeType.ASSET_CREATED:n().then((function(){console.info(e.assetId,e.type,"An asset was created remotely")})),c.assetCreatedEvent({assetId:e.assetId,assetSourceId:u.NEOS_ASSET_SOURCE});break;case d.AssetChangeType.ASSET_REMOVED:n().then((function(){console.info(e.assetId,e.type,"An asset was removed remotely")})),c.assetRemovedEvent({assetId:e.assetId,assetSourceId:u.NEOS_ASSET_SOURCE});break;default:console.debug(e,"unhandled remote change")}}))}),[e,t,n]),null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(6),u=n(8),c=n(7),d=a(n(75));t.default=s.memo((function(){var e=l.useRecoilState(d.default),t=e[0],n=e[1],r=c.useIntl().translate;return s.createElement(u.Button,{size:"regular",style:t?"brand":"lighter",hoverStyle:"brand",onClick:function(){return n(!0)}},r("similarAssetsModal.show","Show similar assets"))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(9),p=a(n(75)),h=a(n(122)),v=a(n(269)),y=d.createUseMediaUiStyles((function(e){return{assetUsage:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridGap:e.spacing.full,padding:e.spacing.full}}}));t.default=s.memo((function(){var e=y(),t=d.useIntl().translate,n=u.useRecoilState(p.default),r=n[0],i=n[1],o=f.useSelectedAsset(),a=h.default(o?{assetId:o.id,assetSourceId:o.assetSource.id}:null),m=a.similarAssets,b=a.loading,g=l.useCallback((function(){return i(!1)}),[i]);return s.createElement(c.Dialog,{isOpen:r,title:t("similarAssetsModal.title","Similar assets to "+o.label,{asset:o.label}),onRequestClose:g,style:"wide",actions:[s.createElement(c.Button,{key:"cancel",style:"neutral",hoverStyle:"darken",onClick:g},t("similarAssetsModal.cancel","Cancel"))]},s.createElement("div",{className:e.assetUsage},(null==m?void 0:m.length)>0?m.map((function(e,t){return s.createElement(v.default,{key:t,asset:e})})):s.createElement("span",null,b?t("similarAssetsModal.loading","Loading..."):t("similarAssetsModal.noResults","No results"))))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7),l=s.createUseMediaUiStyles((function(e){return{similarAsset:{margin:"0",display:"flex",flexDirection:"column",position:"relative"},picture:{backgroundColor:e.colors.assetBackground,"& img":{display:"block",height:"250px",width:"100%",objectFit:"contain"}},caption:{backgroundColor:e.colors.captionBackground,transition:"background-color "+e.transition.fast,padding:e.spacing.half,display:"flex",alignItems:"center",flex:1,"& img":{width:"1.3rem",height:"auto",marginRight:e.spacing.half}}}}));t.default=a.memo((function(e){var t=e.asset,n=l(),r=s.useMediaUi().dummyImage;return a.createElement("figure",{className:n.similarAsset},a.createElement("picture",{className:n.picture},a.createElement("img",{src:t?t.thumbnailUrl:r,alt:null==t?void 0:t.label})),a.createElement("figcaption",{className:n.caption},t&&a.createElement(a.Fragment,null,a.createElement("img",{src:t.file.typeIcon.url,alt:t.file.typeIcon.alt}),a.createElement("span",null,t.label))))}))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?o[e-1]:null,e1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return"";var n=e;return t&&Object.keys(t).forEach((function(e){n=n.replace(e,t[e])})),n}function getWindowWidth(){return void 0!==e.window?e.window.innerWidth:0}var u=27,c=37,d=39,f=function(t){function ReactImageLightbox(e){var t;return function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,ReactImageLightbox),(t=function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}(this,_getPrototypeOf(ReactImageLightbox).call(this,e))).state={isClosing:!e.animationDisabled,shouldAnimate:!1,zoomLevel:0,offsetX:0,offsetY:0,loadErrorStatus:{}},t.outerEl=i.a.createRef(),t.zoomInBtn=i.a.createRef(),t.zoomOutBtn=i.a.createRef(),t.caption=i.a.createRef(),t.closeIfClickInner=t.closeIfClickInner.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleImageDoubleClick=t.handleImageDoubleClick.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleImageMouseWheel=t.handleImageMouseWheel.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleKeyInput=t.handleKeyInput.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleMouseUp=t.handleMouseUp.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleMouseDown=t.handleMouseDown.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleMouseMove=t.handleMouseMove.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleOuterMousewheel=t.handleOuterMousewheel.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleTouchStart=t.handleTouchStart.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleTouchMove=t.handleTouchMove.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleTouchEnd=t.handleTouchEnd.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handlePointerEvent=t.handlePointerEvent.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleCaptionMousewheel=t.handleCaptionMousewheel.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleWindowResize=t.handleWindowResize.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleZoomInButtonClick=t.handleZoomInButtonClick.bind(_assertThisInitialized(_assertThisInitialized(t))),t.handleZoomOutButtonClick=t.handleZoomOutButtonClick.bind(_assertThisInitialized(_assertThisInitialized(t))),t.requestClose=t.requestClose.bind(_assertThisInitialized(_assertThisInitialized(t))),t.requestMoveNext=t.requestMoveNext.bind(_assertThisInitialized(_assertThisInitialized(t))),t.requestMovePrev=t.requestMovePrev.bind(_assertThisInitialized(_assertThisInitialized(t))),t}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}(ReactImageLightbox,t),_createClass(ReactImageLightbox,null,[{key:"isTargetMatchImage",value:function isTargetMatchImage(e){return e&&/ril-image-current/.test(e.className)}},{key:"parseMouseEvent",value:function parseMouseEvent(e){return{id:"mouse",source:1,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parseTouchPointer",value:function parseTouchPointer(e){return{id:e.identifier,source:2,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parsePointerEvent",value:function parsePointerEvent(e){return{id:e.pointerId,source:3,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"getTransform",value:function getTransform(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.zoom,a=void 0===o?1:o,s=e.width,l=e.targetWidth,u=n,c=(getWindowWidth(),a*(l/s));return{transform:"translate3d(".concat(u,"px,").concat(i,"px,0) scale3d(").concat(c,",").concat(c,",1)")}}}]),_createClass(ReactImageLightbox,[{key:"componentWillMount",value:function componentWillMount(){this.timeouts=[],this.currentAction=0,this.eventsSource=0,this.pointerList=[],this.preventInnerClose=!1,this.preventInnerCloseTimeout=null,this.keyPressed=!1,this.imageCache={},this.lastKeyDownTime=0,this.resizeTimeout=null,this.wheelActionTimeout=null,this.resetScrollTimeout=null,this.scrollX=0,this.scrollY=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,this.pinchTouchList=null,this.pinchDistance=0,this.keyCounter=0,this.moveRequested=!1,this.props.animationDisabled||this.setState({isClosing:!1})}},{key:"componentDidMount",value:function componentDidMount(){var t=this;this.windowContext=function getHighestSafeWindowContext(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.window.self,n=t.document.referrer;if(t===e.window.top||!n)return t;var r=function getOrigin(e){return e.match(/(.*\/\/.*?)(\/|$)/)[1]};return r(t.location.href)===r(n)?getHighestSafeWindowContext(t.parent):t}(),this.listeners={resize:this.handleWindowResize,mouseup:this.handleMouseUp,touchend:this.handleTouchEnd,touchcancel:this.handleTouchEnd,pointerdown:this.handlePointerEvent,pointermove:this.handlePointerEvent,pointerup:this.handlePointerEvent,pointercancel:this.handlePointerEvent},Object.keys(this.listeners).forEach((function(e){t.windowContext.addEventListener(e,t.listeners[e])})),this.loadAllImages()}},{key:"componentWillReceiveProps",value:function componentWillReceiveProps(e){var t=this,n=!1,r={},i={};this.getSrcTypes().forEach((function(o){t.props[o.name]!==e[o.name]&&(n=!0,r[t.props[o.name]]=!0,i[e[o.name]]=!0)})),(n||this.moveRequested)&&(Object.keys(r).forEach((function(e){!(e in i)&&e in t.imageCache&&(t.imageCache[e].loaded=!1)})),this.moveRequested=!1,this.loadAllImages(e))}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(){return!this.moveRequested}},{key:"componentWillUnmount",value:function componentWillUnmount(){var e=this;this.didUnmount=!0,Object.keys(this.listeners).forEach((function(t){e.windowContext.removeEventListener(t,e.listeners[t])})),this.timeouts.forEach((function(e){return clearTimeout(e)}))}},{key:"setTimeout",value:function(e){function setTimeout(t,n){return e.apply(this,arguments)}return setTimeout.toString=function(){return e.toString()},setTimeout}((function(e,t){var n=this,r=setTimeout((function(){n.timeouts=n.timeouts.filter((function(e){return e!==r})),e()}),t);return this.timeouts.push(r),r}))},{key:"setPreventInnerClose",value:function setPreventInnerClose(){var e=this;this.preventInnerCloseTimeout&&this.clearTimeout(this.preventInnerCloseTimeout),this.preventInnerClose=!0,this.preventInnerCloseTimeout=this.setTimeout((function(){e.preventInnerClose=!1,e.preventInnerCloseTimeout=null}),100)}},{key:"getBestImageForType",value:function getBestImageForType(e){var t=this.props[e],n={};if(this.isImageLoaded(t))n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height);else{if(!this.isImageLoaded(this.props["".concat(e,"Thumbnail")]))return null;t=this.props["".concat(e,"Thumbnail")],n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height,!0)}return{src:t,height:this.imageCache[t].height,width:this.imageCache[t].width,targetHeight:n.height,targetWidth:n.width}}},{key:"getFitSizes",value:function getFitSizes(e,t,n){var r=this.getLightboxRect(),i=r.height-2*this.props.imagePadding,o=r.width-2*this.props.imagePadding;return n||(i=Math.min(i,t),o=Math.min(o,e)),o/i>e/t?{width:e*i/t,height:i}:{width:o,height:t*o/e}}},{key:"getMaxOffsets",value:function getMaxOffsets(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel,t=this.getBestImageForType("mainSrc");if(null===t)return{maxX:0,minX:0,maxY:0,minY:0};var n=this.getLightboxRect(),r=this.getZoomMultiplier(e),i=0,o=0;return{maxX:i=r*t.width-n.width<0?(n.width-r*t.width)/2:(r*t.width-n.width)/2,maxY:o=r*t.height-n.height<0?(n.height-r*t.height)/2:(r*t.height-n.height)/2,minX:-1*i,minY:-1*o}}},{key:"getSrcTypes",value:function getSrcTypes(){return[{name:"mainSrc",keyEnding:"i".concat(this.keyCounter)},{name:"mainSrcThumbnail",keyEnding:"t".concat(this.keyCounter)},{name:"nextSrc",keyEnding:"i".concat(this.keyCounter+1)},{name:"nextSrcThumbnail",keyEnding:"t".concat(this.keyCounter+1)},{name:"prevSrc",keyEnding:"i".concat(this.keyCounter-1)},{name:"prevSrcThumbnail",keyEnding:"t".concat(this.keyCounter-1)}]}},{key:"getZoomMultiplier",value:function getZoomMultiplier(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel;return Math.pow(1.007,e)}},{key:"getLightboxRect",value:function getLightboxRect(){return this.outerEl.current?this.outerEl.current.getBoundingClientRect():{width:getWindowWidth(),height:void 0!==e.window?e.window.innerHeight:0,top:0,right:0,bottom:0,left:0}}},{key:"clearTimeout",value:function(e){function clearTimeout(t){return e.apply(this,arguments)}return clearTimeout.toString=function(){return e.toString()},clearTimeout}((function(e){this.timeouts=this.timeouts.filter((function(t){return t!==e})),clearTimeout(e)}))},{key:"changeZoom",value:function changeZoom(e,t,n){if(this.props.enableZoom){var r=Math.max(0,Math.min(300,e));if(r!==this.state.zoomLevel)if(0!==r){var i=this.getBestImageForType("mainSrc");if(null!==i){var o=this.getZoomMultiplier(),a=this.getZoomMultiplier(r),s=this.getLightboxRect(),l=void 0!==t?t-s.left:s.width/2,u=void 0!==n?n-s.top:s.height/2,c=(s.width-i.width*o)/2,d=(s.height-i.height*o)/2,f=l-(l-(c-this.state.offsetX))/o*a,p=u-(u-(d-this.state.offsetY))/o*a,h=(s.width-i.width*a)/2-f,v=(s.height-i.height*a)/2-p;if(3!==this.currentAction){var y=this.getMaxOffsets();this.state.zoomLevel>r&&(h=Math.max(y.minX,Math.min(y.maxX,h)),v=Math.max(y.minY,Math.min(y.maxY,v)))}this.setState({zoomLevel:r,offsetX:h,offsetY:v})}}else this.setState({zoomLevel:r,offsetX:0,offsetY:0})}}},{key:"closeIfClickInner",value:function closeIfClickInner(e){!this.preventInnerClose&&e.target.className.search(/\bril-inner\b/)>-1&&this.requestClose(e)}},{key:"handleKeyInput",value:function handleKeyInput(e){if(e.stopPropagation(),!this.isAnimating())if("keyup"!==e.type){var t=e.which||e.keyCode,n=new Date;if(!(n.getTime()-this.lastKeyDownTime=200||e.deltaX>=100?(this.requestMoveNext(e),n=500,this.scrollX=0):(this.scrollX<=-200||e.deltaX<=-100)&&(this.requestMovePrev(e),n=500,this.scrollX=0)}0!==n&&(this.wheelActionTimeout=this.setTimeout((function(){t.wheelActionTimeout=null}),n))}}},{key:"handleImageMouseWheel",value:function handleImageMouseWheel(e){if(Math.abs(e.deltaY)>=Math.abs(e.deltaX)){if(e.stopPropagation(),Math.abs(e.deltaY)<1)return;this.scrollX=0,this.scrollY+=e.deltaY,this.changeZoom(this.state.zoomLevel-e.deltaY,e.clientX,e.clientY)}}},{key:"handleImageDoubleClick",value:function handleImageDoubleClick(e){this.state.zoomLevel>0?this.changeZoom(0,e.clientX,e.clientY):this.changeZoom(this.state.zoomLevel+100,e.clientX,e.clientY)}},{key:"shouldHandleEvent",value:function shouldHandleEvent(e){if(this.eventsSource===e)return!0;if(0===this.eventsSource)return this.eventsSource=e,!0;switch(e){case 1:return!1;case 2:return this.eventsSource=2,this.filterPointersBySource(),!0;case 3:return 1===this.eventsSource&&(this.eventsSource=3,this.filterPointersBySource(),!0);default:return!1}}},{key:"addPointer",value:function addPointer(e){this.pointerList.push(e)}},{key:"removePointer",value:function removePointer(e){this.pointerList=this.pointerList.filter((function(t){return t.id!==e.id}))}},{key:"filterPointersBySource",value:function filterPointersBySource(){var e=this;this.pointerList=this.pointerList.filter((function(t){return t.source===e.eventsSource}))}},{key:"handleMouseDown",value:function handleMouseDown(e){this.shouldHandleEvent(1)&&ReactImageLightbox.isTargetMatchImage(e.target)&&(this.addPointer(ReactImageLightbox.parseMouseEvent(e)),this.multiPointerStart(e))}},{key:"handleMouseMove",value:function handleMouseMove(e){this.shouldHandleEvent(1)&&this.multiPointerMove(e,[ReactImageLightbox.parseMouseEvent(e)])}},{key:"handleMouseUp",value:function handleMouseUp(e){this.shouldHandleEvent(1)&&(this.removePointer(ReactImageLightbox.parseMouseEvent(e)),this.multiPointerEnd(e))}},{key:"handlePointerEvent",value:function handlePointerEvent(e){if(this.shouldHandleEvent(3))switch(e.type){case"pointerdown":ReactImageLightbox.isTargetMatchImage(e.target)&&(this.addPointer(ReactImageLightbox.parsePointerEvent(e)),this.multiPointerStart(e));break;case"pointermove":this.multiPointerMove(e,[ReactImageLightbox.parsePointerEvent(e)]);break;case"pointerup":case"pointercancel":this.removePointer(ReactImageLightbox.parsePointerEvent(e)),this.multiPointerEnd(e)}}},{key:"handleTouchStart",value:function handleTouchStart(e){var t=this;this.shouldHandleEvent(2)&&ReactImageLightbox.isTargetMatchImage(e.target)&&([].forEach.call(e.changedTouches,(function(e){return t.addPointer(ReactImageLightbox.parseTouchPointer(e))})),this.multiPointerStart(e))}},{key:"handleTouchMove",value:function handleTouchMove(e){this.shouldHandleEvent(2)&&this.multiPointerMove(e,[].map.call(e.changedTouches,(function(e){return ReactImageLightbox.parseTouchPointer(e)})))}},{key:"handleTouchEnd",value:function handleTouchEnd(e){var t=this;this.shouldHandleEvent(2)&&([].map.call(e.changedTouches,(function(e){return t.removePointer(ReactImageLightbox.parseTouchPointer(e))})),this.multiPointerEnd(e))}},{key:"decideMoveOrSwipe",value:function decideMoveOrSwipe(e){this.state.zoomLevel<=0?this.handleSwipeStart(e):this.handleMoveStart(e)}},{key:"multiPointerStart",value:function multiPointerStart(e){switch(this.handleEnd(null),this.pointerList.length){case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"multiPointerMove",value:function multiPointerMove(e,t){switch(this.currentAction){case 1:e.preventDefault(),this.handleMove(t[0]);break;case 2:e.preventDefault(),this.handleSwipe(t[0]);break;case 3:e.preventDefault(),this.handlePinch(t)}}},{key:"multiPointerEnd",value:function multiPointerEnd(e){switch(0!==this.currentAction&&(this.setPreventInnerClose(),this.handleEnd(e)),this.pointerList.length){case 0:this.eventsSource=0;break;case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"handleEnd",value:function handleEnd(e){switch(this.currentAction){case 1:this.handleMoveEnd(e);break;case 2:this.handleSwipeEnd(e);break;case 3:this.handlePinchEnd(e)}}},{key:"handleMoveStart",value:function handleMoveStart(e){var t=e.x,n=e.y;this.props.enableZoom&&(this.currentAction=1,this.moveStartX=t,this.moveStartY=n,this.moveStartOffsetX=this.state.offsetX,this.moveStartOffsetY=this.state.offsetY)}},{key:"handleMove",value:function handleMove(e){var t=e.x,n=e.y,r=this.moveStartX-t+this.moveStartOffsetX,i=this.moveStartY-n+this.moveStartOffsetY;this.state.offsetX===r&&this.state.offsetY===i||this.setState({offsetX:r,offsetY:i})}},{key:"handleMoveEnd",value:function handleMoveEnd(){var e=this;this.currentAction=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0;var t=this.getMaxOffsets(),n=Math.max(t.minX,Math.min(t.maxX,this.state.offsetX)),r=Math.max(t.minY,Math.min(t.maxY,this.state.offsetY));n===this.state.offsetX&&r===this.state.offsetY||(this.setState({offsetX:n,offsetY:r,shouldAnimate:!0}),this.setTimeout((function(){e.setState({shouldAnimate:!1})}),this.props.animationDuration))}},{key:"handleSwipeStart",value:function handleSwipeStart(e){var t=e.x,n=e.y;this.currentAction=2,this.swipeStartX=t,this.swipeStartY=n,this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipe",value:function handleSwipe(e){var t=e.x,n=e.y;this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipeEnd",value:function handleSwipeEnd(e){var t=this.swipeEndX-this.swipeStartX,n=Math.abs(t),r=Math.abs(this.swipeEndY-this.swipeStartY);if(this.currentAction=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,!(!e||this.isAnimating()||n<1.5*r)){if(n<200)if(n0&&this.props.prevSrc?(e.preventDefault(),this.requestMovePrev()):t<0&&this.props.nextSrc&&(e.preventDefault(),this.requestMoveNext())}}},{key:"calculatePinchDistance",value:function calculatePinchDistance(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,t=_slicedToArray(e,2),n=t[0],r=t[1];return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}},{key:"calculatePinchCenter",value:function calculatePinchCenter(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,t=_slicedToArray(e,2),n=t[0],r=t[1];return{x:n.x-(n.x-r.x)/2,y:n.y-(n.y-r.y)/2}}},{key:"handlePinchStart",value:function handlePinchStart(e){this.props.enableZoom&&(this.currentAction=3,this.pinchTouchList=e.map((function(e){return{id:e.id,x:e.x,y:e.y}})),this.pinchDistance=this.calculatePinchDistance())}},{key:"handlePinch",value:function handlePinch(e){this.pinchTouchList=this.pinchTouchList.map((function(t){for(var n=0;n0&&t+i>=r||e.deltaY<0&&i<=0)&&e.preventDefault()}}},{key:"isAnimating",value:function isAnimating(){return this.state.shouldAnimate||this.state.isClosing}},{key:"isImageLoaded",value:function isImageLoaded(e){return e&&e in this.imageCache&&this.imageCache[e].loaded}},{key:"loadImage",value:function loadImage(t,n,r){var i=this;if(this.isImageLoaded(n))this.setTimeout((function(){r()}),1);else{var o=new e.Image;this.props.imageCrossOrigin&&(o.crossOrigin=this.props.imageCrossOrigin),o.onerror=function(e){i.props.onImageLoadError(n,t,e),i.setState((function(e){return{loadErrorStatus:_objectSpread({},e.loadErrorStatus,_defineProperty({},t,!0))}})),r(e)},o.onload=function(){i.props.onImageLoad(n,t,o),i.imageCache[n]={loaded:!0,width:o.width,height:o.height},r()},o.src=n}}},{key:"loadAllImages",value:function loadAllImages(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=function generateLoadDoneCallback(t,n){return function(r){r||e.props[t]!==n||e.didUnmount||e.forceUpdate()}};this.getSrcTypes().forEach((function(r){var i=r.name;t[i]&&e.state.loadErrorStatus[i]&&e.setState((function(e){return{loadErrorStatus:_objectSpread({},e.loadErrorStatus,_defineProperty({},i,!1))}})),t[i]&&!e.isImageLoaded(t[i])&&e.loadImage(i,t[i],n(i,t[i]))}))}},{key:"requestClose",value:function requestClose(e){var t=this,n=function closeLightbox(){return t.props.onCloseRequest(e)};this.props.animationDisabled||"keydown"===e.type&&!this.props.animationOnKeyInput?n():(this.setState({isClosing:!0}),this.setTimeout(n,this.props.animationDuration))}},{key:"requestMove",value:function requestMove(e,t){var n=this,r={zoomLevel:0,offsetX:0,offsetY:0};this.props.animationDisabled||this.keyPressed&&!this.props.animationOnKeyInput||(r.shouldAnimate=!0,this.setTimeout((function(){return n.setState({shouldAnimate:!1})}),this.props.animationDuration)),this.keyPressed=!1,this.moveRequested=!0,"prev"===e?(this.keyCounter-=1,this.setState(r),this.props.onMovePrevRequest(t)):(this.keyCounter+=1,this.setState(r),this.props.onMoveNextRequest(t))}},{key:"requestMoveNext",value:function requestMoveNext(e){this.requestMove("next",e)}},{key:"requestMovePrev",value:function requestMovePrev(e){this.requestMove("prev",e)}},{key:"render",value:function render(){var t=this,n=this.props,r=n.animationDisabled,o=n.animationDuration,a=n.clickOutsideToClose,s=n.discourageDownloads,u=n.enableZoom,c=n.imageTitle,d=n.nextSrc,f=n.prevSrc,p=n.toolbarButtons,h=n.reactModalStyle,v=n.onAfterOpen,y=n.imageCrossOrigin,m=n.reactModalProps,b=this.state,g=b.zoomLevel,_=b.offsetX,S=b.offsetY,O=b.isClosing,E=b.loadErrorStatus,w=this.getLightboxRect(),T={};!r&&this.isAnimating()&&(T=_objectSpread({},T,{transition:"transform ".concat(o,"ms")}));var C={};this.getSrcTypes().forEach((function(e){var t=e.name,n=e.keyEnding;C[t]=n}));var j=[],I=function addImage(e,n,r){if(t.props[e]){var o=t.getBestImageForType(e),a=_objectSpread({},T,ReactImageLightbox.getTransform(_objectSpread({},r,o)));g>0&&(a.cursor="move");if(null===o&&function hasTrueValue(e){return Object.keys(e).some((function(t){return e[t]}))}(E))j.push(i.a.createElement("div",{className:"".concat(n," ril__image ril-errored"),style:a,key:t.props[e]+C[e]},i.a.createElement("div",{className:"ril__errorContainer"},t.props.imageLoadErrorMessage)));else if(null!==o){var l=o.src;s?(a.backgroundImage="url('".concat(l,"')"),j.push(i.a.createElement("div",{className:"".concat(n," ril__image ril__imageDiscourager"),onDoubleClick:t.handleImageDoubleClick,onWheel:t.handleImageMouseWheel,style:a,key:l+C[e]},i.a.createElement("div",{className:"ril-download-blocker ril__downloadBlocker"})))):j.push(i.a.createElement("img",_extends({},y?{crossOrigin:y}:{},{className:"".concat(n," ril__image"),onDoubleClick:t.handleImageDoubleClick,onWheel:t.handleImageMouseWheel,onDragStart:function onDragStart(e){return e.preventDefault()},style:a,src:l,key:l+C[e],alt:"string"==typeof c?c:translate("Image"),draggable:!1})))}else{var u=i.a.createElement("div",{className:"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon"},_toConsumableArray(new Array(12)).map((function(e,t){return i.a.createElement("div",{key:t,className:"ril-loading-circle-point ril__loadingCirclePoint"})})));j.push(i.a.createElement("div",{className:"".concat(n," ril__image ril-not-loaded"),style:a,key:t.props[e]+C[e]},i.a.createElement("div",{className:"ril__loadingContainer"},u)))}}},P=this.getZoomMultiplier();I("nextSrc","ril-image-next ril__imageNext",{x:w.width}),I("mainSrc","ril-image-current",{x:-1*_,y:-1*S,zoom:P}),I("prevSrc","ril-image-prev ril__imagePrev",{x:-1*w.width});var M={overlay:_objectSpread({zIndex:1e3,backgroundColor:"transparent"},h.overlay),content:_objectSpread({backgroundColor:"transparent",overflow:"hidden",border:"none",borderRadius:0,padding:0,top:0,left:0,right:0,bottom:0},h.content)};return i.a.createElement(l.a,_extends({isOpen:!0,onRequestClose:a?this.requestClose:void 0,onAfterOpen:function onAfterOpen(){t.outerEl.current&&t.outerEl.current.focus(),v()},style:M,contentLabel:translate("Lightbox"),appElement:void 0!==e.window?e.window.document.body:void 0},m),i.a.createElement("div",{className:"ril-outer ril__outer ril__outerAnimating ".concat(this.props.wrapperClassName," ").concat(O?"ril-closing ril__outerClosing":""),style:{transition:"opacity ".concat(o,"ms"),animationDuration:"".concat(o,"ms"),animationDirection:O?"normal":"reverse"},ref:this.outerEl,onWheel:this.handleOuterMousewheel,onMouseMove:this.handleMouseMove,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,tabIndex:"-1",onKeyDown:this.handleKeyInput,onKeyUp:this.handleKeyInput},i.a.createElement("div",{className:"ril-inner ril__inner",onClick:a?this.closeIfClickInner:void 0},j),f&&i.a.createElement("button",{type:"button",className:"ril-prev-button ril__navButtons ril__navButtonPrev",key:"prev","aria-label":this.props.prevLabel,onClick:this.isAnimating()?void 0:this.requestMovePrev}),d&&i.a.createElement("button",{type:"button",className:"ril-next-button ril__navButtons ril__navButtonNext",key:"next","aria-label":this.props.nextLabel,onClick:this.isAnimating()?void 0:this.requestMoveNext}),i.a.createElement("div",{className:"ril-toolbar ril__toolbar"},i.a.createElement("ul",{className:"ril-toolbar-left ril__toolbarSide ril__toolbarLeftSide"},i.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},i.a.createElement("span",{className:"ril-toolbar__item__child ril__toolbarItemChild"},c))),i.a.createElement("ul",{className:"ril-toolbar-right ril__toolbarSide ril__toolbarRightSide"},p&&p.map((function(e,t){return i.a.createElement("li",{key:"button_".concat(t+1),className:"ril-toolbar__item ril__toolbarItem"},e)})),u&&i.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},i.a.createElement("button",{type:"button",key:"zoom-in","aria-label":this.props.zoomInLabel,className:["ril-zoom-in","ril__toolbarItemChild","ril__builtinButton","ril__zoomInButton"].concat(_toConsumableArray(300===g?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomInBtn,disabled:this.isAnimating()||300===g,onClick:this.isAnimating()||300===g?void 0:this.handleZoomInButtonClick})),u&&i.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},i.a.createElement("button",{type:"button",key:"zoom-out","aria-label":this.props.zoomOutLabel,className:["ril-zoom-out","ril__toolbarItemChild","ril__builtinButton","ril__zoomOutButton"].concat(_toConsumableArray(0===g?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomOutBtn,disabled:this.isAnimating()||0===g,onClick:this.isAnimating()||0===g?void 0:this.handleZoomOutButtonClick})),i.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},i.a.createElement("button",{type:"button",key:"close","aria-label":this.props.closeLabel,className:"ril-close ril-toolbar__item__child ril__toolbarItemChild ril__builtinButton ril__closeButton",onClick:this.isAnimating()?void 0:this.requestClose})))),this.props.imageCaption&&i.a.createElement("div",{onWheel:this.handleCaptionMousewheel,onMouseDown:function onMouseDown(e){return e.stopPropagation()},className:"ril-caption ril__caption",ref:this.caption},i.a.createElement("div",{className:"ril-caption-content ril__captionContent"},this.props.imageCaption))))}}]),ReactImageLightbox}(r.Component);f.propTypes={mainSrc:a.a.string.isRequired,prevSrc:a.a.string,nextSrc:a.a.string,mainSrcThumbnail:a.a.string,prevSrcThumbnail:a.a.string,nextSrcThumbnail:a.a.string,onCloseRequest:a.a.func.isRequired,onMovePrevRequest:a.a.func,onMoveNextRequest:a.a.func,onImageLoadError:a.a.func,onImageLoad:a.a.func,onAfterOpen:a.a.func,discourageDownloads:a.a.bool,animationDisabled:a.a.bool,animationOnKeyInput:a.a.bool,animationDuration:a.a.number,keyRepeatLimit:a.a.number,keyRepeatKeyupBonus:a.a.number,imageTitle:a.a.node,imageCaption:a.a.node,imageCrossOrigin:a.a.string,reactModalStyle:a.a.shape({}),imagePadding:a.a.number,wrapperClassName:a.a.string,toolbarButtons:a.a.arrayOf(a.a.node),clickOutsideToClose:a.a.bool,enableZoom:a.a.bool,reactModalProps:a.a.shape({}),nextLabel:a.a.string,prevLabel:a.a.string,zoomInLabel:a.a.string,zoomOutLabel:a.a.string,closeLabel:a.a.string,imageLoadErrorMessage:a.a.node},f.defaultProps={imageTitle:null,imageCaption:null,toolbarButtons:null,reactModalProps:{},animationDisabled:!1,animationDuration:300,animationOnKeyInput:!1,clickOutsideToClose:!0,closeLabel:"Close lightbox",discourageDownloads:!1,enableZoom:!0,imagePadding:10,imageCrossOrigin:null,keyRepeatKeyupBonus:40,keyRepeatLimit:180,mainSrcThumbnail:null,nextLabel:"Next image",nextSrc:null,nextSrcThumbnail:null,onAfterOpen:function onAfterOpen(){},onImageLoadError:function onImageLoadError(){},onImageLoad:function onImageLoad(){},onMoveNextRequest:function onMoveNextRequest(){},onMovePrevRequest:function onMovePrevRequest(){},prevLabel:"Previous image",prevSrc:null,prevSrcThumbnail:null,reactModalStyle:{},wrapperClassName:"",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",imageLoadErrorMessage:"This image failed to load"},t.default=f}.call(this,n(53))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t0&&0===(y-=1)&&c.show(n),t.props.shouldFocusAfterRender&&(t.props.shouldReturnFocusAfterClose?(l.returnFocus(t.props.preventScroll),l.teardownScopedFocus()):l.popWithoutFocus()),t.props.onAfterClose&&t.props.onAfterClose(),h.default.deregister(t)},t.open=function(){t.beforeOpen(),t.state.afterOpen&&t.state.beforeClose?(clearTimeout(t.closeTimer),t.setState({beforeClose:!1})):(t.props.shouldFocusAfterRender&&(l.setupScopedFocus(t.node),l.markForFocusLater()),t.setState({isOpen:!0},(function(){t.setState({afterOpen:!0}),t.props.isOpen&&t.props.onAfterOpen&&t.props.onAfterOpen({overlayEl:t.overlay,contentEl:t.content})})))},t.close=function(){t.props.closeTimeoutMS>0?t.closeWithTimeout():t.closeWithoutTimeout()},t.focusContent=function(){return t.content&&!t.contentHasFocus()&&t.content.focus({preventScroll:!0})},t.closeWithTimeout=function(){var e=Date.now()+t.props.closeTimeoutMS;t.setState({beforeClose:!0,closesAt:e},(function(){t.closeTimer=setTimeout(t.closeWithoutTimeout,t.state.closesAt-Date.now())}))},t.closeWithoutTimeout=function(){t.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},t.afterClose)},t.handleKeyDown=function(e){9===e.keyCode&&(0,u.default)(t.content,e),t.props.shouldCloseOnEsc&&27===e.keyCode&&(e.stopPropagation(),t.requestClose(e))},t.handleOverlayOnClick=function(e){null===t.shouldClose&&(t.shouldClose=!0),t.shouldClose&&t.props.shouldCloseOnOverlayClick&&(t.ownerHandlesClose()?t.requestClose(e):t.focusContent()),t.shouldClose=null},t.handleContentOnMouseUp=function(){t.shouldClose=!1},t.handleOverlayOnMouseDown=function(e){t.props.shouldCloseOnOverlayClick||e.target!=t.overlay||e.preventDefault()},t.handleContentOnClick=function(){t.shouldClose=!1},t.handleContentOnMouseDown=function(){t.shouldClose=!1},t.requestClose=function(e){return t.ownerHandlesClose()&&t.props.onRequestClose(e)},t.ownerHandlesClose=function(){return t.props.onRequestClose},t.shouldBeClosed=function(){return!t.state.isOpen&&!t.state.beforeClose},t.contentHasFocus=function(){return document.activeElement===t.content||t.content.contains(document.activeElement)},t.buildClassName=function(e,n){var r="object"===(void 0===n?"undefined":i(n))?n:{base:v[e],afterOpen:v[e]+"--after-open",beforeClose:v[e]+"--before-close"},o=r.base;return t.state.afterOpen&&(o=o+" "+r.afterOpen),t.state.beforeClose&&(o=o+" "+r.beforeClose),"string"==typeof n&&n?o+" "+n:o},t.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,r){return n[e+"-"+r]=t[r],n}),{})},t.state={afterOpen:!1,beforeClose:!1},t.shouldClose=null,t.moveFromContentToOverlay=null,t}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(ModalPortal,e),o(ModalPortal,[{key:"componentDidMount",value:function componentDidMount(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function componentDidUpdate(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer)}},{key:"beforeOpen",value:function beforeOpen(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,i=e.bodyOpenClassName;i&&d.add(document.body,i),r&&d.add(document.getElementsByTagName("html")[0],r),n&&(y+=1,c.hide(t)),h.default.register(this)}},{key:"render",value:function render(){var e=this.props,t=e.id,n=e.className,i=e.overlayClassName,o=e.defaultStyles,a=e.children,s=n?{}:o.content,l=i?{}:o.overlay;if(this.shouldBeClosed())return null;var u={ref:this.setOverlayRef,className:this.buildClassName("overlay",i),style:r({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},c=r({id:t,ref:this.setContentRef,style:r({},s,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(c,a);return this.props.overlayElement(u,d)}}]),ModalPortal}(a.Component);m.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},m.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(p.default),s.default.instanceOf(f.SafeHTMLCollection),s.default.instanceOf(f.SafeNodeList),s.default.arrayOf(s.default.instanceOf(p.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=m,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlur=handleBlur,t.handleFocus=handleFocus,t.markForFocusLater=function markForFocusLater(){i.push(document.activeElement)},t.returnFocus=function returnFocus(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==i.length&&(t=i.pop()).focus({preventScroll:e}))}catch(e){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function popWithoutFocus(){i.length>0&&i.pop()},t.setupScopedFocus=function setupScopedFocus(e){o=e,window.addEventListener?(window.addEventListener("blur",handleBlur,!1),document.addEventListener("focus",handleFocus,!0)):(window.attachEvent("onBlur",handleBlur),document.attachEvent("onFocus",handleFocus))},t.teardownScopedFocus=function teardownScopedFocus(){o=null,window.addEventListener?(window.removeEventListener("blur",handleBlur),document.removeEventListener("focus",handleFocus)):(window.detachEvent("onBlur",handleBlur),document.detachEvent("onFocus",handleFocus))};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(128));var i=[],o=null,a=!1;function handleBlur(){a=!0}function handleFocus(){if(a){if(a=!1,!o)return;setTimeout((function(){o.contains(document.activeElement)||((0,r.default)(o)[0]||o).focus()}),0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function scopeTab(e,t){var n=(0,r.default)(e);if(!n.length)return void t.preventDefault();var i=void 0,o=t.shiftKey,a=n[0],s=n[n.length-1];if(e===document.activeElement){if(!o)return;i=s}s!==document.activeElement||o||(i=a);a===document.activeElement&&o&&(i=s);if(i)return t.preventDefault(),void i.focus();var l=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null==l||"Chrome"==l[1]||null!=/\biPod\b|\biPad\b/g.exec(navigator.userAgent))return;var u=n.indexOf(document.activeElement);u>-1&&(u+=o?-1:1);if(void 0===(i=n[u]))return t.preventDefault(),void(i=o?s:a).focus();t.preventDefault(),i.focus()};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(128));e.exports=t.default},function(e,t,n){"use strict";var warning=function(){};e.exports=warning},function(e,t,n){var r;!function(){"use strict";var i=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:i,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:i&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:i&&!!window.screen};void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dumpClassLists=function dumpClassLists(){0};var r={},i={};t.add=function add(e,t){return function trackClass(e,t,n){n.forEach((function(n){!function incrementReference(e,t){e[t]||(e[t]=0),e[t]+=1}(t,n),e.add(n)}))}(e.classList,"html"==e.nodeName.toLowerCase()?r:i,t.split(" "))},t.remove=function remove(e,t){return function untrackClass(e,t,n){n.forEach((function(n){!function decrementReference(e,t){e[t]&&(e[t]-=1)}(t,n),0===t[n]&&e.remove(n)}))}(e.classList,"html"==e.nodeName.toLowerCase()?r:i,t.split(" "))}},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(130));var i=void 0,o=void 0,a=[];function focusContent(){0!==a.length&&a[a.length-1].focusContent()}r.default.subscribe((function bodyTrap(e,t){i&&o||((i=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),i.style.position="absolute",i.style.opacity="0",i.setAttribute("tabindex","0"),i.addEventListener("focus",focusContent),(o=i.cloneNode()).addEventListener("focus",focusContent)),(a=t).length>0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==o&&document.body.appendChild(o)):(i.parentElement&&i.parentElement.removeChild(i),o.parentElement&&o.parentElement.removeChild(o))}))},function(e,t,n){"use strict";function componentWillMount(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function componentWillReceiveProps(e){this.setState(function updater(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function componentWillUpdate(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function polyfill(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,r=null,i=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?r="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(r="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?i="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(i="UNSAFE_componentWillUpdate"),null!==n||null!==r||null!==i){var o=e.displayName||e.name,a="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+o+" uses "+a+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==r?"\n "+r:"")+(null!==i?"\n "+i:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=componentWillMount,t.componentWillReceiveProps=componentWillReceiveProps),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=componentWillUpdate;var s=t.componentDidUpdate;t.componentDidUpdate=function componentDidUpdatePolyfill(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",(function(){return polyfill})),componentWillMount.__suppressDeprecationWarning=!0,componentWillReceiveProps.__suppressDeprecationWarning=!0,componentWillUpdate.__suppressDeprecationWarning=!0},function(e,t,n){e.exports={ril__outer:"style__ril__outer___1zYzZ",ril__outerClosing:"style__ril__outerClosing___3n_rB",ril__inner:"style__ril__inner___dYbbg",ril__image:"style__ril__image___ohhGk",ril__imagePrev:"style__ril__imagePrev___1TitV",ril__imageNext:"style__ril__imageNext___qIMp_",ril__imageDiscourager:"style__ril__imageDiscourager___1loUi",ril__navButtons:"style__ril__navButtons___rD-18",ril__navButtonPrev:"style__ril__navButtonPrev___3XfSU",ril__navButtonNext:"style__ril__navButtonNext___lV26z",ril__downloadBlocker:"style__ril__downloadBlocker___2Jwql",ril__caption:"style__ril__caption___20juT",ril__toolbar:"style__ril__toolbar___10lYy",ril__captionContent:"style__ril__captionContent___6dnIh",ril__toolbarSide:"style__ril__toolbarSide___1-5RY",ril__toolbarLeftSide:"style__ril__toolbarLeftSide___33kts",ril__toolbarRightSide:"style__ril__toolbarRightSide___3xRiA",ril__toolbarItem:"style__ril__toolbarItem___33nhp",ril__toolbarItemChild:"style__ril__toolbarItemChild___1uo52",ril__builtinButton:"style__ril__builtinButton___2ew22",ril__builtinButtonDisabled:"style__ril__builtinButtonDisabled___3xK7K",ril__closeButton:"style__ril__closeButton___2Ge8S",ril__zoomInButton:"style__ril__zoomInButton___2okkJ",ril__zoomOutButton:"style__ril__zoomOutButton___2U6Nk",ril__outerAnimating:"style__ril__outerAnimating___2Z5fK",closeWindow:"style__closeWindow___2YNOe",ril__loadingCircle:"style__ril__loadingCircle___23cHC",ril__loadingCirclePoint:"style__ril__loadingCirclePoint___3pCVl",pointFade:"style__pointFade___2ppwA",ril__loadingContainer:"style__ril__loadingContainer___38L0C",ril__errorContainer:"style__ril__errorContainer___3sKjX",ril__loadingContainer__icon:"style__ril__loadingContainer__icon___2nrVt"}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(9),c=n(27),d=l.createUseMediaUiStyles((function(e){return{assetSourceList:{border:"1px solid "+e.colors.border,padding:"0 "+e.spacing.full},item:{display:"flex",alignItems:"center","& a":{fontWeight:"normal",cursor:"pointer",userSelect:"none","&:hover":{color:e.colors.primary}}},itemSelected:{"&, .neos.neos-module &":{color:e.colors.primary}}}}));t.default=function AssetSourceList(){var e=d(),t=u.useAssetSourcesQuery().assetSources,n=l.useIntl().translate,r=u.useSelectAssetSource(),i=r[0],o=r[1];return!t||t.length<2?null:a.createElement("nav",{className:e.assetSourceList},a.createElement(s.Headline,{type:"h2"},a.createElement(c.IconLabel,{icon:"box",label:n("assetSourceList.header","Media sources")})),null==t?void 0:t.map((function(t){return a.createElement(c.IconLabel,{key:t.id,label:t.label,iconUri:t.iconUri,className:e.item},a.createElement("a",{className:(null==i?void 0:i.id)===t.id?e.itemSelected:null,onClick:function(){return o(t)}},"neos"===t.id?n("assetsource.local","Local"):t.label))})))}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7).createUseMediaUiStyles({assetLabel:{display:"inline-block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}});t.default=a.memo((function(e){var t=e.label,n=s();return a.createElement("span",{className:n.assetLabel},t)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7).createUseMediaUiStyles((function(e){return{column:{display:"grid",gridAutoRows:"minmax(0, min-content)",gridGap:e.spacing.full,overflowY:"auto",overflowX:"hidden",height:"100%"}}}));t.default=function Column(e){var t=e.children,n=s();return a.createElement("div",{className:n.column},t)}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7).createUseMediaUiStyles((function(e){return{iconWrap:{verticalAlign:"middle"},label:{fontWeight:"bold",lineHeight:e.spacing.goldenUnit,paddingLeft:e.spacing.half,userSelect:"none"},imgIcon:{width:"auto",height:"18px"}}}));t.default=a.memo((function(e){var t=e.icon,n=void 0===t?"question":t,r=e.iconUri,i=void 0===r?"":r,o=e.label,u=void 0===o?"":o,c=e.className,d=void 0===c?"":c,f=e.children,p=void 0===f?null:f,h=l();return a.createElement("div",{className:d},a.createElement("span",{className:h.iconWrap},i?a.createElement("img",{src:i,alt:u,className:h.imgIcon}):a.createElement(s.Icon,{icon:n})),a.createElement("span",{className:h.label},p||u||""))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(7).createUseMediaUiStyles((function(e){return{propertyList:{overflow:"hidden",width:"100%",maxWidth:"100%","& dt":{backgroundColor:e.colors.alternatingBackground,color:"white",fontWeight:"bold",padding:e.spacing.half+" "+e.spacing.half+" 0",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"calc("+e.size.sidebarWidth+" - "+e.spacing.full+")"},"& dd":{backgroundColor:e.colors.alternatingBackground,color:e.colors.inactive,margin:"0 0 1px",padding:e.spacing.half,textOverflow:"ellipsis",overflowX:"hidden",whiteSpace:"nowrap",width:"calc("+e.size.sidebarWidth+" - "+e.spacing.full+")"}}}}));t.default=a.memo((function(e){var t=e.children,n=s();return a.createElement("dl",{className:n.propertyList},t)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0));t.default=a.memo((function(e){var t=e.label,n=e.value;return a.createElement(a.Fragment,null,a.createElement("dt",null,t),a.createElement("dd",null,n))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(9),c=n(27),d=l.createUseMediaUiStyles((function(e){return{assetSourceDescription:{border:"1px solid "+e.colors.border,"& .ReactCollapse--collapse":{transition:"height "+e.transition.slow}},panelHeader:{"& button":{position:"absolute"}}}}));t.default=function AssetSourceDescription(){var e=d(),t=l.useIntl().translate,n=u.useSelectAssetSource()[0];return(null==n?void 0:n.description)?a.createElement(s.ToggablePanel,{closesToBottom:!0,className:e.assetSourceDescription},a.createElement(s.ToggablePanel.Header,{className:e.panelHeader},a.createElement(c.IconLabel,{icon:"info-circle",label:t("assetSourceDescription.header","Media source description")})),a.createElement(s.ToggablePanel.Contents,null,a.createElement("p",null,n.description))):null}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(133),l=n(132),u=n(27),c=n(7),d=n(76);t.default=a.memo((function(){var e=[!c.useMediaUi().selectionMode&&d.UploadButton,l.AssetSourceList,s.AssetCollectionTree,l.AssetSourceDescription].filter(Boolean);return a.createElement(u.Column,null,e.map((function(e,t){return a.createElement(e,{key:t})})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(14),f=n(7),p=n(9),h=a(n(301)),v=a(n(302)),y=n(27),m=a(n(303)),b=a(n(304)),g=f.createUseMediaUiStyles((function(e){return{assetCollectionTree:{border:"1px solid "+e.colors.border},headline:{padding:"0 "+e.spacing.full},iconWrap:{width:e.spacing.goldenUnit,display:"inline-flex",justifyContent:"center"},toolbar:{borderTop:"1px solid "+e.colors.border},tree:{borderTop:"1px solid "+e.colors.border}}}));t.default=s.memo((function(){var e=g(),t=f.useIntl().translate,n=f.useNotify(),r=p.useSelectAssetCollection(),i=p.useSelectTag(),o=u.useSetRecoilState(d.selectedAssetCollectionIdState),a=p.useSelectedAssetCollection(),_=p.useSelectedTag(),S=u.useSetRecoilState(d.selectedAssetIdState),O=u.useSetRecoilState(d.selectedTagIdState),E=p.useTagsQuery().tags,w=p.useAssetCollectionsQuery().assetCollections,T=p.useSelectAssetSource()[0],C=p.useDeleteTag().deleteTag,j=p.useDeleteAssetCollection().deleteAssetCollection,I=l.useCallback((function(){if(_){if(!window.confirm(t("action.deleteTag.confirm","Do you really want to delete the tag "+_.label,[_.label])))return;C(_.id).then((function(){n.ok(t("action.deleteTag.success","The tag has been deleted"))})).catch((function(e){var r=e.message;n.error(t("action.deleteTag.error","Error while trying to delete the tag"),r)})),O(null),o(null),S(null)}else if(a){if(!window.confirm(t("action.deleteAssetCollection.confirm","Do you really want to delete the asset collection "+a.title,[a.title])))return;j(a.id).then((function(){n.ok(t("assetCollectionActions.delete.success","Asset collection was successfully deleted"))})).catch((function(e){n.error(t("assetCollectionActions.delete.error","Failed to delete asset collection"),e.message)})),O(null),o(null),S(null)}}),[_,a,t,C,O,o,S,n,j]);return(null==T?void 0:T.supportsCollections)?s.createElement("nav",{className:e.assetCollectionTree},s.createElement(c.Headline,{type:"h2",className:e.headline},s.createElement(y.IconLabel,{icon:"folder",label:t("assetCollectionList.header","Collections")})),s.createElement("div",{className:e.toolbar},s.createElement(m.default,null),s.createElement(b.default,null),s.createElement(c.IconButton,{icon:"trash-alt",size:"regular",style:"transparent",hoverStyle:"brand",disabled:!a&&!_,title:t("assetCollectionTree.toolbar.delete","Delete"),onClick:I})),s.createElement(c.Tree,{className:e.tree},s.createElement(h.default,{isActive:!a&&!_,label:t("assetCollectionList.showAll","All"),title:t("assetCollectionList.showAll.title","Show assets for all collections"),level:1,onClick:r,assetCollection:null,collapsedByDefault:!1},null==E?void 0:E.map((function(e){return s.createElement(v.default,{key:e.id,tag:e,isActive:!a&&e.id==(null==_?void 0:_.id),level:2,onClick:i})}))),w.map((function(e,t){var n;return s.createElement(h.default,{key:t,assetCollection:e,onClick:r,level:1,isActive:e.title==(null==a?void 0:a.title)&&!_},null===(n=e.tags)||void 0===n?void 0:n.map((function(t){return s.createElement(v.default,{key:t.id,tag:t,assetCollection:e,isActive:e.id==(null==a?void 0:a.id)&&t.id==(null==_?void 0:_.id),level:2,onClick:i})})))})))):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(8),c=a(n(134));t.default=s.memo((function(e){var t=e.isActive,n=e.assetCollection,r=e.label,i=e.title,o=e.children,a=e.level,d=e.onClick,f=e.collapsedByDefault,p=void 0===f||f,h=l.useState(p),v=h[0],y=h[1],m=l.useCallback((function(){return y(!v)}),[v]),b=l.useCallback((function(){return d(n)}),[d,n]);return s.createElement(u.Tree.Node,null,s.createElement(u.Tree.Node.Header,{isActive:t,isCollapsed:0===o.length||v,isFocused:t,isLoading:!1,hasError:!1,label:r||n.title,title:i||n.title,icon:"folder",nodeDndType:c.default.COLLECTION,level:a,onToggle:m,onClick:b,hasChildren:o.length>0}),!v&&o)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(8),c=a(n(134));t.default=s.memo((function(e){var t=e.tag,n=e.isActive,r=e.assetCollection,i=e.label,o=e.title,a=e.onClick,d=e.level,f=l.useCallback((function(){return a(t,r)}),[a,t,r]);return s.createElement(u.Tree.Node,null,s.createElement(u.Tree.Node.Header,{isActive:n,isCollapsed:!0,isFocused:n,isLoading:!1,hasError:!1,label:i||t.label,title:o||t.label,icon:"tag",nodeDndType:c.default.TAG,level:d,onClick:f,hasChildren:!1}))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(8),c=n(7),d=n(28),f=c.createUseMediaUiStyles({plusIcon:{top:"15px !important",left:"13px !important",width:"9px !important"}});t.default=a.memo((function(){var e=f(),t=c.useIntl().translate,n=l.useSetRecoilState(d.createAssetCollectionDialogState),r=s.useCallback((function(){n({title:"",visible:!0})}),[n]);return a.createElement(u.Button,{size:"regular",style:"transparent",hoverStyle:"brand",title:t("assetCollectionTree.toolbar.createAssetCollection","Create new asset collection"),onClick:r},a.createElement("span",{className:"fa-layers fa-fw"},a.createElement(u.Icon,{icon:"folder"}),a.createElement(u.Icon,{icon:"plus",color:"primaryBlue",className:e.plusIcon})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(8),c=n(7),d=n(28),f=c.createUseMediaUiStyles({plusIcon:{top:"13px !important",left:"11px !important",width:"9px !important"}});t.default=a.memo((function(){var e=f(),t=c.useIntl().translate,n=l.useSetRecoilState(d.createTagDialogState),r=s.useCallback((function(){n({label:"",visible:!0})}),[n]);return a.createElement(u.Button,{size:"regular",style:"transparent",hoverStyle:"brand",title:t("assetCollectionTree.toolbar.createTag","Create new tag"),onClick:r},a.createElement("span",{className:"fa-layers fa-fw"},a.createElement(u.Icon,{icon:"tag"}),a.createElement(u.Icon,{icon:"plus",color:"primaryBlue",className:e.plusIcon})))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentSelection=t.SideBarRight=void 0;var i=r(n(306));t.SideBarRight=i.default;var o=r(n(136));t.CurrentSelection=o.default},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(49),u=a(n(136)),c=n(27);t.default=s.memo((function(){var e=[u.default,l.AssetInspector,l.AssetCollectionInspector,l.TagInspector,l.IptcMetadataInspector];return s.createElement(c.Column,null,e.map((function(e,t){return s.createElement(e,{key:t})})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(8),u=n(7),c=n(9),d=n(14),f=a(n(308)),p=a(n(135)),h=n(6),v=u.createUseMediaUiStyles((function(){return{tabContent:{height:"calc(100% - 42px)"}}}));t.default=s.memo((function(){var e=v(),t=c.useSelectedAsset(),n=u.useMediaUi().featureFlags,r=h.useRecoilValue(d.selectedInspectorViewState);return t&&"asset"===r?n.showVariantsEditor?s.createElement(l.Tabs,{theme:{tabs__content:e.tabContent}},s.createElement(l.Tabs.Panel,{icon:"pencil",key:"editor",id:"editor"},s.createElement(p.default,null)),s.createElement(l.Tabs.Panel,{icon:"images"},s.createElement(f.default,null))):s.createElement(p.default,null):null}))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?null===(t=d.variants)||void 0===t?void 0:t.map((function(e){return o.default.createElement("li",{className:f.variantItem,key:"variant-"+e.id},o.default.createElement(u.default,r({},e)))})):o.default.createElement("li",null,n("assetVariants.noVariantsFound","No variants found")))))}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(n(310));t.default=function useAssetVariants(e){var t=i.useQuery(o.default,{variables:{id:null==e?void 0:e.assetId,assetSourceId:null==e?void 0:e.assetSourceId},skip:!e}),n=t.data,r=t.loading,a=t.refetch;return{variants:(null==n?void 0:n.assetVariants)||null,loading:r,refetch:a}}},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o,a=n(4),s=i(n(311)),l=a.gql(o||(o=r(["\n query ASSET_VARIANTS($id: AssetId!, $assetSourceId: AssetSourceId!) {\n assetVariants(id: $id, assetSourceId: $assetSourceId) {\n id\n width\n height\n presetIdentifier\n variantName\n hasCrop\n previewUrl\n cropInformation {\n ...CropInformationProps\n }\n }\n }\n ","\n"],["\n query ASSET_VARIANTS($id: AssetId!, $assetSourceId: AssetSourceId!) {\n assetVariants(id: $id, assetSourceId: $assetSourceId) {\n id\n width\n height\n presetIdentifier\n variantName\n hasCrop\n previewUrl\n cropInformation {\n ...CropInformationProps\n }\n }\n }\n ","\n"])),s.default);t.default=l},function(e,t,n){"use strict";var r=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4).gql(i||(i=r(["\n fragment CropInformationProps on CropInformation {\n width\n height\n x\n y\n }\n"],["\n fragment CropInformationProps on CropInformation {\n width\n height\n x\n y\n }\n"])));t.default=o},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(0)),o=n(7).createUseMediaUiStyles((function(e){return{variantContainer:{backgroundColor:e.colors.assetBackground},picture:{height:200,display:"flex",alignItems:"center",justifyContent:"center"},image:{maxHeight:"100%",objectFit:"contain",display:"block",backgroundImage:"repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)",backgroundPosition:"0 0, 10px 10px",backgroundSize:"20px 20px"},caption:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e.spacing.half,backgroundColor:e.colors.captionBackground},infoContainer:{display:"flex",flexDirection:"column",minWidth:0,maxWidth:e.size.sidebarWidth},info:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},variantSizes:{fontSize:e.fontSize.small}}}));t.default=function(e){var t=e.presetIdentifier,n=e.variantName,r=e.width,a=e.height,s=e.previewUrl,l=o();return i.default.createElement("div",{className:l.variantContainer},i.default.createElement("picture",{className:l.picture},i.default.createElement("img",{className:l.image,src:s,alt:n})),i.default.createElement("figcaption",{className:l.caption},i.default.createElement("div",{className:l.infoContainer},t?i.default.createElement("span",{className:l.info},"Preset: ",t):null,n?i.default.createElement("span",{className:l.info},"Variant: ",n):null,i.default.createElement("span",{className:l.variantSizes},"W: ",r," H: ",a))))}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(8),c=n(7),d=n(9),f=n(14),p=n(49),h=n(6),v=a(n(82)),y=a(n(81)),m=a(n(83));t.default=s.memo((function(){var e=d.useSelectedAssetCollection(),t=h.useRecoilValue(f.selectedInspectorViewState),n=c.useNotify(),r=c.useIntl().translate,i=l.useState(null),o=i[0],a=i[1],b=d.useUpdateAssetCollection().updateAssetCollection,g=e&&o!==e.title,_=l.useCallback((function(){e&&a(e.title)}),[e,a]),S=l.useCallback((function(){o!==e.title&&b({assetCollection:e,title:o}).then((function(){n.ok(r("actions.updateAssetCollection.success","The asset collection has been updated"))})).catch((function(e){var t=e.message;n.error(r("actions.deleteAssetCollection.error","Error while updating the asset collection"),t)}))}),[n,r,e,b,o]);return l.useEffect((function(){_()}),[null==e?void 0:e.id]),e&&"assetCollection"===t?s.createElement(m.default,null,s.createElement(y.default,{label:r("inspector.title","Title")},s.createElement(u.TextInput,{type:"text",value:o||"",onChange:a,onEnterKey:S})),s.createElement(v.default,{handleApply:S,handleDiscard:_,hasUnpublishedChanges:g}),s.createElement(p.TagSelectBoxAssetCollection,null)):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(9),c=n(27),d=l.createUseMediaUiStyles((function(e){return{iptcData:{"& dl":{"& dt":{backgroundColor:e.colors.alternatingBackground,fontWeight:"bold",color:"white",padding:"8px 8px 0"},"& dd":{backgroundColor:e.colors.alternatingBackground,marginBottom:"1px",padding:"8px",color:e.colors.inactive}}}}}));t.default=a.memo((function(){var e,t=d(),n=u.useSelectedAsset(),r=l.useIntl().translate;return(null===(e=null==n?void 0:n.iptcProperties)||void 0===e?void 0:e.length)?a.createElement("div",{className:t.iptcData},a.createElement(s.Headline,{type:"h2"},a.createElement(c.IconLabel,{icon:"camera",label:r("inspector.iptcMetadata","IPTC Metadata")})),a.createElement(c.PropertyList,null,n.iptcProperties.map((function(e){return a.createElement(c.PropertyListItem,{key:e.propertyName,label:e.propertyName,value:e.value})})))):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(9),c=n(57),d=n(27);t.default=a.memo((function(){var e=l.useIntl().translate,t=u.useSelectedAsset();return t?a.createElement("div",null,a.createElement(s.Headline,{type:"h2"},a.createElement(d.IconLabel,{icon:"info-circle",label:e("inspector.metadata","Metadata")})),a.createElement(d.PropertyList,null,t.file.size>0&&a.createElement(d.PropertyListItem,{label:e("inspector.property.fileSize","Size"),value:c.humanFileSize(t.file.size)}),a.createElement(d.PropertyListItem,{label:e("inspector.property.lastModified","Last modified"),value:new Date(t.lastModified).toLocaleString()}),a.createElement(d.PropertyListItem,{label:e("inspector.property.dimensions","Dimensions"),value:t.width+"px x "+t.height+"px"}),a.createElement(d.PropertyListItem,{label:e("inspector.property.mediaType","MIME type"),value:t.file.mediaType}),a.createElement(d.PropertyListItem,{label:e("inspector.property.filename","Filename"),value:t.filename}))):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(14),p=n(9),h=a(n(82)),v=a(n(81)),y=a(n(83));t.default=s.memo((function(){var e=p.useSelectedTag(),t=u.useRecoilValue(f.selectedInspectorViewState),n=d.useNotify(),r=d.useIntl().translate,i=l.useState(null),o=i[0],a=i[1],m=p.useUpdateTag().updateTag,b=e&&o!==e.label,g=l.useCallback((function(){e&&a(e.label)}),[e,a]),_=l.useCallback((function(){o!==e.label&&m({tag:e,label:o}).then((function(){n.ok(r("actions.updateTag.success","The tag has been updated"))})).catch((function(e){var t=e.message;n.error(r("actions.updateTag.error","Error while updating the tag"),t)}))}),[n,r,e,m,o]);return l.useEffect((function(){g()}),[null==e?void 0:e.id]),e&&"tag"===t?s.createElement(y.default,null,s.createElement(v.default,{label:r("inspector.label","Label")},s.createElement(c.TextInput,{type:"text",value:o||"",onChange:a,onEnterKey:_})),s.createElement(h.default,{handleApply:_,handleDiscard:g,hasUnpublishedChanges:b})):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7),u=n(27),c=l.createUseMediaUiStyles({tagSelectBox:{},tagSelection:{}});t.default=a.memo((function(e){var t=e.values,n=e.options,r=e.onChange,i=e.disabled,o=void 0!==i&&i,d=c(),f=l.useIntl().translate;return a.createElement("div",{className:d.tagSelectBox},a.createElement(s.Headline,{type:"h2"},a.createElement(u.IconLabel,{icon:"tags",label:f("inspector.tags","Tags")})),a.createElement(s.MultiSelectBox,{className:d.tagSelection,disabled:o,placeholder:f("inspector.tags.placeholder","Select a tag"),noMatchesFoundLabel:f("general.noMatchesFound","No matches found"),values:t,optionValueField:"id",options:n,searchOptions:n,onValuesChange:function(e){return r(e.map((function(e){return n.find((function(t){return t.id===e}))})))}}))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(7),u=n(9),c=n(49);t.default=a.memo((function(){var e=l.useNotify(),t=l.useIntl().translate,n=u.useTagsQuery().tags,r=u.useSetAssetTags(),i=r.setAssetTags,o=r.loading,d=u.useSelectedAsset(),f=s.useMemo((function(){return null==d?void 0:d.tags.map((function(e){return e.id})).sort()}),[null==d?void 0:d.tags]),p=s.useCallback((function(n){var r;r=d,n.map((function(e){return e.id})).sort().join(",")!==r.tags.map((function(e){return e.id})).sort().join(",")&&i({asset:d,tags:n}).then((function(){e.ok(t("actions.setAssetTags.success","The asset has been tagged"))})).catch((function(n){var r=n.message;e.error(t("actions.setAssetTags.error","Error while tagging the asset"),r)}))}),[e,d,i,t]);return d?a.createElement(c.TagSelectBox,{values:f,options:n,onChange:p,disabled:o||d.assetSource.readOnly}):null}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(7),u=n(9),c=n(49);t.default=a.memo((function(){var e=l.useNotify(),t=l.useIntl().translate,n=u.useTagsQuery().tags,r=u.useUpdateAssetCollection().updateAssetCollection,i=u.useSelectedAssetCollection(),o=s.useMemo((function(){return null==i?void 0:i.tags.map((function(e){return e.id})).sort()}),[null==i?void 0:i.tags]),d=s.useCallback((function(n){var o;o=i,n.map((function(e){return e.id})).sort().join(",")!==o.tags.map((function(e){return e.id})).sort().join(",")&&r({assetCollection:i,tags:n}).then((function(){e.ok(t("actions.tagAssetCollection.success","The asset collection has been tagged"))})).catch((function(n){var r=n.message;e.error(t("actions.tagAssetCollection.error","Error while tagging the asset collection"),r)}))}),[e,i,r,t]);return i?a.createElement(c.TagSelectBox,{values:o,options:n,onChange:d}):null}))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1&&"+"!==e.substr(-1)){var t=e.split("+",2);this.subtype=t[0],this.subtypeFacets=t[0].split("."),this.suffix=t[1]}else this.subtypeFacets=e.split(".")},MediaType.prototype.hasSuffix=function(){return!!this.suffix},MediaType.prototype._firstSubtypeFacetEquals=function(e){return this.subtypeFacets.length>0&&this.subtypeFacets[0]===e},MediaType.prototype.isVendor=function(){return this._firstSubtypeFacetEquals("vnd")},MediaType.prototype.isPersonal=function(){return this._firstSubtypeFacetEquals("prs")},MediaType.prototype.isExperimental=function(){return this._firstSubtypeFacetEquals("x")||"x-"===this.subtype.substring(0,2).toLowerCase()},MediaType.prototype.asString=function(){var e="";if(this.isValid()){e=e+this.type+"/"+this.subtype,this.hasSuffix()&&(e=e+"+"+this.suffix);var t=Object.keys(this.parameters);if(t.length>0){var n=[],r=this;t.sort((function(e,t){return e.localeCompare(t)})).forEach((function(e){n.push(e+"="+wrapQuotes(r.parameters[e]))})),e=e+";"+n.join(";")}}return e};var wrapQuotes=function(e){return e.indexOf(";")>-1?'"'+e+'"':e},n=/^(application|audio|font|image|message|model|multipart|text|video|\*)\/([a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]{1,127})(;.*)?$/,r=/;(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/;t.fromString=function(e){var t=new MediaType;if(e){var i=e.match(n);!i||"*"===i[1]&&"*"!==i[2]||(t.type=i[1],t._setSubtypeAndSuffix(i[2]),i[3]&&i[3].substr(1).split(r).forEach((function(e){var n=e.split("=",2);2===n.length&&(t.parameters[n[0].toLowerCase().trim()]=function(e){return'"'===e.substr(0,1)&&'"'===e.substr(-1)?e.substr(1,e.length-2):e}(n[1].trim()))})))}return t}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(6),l=n(7),u=n(14),c=l.createUseMediaUiStyles((function(e){return{"@keyframes cssloadWidth":{"0%, 100%":{transitionTimingFunction:"cubic-bezier(1, 0, .65, .85)"},"0%":{width:0},"100%":{width:"100%"}},container:{left:0,top:0,height:"2px",position:"fixed",width:"100vw",zIndex:e.loadingIndicatorZIndex},indicator:{height:"2px",position:"relative",width:"100%"},bar:{height:"100%",position:"relative",backgroundColor:e.colors.warn,animation:"$cssloadWidth 2s cubic-bezier(.45, 0, 1, 1) infinite"}}}));t.default=function LoadingIndicator(){var e=c(),t=s.useRecoilValue(u.loadingState);return a.createElement(a.Fragment,null,t&&a.createElement("div",{className:e.container},a.createElement("div",{className:e.indicator},a.createElement("div",{className:e.bar}))))}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BottomBar=t.Pagination=t.AssetCount=void 0;var i=r(n(324));t.BottomBar=i.default;var o=r(n(138));t.Pagination=o.default;var a=r(n(137));t.AssetCount=a.default},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(7),c=n(32),d=a(n(137)),f=a(n(138)),p=u.createUseMediaUiStyles((function(e){return{bottomBar:function(t){var n=t.isInNodeCreationDialog,r=t.selectionMode;return{display:"grid",gridTemplateColumns:n||r?"repeat(3, 1fr)":"350px 1fr 350px",gridGap:e.spacing.goldenUnit,position:"fixed",bottom:n?-16:0,left:n?-16:0,right:n?-16:0,borderTop:"1px solid "+e.colors.border,backgroundColor:e.colors.moduleBackground,zIndex:e.paginationZIndex}}}}));t.default=s.memo((function(){var e=u.useMediaUi(),t=e.isInNodeCreationDialog,n=e.selectionMode,r=p({isInNodeCreationDialog:t,selectionMode:n}),i=l.useMemo((function(){return[d.default,f.default,c.ClipboardToggle]}),[]);return s.createElement("div",{className:r.bottomBar},i.map((function(e,t){return s.createElement(e,{key:t})})))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(8),l=n(7).createUseMediaUiStyles({item:{userSelect:"none","& button":{display:"flex",justifyContent:"center",alignItems:"center"}}});t.default=a.memo((function(e){var t=e.title,n=e.label,r=e.onClick,i=e.page,o=void 0===i?null:i,u=e.selected,c=void 0!==u&&u,d=e.disabled,f=void 0!==d&&d,p=e.icon,h=l();return a.createElement("li",{className:[h.item,c?h.selected:""].join(" ")},p?a.createElement(s.IconButton,{icon:p,disabled:f,size:"regular",style:"transparent",hoverStyle:"brand",title:t,onClick:function(){return r(o)}}):a.createElement(s.Button,{icon:p,disabled:f,size:"regular",style:c?"brand":"transparent",hoverStyle:"brand",title:t,onClick:function(){return r(o)}},n||o))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(8),c=n(7),d=n(14),f=n(28),p=c.createUseMediaUiStyles({searchBox:{flex:1,'& input[type="search"]':{"-webkit-appearance":"auto",width:"100%","&::-webkit-search-cancel-button":{"-webkit-appearance":"searchfield-cancel-button",cursor:"pointer"}}}});t.default=a.memo((function(){var e=p(),t=l.useRecoilState(d.searchTermState),n=t[0],r=t[1],i=l.useSetRecoilState(d.currentPageState),o=s.useState(n),h=o[0],v=o[1],y=c.useIntl().translate,m=l.useRecoilValue(f.mainViewState),b=s.useCallback((function(){r(h),i(1)}),[h,i,r]);return m!==f.MainViewState.DEFAULT?null:a.createElement("div",{className:e.searchBox},a.createElement(u.TextInput,{value:h,type:"search",onChange:function(e){return v(e)},onEnterKey:b,placeholder:y("searchBox.placeholder","Search")}))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(7),c=n(32),d=n(139),f=a(n(328)),p=u.createUseMediaUiStyles((function(e){return{topBar:{display:"flex",flexWrap:"nowrap",justifyContent:"flex-end",margin:"0 -"+e.spacing.half,paddingRight:function(t){return t.selectionMode?e.spacing.goldenUnit:null},"& > *":{margin:"0 "+e.spacing.half}}}}));t.default=s.memo((function(){var e=u.useMediaUi().selectionMode,t=p({selectionMode:e}),n=l.useMemo((function(){return[c.ClipboardActions,d.SearchBox,d.TypeFilter,f.default,d.ViewModeSelector]}),[]);return s.createElement("div",{className:t.topBar},n.map((function(e,t){return s.createElement(e,{key:t})})))}))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n *":{verticalAlign:"middle"}},previewColumn:{minWidth:e.spacing.goldenUnit,width:e.spacing.goldenUnit,cursor:"pointer","& picture":{display:"block",width:"100%",height:e.spacing.goldenUnit,textAlign:"center","& img, & svg":{display:"inline-block",width:"100%",height:"100%",objectFit:"contain"}}},labelColumn:{extend:"textColumn",display:"table",tableLayout:"fixed",width:"100%",lineHeight:e.spacing.goldenUnit,userSelect:"text","& > *":{width:"100%"}},lastModifiedColumn:{extend:"textColumn"},fileSizeColumn:{extend:"textColumn"},mediaTypeColumn:{extend:"textColumn",maxWidth:"100px",overflow:"hidden",textOverflow:"ellipsis"},actionsColumn:{extend:"textColumn",textAlign:"right"}}})),g={weekday:"short",year:"numeric",month:"short",day:"numeric"};t.default=s.memo((function(e){var t=e.assetIdentity,n=e.onSelect,r=b(),i=d.useMediaUi(),o=i.dummyImage,a=i.isAssetSelectable,_=f.useAssetQuery(t),S=_.asset,O=_.loading,E=u.useRecoilState(p.selectedAssetIdState)[0],w=(null==E?void 0:E.assetId)===t.assetId,T=l.useMemo((function(){return a(S)}),[S,a]),C=l.useCallback((function(){return n(t,w)}),[n,t,w]);return s.createElement("tr",{className:[r.listViewItem,w?r.selected:""].join(" ")},s.createElement("td",{className:r.previewColumn,onClick:C},s.createElement("picture",null,T?s.createElement("img",{src:(null==S?void 0:S.thumbnailUrl)||o,alt:null==S?void 0:S.label,width:40,height:36}):s.createElement(c.Icon,{icon:"ban",color:"error"}))),s.createElement("td",{className:r.labelColumn,onClick:C},S&&s.createElement(y.AssetLabel,{label:S.label})),s.createElement("td",{className:r.lastModifiedColumn,onClick:C},S&&new Date(S.lastModified).toLocaleString([],g)),s.createElement("td",{className:r.fileSizeColumn,onClick:C},S&&h.humanFileSize(S.file.size)),s.createElement("td",{className:r.mediaTypeColumn,onClick:C,title:null==S?void 0:S.file.mediaType},null==S?void 0:S.file.mediaType),s.createElement("td",{className:r.actionsColumn},!O&&(S?s.createElement(v.AssetActions,{asset:S}):s.createElement(m.default,{assetIdentity:t}))))}),(function(e,t){return e.assetIdentity.assetId===t.assetIdentity.assetId}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(32),p=n(39),h=n(46),v=n(40),y=a(n(335)),m=n(28),b=d.createUseMediaUiStyles({emptyStateWrapper:{display:"flex",alignItems:"center",justifyContent:"center",height:"inherit"}});t.default=s.memo((function(){var e=b(),t=h.useViewModeSelection()[0],n=d.useMediaUi().assets,r=p.useUnusedAssetsQuery().assets,i=f.useClipboard().clipboard,o=u.useRecoilValue(m.mainViewState),a=u.useSetRecoilState(f.clipboardVisibleState),g=d.useIntl().translate,_=l.useState([]),S=_[0],O=_[1],E=l.useMemo((function(){return n.filter((function(e){return null==e?void 0:e.id})).map((function(e){return{assetId:e.id,assetSourceId:e.assetSource.id}}))}),[n]),w=l.useMemo((function(){return r.filter((function(e){return null==e?void 0:e.id})).map((function(e){return{assetId:e.id,assetSourceId:e.assetSource.id}}))}),[r]);return l.useEffect((function(){o===m.MainViewState.CLIPBOARD?O(Object.values(i)):o===m.MainViewState.UNUSED_ASSETS?O(w):O(E)}),[o,E,w,i,O]),S.length>0?t===h.VIEW_MODES.List?s.createElement(v.ListView,{assetIdentities:S}):s.createElement(v.ThumbnailView,{assetIdentities:S}):s.createElement("div",{className:e.emptyStateWrapper},o===m.MainViewState.CLIPBOARD?s.createElement(c.Button,{size:"regular",style:"brand",hoverStyle:"brand",onClick:function(){return a(!1)}},g("clipboard.close","Close clipboard")):s.createElement(y.default,{loadingText:g("assetList.loading","Loading assets"),emptyText:g("assetList.empty","No assets found")}))}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(6),l=n(7),u=n(14),c=l.createUseMediaUiStyles({loadingLabel:{}});t.default=a.memo((function(e){var t=e.loadingText,n=e.emptyText,r=c(),i=s.useRecoilValue(u.loadingState);return a.createElement("div",{className:r.loadingLabel},i?t:n)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(0)),l=n(0),u=n(6),c=n(8),d=n(7),f=n(9),p=n(14),h=n(40),v=n(27),y=a(n(140)),m=d.createUseMediaUiStyles((function(e){return{thumbnail:{margin:"0",display:"flex",flexDirection:"column",position:"relative","&:hover $caption":{backgroundColor:e.colors.primary},"&:hover $toolBar":{pointerEvents:"all",backgroundColor:"rgba(0.15, 0.15, 0.15, 0.25)","& button":{opacity:1,"&[disabled]":{opacity:.5},"&.button--active":{"& svg":{color:"white"}}}}},picture:{cursor:"pointer",height:"250px",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"center",backgroundColor:e.colors.assetBackground,"& img":{display:"block",backgroundImage:"repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)",backgroundPosition:"0 0, 10px 10px",backgroundSize:"20px 20px",maxHeight:"250px",maxWidth:"100%"}},caption:{backgroundColor:e.colors.captionBackground,transition:"background-color "+e.transition.fast,padding:e.spacing.half,display:"flex",alignItems:"center",flex:1,"& img, & svg":{width:"1.3rem",height:"auto",marginRight:e.spacing.half}},selected:{backgroundColor:e.colors.primary},toolBar:{display:"flex",position:"absolute",top:e.spacing.quarter,right:e.spacing.quarter,pointerEvents:"none",backgroundColor:"transparent",transition:"background-color .1s ease-in","& button, & button[disabled]":{transition:"opacity .1s ease-in",opacity:0,"&.button--active":{opacity:1,"& svg":{color:e.colors.primary}}}},label:{position:"absolute",top:e.spacing.quarter,left:e.spacing.quarter,fontSize:e.fontSize.small,borderRadius:"3px",padding:"2px 4px",userSelect:"none"},disabled:{"& $picture":{filter:"grayscale(1)",cursor:"not-allowed"}}}}));t.default=s.memo((function(e){var t=e.assetIdentity,n=e.onSelect,r=m(),i=d.useIntl().translate,o=d.useMediaUi(),a=o.dummyImage,b=o.isAssetSelectable,g=f.useAssetQuery(t),_=g.asset,S=g.loading,O=u.useRecoilValue(p.selectedAssetIdState),E=(null==O?void 0:O.assetId)===t.assetId,w=l.useMemo((function(){return b(_)}),[_,b]);return s.createElement("figure",{className:[r.thumbnail,!w&&r.disabled].join(" "),title:null==_?void 0:_.label},(null==_?void 0:_.imported)&&s.createElement("span",{className:r.label},i("asset.label.imported","Imported")),s.createElement("picture",{onClick:function(){return n(t,E)},className:r.picture},s.createElement("img",{src:S||!_?a:_.thumbnailUrl,alt:null==_?void 0:_.label})),s.createElement("figcaption",{className:[r.caption,E?r.selected:""].join(" ")},_&&s.createElement(s.Fragment,null,w&&_.file?s.createElement("img",{src:_.file.typeIcon.url,alt:_.file.typeIcon.alt}):s.createElement(c.Icon,{icon:"ban",color:"error"}),s.createElement(v.AssetLabel,{label:_.label}))),s.createElement("div",{className:r.toolBar},!S&&(_?s.createElement(h.AssetActions,{asset:_}):s.createElement(y.default,{assetIdentity:t}))))}),(function(e,t){return e.assetIdentity.assetId===t.assetIdentity.assetId}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(0),l=n(6),u=n(7),c=n(9),d=n(58),f=n(40),p=u.createUseMediaUiStyles((function(e){return{thumbnailView:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridGap:e.spacing.full}}}));t.default=a.memo((function(e){var t=e.assetIdentities,n=p(),r=l.useSetRecoilState(d.selectedAssetForPreviewState),i=c.useSelectAsset(),o=s.useCallback((function(e,t){void 0===t&&(t=!1),t?r(e):i(e)}),[r,i]);return a.createElement("section",{className:n.thumbnailView},t.map((function(e,t){return a.createElement(f.Thumbnail,{key:t,assetIdentity:e,onSelect:o})})))}))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),s=n(66),l=function(e){function ErrorBoundary(t){var n=e.call(this,t)||this;return n.state={hasError:!1},n}return i(ErrorBoundary,e),ErrorBoundary.getDerivedStateFromError=function(){return{hasError:!0}},ErrorBoundary.prototype.componentDidCatch=function(e){this.context.error(e.name,e.message)},ErrorBoundary.prototype.render=function(){return this.state.hasError?a.default.createElement(a.default.Fragment,null,a.default.createElement("p",{style:{color:"red"}},"Something went wrong."),a.default.createElement("br",null),a.default.createElement("button",{className:"neos-button",onClick:function(){return window.location.reload()}},"Reload")):this.props.children},ErrorBoundary.contextType=s.NotifyContext,ErrorBoundary}(a.default.Component);t.default=l},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CreateAssetCollectionDialog=t.CreateTagDialog=void 0;var i=r(n(340));t.CreateTagDialog=i.default;var o=r(n(341));t.CreateAssetCollectionDialog=o.default},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1)return registerClass(e,t.split(" "));var r=e.options.parent;if("$"===t[0]){var i=r.getRule(t.substr(1));return!!i&&(i!==e&&(r.classes[e.key]+=" "+r.classes[i.key],!0))}return r.classes[e.key]+=" "+t,!0}(t,e.composes),delete e.composes,e):e}}},q=/[A-Z]/g,Q=/^ms-/,$={};function toHyphenLower(e){return"-"+e.toLowerCase()}var W=function hyphenateStyleName(e){if($.hasOwnProperty(e))return $[e];var t=e.replace(q,toHyphenLower);return $[e]=Q.test(t)?"-"+t:t};function convertCase(e){var t={};for(var n in e){t[0===n.indexOf("--")?n:W(n)]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(convertCase):t.fallbacks=convertCase(e.fallbacks)),t}var G=function camelCase(){return{onProcessStyle:function onProcessStyle(e){if(Array.isArray(e)){for(var t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var i=Ne[e];if(!Array.isArray(i))return pe+pascalize(i)in t&&he+i;if(!r)return!1;for(var o=0;ot?1:-1:e.length-t.length};return{onProcessStyle:function onProcessStyle(t,n){if("style"!==n.type)return t;for(var r={},i=Object.keys(t).sort(e),o=0;o1e4)&&(t=e.createStyleSheet().attach()),t};function css(){var e=arguments,t=JSON.stringify(e),o=n.get(t);if(o)return o.className;var a=[];for(var s in e){var l=e[s];if(Array.isArray(l))for(var u=0;u1&&(a.scd=function(e){for(var t={},r=0;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;var s=new Map([["avi","video/avi"],["gif","image/gif"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["mkv","video/x-matroska"],["mov","video/quicktime"],["mp4","video/mp4"],["pdf","application/pdf"],["png","image/png"],["zip","application/zip"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]]);function toFileWithPath(e,t){var n=function withMimeType(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=s.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!=typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"==typeof t?t:"string"==typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var l=[".DS_Store","Thumbs.db"];function getInputFiles(e){return(function isInput(e){return null!==e}(e.target)&&e.target.files?fromList(e.target.files):[]).map((function(e){return toFileWithPath(e)}))}function getDataTransferFiles(e,t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:return e.items?(n=fromList(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(toFilePromises))]):[3,2];case 1:return[2,noIgnoredFiles(flatten(r.sent()))];case 2:return[2,noIgnoredFiles(fromList(e.files).map((function(e){return toFileWithPath(e)})))]}}))}))}function noIgnoredFiles(e){return e.filter((function(e){return-1===l.indexOf(e.name)}))}function fromList(e){for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,f(n)];if(e.sizen)return[!1,f(n)]}return[!0,null]}function isDefined(e){return null!=e}function allFilesAccepted(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles;return!(!o&&t.length>1||o&&a>=1&&t.length>a)&&t.every((function(e){var t=_slicedToArray(fileAccepted(e,n),1)[0],o=_slicedToArray(fileMatchSize(e,r,i),1)[0];return t&&o}))}function isPropagationStopped(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function isEvtWithFiles(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function onDocumentDragOver(e){e.preventDefault()}function isIe(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function isEdge(e){return-1!==e.indexOf("Edge/")}function isIeOrEdge(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return isIe(e)||isEdge(e)}function composeEventHandlers(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),i=1;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var v=Object(r.forwardRef)((function(e,t){var n=e.children,o=useDropzone(_objectWithoutProperties(e,["children"])),a=o.open,s=_objectWithoutProperties(o,["open"]);return Object(r.useImperativeHandle)(t,(function(){return{open:a}}),[a]),i.a.createElement(r.Fragment,null,n(_objectSpread(_objectSpread({},s),{},{open:a})))}));v.displayName="Dropzone";var y={disabled:!1,getFilesFromEvent:function fromEvent(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,(n=e,n.dataTransfer&&e.dataTransfer?getDataTransferFiles(e.dataTransfer,e.type):getInputFiles(e))];var n}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null};v.defaultProps=y,v.propTypes={children:a.a.func,accept:a.a.oneOfType([a.a.string,a.a.arrayOf(a.a.string)]),multiple:a.a.bool,preventDropOnDocument:a.a.bool,noClick:a.a.bool,noKeyboard:a.a.bool,noDrag:a.a.bool,noDragEventsBubbling:a.a.bool,minSize:a.a.number,maxSize:a.a.number,maxFiles:a.a.number,disabled:a.a.bool,getFilesFromEvent:a.a.func,onFileDialogCancel:a.a.func,onDragEnter:a.a.func,onDragLeave:a.a.func,onDragOver:a.a.func,onDrop:a.a.func,onDropAccepted:a.a.func,onDropRejected:a.a.func,validator:a.a.func};t.default=v;var m={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function useDropzone(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_objectSpread(_objectSpread({},y),e),n=t.accept,i=t.disabled,o=t.getFilesFromEvent,a=t.maxSize,s=t.minSize,l=t.multiple,u=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,f=t.onDragOver,p=t.onDrop,v=t.onDropAccepted,b=t.onDropRejected,g=t.onFileDialogCancel,_=t.preventDropOnDocument,S=t.noClick,O=t.noKeyboard,E=t.noDrag,w=t.noDragEventsBubbling,T=t.validator,C=Object(r.useRef)(null),j=Object(r.useRef)(null),I=Object(r.useReducer)(reducer,m),P=es_slicedToArray(I,2),M=P[0],k=P[1],R=M.isFocused,x=M.isFileDialogActive,D=M.draggedFiles,N=Object(r.useCallback)((function(){j.current&&(k({type:"openDialog"}),j.current.value=null,j.current.click())}),[k]),L=function onWindowFocus(){x&&setTimeout((function(){j.current&&(j.current.files.length||(k({type:"closeDialog"}),"function"==typeof g&&g()))}),300)};Object(r.useEffect)((function(){return window.addEventListener("focus",L,!1),function(){window.removeEventListener("focus",L,!1)}}),[j,x,g]);var F=Object(r.useCallback)((function(e){C.current&&C.current.isEqualNode(e.target)&&(32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),N()))}),[C,j]),U=Object(r.useCallback)((function(){k({type:"focus"})}),[]),V=Object(r.useCallback)((function(){k({type:"blur"})}),[]),B=Object(r.useCallback)((function(){S||(isIeOrEdge()?setTimeout(N,0):N())}),[j,S]),q=Object(r.useRef)([]),Q=function onDocumentDrop(e){C.current&&C.current.contains(e.target)||(e.preventDefault(),q.current=[])};Object(r.useEffect)((function(){return _&&(document.addEventListener("dragover",onDocumentDragOver,!1),document.addEventListener("drop",Q,!1)),function(){_&&(document.removeEventListener("dragover",onDocumentDragOver),document.removeEventListener("drop",Q))}}),[C,_]);var $=Object(r.useCallback)((function(e){e.preventDefault(),e.persist(),Z(e),q.current=[].concat(_toConsumableArray(q.current),[e.target]),isEvtWithFiles(e)&&Promise.resolve(o(e)).then((function(t){isPropagationStopped(e)&&!w||(k({draggedFiles:t,isDragActive:!0,type:"setDraggedFiles"}),c&&c(e))}))}),[o,c,w]),W=Object(r.useCallback)((function(e){e.preventDefault(),e.persist(),Z(e);var t=isEvtWithFiles(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return t&&f&&f(e),!1}),[f,w]),G=Object(r.useCallback)((function(e){e.preventDefault(),e.persist(),Z(e);var t=q.current.filter((function(e){return C.current&&C.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),q.current=t,t.length>0||(k({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),isEvtWithFiles(e)&&d&&d(e))}),[C,d,w]),H=Object(r.useCallback)((function(e){e.preventDefault(),e.persist(),Z(e),q.current=[],isEvtWithFiles(e)&&Promise.resolve(o(e)).then((function(t){if(!isPropagationStopped(e)||w){var r=[],i=[];t.forEach((function(e){var t=es_slicedToArray(fileAccepted(e,n),2),o=t[0],l=t[1],u=es_slicedToArray(fileMatchSize(e,s,a),2),c=u[0],d=u[1],f=T?T(e):null;if(o&&c&&!f)r.push(e);else{var p=[l,d];f&&(p=p.concat(f)),i.push({file:e,errors:p.filter((function(e){return e}))})}})),(!l&&r.length>1||l&&u>=1&&r.length>u)&&(r.forEach((function(e){i.push({file:e,errors:[h]})})),r.splice(0)),k({acceptedFiles:r,fileRejections:i,type:"setFiles"}),p&&p(r,i,e),i.length>0&&b&&b(i,e),r.length>0&&v&&v(r,e)}})),k({type:"reset"})}),[l,n,s,a,u,o,p,v,b,w]),K=function composeHandler(e){return i?null:e},Y=function composeKeyboardHandler(e){return O?null:K(e)},X=function composeDragHandler(e){return E?null:K(e)},Z=function stopPropagation(e){w&&e.stopPropagation()},J=Object(r.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.onKeyDown,o=e.onFocus,a=e.onBlur,s=e.onClick,l=e.onDragEnter,u=e.onDragOver,c=e.onDragLeave,d=e.onDrop,f=_objectWithoutProperties(e,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return _objectSpread(_objectSpread(_defineProperty({onKeyDown:Y(composeEventHandlers(r,F)),onFocus:Y(composeEventHandlers(o,U)),onBlur:Y(composeEventHandlers(a,V)),onClick:K(composeEventHandlers(s,B)),onDragEnter:X(composeEventHandlers(l,$)),onDragOver:X(composeEventHandlers(u,W)),onDragLeave:X(composeEventHandlers(c,G)),onDrop:X(composeEventHandlers(d,H))},n,C),i||O?{}:{tabIndex:0}),f)}}),[C,F,U,V,B,$,W,G,H,O,E,i]),ee=Object(r.useCallback)((function(e){e.stopPropagation()}),[]),te=Object(r.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,r=void 0===t?"ref":t,i=e.onChange,o=e.onClick,a=_objectWithoutProperties(e,["refKey","onChange","onClick"]),s=_defineProperty({accept:n,multiple:l,type:"file",style:{display:"none"},onChange:K(composeEventHandlers(i,H)),onClick:K(composeEventHandlers(o,ee)),autoComplete:"off",tabIndex:-1},r,j);return _objectSpread(_objectSpread({},s),a)}}),[j,n,l,H,i]),ne=D.length,re=ne>0&&allFilesAccepted({files:D,accept:n,minSize:s,maxSize:a,multiple:l,maxFiles:u}),ie=ne>0&&!re;return _objectSpread(_objectSpread({},M),{},{isDragAccept:re,isDragReject:ie,isFocused:R&&!i,getRootProps:J,getInputProps:te,rootRef:C,inputRef:j,open:K(N)})}function reducer(e,t){switch(t.type){case"focus":return _objectSpread(_objectSpread({},e),{},{isFocused:!0});case"blur":return _objectSpread(_objectSpread({},e),{},{isFocused:!1});case"openDialog":return _objectSpread(_objectSpread({},e),{},{isFileDialogActive:!0});case"closeDialog":return _objectSpread(_objectSpread({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return _objectSpread(_objectSpread({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return _objectSpread(_objectSpread({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _objectSpread(_objectSpread({},e),{},{isFileDialogActive:!1,isDragActive:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]});default:return e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"matcher",(function(){return matcher})),n.d(t,"isMatch",(function(){return isMatch}));const r=new Map,sanitizeArray=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(e=>{if("string"!=typeof e){if(void 0===e)return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0})},makeRegexp=(e,t)=>{t={caseSensitive:!1,...t};const n=e+JSON.stringify(t);if(r.has(n))return r.get(n);const i="!"===e[0];i&&(e=e.slice(1)),e=function escapeStringRegexp(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e).replace(/\\\*/g,"[\\s\\S]*");const o=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return o.negated=i,r.set(n,o),o},baseMatcher=(e,t,n,r)=>{if(e=sanitizeArray(e,"inputs"),0===(t=sanitizeArray(t,"patterns")).length)return[];t=t.map(e=>makeRegexp(e,n));const{allPatterns:i}=n||{},o=[];for(const n of e){let e;const a=[...t].fill(!1);for(const[r,i]of t.entries())if(i.test(n)&&(a[r]=!0,e=!i.negated,!e))break;if(!(!1===e||void 0===e&&t.some(e=>!e.negated)||i&&a.some((e,n)=>!e&&!t[n].negated))&&(o.push(n),r))break}return o};function matcher(e,t,n){return baseMatcher(e,t,n,!1)}function isMatch(e,t,n){return baseMatcher(e,t,n,!0).length>0}}]); //# sourceMappingURL=Plugin.js.map \ No newline at end of file diff --git a/Resources/Public/AssetEditor/Plugin.js.map b/Resources/Public/AssetEditor/Plugin.js.map index 59377dcae..f8c6b5ccf 100644 --- a/Resources/Public/AssetEditor/Plugin.js.map +++ b/Resources/Public/AssetEditor/Plugin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/tslib/tslib.es6.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/graphql/directives.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/graphql/fragments.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/graphql/storeUtils.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/graphql/getFromAST.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/filterInPlace.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/graphql/transform.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/mergeDeep.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/observables/Observable.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/cloneDeep.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/observables/iteration.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/observables/asyncMap.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/observables/subclassing.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/observables/Concast.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/arrays.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/errorHandling.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/canUse.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/compact.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/node_modules/ts-invariant/lib/invariant.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/recoil/es/recoil.js","webpack:///../core/src/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///../core/src/hooks/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/inmemory/helpers.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@wry/equality/lib/equality.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/extends.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/core/networkStatus.js","webpack:///../core/src/state/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/createClass.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss/dist/jss.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/jsutils/defineInspect.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/jsutils/invariant.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/ast.mjs","webpack:///../core/src/queries/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@wry/trie/lib/trie.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/optimism/lib/bundle.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/utils/fromError.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/utils/toPromise.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/utils/fromPromise.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/utils/throwServerError.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/utils/validateOperation.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/utils/createOperation.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/utils/transformOperation.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/core/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/errors/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/context/ApolloContext.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/context/ApolloConsumer.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/context/ApolloProvider.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/parser/index.js","webpack:///../core/src/mutations/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/core/ApolloLink.js","webpack:///../core/src/fragments/asset.ts","webpack:///../media-module/src/components/Presentation/index.ts","webpack:///../media-module/src/state/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/tiny-warning/dist/tiny-warning.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/core/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/dist/readFromConsumerApi.js","webpack:///../clipboard/src/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@wry/context/lib/context.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/inmemory/reactiveVars.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/is-in-browser/dist/module.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///../core/src/fragments/tag.ts","webpack:///../asset-usage/src/index.ts","webpack:///../media-module/src/components/Main/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/core/types/common.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql-tag/node_modules/tslib/tslib.es6.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/jsutils/isObjectLike.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/polyfills/symbols.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/location.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/printLocation.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/error/GraphQLError.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/error/syntaxError.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/kinds.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/tokenKind.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/jsutils/devAssert.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/jsutils/instanceOf.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/source.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/directiveLocation.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/lexer.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/parser.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql-tag/lib/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack:///../core/src/components/index.ts","webpack:///../media-module/src/hooks/index.ts","webpack:///../asset-upload/src/state/index.ts","webpack:///../asset-upload/src/state/uploadDialogVisibleState.ts","webpack:///../media-module/src/components/SideBarRight/Inspector/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/serializeFetchParameter.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/printer.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/checkFetcher.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/createSignalIfSupported.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/selectURI.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/rewriteURIForGET.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/createHttpLink.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/http/HttpLink.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/inmemory/policies.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs","webpack:///(webpack)/buildin/global.js","webpack:///../core/src/fragments/assetCollection.ts","webpack:///../core/src/events/index.ts","webpack:///../core/src/helper/index.ts","webpack:///../asset-preview/src/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-dom/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/core/cache.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/core/Reobserver.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/core/ObservableQuery.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/jsutils/inspect.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/blockString.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack:///../core/src/provider/index.ts","webpack:///../core/src/provider/Notify.tsx","webpack:///../core/src/hooks/useSelectedTag.ts","webpack:///../core/src/state/selectedInspectorViewState.ts","webpack:///../core/src/hooks/useSelectedAssetCollection.ts","webpack:///../core/src/constants/pagination.ts","webpack:///../asset-usage/src/state/assetUsageDetailsModalState.ts","webpack:///../clipboard/src/state/clipboardVisibleState.ts","webpack:///../clipboard/src/queries/ClipboardQuery.ts","webpack:///../clipboard/src/hooks/useClipboard.ts","webpack:///../similar-assets/src/state/similarAssetsModalState.ts","webpack:///../asset-upload/src/components/index.ts","webpack:///../asset-upload/src/components/UploadSection.tsx","webpack:///../asset-upload/src/components/PreviewSection.tsx","webpack:///../asset-upload/src/mutations/index.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/helpers/safeHTMLElement.js","webpack:///../media-module/src/components/SideBarRight/Inspector/Property.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/Actions.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/InspectorContainer.tsx","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/core/LocalState.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/core/QueryInfo.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/core/QueryManager.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/core/ApolloClient.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/version.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/zen-observable/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/symbol-observable/es/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/dist/registry/SynchronousRegistry.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/process/browser.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/core/empty.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/core/from.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/core/split.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/core/concat.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/core/execute.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/core/types/Cache.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/extract-files/public/isExtractableFile.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/extract-files/public/ReactNativeFile.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/apollo-upload-client/public/formDataAppendFile.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/apollo-upload-client/public/isExtractableFile.js","webpack:///../core/src/fragments/assetSource.ts","webpack:///../core/src/state/selectedAssetIdState.ts","webpack:///../core/src/state/selectedSortOrderState.ts","webpack:///../core/src/hooks/useAssetQuery.ts","webpack:///../core/src/events/createEvent.ts","webpack:///../media-module/src/core/index.ts","webpack:///../core/src/constants/neos.ts","webpack:///../media-module/src/queries/index.ts","webpack:///../asset-usage/src/queries/assetUsages.ts","webpack:///../asset-usage/src/fragments/usageDetailsGroupFragment.ts","webpack:///../asset-usage/src/queries/unusedAssets.ts","webpack:///../asset-usage/src/hooks/useAssetUsages.ts","webpack:///../asset-usage/src/state/showUnusedAssetsState.ts","webpack:///../clipboard/src/components/ClipboardItem.tsx","webpack:///../clipboard/src/resolvers/mutation.ts","webpack:///../concurrent-editing/src/hooks/useChangedAssetsQuery.ts","webpack:///../concurrent-editing/src/queries/changedAssets.ts","webpack:///../similar-assets/src/index.ts","webpack:///../similar-assets/src/hooks/useSimilarAssets.ts","webpack:///../similar-assets/src/queries/similarAssets.ts","webpack:///../asset-upload/src/components/Dialogs/NewAssetDialog.tsx","webpack:///../asset-upload/src/components/FilePreview.tsx","webpack:///../asset-upload/src/hooks/index.ts","webpack:///../asset-upload/src/components/Dialogs/ReplaceAssetDialog.tsx","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/helpers/tabbable.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/helpers/ariaAppHider.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/helpers/portalOpenInstances.js","webpack:///../asset-preview/src/state/selectedAssetForPreviewState.ts","webpack:///../media-module/src/components/SideBarLeft/index.ts","webpack:///../media-module/src/components/SideBarLeft/Tree/index.ts","webpack:///../core/src/constants/dndTypes.ts","webpack:///../media-module/src/components/SideBarRight/CurrentSelection.tsx","webpack:///../media-module/src/components/BottomBar/AssetCount/AssetCount.tsx","webpack:///../media-module/src/components/BottomBar/Pagination/Pagination.tsx","webpack:///../media-module/src/components/TopBar/index.ts","webpack:///../media-module/src/components/Main/MissingAssetActions.tsx","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/hooks/useApolloClient.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/data/OperationData.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/data/SubscriptionData.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/data/MutationData.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/data/QueryData.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/hooks/utils/useBaseQuery.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/hooks/utils/useDeepMemo.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/hooks/useLazyQuery.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/hooks/useMutation.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/hooks/useQuery.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/hooks/useSubscription.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/react/hooks/useReactiveVar.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/inmemory/entityStore.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/inmemory/readFromStore.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/inmemory/writeToStore.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/cache/inmemory/inMemoryCache.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/node_modules/ts-invariant/node_modules/tslib/tslib.es6.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/graphql/language/visitor.mjs","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/fast-json-stable-stringify/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/node_modules/symbol-observable/es/ponyfill.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/symbol-observable/es/ponyfill.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/attr-accept/dist/es/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/index.js","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/dist/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/dist/createConsumerApi.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/dist/manifest.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/dist/registry/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/dist/registry/AbstractRegistry.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/positional-array-sorter/dist/positionalArraySorter.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/dist/registry/SynchronousMetaRegistry.js","webpack:///./src/MediaSelectionScreen.tsx","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/zen-observable/lib/Observable.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/node_modules/symbol-observable/es/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/utilities/common/environment.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/apollo-upload-client/public/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/apollo-upload-client/public/createUploadLink.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/extends.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/extract-files/public/extractFiles.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/apollo-upload-client/public/ReactNativeFile.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:///../core/src/provider/MediaUiProvider.tsx","webpack:///../core/src/hooks/useAssetCollectionsQuery.ts","webpack:///../core/src/queries/asset.ts","webpack:///../core/src/fragments/iptcProperty.ts","webpack:///../core/src/fragments/file.ts","webpack:///../core/src/queries/assets.ts","webpack:///../core/src/queries/assetCollection.ts","webpack:///../core/src/queries/assetCollections.ts","webpack:///../core/src/queries/assetCount.ts","webpack:///../core/src/queries/assetSources.ts","webpack:///../core/src/queries/config.ts","webpack:///../core/src/queries/tag.ts","webpack:///../core/src/queries/tags.ts","webpack:///../core/src/queries/selectedAssetSource.ts","webpack:///../core/src/hooks/useAssetCountQuery.ts","webpack:///../core/src/state/currentPageState.ts","webpack:///../core/src/state/initialLoadComplete.ts","webpack:///../core/src/state/loadingState.ts","webpack:///../core/src/state/searchTermState.ts","webpack:///../core/src/state/selectedAssetCollectionIdState.ts","webpack:///../core/src/state/selectedMediaTypeState.ts","webpack:///../core/src/state/selectedTagIdState.ts","webpack:///../core/src/hooks/useAssetSourcesQuery.ts","webpack:///../core/src/hooks/useAssetsQuery.ts","webpack:///../core/src/hooks/useConfigQuery.ts","webpack:///../core/src/hooks/useCreateAssetCollection.ts","webpack:///../core/src/mutations/createAssetCollection.ts","webpack:///../core/src/mutations/createTag.ts","webpack:///../core/src/mutations/deleteAsset.ts","webpack:///../core/src/mutations/deleteAssetCollection.ts","webpack:///../core/src/mutations/deleteTag.ts","webpack:///../core/src/mutations/importAsset.ts","webpack:///../core/src/mutations/setAssetCollections.ts","webpack:///../core/src/mutations/setAssetTags.ts","webpack:///../core/src/mutations/tagAsset.ts","webpack:///../core/src/mutations/untagAsset.ts","webpack:///../core/src/mutations/updateAsset.ts","webpack:///../core/src/mutations/updateAssetCollection.ts","webpack:///../core/src/mutations/updateTag.ts","webpack:///../core/src/hooks/useCreateTag.ts","webpack:///../core/src/hooks/useDeleteAsset.ts","webpack:///../core/src/events/asset.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/pubsub-js/src/pubsub.js","webpack:///(webpack)/buildin/module.js","webpack:///../core/src/hooks/useDeleteAssetCollection.ts","webpack:///../core/src/hooks/useDeleteTag.ts","webpack:///../core/src/hooks/useEvent.tsx","webpack:///../core/src/hooks/useImportAsset.ts","webpack:///../core/src/hooks/useSelectAsset.ts","webpack:///../core/src/hooks/useSelectAssetCollection.ts","webpack:///../core/src/hooks/useSelectAssetSource.ts","webpack:///../core/src/hooks/useSelectTag.ts","webpack:///../core/src/hooks/useSelectedAsset.ts","webpack:///../core/src/hooks/useSetAssetCollections.ts","webpack:///../core/src/hooks/useSetAssetTags.ts","webpack:///../core/src/hooks/useTagsQuery.ts","webpack:///../core/src/hooks/useUntagAsset.ts","webpack:///../core/src/hooks/useUpdateAsset.ts","webpack:///../core/src/hooks/useUpdateAssetCollection.ts","webpack:///../core/src/hooks/useUpdateTag.ts","webpack:///../core/src/provider/Intl.tsx","webpack:///../core/src/provider/MediaUiTheme.tsx","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-is/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-is/cjs/react-is.production.min.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-display-name/lib/getDisplayName.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-cache/dist/jss-plugin-cache.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@neos-project/build-essentials/src/styles/styleConstants.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/lodash.upperfirst/index.js","webpack:///../core/src/components/Dialog.tsx","webpack:///../core/src/helper/humanFileSize.ts","webpack:///../media-module/src/core/PersistentStateManager.ts","webpack:///../media-module/src/hooks/useViewModeSelection.ts","webpack:///../media-module/src/queries/ViewModeSelectionQuery.ts","webpack:///../media-module/src/hooks/useAssetCount.ts","webpack:///../asset-usage/src/interfaces/UsageDetails.ts","webpack:///../asset-usage/src/components/AssetUsagesModal.tsx","webpack:///../asset-usage/src/components/AssetUsageSection.tsx","webpack:///../asset-usage/src/components/AssetUsagesToggleButton.tsx","webpack:///../asset-usage/src/hooks/useUnusedAssetsQuery.ts","webpack:///../asset-usage/src/queries/useUnusedAssetCountQuery.ts","webpack:///../asset-usage/src/queries/unusedAssetCount.ts","webpack:///../media-module/src/state/createAssetCollectionDialogState.ts","webpack:///../media-module/src/state/createTagDialogState.ts","webpack:///../media-module/src/state/mainViewState.ts","webpack:///../clipboard/src/components/ClipboardToggle.tsx","webpack:///../clipboard/src/components/ClipboardActions.tsx","webpack:///../clipboard/src/components/ClipboardWatcher.ts","webpack:///../media-module/src/core/IdFromObjectResolver.ts","webpack:///../media-module/src/core/ApolloErrorHandler.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@apollo/client/link/error/index.js","webpack:///../media-module/src/core/Cache.ts","webpack:///../media-module/src/components/App.tsx","webpack:///../concurrent-editing/src/index.ts","webpack:///../concurrent-editing/src/components/ConcurrentChangeMonitor.tsx","webpack:///../similar-assets/src/components/SimilarAssetsToggleButton.tsx","webpack:///../similar-assets/src/components/SimilarAssetsModal.tsx","webpack:///../similar-assets/src/components/SimilarAsset.tsx","webpack:///../asset-upload/src/hooks/useUploadDialogState.ts","webpack:///../asset-upload/src/hooks/useUploadFile.ts","webpack:///../asset-upload/src/mutations/replaceAsset.ts","webpack:///../asset-upload/src/mutations/uploadFiles.ts","webpack:///../asset-upload/src/mutations/uploadFile.ts","webpack:///../asset-upload/src/hooks/useUploadFiles.ts","webpack:///../asset-upload/src/hooks/useReplaceAsset.ts","webpack:///../asset-upload/src/components/Dialogs/UploadDialog.tsx","webpack:///../asset-upload/src/components/AssetReplacementButton.tsx","webpack:///../asset-upload/src/components/UploadButton.tsx","webpack:///../asset-preview/src/components/AssetPreview.tsx","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-image-lightbox/dist/index.es.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/components/Modal.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/components/ModalPortal.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/helpers/focusManager.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/helpers/scopeTab.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/warning/warning.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/exenv/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/helpers/classList.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-modal/lib/helpers/bodyTrap.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-image-lightbox/style.css?30a3","webpack:///../media-module/src/components/SideBarLeft/AssetSourceList.tsx","webpack:///../media-module/src/components/Presentation/AssetLabel.tsx","webpack:///../media-module/src/components/Presentation/Column.tsx","webpack:///../media-module/src/components/Presentation/IconLabel.tsx","webpack:///../media-module/src/components/Presentation/PropertyList.tsx","webpack:///../media-module/src/components/Presentation/PropertyListItem.tsx","webpack:///../media-module/src/components/SideBarLeft/AssetSourceDescription.tsx","webpack:///../media-module/src/components/SideBarLeft/SideBarLeft.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/AssetCollectionTree.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/AssetCollectionTreeNode.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/TagTreeNode.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/AddAssetCollectionButton.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/AddTagButton.tsx","webpack:///../media-module/src/components/SideBarRight/index.ts","webpack:///../media-module/src/components/SideBarRight/SideBarRight.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/AssetInspector.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/AssetCollectionInspector.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/IptcMetadataInspector.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/MetadataView.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/TagInspector.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/TagSelectBox.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/TagSelectBoxAsset.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/TagSelectBoxAssetCollection.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/CollectionSelectBox.tsx","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/media-type/lib/mediaType.js","webpack:///../media-module/src/components/LoadingIndicator.tsx","webpack:///../media-module/src/components/BottomBar/index.ts","webpack:///../media-module/src/components/BottomBar/BottomBar.tsx","webpack:///../media-module/src/components/BottomBar/Pagination/PaginationItem.tsx","webpack:///../media-module/src/components/TopBar/SearchBox.tsx","webpack:///../media-module/src/components/TopBar/TopBar.tsx","webpack:///../media-module/src/components/TopBar/SortOrderSelector.tsx","webpack:///../media-module/src/components/TopBar/TypeFilter.tsx","webpack:///../media-module/src/components/TopBar/ViewModeSelector.tsx","webpack:///../media-module/src/components/Main/AssetActions.tsx","webpack:///../media-module/src/components/Main/ListView.tsx","webpack:///../media-module/src/components/Main/ListViewItem.tsx","webpack:///../media-module/src/components/Main/Main.tsx","webpack:///../media-module/src/components/LoadingLabel.tsx","webpack:///../media-module/src/components/Main/Thumbnail.tsx","webpack:///../media-module/src/components/Main/ThumbnailView.tsx","webpack:///../media-module/src/components/ErrorBoundary.tsx","webpack:///../media-module/src/components/Dialogs/index.ts","webpack:///../media-module/src/components/Dialogs/CreateTagDialog.tsx","webpack:///../media-module/src/components/Dialogs/CreateAssetCollectionDialog.tsx","webpack:///../core/schema.graphql","webpack:///../clipboard/schema.graphql","webpack:///../asset-usage/schema.graphql","webpack:///../media-module/src/resolvers/mutation.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/theming/dist/theming.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-rule-value-observable/dist/jss-plugin-rule-value-observable.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-template/dist/jss-plugin-template.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-global/dist/jss-plugin-global.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-extend/dist/jss-plugin-extend.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-nested/dist/jss-plugin-nested.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-compose/dist/jss-plugin-compose.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/hyphenate-style-name/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-default-unit/dist/jss-plugin-default-unit.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-expand/dist/jss-plugin-expand.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/css-vendor/dist/css-vendor.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-vendor-prefixer/dist/jss-plugin-vendor-prefixer.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-plugin-props-sort/dist/jss-plugin-props-sort.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/jss-preset-default/dist/jss-preset-default.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/shallow-equal/dist/index.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/css-jss/dist/css-jss.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-jss/dist/react-jss.esm.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/file-selector/node_modules/tslib/tslib.es6.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/file-selector/dist/es5/file.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/file-selector/dist/es5/file-selector.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-dropzone/dist/es/utils/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/react-dropzone/dist/es/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/matcher/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Application/Flowpack.Media.Ui/node_modules/matcher/node_modules/escape-string-regexp/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","React","extendStatics","b","setPrototypeOf","__proto__","Array","__extends","__","this","constructor","__assign","assign","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","desc","getOwnPropertyDescriptor","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","result","done","adopt","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","iterator","v","op","TypeError","pop","push","__createBinding","k","k2","undefined","__exportStar","__values","__read","ar","error","__spread","concat","__spreadArrays","il","a","j","jl","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","mod","default","__importDefault","__classPrivateFieldGet","receiver","privateMap","has","__classPrivateFieldSet","set","shouldInclude","_a","variables","directives","getInclusionDirectives","forEach","directive","isInclusionDirective","directiveArguments","ifArgument","ifValue","kind","every","evaledValue","hasDirectives","names","root","getDirectiveNames","Directive","node","some","hasClientExports","document","getFragmentQueryDocument","fragmentName","actualFragmentName","fragments","definitions","definition","operation","selectionSet","selections","createFragmentMap","symTable","fragment","getFragmentFromSelection","selection","fragmentMap","makeReference","id","__ref","String","obj","Boolean","valueToObjectRepresentation","argObj","isIntValue","isFloatValue","Number","isBooleanValue","isStringValue","isObjectValue","nestedArgObj_1","fields","map","isVariable","variableValue","isListValue","values","listValue","nestedArgArrayObj","isEnumValue","isNullValue","storeKeyNameFromField","field","directivesObj","getStoreKeyName","KNOWN_DIRECTIVES","fieldName","args","filterKeys","sort","filteredArgs_1","JSON","stringify","completeFieldName","stringifiedArgs","keys","argumentsObjectFromField","argObj_1","resultKeyNameFromField","alias","getTypenameFromResult","__typename","_i","isField","typename","isInlineFragment","checkDocument","doc","operations","filter","getOperationDefinition","getOperationName","x","getFragmentDefinitions","getQueryDefinition","queryDef","getMainDefinition","queryDoc","fragmentDefinition","getDefaultValues","defaultValues","defs","variableDefinitions","def","defaultValue","variable","filterInPlace","array","test","context","elem","TYPENAME_FIELD","nullIfDocIsEmpty","isEmpty","getFragmentDefinition","fragmentDef","getDirectiveMatcher","directiveMatcher","dir","removeDirectivesFromDocument","variablesInUse","variablesToRemove","fragmentSpreadsInUse","fragmentSpreadsToRemove","modifiedDoc","Variable","enter","_key","parent","Field","remove","arg","getAllFragmentSpreadsFromSelectionSet","allFragments","frag","FragmentSpread","removeArgumentsFromDocument","config","argMatcher","getArgumentMatcher","argumentMatcher","argument","aConfig","OperationDefinition","varDef","argConfig","argMatchCount_1","Argument","fs","removeFragmentSpreadFromDocument","FragmentDefinition","addTypenameToDocument","SelectionSet","lastIndexOf","added","connectionRemoveConfig","willRemove","removeConnectionDirectiveFromDocument","buildQueryFromSelectionSet","removeClientSetsFromDocument","mergeDeep","sources","mergeDeepArray","count","merger","merge","isObject","defaultReconciler","source","DeepMerger","reconciler","pastCopies","Set","_this","sourceKey","targetValue","shallowCopyForMerge","isArray","slice","getPrototypeOf","add","toString","cloneDeep","cloneDeepHelper","val","seen","Map","copy_1","child","copy_2","maybeDeepFreeze","iterateObserversSafely","observers","method","observersWithMethod","obs","asyncMap","observable","mapFn","catchFn","observer","complete","activeCallbackCount","completed","promiseQueue","callback","makeCallback","examiner","delegate","both","handler","catch","caught","sub","subscribe","unsubscribe","fixObservableSubclass","subclass","species","isPromiseLike","_super","Concast","addObserver","removeObserver","addCount","promise","handlers","latest","cancel","reason","iterable","start","from","deliverLastMessage","nextOrError","quietly","delete","Error","cleanup","called","once","isNonEmptyArray","graphQLResultHasError","errors","canUseWeakMap","WeakMap","navigator","product","compact","objects","proto","InvariantError","message","genericMessage","framesToPop","invariant","condition","verbosityLevels","verbosityLevel","wrapConsoleMethod","console","setVerbosity","level","old","Math","max","log","warn","process","env","PropTypes","Recoil_nullthrows","nullthrows","Recoil_recoverableViolation","recoverableViolation","projectName","Recoil_CopyOnWrite","setByAddingToSet","setByDeletingFromSet","mapBySettingInMap","mapByUpdatingInMap","updater","mapByDeletingFromMap","mapByDeletingMultipleFromMap","ks","Recoil_filterIterable","filterIterable","predicate","index","gks","Recoil_gkx","gk","_gks$get","setPass","setFail","Recoil_gkx_1","Recoil_mapIterable","mapIterable","Recoil_expectationViolation","expectationViolation","format","_defineProperty","configurable","writable","AbstractRecoilValue","newKey","RecoilState","RecoilValueReadOnly","Recoil_RecoilValue","isRecoilValue","Recoil_RecoilValue_1","Recoil_RecoilValue_2","Recoil_RecoilValue_3","Recoil_RecoilValue_4","Recoil_RecoilValue$1","freeze","DefaultValue","DEFAULT_VALUE","RecoilValueNotReady","super","nodes","recoilValues","NodeMissingError","configDeletionHandlers","getConfigDeletionHandler","Recoil_Node","registerNode","recoilValue","getNode","getNodeMaybe","deleteNodeConfigIfPossible","_node$shouldDeleteCon","_getConfigDeletionHan","shouldDeleteConfigOnRelease","setConfigDeletionHandler","fn","recoilValuesForKeys","RetentionZone","Recoil_RetentionZone","retentionZone","setByAddingToSet$1","getNode$1","getNodeMaybe$1","recoilValuesForKeys$1","RetentionZone$1","emptySet","ReadOnlyRecoilValueError","initializeNodeIfNewToStore","store","treeState","trigger","storeState","getState","nodeCleanupFunctions","retentionCleanup","initializeRetentionForNode","nodeKey","retainedBy","nodesRetainedByZone","retention","addToZone","zone","deleteFromZone","size","nodeCleanup","init","peekNodeLoadable","state","peek","getDownstreamNodes","visitedNodes","visitingNodes","graph","getGraph","version","_graph$nodeToNodeSubs","subscribedNodes","nodeToNodeSubscriptions","downstreamNode","Recoil_FunctionalCore","getNodeLoadable","setNodeValue","newValue","cleanUpNode","_state$nodeCleanupFun","setUnvalidatedAtomValue_DEPRECATED","_node$invalidate","invalidate","atomValues","clone","nonvalidatedAtoms","dirtyAtoms","peekNodeInfo","_graph$nodeDeps$get","_storeState$nodeToCom","_storeState$nodeToCom2","type","knownAtoms","knownSelectors","downstreamNodes","loadable","isActive","isSet","isModified","deps","nodeDeps","subscribers","components","nodeToComponentSubscriptions","getDownstreamNodes$1","getNodeLoadable$1","setNodeValue$1","getNodeMaybe$2","DefaultValue$1","RecoilValueNotReady$1","AbstractRecoilValue$1","RecoilState$1","RecoilValueReadOnly$1","isRecoilValue$1","applyAction","action","valueOrUpdater","valueFromValueOrUpdater","current","contents","writes","entries","writeLoadableToTreeState","unvalidatedValue","applyActionsToStore","actions","replaceState","newState","copyTreeState","invalidateDownstreams","queueOrPerformStateUpdate","batchStack","actionsByStore","downstreams","_getNodeMaybe","_getNodeMaybe$invalid","setRecoilValue","subscriptionID","Recoil_RecoilValueInterface","getRecoilValueAsLoadable","currentTree","_storeState$nextTree","_storeState$previousT","nextTree","previousTree","setRecoilValueLoadable","markRecoilValueModified","setUnvalidatedRecoilValue","subscribeToRecoilValue","componentDebugName","subID","release","subs","applyAtomValueWrites","batchStart","invalidateDownstreams_FOR_TESTING","unstable_batchedUpdates","ReactBatchedUpdates","unstable_batchedUpdates$1","Recoil_ReactBatchedUpdates","batchStart$1","unstable_batchedUpdates$2","batcher","Recoil_Batching","getBatcher","setBatcher","newBatcher","batchUpdates","batchEnd","Recoil_Queue","enqueueExecution","Recoil_differenceSets","differenceSets","setsWithValuesToRemove","ret","FIRST","otherSet","Recoil_mapMap","mapMap","mergeDependencyMapIntoGraph","olderGraph","upstreams","downstream","existingUpstreams","upstream","existing","Recoil_Graph","addToDependencyMap","dependencyMap","cloneGraph","mergeDepsIntoDependencyMap","into","upstreamDeps","dep","saveDependencyMapToStore","_storeState$previousT2","_storeState$previousT3","_storeState$nextTree2","nextVersion","hamt_1","createCommonjsModule","_typeof","hamt","BUCKET_SIZE","pow","MASK","MAX_INDEX_NODE","MIN_ARRAY_NODE","nothing","constant","hash","str","len","charCodeAt","hashFragment","h","toBitmap","fromBitmap","bitmap","bit","popcount","arrayUpdate","mutate","at","arr","out","arraySpliceOut","newLen","empty","__hamt_isEmpty","isEmptyNode","Leaf","edit","_modify","Leaf__modify","Collision","children","Collision__modify","IndexedNode","mask","IndexedNode__modify","ArrayNode","ArrayNode__modify","mergeLeaves","h1","n1","h2","n2","subH1","subH2","canEditNode","keyEq","_v","list","updateCollisionList","_newValue","indx","exists","canEdit","newChildren","isLeaf","expand","subNodes","arraySpliceIn","newChild","pack","removed","elements","editable","_editable","_edit","_config","_root","_size","setTree","newRoot","newSize","tryGetHash","alt","tryGet","getHash","hasHash","defKeyCompare","make","modifyHash","NaN","modify","setHash","del","removeHash","deleteHash","beginMutation","endMutation","transient","appk","lazyVisitChildren","lazyVisit","rest","DONE","MapIterator","v0","visit","buildPairs","buildKeys","buildValues","fold","z","toVisit","BuiltInMap","_map","persistentMap","HashArrayMappedTrieMap","_hamt","Recoil_PersistentMap_1","Recoil_PersistentMap$1","graph$1","persistentMap$1","nextTreeStateVersion","getNextTreeStateVersion","makeEmptyTreeState","stateID","transactionMetadata","Recoil_State","makeEmptyStoreState","transactionSubscriptions","nodeTransactionSubscriptions","queuedComponentCallbacks_DEPRECATED","suspendedComponentResolvers","graphsByVersion","versionsUsedByComponent","referenceCounts","retainablesToCheckForRelease","Recoil_unionSets","unionSets","sets","Recoil_someSet","someSet","entry","cleanUpNode$1","deleteNodeConfigIfPossible$1","getNode$2","RetentionZone$2","emptySet$1","releaseRetainablesNowOnCurrentTree","retainables","releasableNodes","findReleasableNodes","searchFromNodes","nonReleasableNodes","findReleasableNodesInner","releasableNodesFoundThisIteration","getDownstreamNodesInTopologicalOrder","doNotDescendInto1","doNotDescendInto2","answer","visited","_storeState$retention","zonesThatCouldRetainNode","nodeChildren","parents","releaseNode","zones","_storeState$retention2","_storeState$retention3","Recoil_Retention","updateRetainCount","retainable","delta","_map$get","newCount","scheduleOrPerformPossibleReleaseOfRetainable","releaseScheduledRetainablesNow","clear","retainedByOptionWithDefault","Recoil_concatIterables","concatIterables","iters","iter","Recoil_Environment","isSSR","window","isReactNative","isSSR$1","batchUpdates$1","initializeNodeIfNewToStore$1","peekNodeInfo$1","graph$2","DEFAULT_VALUE$1","recoilValues$1","recoilValuesForKeys$2","AbstractRecoilValue$2","getRecoilValueAsLoadable$1","setRecoilValue$1","setUnvalidatedRecoilValue$1","getNextTreeStateVersion$1","makeEmptyStoreState$1","Snapshot","checkRefCount_INTERNAL","_store","getLoadable","toPromise","opt","isInitialized","mapper","mutableSnapshot","MutableSnapshot","cloneSnapshot","getStore_INTERNAL","async","replacer","graphs","newGraph","subscribeToTransactions","addTransactionMetadata","retain","autorelease","_refCount","released","setTimeout","getID_INTERNAL","cloneStoreState","bumpVersion","snapshot","recoilState","newValueOrUpdater","Recoil_Snapshot","freshSnapshot","initializeState","Recoil_Snapshot_1","Recoil_Snapshot_2","Recoil_Snapshot_3","Recoil_Snapshot_4","Recoil_Snapshot$1","getNextTreeStateVersion$2","makeEmptyStoreState$2","cleanUpNode$2","getDownstreamNodes$2","setNodeValue$2","setUnvalidatedAtomValue_DEPRECATED$1","graph$3","cloneGraph$1","applyAtomValueWrites$1","releaseScheduledRetainablesNow$1","freshSnapshot$1","useCallback","useContext","useEffect","useMemo","useRef","useState","notInAContext","defaultStore","stateReplacerIsBeingExecuted","startNextTreeIfNeeded","AppContext","createContext","useStoreRef","MutableSourceContext","sendEndOfBatchNotifications","subscriptions","subscription","dependentNodes","comps","_subID","_debugName","cb","splice","Batcher","setNotifyBatcherOfChange","storeRef","setState","discardedVersion","nextID","Recoil_RecoilRoot_react","useRecoilMutableSource","mutableSource","RecoilRoot","initializeState_DEPRECATED","store_INTERNAL","storeProp","_createMutableSource","notifyBatcherOfChange","createMutableSource","unstable_createMutableSource","replaced","initialStoreState_DEPRECATED","initial","atom","writtenNodes","setUnvalidatedAtomValues","initialStoreState","atomKey","createElement","Provider","sendEndOfBatchNotifications_FOR_TESTING","Recoil_filterMap","filterMap","Recoil_filterSet","filterSet","Recoil_invariant","_useMutableSource","Recoil_mergeMaps","mergeMaps","maps","nextKey","useMutableSource","unstable_useMutableSource","Recoil_mutableSource","mutableSourceExists","$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE","Recoil_shallowArrayEqual","shallowArrayEqual","useRef$1","Recoil_useComponentName","useComponentName","batchUpdates$2","DEFAULT_VALUE$2","getNode$3","nodes$1","useRecoilMutableSource$1","useStoreRef$1","isRecoilValue$2","AbstractRecoilValue$3","getRecoilValueAsLoadable$2","setRecoilValue$2","setRecoilValueLoadable$1","setUnvalidatedRecoilValue$2","subscribeToRecoilValue$1","updateRetainCount$1","RetentionZone$3","Snapshot$1","cloneSnapshot$1","setByAddingToSet$2","isSSR$2","mutableSourceExists$1","useMutableSource$1","useCallback$1","useEffect$1","useMemo$1","useRef$2","useState$1","handleLoadable","useRecoilValueLoadable","useRetain","useRecoilValueLoadable_MUTABLESOURCE","getLoadableWithTesting","componentName","_storeState","newLoadable","prevLoadableRef","is","useRecoilValueLoadable_LEGACY","forceUpdate","_state","_prevLoadableRef$curr","_prevLoadableRef$curr2","useRecoilValue","useSetRecoilState","useTransactionSubscription","externallyVisibleAtomValuesInState","toMap","persistedAtomContentsValues","persistence","persistence_UNSTABLE","usePrevious","ref","useGotoRecoilSnapshot","prev","keysToUpdate","_prev$atomValues$get","_next$atomValues$get","shouldRestoreFromSnapshots","Sentinel","SENTINEL","toRetain","useRetain_ACTUAL","timeoutID","clearTimeout","previousRetainables","Recoil_Hooks","recoilComponentGetRecoilValueCount_FOR_TESTING","useRecoilCallback","gotoSnapshot","reset","errMsg","useRecoilInterface","useRecoilInterface_DEPRECATED","recoilValuesUsed","previousSubscriptions","unsubscribeFrom","updateState","getRecoilValue","getRecoilValueLoadable","getRecoilState","useRecoilState","getRecoilStateLoadable","useRecoilStateLoadable","getSetRecoilState","getResetRecoilState","useResetRecoilState","useRecoilSnapshot","setSnapshot","previousSnapshot","useRecoilTransactionObserver","useSetUnvalidatedAtomValues","useTransactionObservation_DEPRECATED","previousAtomValues","atomInfo","_node$persistence_UNS","_node$persistence_UNS2","_node$persistence_UNS3","_node$persistence_UNS4","backButton","modifiedAtoms","useTransactionSubscription_DEPRECATED","peekNodeInfo$2","useStoreRef$2","Recoil_useGetRecoilValueInfo","useGetRecoilValueInfo","RecoilRoot$1","useStoreRef$3","useMemo$2","Recoil_useRecoilBridgeAcrossReactRoots","useRecoilBridgeAcrossReactRoots","RecoilBridge","Recoil_isPromise","isPromise","Canceled","CANCELED","loadableAccessors","__value","other","loadableWithPromise","loadableWithValue","loadableWithError","Recoil_Loadable","loadableLoading","loadableAll","inputs","find","all","isReactNative$1","isSSR$3","Recoil_stableStringify","stableStringify","allowFunctions","includes","_JSON$stringify","toJSON","localeCompare","join","findLeaf","getNodeValue","_handlers$onNodeVisit","onNodeVisit","nodeValue","branches","addLeaf","route","branchKey","_handlers$onNodeVisit2","path","pruneNodeFromTree","pruneUpstreamBranches","branchNode","countDownstreamLeaves","reduce","sum","currNode","Recoil_TreeCache_1","TreeCache","options","_options$onHit","_options$onSet","_options$mapNodeValue","_numLeafs","_onHit","onHit","_onSet","onSet","_mapNodeValue","mapNodeValue","_this$getLeafNode","getLeafNode","leafNode","Recoil_TreeCache$1","Recoil_LRUCache_1","LRUCache","_options$mapKey","_maxSize","maxSize","_head","_tail","_keyMapper","mapKey","mappedKey","head","right","left","_maybeDeleteLRU","deleteLru","tail","Recoil_LRUCache$1","LRUCache$1","TreeCache$1","Recoil_treeCacheLRU","treeCacheLRU","lruCache","cache","lruNode","TreeCache$2","defaultPolicy","equality","eviction","Infinity","Recoil_treeCacheFromPolicy","treeCacheFromPolicy","getTreeCache","getValueMapper","Recoil_PerformanceTimings","startPerfBlock","_id","CANCELED$1","Canceled$1","loadableWithError$1","loadableWithPromise$1","loadableWithValue$1","getNodeLoadable$2","peekNodeLoadable$1","setNodeValue$3","saveDependencyMapToStore$1","DEFAULT_VALUE$3","RecoilValueNotReady$2","getConfigDeletionHandler$1","registerNode$1","isRecoilValue$3","AbstractRecoilValue$4","setRecoilValueLoadable$2","retainedByOptionWithDefault$1","startPerfBlock$1","dependencyStack","waitingStores","getNewExecutionId","executionId","Recoil_selector","selector","cachePolicy_UNSTABLE","cachePolicy","retainedBy_UNSTABLE","executionInfoMap","liveStoresCount","selectorIsLive","getExecutionInfo","depValuesDiscoveredSoFarDuringAsyncWork","latestLoadable","latestExecutionId","stateVersion","selectorInit","selectorShouldDeleteConfigOnRelease","notifyStoreWhenAsyncSettles","stores","getCachedNodeLoadable","isKeyPointingToSelector","wrapPendingDependencyPromise","existingDeps","resolvedDep","clearExecutionInfo","__key","resolvedDepKey","depValue","bypassSelectorDepCacheOnReevaluation","depValues","evaluateSelectorGetter","isLatestExecution","updateExecutionInfoDepValues","maybeFreezeLoadableContents","setCache","depValuesToDepRoute","setDepsInStore","setLoadableInStoreToNotifyDeps","maybeFreezeValue","setExecutionInfo","notifyStoresOfSettledAsync","_store$getState","_store$getState$curre","_store$getState2","_store$getState2$next","_store$getState$nextT","_store$getState3","_store$getState3$next","bypassSelectorDepCache","endPerfBlock","resultIsError","depKey","setNewDepInStore","newDepKey","depLoadable","wrapPendingPromise","errorOrPromise","finally","errorOrDepPromise","valLoadable","getValFromRunningNewExecutionAndUpdatedDeps","newExecutionId","newDepValues","maybeSetCacheWithLoadable","depRoute","getSelectorValAndUpdatedDeps","cachedVal","getValFromCacheAndUpdatedDownstreamDeps","depsAfterCacheDone","executionInfo","inProgressExecutionInfo","getExecutionInfoOfInProgressExecution","_Array$from$find","haveAsyncDepsChanged","_executionInfo$depVal","_mapOfCheckedVersions","oldDepValues","cachedDepValuesCheckedForThisVersion","mapOfCheckedVersions","isCachedVersionSame","nodeVal","oldVal","cacheRoute","selectorPeek","selectorGet","detectCircularDependencies","invalidateSelector","selectorSet","syncSelectorSetFinished","setRecoilState","resetRecoilState","dangerouslyAllowMutability","loadableWithError$2","loadableWithPromise$2","loadableWithValue$2","DEFAULT_VALUE$4","DefaultValue$2","getConfigDeletionHandler$2","registerNode$2","setConfigDeletionHandler$1","isRecoilValue$4","markRecoilValueModified$1","setRecoilValue$3","setRecoilValueLoadable$3","retainedByOptionWithDefault$2","baseAtom","defaultLoadable","cachedAnswerForUnvalidatedValue","cleanupEffectsByStore","peekAtom","_ref","_state$atomValues$get3","_cachedAnswerForUnval","getAtom","nonvalidatedValue","validatorResult","validator","validatedValueLoadable","setAtom","initAtom","initState","alreadyKnown","notifyDefaultSubscribers","_store$getState$nextT3","initValue","pendingSetSelf","effects_UNSTABLE","duringInit","setSelf","effect","currentValue","resetSelf","currentStore","_pendingSetSelf3","_previousTree$atomVal","_pendingSetSelf","_pendingSetSelf2","oldLoadable","oldValue","_options$effects_UNST","_store$getState$nextT4","initLoadable","wrappedPromise","_state$atomValues$get","_store$getState$nextT2","_state$atomValues$get2","_cleanupEffectsByStor","invalidateAtom","shouldDeleteConfigOnReleaseAtom","optionsDefault","restOptions","atomWithFallback","base","storedValue","sel","baseValue","Recoil_atom","Recoil_MapCache_1","MapCache","Recoil_MapCache$1","LRUCache$2","MapCache$1","defaultPolicy$1","Recoil_cacheFromPolicy","cacheFromPolicy","getCache","getValueMapper$1","setConfigDeletionHandler$2","nextIndex","Recoil_selectorFamily","selectorFamily","_options$cachePolicyF","selectorCache","cachePolicyForParams_UNSTABLE","params","_stableStringify","cachedSelector","myKey","myGet","callbacks","myCachePolicy","newSelector","DEFAULT_VALUE$5","DefaultValue$3","setConfigDeletionHandler$3","Recoil_atomFamily","atomFamily","atomCache","legacyAtomOptions","legacyAtom","atomFamilyDefault","param","legacyValue","cachedAtom","atomOptions","newAtom","constantSelector","Recoil_constSelector","constSelector","throwingSelector","Recoil_errorSelector","errorSelector","Recoil_readOnlySelector","readOnlySelector","loadableWithError$3","loadableWithPromise$3","loadableWithValue$3","concurrentRequests","results","fill","exceptions","isError","exp","unwrapDependencies","dependencies","getOwnPropertyNames","getValueFromLoadablePromiseResult","wrapResults","idx","wrapLoadables","exception","Recoil_WaitFor","waitForNone","waitForAny","waitForAll","exceptionResults","combineAsyncResultsWithSyncResults","syncResults","asyncResults","waitForAllSettled","noWait","dependency","batchUpdates$3","setBatcher$1","DefaultValue$4","RecoilRoot$2","isRecoilValue$5","retentionZone$1","freshSnapshot$2","useGotoRecoilSnapshot$1","useRecoilCallback$1","useRecoilSnapshot$1","useRecoilState$1","useRecoilStateLoadable$1","useRecoilTransactionObserver$1","useRecoilValue$1","useRecoilValueLoadable$1","useResetRecoilState$1","useRetain$1","useSetRecoilState$1","useSetUnvalidatedAtomValues$1","useTransactionObservation_DEPRECATED$1","noWait$1","waitForAll$1","waitForAllSettled$1","waitForAny$1","waitForNone$1","Recoil_index","useRecoilBridgeAcrossReactRoots_UNSTABLE","useGetRecoilValueInfo_UNSTABLE","useRecoilTransactionObserver_UNSTABLE","useTransactionObservation_UNSTABLE","useSetUnvalidatedAtomValues_UNSTABLE","snapshot_UNSTABLE","Recoil_index_1","Recoil_index_2","Recoil_index_3","Recoil_index_4","Recoil_index_5","Recoil_index_6","Recoil_index_7","Recoil_index_8","Recoil_index_9","Recoil_index_10","Recoil_index_11","Recoil_index_12","Recoil_index_13","Recoil_index_14","Recoil_index_15","Recoil_index_16","Recoil_index_17","Recoil_index_18","Recoil_index_19","Recoil_index_20","Recoil_index_21","Recoil_index_22","Recoil_index_23","Recoil_index_24","Recoil_index_25","Recoil_index_26","Recoil_index_27","Recoil_index_28","Recoil_index_29","Recoil_index_30","Recoil_index_31","Recoil_index_32","Recoil_index_33","Recoil_index_34","__setModuleDefault","useNotify","useMediaUiTheme","useMediaUi","useIntl","createUseMediaUiStyles","NotifyProvider","MediaUiThemeProvider","MediaUiProvider","IntlProvider","Helper","Events","Components","provider_1","ReactUiComponents","useUpdateTag","useUpdateAssetCollection","useUpdateAsset","useUntagAsset","useTagsQuery","useSetAssetTags","useSetAssetCollections","useSelectedTag","useSelectedAssetCollection","useSelectedAsset","useSelectTag","useSelectAssetSource","useSelectAssetCollection","useSelectAsset","useImportAsset","useEvent","useDeleteTag","useDeleteAssetCollection","useDeleteAsset","useCreateTag","useCreateAssetCollection","useConfigQuery","useAssetsQuery","useAssetSourcesQuery","useAssetQuery","useAssetCountQuery","useAssetCollectionsQuery","useAssetCollectionsQuery_1","useAssetCountQuery_1","useAssetQuery_1","useAssetSourcesQuery_1","useAssetsQuery_1","useConfigQuery_1","useCreateAssetCollection_1","useCreateTag_1","useDeleteAsset_1","useDeleteAssetCollection_1","useDeleteTag_1","useEvent_1","useImportAsset_1","useSelectAsset_1","useSelectAssetCollection_1","useSelectAssetSource_1","useSelectTag_1","useSelectedAsset_1","useSelectedAssetCollection_1","useSelectedTag_1","useSetAssetCollections_1","useSetAssetTags_1","useTagsQuery_1","useUntagAsset_1","useUpdateAsset_1","useUpdateAssetCollection_1","useUpdateTag_1","hasOwn","TypeOrFieldNameRegExp","fieldNameFromStoreName","storeFieldName","match","selectionSetMatchesResult","item","storeValueIsStoreObject","makeProcessedFieldsMerger","fnToStr","Function","previousComparisons","equal","check","aTag","bTag","previouslyCompared","aKeys","definedKeys","bKeys","keyCount","aIterator","isMap","info","aKey","aValue","aCode","endsWith","full","suffix","fromIndex","nativeCodeSuffix","isDefinedKey","bSet","_extends","NetworkStatus","isNetworkRequestInFlight","networkStatus","selectedTagIdState","selectedSortOrderState","selectedMediaTypeState","selectedInspectorViewState","selectedAssetIdState","selectedAssetCollectionIdState","searchTermState","loadingState","initialLoadCompleteState","currentPageState","currentPageState_1","initialLoadComplete_1","loadingState_1","searchTermState_1","selectedAssetCollectionIdState_1","selectedAssetIdState_1","selectedInspectorViewState_1","selectedMediaTypeState_1","selectedSortOrderState_1","selectedTagIdState_1","_defineProperties","props","descriptor","_createClass","Constructor","protoProps","staticProps","_assertThisInitialized","self","ReferenceError","plainObjectConstrurctor","cloneStyle","style","newStyle","createRule","decl","jss","declCopy","rule","plugins","onCreateRule","by","toCssValue","ignoreImportant","cssValue","indentStr","indent","toCss","_options$indent","fallbacks","fallback","prop","_prop","_value","_prop2","_value2","allowEmpty","escapeRegex","nativeEscape","CSS","escape","replace","BaseStyleRule","isProcessed","renderer","renderable","sheet","Renderer","force","onChangeValue","isDefined","removeProperty","setProperty","attached","_BaseStyleRule","StyleRule","selectorText","scoped","generateId","_proto2","applyTo","json","opts","link","setSelector","replaceRule","pluginStyleRule","defaultToStringOptions","atRegExp","ConditionalRule","styles","query","rules","atMatch","_proto","getRule","addRule","onProcessRule","keyRegExp","pluginConditionalRule","defaultToStringOptions$1","nameRegExp","KeyframesRule","frames","nameMatch","keyRegExp$1","refRegExp","findReferencedKeyframe","keyframes","replaceRef","refKeyframe","onProcessStyle","KeyframeRule","_len","pluginKeyframeRule","FontFaceRule","keyRegExp$2","pluginFontFaceRule","ViewportRule","pluginViewportRule","SimpleRule","keysMap","defaultUpdateOptions","forceUpdateOptions","RuleList","counter","classes","ruleOptions","_this$options","register","unregister","update","data","updateOne","_this$options2","styleRule","onUpdate","nextValue","_nextValue","_prevValue","css","StyleSheet","deployed","queue","attach","deploy","detach","insertRule","addRules","deleteRule","_this$rules","PluginsRegistry","internal","external","registry","onProcessSheet","processedValue","use","newPlugin","plugin","SheetsRegistry","_temp","globalThis$1","globalThis","createGenerateId","ruleCounter","jssId","prefix","classNamePrefix","minify","memoize","getPropertyValue","cssRule","attributeStyleMap","err","getHead","querySelector","findPrevNode","registry$1","findHigherSheet","insertionPoint","element","parentNode","findHighestSheet","nextSibling","comment","findCommentNode","text","childNodes","nodeType","trim","getNonce","getAttribute","_insertRule","container","appendRule","cssRules","getValidRuleInsertionIndex","maxIndex","DomRenderer","hasInsertedRules","media","meta","createStyle","el","textContent","setAttribute","nonce","insertStyle","nextNode","insertBefore","insertionPointElement","appendChild","removeChild","insertRules","nativeParent","latestNativeParent","_insertionIndex","refCssRule","ruleStr","insertionIndex","nativeRule","getRules","instanceCounter","Jss","setup","createStyleSheet","removeStyleSheet","createRule$1","getDynamicStyles","to","extracted","SheetsManager","sheets","refs","manage","unmanage","hasCSSTOMSupport","defineInspect","classObject","inspect","nodejsCustomInspectSymbol","Location","startToken","endToken","end","Token","line","column","isNode","maybeNode","TAGS","TAG","SET_SELECTED_ASSET_SOURCE_ID","SELECTED_ASSET_SOURCE_ID","CONFIG","ASSET_SOURCES","ASSET_COUNT","ASSET_COLLECTIONS","ASSET_COLLECTION","ASSETS","ASSET","asset_1","assets_1","assetCollection_1","assetCollections_1","assetCount_1","assetSources_1","config_1","tag_1","tags_1","selectedAssetSource_1","defaultMakeData","Trie","weakness","makeData","lookup","lookupArray","getChildTrie","isObjRef","weak","strong","defaultDispose","Cache","dispose","newest","oldest","older","newer","clean","parentEntrySlot","maybeUnsubscribe","entryOrDep","emptySetPool","assert","optionalMessage","valueGet","Entry","childValues","dirtyChildren","dirty","recomputing","mightBeDirty","recompute","rememberParent","getValue","reportDirtyChild","reportCleanChild","reallyRecompute","forgetChildren","withValue","recomputeNewValue","maybeSubscribe","setDirty","setClean","reportClean","reportDirty","forgetChild","dependOn","forgetDeps","childValue","valueCopy","valueIs","removeDirtyChild","dc","depsByKey","depend","dep_1","keyTrie","defaultMakeCacheKey","caches","wrap","originalFunction","keyArgs","makeCacheKey","optimistic","hasValue","forget","fromError","errorValue","fromPromise","throwServerError","response","statusCode","status","validateOperation","OPERATION_FIELDS","createOperation","starting","transformOperation","transformedOperation","extensions","operationName","isApolloError","ApolloError","graphQLErrors","networkError","errorMessage","extraInfo","graphQLError","getApolloContext","displayName","ApolloConsumer","ApolloContext","Consumer","client","ApolloProvider","DocumentType","Query","Mutation","Subscription","parser","cached","queries","mutations","payload","UPDATE_TAG","UPDATE_ASSET_COLLECTION","UPDATE_ASSET","UNTAG_ASSET","TAG_ASSET","SET_ASSET_TAGS","SET_ASSET_COLLECTIONS","IMPORT_ASSET","DELETE_TAG","DELETE_ASSET_COLLECTION","DELETE_ASSET","CREATE_TAG","CREATE_ASSET_COLLECTION","createAssetCollection_1","createTag_1","deleteAsset_1","deleteAssetCollection_1","deleteTag_1","importAsset_1","setAssetCollections_1","setAssetTags_1","tagAsset_1","untagAsset_1","updateAsset_1","updateAssetCollection_1","updateTag_1","passthrough","forward","of","toLink","ApolloLink","isTerminating","request","LinkError","links","split","leftLink","rightLink","execute","first","second","firstLink","nextLink","onError","setOnError","ASSET_FRAGMENT","templateObject_1","client_1","assetSource_1","iptcProperty_1","file_1","gql","ASSET_SOURCE_FRAGMENT","IPTC_PROPERTY_FRAGMENT","FILE_FRAGMENT","TAG_FRAGMENT","PropertyListItem","PropertyList","IconLabel","Column","AssetLabel","AssetLabel_1","Column_1","IconLabel_1","PropertyList_1","PropertyListItem_1","MainViewState","mainViewState","createTagDialogState","createAssetCollectionDialogState","createAssetCollectionDialogState_1","createTagDialogState_1","mainViewState_1","warning","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","tslib_1","require","readFromConsumerApi","useClipboard","clipboardVisibleState","buildResolvers","ClipboardWatcher","ClipboardItem","ClipboardActions","ClipboardToggle","CLIPBOARD","TOGGLE_CLIPBOARD_STATE","clipboardVisibleState_1","ClipboardQuery_1","useClipboard_1","ClipboardToggle_1","ClipboardItem_1","ClipboardActions_1","ClipboardWatcher_1","mutation_1","currentContext","MISSING_VALUE","idCounter","host","Slot","Date","now","random","context_1","slots","saved","noContext","cacheSlot","consumeAndIterate","items_1","cacheInfoMap","getCacheInfo","vars","forgetCache","rv","recallCache","attachCache","makeVar","listeners","broadcast","listener","onNextChange","broadcastWatches","isBrowser","_objectWithoutPropertiesLoose","excluded","sourceKeys","useUnusedAssetCountQuery","useUnusedAssetsQuery","useAssetUsagesQuery","showUnusedAssetsState","assetUsageDetailsModalState","UsageDetailsMetadataType","USAGE_DETAILS_GROUP_FRAGMENT","UNUSED_ASSETS","AssetUsagesToggleButton","AssetUsagesModal","ASSET_USAGE_DETAILS","assetUsages_1","unusedAssets_1","usageDetailsGroupFragment_1","UsageDetails_1","AssetUsagesModal_1","AssetUsagesToggleButton_1","assetUsageDetailsModalState_1","showUnusedAssetsState_1","useAssetUsages_1","useUnusedAssetsQuery_1","useUnusedAssetCountQuery_1","Main","AssetActions","ListViewItem","ListView","Thumbnail","ThumbnailView","AssetActions_1","ListView_1","ListViewItem_1","Main_1","Thumbnail_1","ThumbnailView_1","MissingFieldError","clientOnly","SYMBOL_TO_STRING_TAG","getLocation","position","lineRegexp","exec","printLocation","location","printSourceLocation","sourceLocation","firstLineColumnOffset","locationOffset","whitespace","lineIndex","lineOffset","lineNum","columnOffset","columnNum","locationStr","lines","locationLine","subLineIndex","floor","subLineColumnNum","subLines","printPrefixedLines","subLine","existingLines","padLen","_ref2","_ref3","leftPad","_possibleConstructorReturn","_wrapNativeSuper","Class","_cache","_isNativeFunction","Wrapper","_construct","_getPrototypeOf","_setPrototypeOf","Parent","_isNativeReflectConstruct","construct","instance","sham","Proxy","_Error","_inherits","subClass","superClass","GraphQLError","_createSuper","Derived","hasNativeReflectConstruct","_createSuperInternal","Super","NewTarget","positions","originalError","_locations2","_source2","_positions2","_extensions2","_classCallCheck","_nodes$0$loc","_nodes","_source","loc","_locations","_positions","pos","_extensions","originalExtensions","isObjectLike","defineProperties","locations","stack","captureStackTrace","printError","output","_i2","_error$nodes2","_i4","_error$locations2","syntaxError","description","Kind","NAME","DOCUMENT","OPERATION_DEFINITION","VARIABLE_DEFINITION","SELECTION_SET","FIELD","ARGUMENT","FRAGMENT_SPREAD","INLINE_FRAGMENT","FRAGMENT_DEFINITION","VARIABLE","INT","FLOAT","STRING","BOOLEAN","NULL","ENUM","LIST","OBJECT","OBJECT_FIELD","DIRECTIVE","NAMED_TYPE","LIST_TYPE","NON_NULL_TYPE","SCHEMA_DEFINITION","OPERATION_TYPE_DEFINITION","SCALAR_TYPE_DEFINITION","OBJECT_TYPE_DEFINITION","FIELD_DEFINITION","INPUT_VALUE_DEFINITION","INTERFACE_TYPE_DEFINITION","UNION_TYPE_DEFINITION","ENUM_TYPE_DEFINITION","ENUM_VALUE_DEFINITION","INPUT_OBJECT_TYPE_DEFINITION","DIRECTIVE_DEFINITION","SCHEMA_EXTENSION","SCALAR_TYPE_EXTENSION","OBJECT_TYPE_EXTENSION","INTERFACE_TYPE_EXTENSION","UNION_TYPE_EXTENSION","ENUM_TYPE_EXTENSION","INPUT_OBJECT_TYPE_EXTENSION","TokenKind","SOF","EOF","BANG","DOLLAR","AMP","PAREN_L","PAREN_R","SPREAD","COLON","EQUALS","AT","BRACKET_L","BRACKET_R","BRACE_L","PIPE","BRACE_R","BLOCK_STRING","COMMENT","devAssert","instanceOf","Source","DirectiveLocation","QUERY","MUTATION","SUBSCRIPTION","SCHEMA","SCALAR","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","Lexer","startOfFileToken","lastToken","token","lineStart","advance","lookahead","_token$next","readToken","printCharCode","code","isNaN","fromCharCode","toUpperCase","lexer","bodyLength","_line","_col","readComment","readBlockString","readString","readNumber","readName","unexpectedCharacterMessage","col","firstCode","isFloat","readDigits","isNameStart","chunkStart","charCode","char2hex","invalidSequence","rawValue","Parser","sourceObj","isSource","_lexer","_options","parseName","expectToken","parseDocument","many","parseDefinition","parseOperationDefinition","parseFragmentDefinition","parseTypeSystemDefinition","parseTypeSystemExtension","peekDescription","unexpected","parseSelectionSet","parseOperationType","parseVariableDefinitions","parseDirectives","operationToken","optionalMany","parseVariableDefinition","parseVariable","parseTypeReference","expectOptionalToken","parseValueLiteral","parseSelection","parseFragment","parseField","nameOrAlias","parseArguments","isConst","parseConstArgument","parseArgument","hasTypeCondition","expectOptionalKeyword","parseFragmentName","typeCondition","parseNamedType","_this$_options","expectKeyword","experimentalFragmentVariables","parseList","parseObject","parseStringLiteral","block","any","_this2","parseObjectField","parseDirective","keywordToken","parseSchemaDefinition","parseScalarTypeDefinition","parseObjectTypeDefinition","parseInterfaceTypeDefinition","parseUnionTypeDefinition","parseEnumTypeDefinition","parseInputObjectTypeDefinition","parseDirectiveDefinition","parseDescription","operationTypes","parseOperationTypeDefinition","interfaces","parseImplementsInterfaces","parseFieldsDefinition","_this$_options2","allowLegacySDLImplementsInterfaces","types","delimitedMany","_this$_options3","allowLegacySDLEmptyFields","parseFieldDefinition","parseArgumentDefs","parseInputValueDef","parseUnionMemberTypes","parseEnumValuesDefinition","parseEnumValueDefinition","parseInputFieldsDefinition","parseSchemaExtension","parseScalarTypeExtension","parseObjectTypeExtension","parseInterfaceTypeExtension","parseUnionTypeExtension","parseEnumTypeExtension","parseInputObjectTypeExtension","repeatable","parseDirectiveLocations","parseDirectiveLocation","_this$_options4","noLocation","getTokenKindDesc","getTokenDesc","atToken","openKind","parseFn","closeKind","delimiterKind","isPunctuatorTokenKind","docCache","fragmentSourceMap","printFragmentWarnings","normalize","string","processFragments","ast","seenKeys","cacheKeyFromLoc","substring","sourceKeySet","cacheKey","parsed","parse","stripLoc","workSet","literals","gql_1","extras","_inheritsLoose","Dialog","Dialog_1","useAssetCount","useViewModeSelection","VIEW_MODES","useViewModeSelection_1","useAssetCount_1","uploadDialogVisibleState","uploadDialogVisibleState_1","UPLOAD_TYPE","recoil_1","visible","uploadType","new","TagSelectBoxAssetCollection","TagSelectBoxAsset","TagSelectBox","TagInspector","MetadataView","IptcMetadataInspector","CollectionSelectBox","AssetCollectionInspector","AssetInspector","AssetInspector_1","AssetCollectionInspector_1","IptcMetadataInspector_1","MetadataView_1","TagInspector_1","TagSelectBox_1","TagSelectBoxAsset_1","TagSelectBoxAssetCollection_1","CollectionSelectBox_1","parseAndCheckHttpResponse","bodyText","parseError","serializeFetchParameter","serialized","print","leave","printDocASTReducer","Name","Document","varDefs","VariableDefinition","argsLine","_ref4","_ref5","InlineFragment","_ref6","_ref7","IntValue","_ref8","FloatValue","_ref9","StringValue","_ref10","BooleanValue","_ref11","NullValue","EnumValue","_ref12","ListValue","_ref13","ObjectValue","_ref14","ObjectField","_ref15","_ref16","NamedType","_ref17","ListType","_ref18","NonNullType","_ref19","SchemaDefinition","addDescription","_ref20","OperationTypeDefinition","_ref21","ScalarTypeDefinition","_ref22","ObjectTypeDefinition","_ref23","FieldDefinition","_ref24","hasMultilineItems","InputValueDefinition","_ref25","InterfaceTypeDefinition","_ref26","UnionTypeDefinition","_ref27","EnumTypeDefinition","_ref28","EnumValueDefinition","_ref29","InputObjectTypeDefinition","_ref30","DirectiveDefinition","_ref31","SchemaExtension","_ref32","ScalarTypeExtension","_ref33","ObjectTypeExtension","_ref34","InterfaceTypeExtension","_ref35","UnionTypeExtension","_ref36","EnumTypeExtension","_ref37","InputObjectTypeExtension","_ref38","maybeArray","_maybeArray$filter$jo","separator","maybeString","isMultiline","fallbackHttpConfig","http","includeQuery","includeExtensions","headers","accept","selectHttpOptionsAndBody","fallbackConfig","configs","credentials","checkFetcher","fetcher","fetch","createSignalIfSupported","AbortController","controller","signal","selectURI","fallbackURI","contextURI","getContext","uri","rewriteURIForGET","chosenURI","queryParams","addQueryParam","encodeURIComponent","serializedVariables","serializedExtensions","preFragment","fragmentStart","substr","queryParamsPrefix","newURI","createHttpLink","linkOptions","useGETForQueries","_b","includeUnusedVariables","requestOptions","linkConfig","fetchOptions","clientAwarenessHeaders","clientAwareness","name_1","contextHeaders","contextConfig","unusedNames_1","_c","_controller","_d","setContext","abort","HttpLink","argsFromFieldSpecifier","spec","defaultDataIdFromObject","keyObject","nullKeyFieldsFn","simpleKeyArgsFn","_args","mergeTrueFn","incoming","mergeObjects","mergeFalseFn","Policies","typePolicies","toBeAdded","supertypeMap","fuzzySubtypes","rootIdsByTypename","rootTypenamesById","usingPossibleTypes","dataIdFromObject","setRootTypename","possibleTypes","addPossibleTypes","addTypePolicies","identify","ROOT_QUERY","policy","getTypePolicy","keyFn","specifierOrId","keyFieldsFnFromSpecifier","queryType","mutationType","subscriptionType","updateTypePolicy","keyFields","setMerge","getFieldPolicy","read","keyArgsFnFromSpecifier","which","rootId","supertype","getSupertypeSet","subtype","RegExp","policy_1","supertypes","inbox","createIfMissing","fieldPolicies","supertypeSet","fragmentMatches","typenameSupertypeSet","workQueue_1","maybeEnqueue_1","needToCheckFuzzySubtypes","regExp","fuzzyString","hasKeyArgs","getStoreFieldName","fieldSpec","specifierOrString","readField","objectOrReference","getFieldValue","readOptions","makeFieldFunctionOptions","getStorage","getMergeFunction","parentTypename","childTypename","runMergeFunction","storage","makeMergeObjectsFunction","policies","toReference","canRead","isReference","fieldNameOrOptions","eType","iType","specifier","computeKeyObject","trie","aliasMap","makeAliasMap","workQueue","responseKey","storeKey","aliases","subsets","strict","prevKey","keyObj","subset","responseName","for","ASSET_COLLECTION_FRAGMENT","assetUpdatedEvent","assetRemovedEvent","assetCreatedEvent","createEvent","createEvent_1","humanFileSize","humanFileSize_1","AssetPreview","selectedAssetForPreviewState","AssetPreview_1","selectedAssetForPreviewState_1","ReactDOM","ApolloCache","getFragmentDoc","recordOptimisticTransaction","transaction","optimisticId","performTransaction","transformDocument","gc","transformForLink","readQuery","returnPartialData","readFragment","writeQuery","write","dataId","writeFragment","Reobserver","shouldFetch","reobserve","newOptions","newNetworkStatus","updateOptions","updatePolling","concast","stop","pollingInfo","timeout","pollInterval","interval","maybeFetch","fetchPolicy","nextFetchPolicy","poll","ObservableQuery","queryManager","queryInfo","onSubscribe","lastError","isDifferentFromLastResult","updateLastResult","lastResult","loading","isTornDown","queryId","generateQueryId","opDef","queryName","removeQuery","getCurrentResult","saveAsLastResult","ready","partial","transform","hasForcedResolvers","diff","getDiff","newResult","lastResultSnapshot","getLastResult","getLastError","resetLastResults","resetQueryStoreErrors","resetErrors","refetch","reobserveOptions","newReobserver","fetchMore","fetchMoreOptions","combinedOptions","qid","notifyOnNetworkStatusChange","observe","fetchQuery","fetchMoreResult","updateQuery","previous","stopQuery","subscribeToMore","startGraphQLSubscription","subscriptionData","setOptions","setVariables","previousResult","broadcastQueries","startPolling","getReobserver","stopPolling","reobserver","assumeImmutableResults","subObserver","_subscription","_observer","defaultSubscriptionObserverErrorCallback","tearDownQuery","shareOptions","setObservableQuery","currentOptions","fetchQueryObservable","ssrMode","hasObservers","formatValue","seenValues","formatObjectValue","previouslySeenValues","customInspectFn","getCustomFn","customValue","formatArray","min","remaining","items","formatObject","getObjectTag","tag","dedentBlockStringValue","rawString","commonIndent","getBlockStringIndentation","_commonIndent","isFirstLine","isEmptyLine","startLine","isBlank","endLine","printBlockString","indentation","preferMultipleLines","isSingleLine","hasLeadingSpace","hasTrailingQuote","hasTrailingSlash","printAsMultipleLines","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","defaultProps","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","propTypes","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","compare","TYPE_STATICS","getStatics","component","isMemo","ForwardRef","render","Memo","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","Notify_1","MediaUiProvider_1","Intl_1","MediaUiTheme_1","NotifyContext","react_1","notificationApi","notice","title","ok","state_1","queries_1","selectedTagId","useQuery","skip","selectedAssetCollectionId","assetCollection","PAGINATION_MAXIMUM_LINKS","ASSETS_PER_PAGE","templateObject_2","clipboard","mutateClipboard","useMutation","inClipboard","assetId","toggleClipboardState","assetIdentity","cachedClipboard","isInClipboard","flushClipboard","similarAssetsModalState","UploadSection","UploadDialog","UploadButton","ReplaceAssetDialog","PreviewSection","NewAssetDialog","FilePreview","AssetReplacementButton","NewAssetDialog_1","ReplaceAssetDialog_1","UploadDialog_1","FilePreview_1","PreviewSection_1","UploadSection_1","AssetReplacementButton_1","UploadButton_1","react_dropzone_1","src_1","hooks_1","helper_1","useStyles","theme","dropzone","display","flexDirection","alignItems","padding","spacing","goldenUnit","borderWidth","borderRadius","borderColor","isDragAccept","isDragActive","isDragReject","colors","success","primary","disabled","borderStyle","backgroundColor","alternatingBackground","color","outline","cursor","userSelect","transition","memo","acceptedFileTypes","files","maxFiles","onSetFiles","translate","Notify","dummyImage","maxFilesToUpload","uploadMaxFileUploadLimit","useDropzone","onDrop","acceptedFiles","spotsLeft","limit","newFiles","file","lastModified","preview","URL","createObjectURL","onDropRejected","rejections","rejection","acc","uploadMaxFileSize","multiple","preventDropOnDocument","getRootProps","getInputProps","className","fileList","marginTop","flexWrap","fileListHeader","flex","marginBottom","fontSize","uploadState","selected","Fragment","fileState","filename","finished","REPLACE_ASSET","UPLOAD_FILE","UPLOAD_FILES","replaceAsset_1","uploadFiles_1","uploadFile_1","canUseDOM","SafeNodeList","SafeHTMLCollection","EE","_interopRequireDefault","SafeHTMLElement","HTMLElement","HTMLCollection","NodeList","react_ui_components_1","propertyGroup","Label","mainBackground","bottom","hasUnpublishedChanges","handleApply","handleDiscard","Button","hoverStyle","onClick","inspector","gridTemplateColumns","gridAutoRows","gridGap","width","LocalState","resolvers","fragmentMatcher","addResolvers","setFragmentMatcher","resolverGroup","setResolvers","getResolvers","runResolvers","remoteResult","onlyRunForcedResolvers","resolveDocument","localResult","getFragmentMatcher","clientQuery","serverQuery","prepareContext","getCacheKey","addExportedVariables","buildRootValueFromCache","exportedVariables","shouldForceResolvers","forceResolvers","rootValue","mainDefinition","definitionOperation","defaultOperationType","execContext","charAt","resolveSelectionSet","resultsToMerge","resolveField","fieldResult","fragmentResult","aliasedFieldName","aliasUsed","defaultResult","resultPromise","resolverType","resolverMap","resolveSubSelectedArray","destructiveMethodCounts","wrapDestructiveCacheMethod","methodName","original","cancelNotifyTimeout","QueryInfo","lastRequestId","stopped","observableQuery","updateWatch","setDiff","oldDiff","notifyTimeout","notify","oq","oqListener","fromOptimisticTransaction","shouldNotify","lastWatch","watch","shouldWrite","lastWrite","dmCount","markResult","allowCacheWrite","shouldWriteResult","errorPolicy","markReady","markError","ignoreErrors","writeWithErrors","QueryManager","queryDeduplication","onBroadcast","localState","fetchCancelFns","transformCache","queryIdCounter","requestIdCounter","mutationIdCounter","inFlightLinkObservables","mutationStore","_info","stopQueryNoBroadcast","cancelPendingFetches","mutation","optimisticResponse","updateQueries","refetchQueries","awaitRefetchQueries","updateWithProxyFn","_e","mutationId","mutationStoreValue","_f","generateMutationId","getVariables","markMutationOptimistic","storeResult","getObservableFromLink","markMutationResult","removeOptimistic","refetchQueryPromises","refetchQuery","queryOptions","cacheWrites_1","updateQueries_1","currentQueryResult","nextQueryResult","mutationResult","queryVariables","getQueryStore","transformed","forLink","cacheEntry_1","defaultVars","watchQuery","generateRequestId","stopQueryInStore","stopQueryInStoreNoBroadcast","clearStore","resetStore","reFetchObservableQueries","includeStandby","observableQueryPromises","getQuery","makeObservable","observablePromise_1","getLocalState","deduplication","inFlightLinkObservables_1","forceFetch","byVariables_1","varJson_1","getResultsFromLink","requestId","hasErrors","aqr","oldNetworkStatus","normalized","fromVariables","fetchQueryByPolicy","readCache","resultsFromCache","fromData","resolved","resultsFromLink","newContext","mergeOptions","defaults","ApolloClient","defaultOptions","resetStoreCallbacks","clearStoreCallbacks","ssrForceFetchDelay","connectToDevTools","__APOLLO_CLIENT__","typeDefs","clientAwarenessName","clientAwarenessVersion","disableNetworkFetches","devToolsHookCb","dataWithOptimisticResults","extract","__actionHookForDevTools","__requestRaw","onResetStore","onClearStore","restore","serializedState","setLocalStateFragmentMatcher","setLink","newLink","Observable","global","AbstractRegistry_1","positional_array_sorter_1","SynchronousRegistry","_registry","indexOfItemWithTheSameKey","findIndex","_getChildrenWrapped","searchKey","unsortedChildren","getChildrenAsObject","getChildren","_getAllWrapped","getAllAsObject","getAllAsList","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","draining","queueIndex","cleanUpNextTick","drainQueue","run","runClearTimeout","marker","Item","noop","nextTick","browser","argv","versions","on","addListener","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","binding","cwd","chdir","umask","originalModule","webpackPolyfill","ReactNativeFile","isExtractableFile","File","Blob","formDataAppendFile","formData","append","SORT_DIRECTION","SORT_BY","sortBy","LastModified","sortDirection","Desc","assetSourceId","asset","pubsub_js_1","topic","event","publish","subscriber","PersistentStateManager","IdFromObjectResolver","CacheFactory","ApolloErrorHandler","IdFromObjectResolver_1","ApolloErrorHandler_1","Cache_1","NEOS_ASSET_SOURCE","VIEW_MODE_SELECTION","SET_VIEW_MODE_SELECTION","ViewModeSelectionQuery_1","assetUsageDetails","clipboardItem","minWidth","height","objectFit","selectAsset","src","thumbnailUrl","updateLocalState","carry","AssetChangeType","changedAssets_1","AssetLastModifiedFragment","useChangedAssetsQuery","lastUpdate","setLastUpdate","changes","setChanges","since","currentServerTime","changedAssets","relevantChanges","change","ASSET_CREATED","CHANGED_ASSETS","SIMILAR_ASSETS","useSimilarAssetsQuery","SimilarAssetsModal","SimilarAssetsToggleButton","SimilarAssetsToggleButton_1","SimilarAssetsModal_1","similarAssetsModalState_1","useSimilarAssets_1","similarAssets_1","similarAssets","components_1","uploadArea","useUploadFiles","uploadFiles","useUploadDialogState","dialogState","closeDialog","setFiles","refetchAssets","uploadPossible","handleUpload","handleSetFiles","isOpen","onRequestClose","thumb","border","half","marginRight","quarter","boxSizing","thumbInner","justifyContent","marginLeft","img","top","zIndex","stateOverlay","content","opacity","extend","stateClassName","Icon","icon","spin","useUploadFile","useUploadDialogState_1","useUploadFile_1","useUploadFiles_1","hooks_2","useReplaceAsset_1","optionSection","option","selectedAsset","replaceAsset","keepOriginalFilename","generateRedirects","replacementOptions","setReplacementOptions","mainType","mediaType","groups","CheckBox","isChecked","onChange","findTabbableDescendants","querySelectorAll","tabbable","tabbableNode","hidesContents","zeroSize","offsetWidth","offsetHeight","innerHTML","getComputedStyle","scrollWidth","scrollHeight","focusable","isTabIndexNotNaN","nodeName","toLowerCase","href","parentElement","tabIndex","isTabIndexNaN","assertNodeList","setElement","useElement","_safeHTMLElement","globalElement","validateElement","hide","appElement","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","return","show","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","removeAttribute","documentNotReadyOrSSRTesting","resetForTesting","_warning2","nodeList","portalOpenInstances","PortalOpenInstances","openInstance","openInstances","deregister","eventType","AssetCollectionTree","SideBarLeft","AssetSourceDescription","AssetSourceList","AssetSourceList_1","AssetSourceDescription_1","SideBarLeft_1","Tree_1","AssetCollectionTree_1","COLLECTION","media_type_1","currentSelection","overflow","headline","fontWeight","lineHeight","whiteSpace","textOverflow","selectedAssetCollection","selectedTag","selectedInspectorView","mainMediaType","fromString","Headline","assetCount","alignSelf","pagination_1","PaginationItem_1","state_2","pagination","justifySelf","listStyleType","textAlign","ellipsis","currentPage","setCurrentPage","mainView","DEFAULT","numberOfPages","ceil","hasLessPages","hasMorePages","pages","displayRange","setDisplayRange","handlePageClick","page","handlePreviousPageClick","handleNextPageClick","maxLinks","ViewModeSelector","TypeFilter","TopBar","SearchBox","SearchBox_1","TopBar_1","TypeFilter_1","ViewModeSelector_1","src_2","IconButton","useApolloClient","OperationData","isMounted","previousOptions","getOptions","storePrevious","unmount","refreshClient","isNew","verifyDocumentType","SubscriptionData","setResult","currentObservable","initialize","currentResult","getLoadingResult","shouldResubscribe","startSubscription","afterExecute","endSubscription","updateCurrentData","updateError","completeSubscription","updateResult","onSubscriptionData","onSubscriptionComplete","MutationData","runMutation","mutationFunctionOptions","onMutationStart","generateNewMutationId","onMutationCompleted","onMutationError","mostRecentMutationId","ignoreResults","onCompleted","isMostRecentMutation","QueryData","onNewData","runLazy","runLazyQuery","lazyOptions","getQueryResult","observableQueryFields","partialRefetch","previousData","obsRefetch","obsFetchMore","obsUpdateQuery","obsStartPolling","obsStopPolling","obsSubscribeToMore","removeQuerySubscription","removeObservable","updateObservableQuery","startQuerySubscription","getExecuteSsrResult","getExecuteResult","executeLazy","fetchData","ssr","lazy","handleErrorOrCompleted","ssrInitiated","renderPromises","ssrDisabled","fetchDisabled","ssrLoading","stale","addQueryPromise","prepareObservableQueryOptions","initializeObservableQuery","getSSRObservable","observableQueryOptions","registerSSRObservable","newObservableQueryOptions","currentSubscription","resubscribeToQuery","andDelete","useBaseQuery","tick","updatedOptions","queryDataRef","queryData","useDeepMemo","memoFn","queryResult","useLazyQuery","mutationDataRef","mutationData","getMutationDataRef","useSubscription","subscriptionDataRef","getSubscriptionDataRef","useReactiveVar","setValue","EntityStore","Root","DELETE","delModifier","INVALIDATE","group","rootIds","objOrRef","objOrIdOrRef","mergeIntoStore","toObject","storeObject","dependOnExistence","merged","storeObjectReconciler","caching","fieldsToDirty_1","__exists","changedFields_1","needToMerge_1","allDeleted_1","sharedDetails_1","fieldValue","evict","evicted","extraRootIds","getRootIdSet","__META","newData","rest_1","ids","findChildRefIds","idsToRemove","root_1","found_1","workSet_1","canTraverse_1","keyMaker","CacheGroup","makeDepKey","resultCaching","seed","storageTrie","sharedLayerGroup","addLayer","layerId","replay","removeLayer","Layer","fromParent","existingObject","incomingObject","existingValue","incomingValue","supportsResultCaching","missingFromInvariant","StoreReader","executeSelectionSet","execSelectionSetImpl","varString","knownResults","executeSubSelectedArray","execSubSelectedArrayImpl","addTypename","diffQueryAgainstStore","execResult","hasMissingFields","missing","isFresh","objectsToMerge","finalResult","getMissing","handleMissing","resultName","wasClientOnly","childResult","StoreWriter","reader","writeToStore","operationDefinition","processSelectionSet","mergeTree","written","incomingFields","resultFieldKey","childTree","getChildMergeTree","processFieldValue","maybeRecycleChildMergeTree","entityRef_1","applyMerges","getStorageArgs","e_1","i_1","getValue_1","eVal","iVal","aVal","emptyMergeTreePool","defaultConfig","InMemoryCache","watches","typenameDocumentCache","txCount","maybeBroadcastWatch","broadcastWatch","optimisticData","watchDep","storeWriter","storeReader","immediate","idToRemove","newOptimisticData","perform","layer","QueryDocumentKeys","BREAK","visitor","visitorKeys","inArray","edits","ancestors","isLeaving","isEdited","_Object$keys2","editOffset","ii","editKey","editValue","_visitorKeys$node$kin","visitFn","getVisitFn","kindVisitor","kindSpecificVisitor","specificVisitor","specificKindVisitor","cmp","cycles","aobj","bobj","isFinite","seenIndex","symbolObservablePonyfill","acceptedFilesArray","fileName","mimeType","baseMimeType","validType","_Modal2","globalRegistry","frontendConfiguration","secondaryEditorsRegistry","useNewMediaSelection","MediaSelectionScreen","createConsumerApi_1","createConsumerApi","readFromConsumerApi_1","index_1","SynchronousMetaRegistry","manifest_1","createReadOnlyValue","manifests","exposureMap","api","identifier","bootstrap","SynchronousRegistry_1","SynchronousMetaRegistry_1","AbstractRegistry","SERIAL_VERSION_UID","positionalArraySorter","subject","idKey","e_2","e_3","e_4","e_5","e_6","e_7","_g","positionAccessor","indexMapping","middleKeys","startKeys","endKeys","beforeKeys","afterKeys","positionValue","invalid","startsWith","weight","weightMatch","reference","numberPosition","parseFloat","resultStart","resultMiddle","resultEnd","processedKeys","sortedWeights","dict","asc","weights","reverse","addToResults","e_8","e_9","beforeWeights","beforeWeights_1","beforeWeights_1_1","e_8_1","afterWeights","afterWeights_1","afterWeights_1_1","e_9_1","_h","_j","e_1_1","_k","_l","e_2_1","_m","_o","e_3_1","_p","_q","_r","_s","e_5_1","e_4_1","_t","_u","_w","e_7_1","e_6_1","react_redux_1","apollo_upload_client_1","plow_js_1","neos_ui_decorators_1","neos_ui_redux_store_1","core_1","App_1","schema_graphql_1","schema_graphql_2","schema_graphql_3","mutation_2","apolloClient","packageKey","sourceName","i18nRegistry","initialLeftSideBarHiddenState","initialNodeCreationDialogOpenState","componentDidMount","isLeftSideBarHidden","isNodeCreationDialogOpen","toggleSidebar","componentWillUnmount","getConfig","endpoints","graphql","upload","getApolloClient","createCache","restoreLocalState","constraints","createUploadLink","addFlashMessage","onComplete","containerRef","createRef","featureFlags","Notification","isInNodeCreationDialog","onAssetSelection","selectionMode","assetType","connect","$transform","$get","UI","FlashMessages","LeftSideBar","toggle","neos","PureComponent","reactRedux","hasSymbols","hasSymbol","getSymbol","SymbolIterator","SymbolObservable","SymbolSpecies","getMethod","getSpecies","ctor","isObservable","hostReportError","enqueue","cleanupSubscription","_cleanup","closeSubscription","_queue","notifySubscription","onNotify","flushSubscription","subscriptionObserver","SubscriptionObserver","_subscriber","_this3","_this4","C","hasSeed","_this5","startNext","flatMap","_this6","outer","inner","completeIfDone","closed","_item","_len2","_key2","symbol","_require","_require2","extractFiles","_ref$uri","fetchUri","_ref$isExtractableFil","customIsExtractableFile","CustomFormData","FormData","_ref$formDataAppendFi","customFormDataAppendFile","customFetch","_context$clientAwaren","_selectHttpOptionsAnd","_extractFiles","form","paths","_rewriteURIForGET","addEventListener","runtimeFetch","cleaningUp","defaultIsExtractableFile","addFile","storedPaths","FileList","plow","NeosUiDecorators","NeosUiReduxStore","MediaUiContext","matcher_1","deleteAsset","importAsset","assets","setSelectedMediaType","handleDeleteAsset","confirm","assetSource","isAssetSelectable","mediaTypes","isMatch","assetSources","handleSelectAsset","includeUsage","localId","assetCollections","searchTerm","assetCollectionId","tagId","mediaTypeFilter","sortOrderState","isLoading","setIsLoading","setInitialLoadComplete","setAssets","offset","mutations_1","createAssetCollection","createTag","proxy","newTag","updatedAssetCollections","tags","events_1","selectedAssetId","setSelectedAsset","assetRemoved","factory","PubSub","messages","lastUid","callSubscriberWithDelayedExceptions","ex","throwException","reThrowException","callSubscriberWithImmediateExceptions","deliverMessage","originalMessage","matchedMessage","immediateExceptions","callSubscriber","hasDirectSubscribersFor","hasKeys","sync","deliver","createDeliveryFunction","deliverNamespaced","messageHasSubscribers","found","publishSync","func","subscribeAll","subscribeOnce","clearAllSubscriptions","clearSubscriptions","countSubscriptions","getSubscriptions","isTopic","descendantTopicExists","isToken","isFunction","deprecate","deleteAssetCollection","setSelectedTagId","deleteTag","setSelectedAssetId","setSelectedInspectorView","setSelectedAssetCollectionId","selectedAssetSourceId","selectedAssetSource","mutateSelectedAssetSourceId","setAssetCollections","assetCollectionIds","collections","setAssetTags","tagIds","useAssetTagsQuery","untagAsset","tagName","updateAsset","caption","copyrightNotice","updateAssetCollection","updateTag","IntlContext","react_jss_1","jss_1","jss_plugin_cache_1","styleConstants_1","ThemeContext","theming","createTheming","ThemeProvider","useTheme","mediaUiTheme","large","sidebarWidth","scrollbarSize","primaryBlue","contrastBright","contrastNeutral","contrastDark","inactive","generated","deleted","assetBackground","contrastDarkest","captionBackground","moduleBackground","contrastDarker","scrollbarBackground","scrollbarForeground","loadingIndicatorZIndex","paginationZIndex","lightboxZIndex","createUseStyles","w","u","$$typeof","A","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","Lazy","Portal","Profiler","StrictMode","Suspense","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isPortal","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","getDisplayName","Component","cachePlugin","_rule$options","originalStyle","upperFirst","fast","slow","secondaryToolbar","flashMessageContainer","loadingIndicatorContainer","secondaryInspector","secondaryInspectorElevated","dialog","fullScreenClose","drawer","bar","primaryToolbar","checkboxInput","dropdownContents","selectBoxContents","notInlineEditableOverlay","calendarFakeInputMirror","rdtPicker","sideBar","wrapperDropdown","unappliedChangesOverlay","nodeToolBar","small","fonts","headings","family","cssWeight","copy","primaryViolet","primaryVioletHover","primaryBlueHover","contrastBrighter","contrastBrightest","successHover","warnHover","errorHover","uncheckedCheckboxTick","generateCssVarsObject","hasPredicate","camelKey","nestedPredicate","rsAstral","rsCombo","rsFitz","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsSeq","rsSymbol","reUnicode","reHasUnicode","freeGlobal","freeSelf","hasUnicode","stringToArray","unicodeToArray","asciiToArray","objectToString","symbolProto","symbolToString","baseToString","isSymbol","castSlice","baseSlice","createCaseFirst","strSymbols","chr","trailing","dialogRef","section","findDOMNode","firstElementChild","bytes","si","thresh","abs","units","toFixed","resetLocalState","getItem","neos_1","queries_2","writeToCache","viewModeSelection","localStorage","STORAGE_PREFIX","Thumbnails","setItem","mutateViewModeSelection","viewMode","unusedAssetCountLoaded","loadUnusedAssetCount","load","unusedAssetCount","AssetUsageSection_1","assetUsage","usageTable","paddingLeft","paddingRight","textDecoration","setIsOpen","handleRequestClose","usageDetailsGroup","usageSection","usages","metadataSchema","schema","url","rel","usage","toLocaleString","assetUsagesModalOpen","setAssetUsagesModalOpen","showUnusedAssets","unusedAssets","unusedAssetCount_1","UNUSED_ASSET_COUNT","clipboardVisible","margin","setClipboardVisible","initialLoadComplete","toggleClipboard","clipboardActions","onDeleteClipboard","onFlushClipboard","category","errorHandler","retriedSub","retriedResult","ErrorLink","queryAssetUsage","Asset","Tag","AssetCollection","AssetSource","src_3","src_4","src_5","src_6","SideBarRight_1","LoadingIndicator_1","BottomBar_1","ErrorBoundary_1","Dialogs_1","gridTemplateRows","gridTemplateAreas","gridColumn","overflowY","gridRight","gridArea","gridLeft","gridMain","gridTop","scrollbarWidth","scrollbarColor","background","paddingTop","paddingBottom","showUploadDialog","showCreateTagDialog","showCreateAssetCollectionDialog","showAssetUsagesModal","showSimilarAssetsModal","BottomBar","SideBarRight","CreateTagDialog","CreateAssetCollectionDialog","ConcurrentChangeMonitor","ConcurrentChangeMonitor_1","useChangedAssetsQuery_1","refetchAsset","ASSET_REPLACED","ASSET_UPDATED","ASSET_REMOVED","debug","similarAssetsModalOpen","setSimilarAssetsModalOpen","SimilarAsset_1","similarAsset","picture","typeIcon","setDialogState","handleClose","revokeObjectURL","uploadFile","useReplaceAsset","setUploadDialogState","react_image_lightbox_1","lightbox","maxWidth","selectedAssetForPreview","setSelectedAssetForPreview","lightBoxContainer","defaultContainer","lightBoxContainerRef","newLightBoxContainer_1","useLightBoxContainer","currentAssetIndex","prevAsset","nextAsset","reactModalStyle","overlay","reactModalProps","parentSelector","wrapperClassName","mainSrc","previewUrl","mainSrcThumbnail","imageTitle","imageCaption","onCloseRequest","prevSrc","prevSrcThumbnail","prevLabel","onMovePrevRequest","nextSrc","nextSrcThumbnail","nextLabel","onMoveNextRequest","_objectSpread","ownKeys","sym","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_arr","_n","_nonIterableRest","_toConsumableArray","_arrayWithoutHoles","arr2","_iterableToArray","_nonIterableSpread","replaceStrings","translated","placeholder","getWindowWidth","innerWidth","KEYS","ReactImageLightbox","_Component","isClosing","animationDisabled","shouldAnimate","zoomLevel","offsetX","offsetY","loadErrorStatus","outerEl","zoomInBtn","zoomOutBtn","closeIfClickInner","handleImageDoubleClick","handleImageMouseWheel","handleKeyInput","handleMouseUp","handleMouseDown","handleMouseMove","handleOuterMousewheel","handleTouchStart","handleTouchMove","handleTouchEnd","handlePointerEvent","handleCaptionMousewheel","handleWindowResize","handleZoomInButtonClick","handleZoomOutButtonClick","requestClose","requestMoveNext","requestMovePrev","isTargetMatchImage","parseMouseEvent","mouseEvent","parseInt","clientX","clientY","parseTouchPointer","touchPointer","parsePointerEvent","pointerEvent","pointerId","getTransform","_ref$x","_ref$y","_ref$zoom","zoom","targetWidth","nextX","scaleFactor","componentWillMount","timeouts","currentAction","eventsSource","pointerList","preventInnerClose","preventInnerCloseTimeout","keyPressed","imageCache","lastKeyDownTime","resizeTimeout","wheelActionTimeout","resetScrollTimeout","scrollX","scrollY","moveStartX","moveStartY","moveStartOffsetX","moveStartOffsetY","swipeStartX","swipeStartY","swipeEndX","swipeEndY","pinchTouchList","pinchDistance","keyCounter","moveRequested","windowContext","getHighestSafeWindowContext","referrer","getOrigin","resize","mouseup","touchend","touchcancel","pointerdown","pointermove","pointerup","pointercancel","loadAllImages","componentWillReceiveProps","nextProps","sourcesChanged","prevSrcDict","nextSrcDict","getSrcTypes","srcType","loaded","shouldComponentUpdate","didUnmount","removeEventListener","tid","_setTimeout","_x","_x2","time","setPreventInnerClose","getBestImageForType","imageSrc","fitSizes","isImageLoaded","getFitSizes","targetHeight","stretch","boxSize","getLightboxRect","maxHeight","imagePadding","getMaxOffsets","currentImageInfo","maxX","minX","maxY","minY","zoomMultiplier","getZoomMultiplier","keyEnding","getBoundingClientRect","innerHeight","_clearTimeout","_x3","changeZoom","enableZoom","nextZoomLevel","imageBaseSize","currentZoomMultiplier","nextZoomMultiplier","boxRect","pointerX","pointerY","currentImageOffsetX","currentImageOffsetY","nextImageRealOffsetX","nextImageRealOffsetY","nextOffsetX","nextOffsetY","maxOffsets","search","stopPropagation","isAnimating","keyCode","currentTime","getTime","keyRepeatLimit","preventDefault","keyRepeatKeyupBonus","_this7","actionDelay","deltaY","deltaX","xThreshold","shouldHandleEvent","filterPointersBySource","addPointer","pointer","removePointer","_this8","multiPointerStart","multiPointerMove","multiPointerEnd","_this9","changedTouches","eventTouch","_this10","touch","decideMoveOrSwipe","handleSwipeStart","handleMoveStart","handleEnd","handlePinchStart","handleMove","handleSwipe","handlePinch","handleMoveEnd","handleSwipeEnd","handlePinchEnd","newOffsetX","newOffsetY","_this11","animationDuration","xDiff","xDiffAbs","yDiffAbs","calculatePinchDistance","sqrt","calculatePinchCenter","oldPointer","newDistance","_this$calculatePinchC","focus","_this$caption$current2","scrollTop","loadImage","_this12","inMemoryImage","Image","imageCrossOrigin","crossOrigin","onerror","errorEvent","onImageLoadError","prevState","onload","onImageLoad","_this13","generateLoadDoneCallback","_this14","closeLightbox","animationOnKeyInput","requestMove","direction","_this15","nextState","_this16","_this$props","clickOutsideToClose","discourageDownloads","toolbarButtons","_onAfterOpen","onAfterOpen","_this$state","transitionStyle","keyEndings","images","addImage","imageClass","transforms","bestImageInfo","imageStyle","hasTrueValue","imageLoadErrorMessage","backgroundImage","onDoubleClick","onWheel","onDragStart","draggable","loadingIcon","modalStyle","contentLabel","animationDirection","onMouseMove","onMouseDown","onTouchStart","onTouchMove","onKeyDown","onKeyUp","button","zoomInLabel","zoomOutLabel","closeLabel","isRequired","bool","number","shape","arrayOf","bodyOpenClassName","portalClassName","_react","_react2","_reactDom2","_propTypes2","_ModalPortal2","ariaAppHider","_interopRequireWildcard","newObj","_safeHTMLElement2","_reactLifecyclesCompat","isReact16","createPortal","getCreatePortal","unstable_renderSubtreeIntoContainer","getParentElement","Modal","removePortal","unmountComponentAtNode","contains","portalRef","portal","renderPortal","defaultStyles","getSnapshotBeforeUpdate","prevProps","prevParent","nextParent","componentDidUpdate","_props","closesAt","closeTimeoutMS","beforeClose","closeWithTimeout","setAppElement","htmlOpenClassName","oneOfType","afterOpen","overlayClassName","ariaHideApp","shouldFocusAfterRender","shouldCloseOnOverlayClick","shouldReturnFocusAfterClose","preventScroll","aria","role","shouldCloseOnEsc","overlayRef","contentRef","overlayElement","contentElement","contentEl","WebkitOverflowScrolling","polyfill","focusManager","_scopeTab2","classList","_portalOpenInstances2","CLASS_NAMES","ariaHiddenInstances","ModalPortal","setOverlayRef","setContentRef","afterClose","getElementsByTagName","returnFocus","teardownScopedFocus","popWithoutFocus","onAfterClose","open","beforeOpen","closeTimer","setupScopedFocus","markForFocusLater","overlayEl","close","closeWithoutTimeout","focusContent","contentHasFocus","handleKeyDown","handleOverlayOnClick","shouldClose","ownerHandlesClose","handleContentOnMouseUp","handleOverlayOnMouseDown","handleContentOnClick","handleContentOnMouseDown","shouldBeClosed","activeElement","buildClassName","additional","classNames","attributesFromObject","moveFromContentToOverlay","_props2","contentStyles","overlayStyles","overlayProps","contentProps","onMouseUp","modal","testId","handleBlur","handleFocus","focusLaterElements","toFocus","modalElement","attachEvent","detachEvent","_tabbable2","needToFocus","scopeTab","shiftKey","checkSafari","userAgent","ExecutionEnvironment","canUseWorkers","Worker","canUseEventListeners","canUseViewport","screen","dumpClassLists","htmlClassList","docBodyClassList","classString","trackClass","classListRef","incrementReference","untrackClass","decrementReference","before","after","instances","bodyTrap","cloneNode","firstChild","lastChild","componentWillUpdate","__reactInternalSnapshotFlag","__reactInternalSnapshot","isReactComponent","foundWillMountName","foundWillReceivePropsName","foundWillUpdateName","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate","newApiName","componentDidUpdatePolyfill","maybeSnapshot","__suppressDeprecationWarning","Presentation_1","assetSourceList","itemSelected","setSelectedAssetSource","iconUri","assetLabel","overflowX","iconWrap","verticalAlign","imgIcon","propertyList","assetSourceDescription","panelHeader","ToggablePanel","closesToBottom","Header","Contents","AssetCollectionTreeNode_1","TagTreeNode_1","AddAssetCollectionButton_1","AddTagButton_1","assetCollectionTree","toolbar","borderTop","tree","selectAssetCollection","selectTag","onClickDelete","supportsCollections","Tree","collapsedByDefault","dndTypes_1","collapsed","setCollapsed","handleToggle","handleClick","Node","isCollapsed","isFocused","hasError","nodeDndType","onToggle","hasChildren","plusIcon","setCreateAssetCollectionDialogState","onClickCreate","setCreateTagDialogState","CurrentSelection","CurrentSelection_1","Inspector_1","Property_1","Actions_1","InspectorContainer_1","textArea","setLabel","setCaption","setCopyrightNotice","isEditable","TextInput","onEnterKey","TextArea","minRows","expandedRows","supportsTagging","showSimilarAssets","readOnly","_1","setTitle","iptcData","iptcProperties","iptcProperty","propertyName","tagSelectBox","tagSelection","MultiSelectBox","noMatchesFoundLabel","optionValueField","searchOptions","onValuesChange","allTags","selectedTagIds","handleChange","newTags","collectionSelectBox","collectionSelection","assetCollectionsWithLabel","newAssetCollectionIds","collection","collectionsMatchAsset","MediaType","_setSubtypeAndSuffix","parameters","isValid","subtypeFacets","fixes","hasSuffix","_firstSubtypeFacetEquals","isVendor","isPersonal","isExperimental","asString","parameterKeys","that","wrapQuotes","mediaTypeMatcher","parameterSplitter","parameter","keyAndValue","unwrapQuotes","transitionTimingFunction","indicator","animation","LoadingIndicator","Pagination","AssetCount","Pagination_1","AssetCount_1","bottomBar","searchBox","setSearchTerm","searchValue","setSearchValue","handleSearch","SortOrderSelector_1","topBar","sortingState","selectBox","setSortOrderState","hideOptionIcon","handleChangeSortBy","handleSwitchSortDirection","Asc","sortByOptions","SelectBox","onValueChange","typeFilter","setMediaTypeFilter","setShowUnusedAssets","mediaTypeOptions","video","audio","image","placeholderIcon","viewModeSelector","setViewModeSelection","List","onImportAsset","imported","isInUse","download","listView","borderSpacing","tableHeader","assetIdentities","onSelect","openPreview","MissingAssetActions_1","listViewItem","textColumn","previewColumn","labelColumn","tableLayout","lastModifiedColumn","fileSizeColumn","mediaTypeColumn","actionsColumn","dateFormatOptions","weekday","year","month","day","isSelected","canBeSelected","onSelectItem","LoadingLabel_1","emptyStateWrapper","setAssetIdentities","queriedAssets","queriedUnusedAssets","loadingText","emptyText","loadingLabel","thumbnail","pointerEvents","alignContent","backgroundPosition","backgroundSize","toolBar","thumbnailView","ErrorBoundary","componentDidCatch","reload","CreateTagDialog_1","CreateAssetCollectionDialog_1","formBody","createPossible","handleCreate","setFocus","setSelectedAssetSourceId","createThemeProvider","_React$Component","outerTheme","getTheme","lastTheme","lastOuterTheme","cachedTheme","_theme","renderProvider","createWithTheme","hoc","withTheme","forwardRef","createUseTheme","_createTheming","fnValuesNs","fnRuleNs","functionPlugin","fnValues","fnRule","observablePlugin","style$","_loop","semiWithNl","cssText","colonIndex","templatePlugin","GlobalContainerRule","GlobalPrefixedRule","separatorRegExp","addScope","scope","parts","jssGlobal","handleNestedGlobalContainerRule","handlePrefixedGlobalRule","valueNs","mergeExtend","singleExtend","refRule","mergeRest","jssExtend","parentRegExp","jssNested","getReplaceRef","replaceParentRefs","nestedProp","parentProp","parentSelectors","nestedSelectors","nested","prevOptions","nestingLevel","isNested","isNestedConditional","jssCompose","registerClass","composes","uppercasePattern","msPattern","toHyphenLower","hyphenateStyleName","hName","convertCase","converted","camelCase","hyphenatedProp","px","ms","percent","addCamelCasedVersion","inset","motion","perspective","gap","grid","iterate","innerProp","_innerProp","unit","defaultUnit","camelCasedOptions","propArray","propArrayInObj","propObj","attachment","repeat","duration","timingFunction","delay","iterationCount","fillMode","playState","blur","spread","customPropObj","radius","font","variant","grow","basis","flow","shrink","align","templateColumns","templateRows","templateAreas","template","autoColumns","autoRows","autoFlow","row","rowStart","rowEnd","columnStart","columnEnd","area","rowGap","columnGap","processArray","scheme","mapValuesByProp","objectToArray","isFallback","isInArray","customPropsToStyle","customProps","propName","_styleDetector","appendedValue","styleDetector","baseProp","jssExpand","_arrayLikeToArray","_unsupportedIterableToArray","minLen","js","vendor","isTouch","documentElement","jsCssMap","Moz","O","Webkit","appearence","noPrefill","supportedProperty","colorAdjust","toUpper","camelize","pascalize","textOrientation","writingMode","breakPropsOld","inlineLogicalOld","newProp","unprefixed","prefixed","pascalized","scrollSnap","overscrollBehavior","propMap","order","flex2012","propMap$1","propKeys","prefixCss","propertyDetectors","computed","key$1","el$1","cache$1","transitionProperties","transPropsRegExp","prefixTransitionCallback","p1","p2","prefixedValue","supportedValue","jssVendorPrefixer","prefixStyle","changeProp","supportedProp","changeValue","supportedValue$1","atRule","supportedKeyframes","jssPropsSort","prop0","prop1","shallowEqualObjects","objA","objB","reactPropsRegex","defaultJss","createCss","ruleIndex","getSheet","argsStr","flatArgs","argIndex","innerArgIndex","mergedStyle","labels","styleObject","_cached","cacheValue","JssContext","disableStylesGeneration","MIN_SAFE_INTEGER","getSheetIndex","defaultManagers","getManager","managerId","managers","manager","manageSheet","unmanageSheet","sheetsMeta","getMeta","existingSheet","jss$1","getStyles","dynamicStyles","getSheetOptions","sheetOptions","addMeta","removeDynamicRules","updateDynamicRules","addDynamicRules","initialRuleCount","originalRule","getSheetClasses","dynamicRules","NoRenderer","noTheme","createWithStyles","_options$index","injectTheme","isThemingEnabled","ThemeConsumer","InnerComponent","WithStyles","mergeClassesProp","lastArgs","isSame","sheetClasses","classesProp","mergeClasses","baseClasses","additionalClasses","combinedClasses","createState","jssContext","innerRef","JssContextSubscriber","useEffectOrLayoutEffect","noTheme$1","ThemeContext$1","isFirstMount","_React$useMemo","newSheet","newDynamicRules","initialContext","JssProvider","parentContext","prevContext","parseStyles","staticStyle","dynamicStyle","shouldForwardPropSymbol","getChildProps","shouldForwardProp","isTag","childProps","configureStyled","tagOrComponent","getShouldForwardProp","childShouldForwardProp","finalShouldForwardProp","_options2","hookOptions","createStyledComponent","_parseStyles","Styled","as","propsWithTheme","sc","scd","newProps","COMMON_MIME_TYPES","toFileWithPath","withMimeType","ext","webkitRelativePath","FILES_TO_IGNORE","getInputFiles","evt","isInput","fromList","getDataTransferFiles","dt","toFilePromises","noIgnoredFiles","flatten","webkitGetAsEntry","fromDataTransferItem","isDirectory","fromDirEntry","getAsFile","fwp","fromEntry","fromFileEntry","createReader","readEntries","batch","err_1","fullPath","getInvalidTypeRejectionErr","messageSuffix","getTooLargeRejectionErr","getTooSmallRejectionErr","minSize","TOO_MANY_FILES_REJECTION","fileAccepted","isAcceptable","fileMatchSize","allFilesAccepted","accepted","sizeMatch","isPropagationStopped","cancelBubble","isEvtWithFiles","dataTransfer","onDocumentDragOver","isIe","isEdge","isIeOrEdge","composeEventHandlers","fns","enumerableOnly","symbols","getOwnPropertyDescriptors","_objectWithoutProperties","sourceSymbolKeys","Dropzone","_useDropzone","getFilesFromEvent","fromEvent","noClick","noKeyboard","noDrag","noDragEventsBubbling","onFileDialogCancel","onDragEnter","onDragLeave","onDragOver","onDropAccepted","initialState","isFileDialogActive","draggedFiles","fileRejections","_defaultProps$options","rootRef","inputRef","_useReducer","reducer","_useReducer2","dispatch","openFileDialog","click","onWindowFocus","onKeyDownCb","isEqualNode","onFocusCb","onBlurCb","onClickCb","dragTargetsRef","onDocumentDrop","onDragEnterCb","persist","onDragOverCb","hasFiles","dropEffect","_unused","onDragLeaveCb","targets","targetIdx","onDropCb","_fileAccepted2","acceptError","_fileMatchSize2","sizeError","customErrors","composeHandler","composeKeyboardHandler","composeDragHandler","_ref2$refKey","refKey","onFocus","onBlur","onInputElementClick","_ref3$refKey","inputProps","autoComplete","fileCount","regexpCache","sanitizeArray","input","inputName","makeRegexp","pattern","caseSensitive","negated","escapeStringRegexp","regexp","baseMatcher","patterns","firstMatchOnly","allPatterns","matches","didFit","yes","matcher"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,oBAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,qBAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,oBAAoBQ,EAAIF,EAGxBN,oBAAoBS,EAAIV,EAGxBC,oBAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,oBAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,oBAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,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AAO21J,KAAYM,EAASvtJ,UACvC,GAAIitJ,EAAQ/gK,KAAK4gK,KAChBa,EAAOr2J,IAAS,EAChBo2J,GAAWT,EAAQE,SAEdO,GACJ,MAKH,MAEc,IAAZA,QACgB1qK,IAAZ0qK,GAAyBH,EAAS/mK,KAAKymK,IAAYA,EAAQE,UAC3DM,GAAeE,EAAOnnK,KAAK,CAAConK,EAAKt2J,KAAWs2J,IAAQL,EAASj2J,GAAO61J,YAGzE3rK,EAAOoB,KAAKkqK,GAERU,GACH,MAKH,OAAOhsK,GAGD,SAASqsK,QAAQxtI,EAAQktI,EAAUjrI,GACzC,OAAOgrI,YAAYjtI,EAAQktI,EAAUjrI,GAAS,GAGxC,SAASkyF,QAAQn0F,EAAQktI,EAAUjrI,GACzC,OAAOgrI,YAAYjtI,EAAQktI,EAAUjrI,GAAS,GAAM/iC,OAAS","file":"Plugin.js","sourcesContent":[" \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 149);\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { visit, } from 'graphql';\nimport { invariant } from 'ts-invariant';\nexport function shouldInclude(_a, variables) {\n var directives = _a.directives;\n if (!directives || !directives.length) {\n return true;\n }\n return getInclusionDirectives(directives).every(function (_a) {\n var directive = _a.directive, ifArgument = _a.ifArgument;\n var evaledValue = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables && variables[ifArgument.value.name.value];\n process.env.NODE_ENV === \"production\" ? invariant(evaledValue !== void 0, 38) : invariant(evaledValue !== void 0, \"Invalid variable referenced in @\" + directive.name.value + \" directive.\");\n }\n else {\n evaledValue = ifArgument.value.value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\nexport function getDirectiveNames(root) {\n var names = [];\n visit(root, {\n Directive: function (node) {\n names.push(node.name.value);\n },\n });\n return names;\n}\nexport function hasDirectives(names, root) {\n return getDirectiveNames(root).some(function (name) { return names.indexOf(name) > -1; });\n}\nexport function hasClientExports(document) {\n return (document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document));\n}\nfunction isInclusionDirective(_a) {\n var value = _a.name.value;\n return value === 'skip' || value === 'include';\n}\nexport function getInclusionDirectives(directives) {\n var result = [];\n if (directives && directives.length) {\n directives.forEach(function (directive) {\n if (!isInclusionDirective(directive))\n return;\n var directiveArguments = directive.arguments;\n var directiveName = directive.name.value;\n process.env.NODE_ENV === \"production\" ? invariant(directiveArguments && directiveArguments.length === 1, 39) : invariant(directiveArguments && directiveArguments.length === 1, \"Incorrect number of arguments for the @\" + directiveName + \" directive.\");\n var ifArgument = directiveArguments[0];\n process.env.NODE_ENV === \"production\" ? invariant(ifArgument.name && ifArgument.name.value === 'if', 40) : invariant(ifArgument.name && ifArgument.name.value === 'if', \"Invalid argument for the @\" + directiveName + \" directive.\");\n var ifValue = ifArgument.value;\n process.env.NODE_ENV === \"production\" ? invariant(ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 41) : invariant(ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), \"Argument for the @\" + directiveName + \" directive must be a variable or a boolean value.\");\n result.push({ directive: directive, ifArgument: ifArgument });\n });\n }\n return result;\n}\n//# sourceMappingURL=directives.js.map","import { __assign, __spreadArrays } from \"tslib\";\nimport { invariant, InvariantError } from 'ts-invariant';\nexport function getFragmentQueryDocument(document, fragmentName) {\n var actualFragmentName = fragmentName;\n var fragments = [];\n document.definitions.forEach(function (definition) {\n if (definition.kind === 'OperationDefinition') {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(42) : new InvariantError(\"Found a \" + definition.operation + \" operation\" + (definition.name ? \" named '\" + definition.name.value + \"'\" : '') + \". \" +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.');\n }\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n if (typeof actualFragmentName === 'undefined') {\n process.env.NODE_ENV === \"production\" ? invariant(fragments.length === 1, 43) : invariant(fragments.length === 1, \"Found \" + fragments.length + \" fragments. `fragmentName` must be provided when there is not exactly 1 fragment.\");\n actualFragmentName = fragments[0].name.value;\n }\n var query = __assign(__assign({}, document), { definitions: __spreadArrays([\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n }\n ], document.definitions) });\n return query;\n}\nexport function createFragmentMap(fragments) {\n if (fragments === void 0) { fragments = []; }\n var symTable = {};\n fragments.forEach(function (fragment) {\n symTable[fragment.name.value] = fragment;\n });\n return symTable;\n}\nexport function getFragmentFromSelection(selection, fragmentMap) {\n switch (selection.kind) {\n case 'InlineFragment':\n return selection;\n case 'FragmentSpread': {\n var fragment = fragmentMap && fragmentMap[selection.name.value];\n process.env.NODE_ENV === \"production\" ? invariant(fragment, 44) : invariant(fragment, \"No fragment named \" + selection.name.value + \".\");\n return fragment;\n }\n default:\n return null;\n }\n}\n//# sourceMappingURL=fragments.js.map","import stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\nimport { getFragmentFromSelection } from \"./fragments.js\";\nexport function makeReference(id) {\n return { __ref: String(id) };\n}\nexport function isReference(obj) {\n return Boolean(obj && typeof obj === 'object' && typeof obj.__ref === 'string');\n}\nfunction isStringValue(value) {\n return value.kind === 'StringValue';\n}\nfunction isBooleanValue(value) {\n return value.kind === 'BooleanValue';\n}\nfunction isIntValue(value) {\n return value.kind === 'IntValue';\n}\nfunction isFloatValue(value) {\n return value.kind === 'FloatValue';\n}\nfunction isVariable(value) {\n return value.kind === 'Variable';\n}\nfunction isObjectValue(value) {\n return value.kind === 'ObjectValue';\n}\nfunction isListValue(value) {\n return value.kind === 'ListValue';\n}\nfunction isEnumValue(value) {\n return value.kind === 'EnumValue';\n}\nfunction isNullValue(value) {\n return value.kind === 'NullValue';\n}\nexport function valueToObjectRepresentation(argObj, name, value, variables) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n }\n else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n }\n else if (isObjectValue(value)) {\n var nestedArgObj_1 = {};\n value.fields.map(function (obj) {\n return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables);\n });\n argObj[name.value] = nestedArgObj_1;\n }\n else if (isVariable(value)) {\n var variableValue = (variables || {})[value.name.value];\n argObj[name.value] = variableValue;\n }\n else if (isListValue(value)) {\n argObj[name.value] = value.values.map(function (listValue) {\n var nestedArgArrayObj = {};\n valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables);\n return nestedArgArrayObj[name.value];\n });\n }\n else if (isEnumValue(value)) {\n argObj[name.value] = value.value;\n }\n else if (isNullValue(value)) {\n argObj[name.value] = null;\n }\n else {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(53) : new InvariantError(\"The inline argument \\\"\" + name.value + \"\\\" of kind \\\"\" + value.kind + \"\\\"\" +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.');\n }\n}\nexport function storeKeyNameFromField(field, variables) {\n var directivesObj = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(function (directive) {\n directivesObj[directive.name.value] = {};\n if (directive.arguments) {\n directive.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables);\n });\n }\n });\n }\n var argObj = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(argObj, name, value, variables);\n });\n }\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\nvar KNOWN_DIRECTIVES = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\nexport function getStoreKeyName(fieldName, args, directives) {\n if (args &&\n directives &&\n directives['connection'] &&\n directives['connection']['key']) {\n if (directives['connection']['filter'] &&\n directives['connection']['filter'].length > 0) {\n var filterKeys = directives['connection']['filter']\n ? directives['connection']['filter']\n : [];\n filterKeys.sort();\n var filteredArgs_1 = {};\n filterKeys.forEach(function (key) {\n filteredArgs_1[key] = args[key];\n });\n return directives['connection']['key'] + \"(\" + JSON.stringify(filteredArgs_1) + \")\";\n }\n else {\n return directives['connection']['key'];\n }\n }\n var completeFieldName = fieldName;\n if (args) {\n var stringifiedArgs = stringify(args);\n completeFieldName += \"(\" + stringifiedArgs + \")\";\n }\n if (directives) {\n Object.keys(directives).forEach(function (key) {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1)\n return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += \"@\" + key + \"(\" + JSON.stringify(directives[key]) + \")\";\n }\n else {\n completeFieldName += \"@\" + key;\n }\n });\n }\n return completeFieldName;\n}\nexport function argumentsObjectFromField(field, variables) {\n if (field.arguments && field.arguments.length) {\n var argObj_1 = {};\n field.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(argObj_1, name, value, variables);\n });\n return argObj_1;\n }\n return null;\n}\nexport function resultKeyNameFromField(field) {\n return field.alias ? field.alias.value : field.name.value;\n}\nexport function getTypenameFromResult(result, selectionSet, fragmentMap) {\n if (typeof result.__typename === 'string') {\n return result.__typename;\n }\n for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {\n var selection = _a[_i];\n if (isField(selection)) {\n if (selection.name.value === '__typename') {\n return result[resultKeyNameFromField(selection)];\n }\n }\n else {\n var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);\n if (typeof typename === 'string') {\n return typename;\n }\n }\n }\n}\nexport function isField(selection) {\n return selection.kind === 'Field';\n}\nexport function isInlineFragment(selection) {\n return selection.kind === 'InlineFragment';\n}\n//# sourceMappingURL=storeUtils.js.map","import { invariant, InvariantError } from 'ts-invariant';\nimport { valueToObjectRepresentation } from \"./storeUtils.js\";\nexport function checkDocument(doc) {\n process.env.NODE_ENV === \"production\" ? invariant(doc && doc.kind === 'Document', 45) : invariant(doc && doc.kind === 'Document', \"Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \\\"gql\\\" tag? http://docs.apollostack.com/apollo-client/core.html#gql\");\n var operations = doc.definitions\n .filter(function (d) { return d.kind !== 'FragmentDefinition'; })\n .map(function (definition) {\n if (definition.kind !== 'OperationDefinition') {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(46) : new InvariantError(\"Schema type definitions not allowed in queries. Found: \\\"\" + definition.kind + \"\\\"\");\n }\n return definition;\n });\n process.env.NODE_ENV === \"production\" ? invariant(operations.length <= 1, 47) : invariant(operations.length <= 1, \"Ambiguous GraphQL document: contains \" + operations.length + \" operations\");\n return doc;\n}\nexport function getOperationDefinition(doc) {\n checkDocument(doc);\n return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0];\n}\nexport function getOperationName(doc) {\n return (doc.definitions\n .filter(function (definition) {\n return definition.kind === 'OperationDefinition' && definition.name;\n })\n .map(function (x) { return x.name.value; })[0] || null);\n}\nexport function getFragmentDefinitions(doc) {\n return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; });\n}\nexport function getQueryDefinition(doc) {\n var queryDef = getOperationDefinition(doc);\n process.env.NODE_ENV === \"production\" ? invariant(queryDef && queryDef.operation === 'query', 48) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');\n return queryDef;\n}\nexport function getFragmentDefinition(doc) {\n process.env.NODE_ENV === \"production\" ? invariant(doc.kind === 'Document', 49) : invariant(doc.kind === 'Document', \"Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \\\"gql\\\" tag? http://docs.apollostack.com/apollo-client/core.html#gql\");\n process.env.NODE_ENV === \"production\" ? invariant(doc.definitions.length <= 1, 50) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');\n var fragmentDef = doc.definitions[0];\n process.env.NODE_ENV === \"production\" ? invariant(fragmentDef.kind === 'FragmentDefinition', 51) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');\n return fragmentDef;\n}\nexport function getMainDefinition(queryDoc) {\n checkDocument(queryDoc);\n var fragmentDefinition;\n for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) {\n var definition = _a[_i];\n if (definition.kind === 'OperationDefinition') {\n var operation = definition.operation;\n if (operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription') {\n return definition;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n fragmentDefinition = definition;\n }\n }\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(52) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.');\n}\nexport function getDefaultValues(definition) {\n var defaultValues = Object.create(null);\n var defs = definition && definition.variableDefinitions;\n if (defs && defs.length) {\n defs.forEach(function (def) {\n if (def.defaultValue) {\n valueToObjectRepresentation(defaultValues, def.variable.name, def.defaultValue);\n }\n });\n }\n return defaultValues;\n}\n//# sourceMappingURL=getFromAST.js.map","export function filterInPlace(array, test, context) {\n var target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n//# sourceMappingURL=filterInPlace.js.map","import { __assign, __spreadArrays } from \"tslib\";\nimport { visit, } from 'graphql';\nimport { invariant } from 'ts-invariant';\nimport { checkDocument, getOperationDefinition, getFragmentDefinition, getFragmentDefinitions, getMainDefinition, } from \"./getFromAST.js\";\nimport { filterInPlace } from \"../common/filterInPlace.js\";\nimport { isField, isInlineFragment } from \"./storeUtils.js\";\nimport { createFragmentMap, } from \"./fragments.js\";\nvar TYPENAME_FIELD = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\nfunction isEmpty(op, fragments) {\n return op.selectionSet.selections.every(function (selection) {\n return selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments);\n });\n}\nfunction nullIfDocIsEmpty(doc) {\n return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))\n ? null\n : doc;\n}\nfunction getDirectiveMatcher(directives) {\n return function directiveMatcher(directive) {\n return directives.some(function (dir) {\n return (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive));\n });\n };\n}\nexport function removeDirectivesFromDocument(directives, doc) {\n var variablesInUse = Object.create(null);\n var variablesToRemove = [];\n var fragmentSpreadsInUse = Object.create(null);\n var fragmentSpreadsToRemove = [];\n var modifiedDoc = nullIfDocIsEmpty(visit(doc, {\n Variable: {\n enter: function (node, _key, parent) {\n if (parent.kind !== 'VariableDefinition') {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n Field: {\n enter: function (node) {\n if (directives && node.directives) {\n var shouldRemoveField = directives.some(function (directive) { return directive.remove; });\n if (shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))) {\n if (node.arguments) {\n node.arguments.forEach(function (arg) {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: arg.value.name.value,\n });\n }\n });\n }\n if (node.selectionSet) {\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n });\n }\n return null;\n }\n }\n },\n },\n FragmentSpread: {\n enter: function (node) {\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n Directive: {\n enter: function (node) {\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }));\n if (modifiedDoc &&\n filterInPlace(variablesToRemove, function (v) { return !!v.name && !variablesInUse[v.name]; }).length) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n if (modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, function (fs) { return !!fs.name && !fragmentSpreadsInUse[fs.name]; })\n .length) {\n modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc);\n }\n return modifiedDoc;\n}\nexport function addTypenameToDocument(doc) {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter: function (node, _key, parent) {\n if (parent &&\n parent.kind === 'OperationDefinition') {\n return;\n }\n var selections = node.selections;\n if (!selections) {\n return;\n }\n var skip = selections.some(function (selection) {\n return (isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0));\n });\n if (skip) {\n return;\n }\n var field = parent;\n if (isField(field) &&\n field.directives &&\n field.directives.some(function (d) { return d.name.value === 'export'; })) {\n return;\n }\n return __assign(__assign({}, node), { selections: __spreadArrays(selections, [TYPENAME_FIELD]) });\n },\n },\n });\n}\naddTypenameToDocument.added = function (field) {\n return field === TYPENAME_FIELD;\n};\nvar connectionRemoveConfig = {\n test: function (directive) {\n var willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (!directive.arguments ||\n !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {\n process.env.NODE_ENV === \"production\" || invariant.warn('Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.');\n }\n }\n return willRemove;\n },\n};\nexport function removeConnectionDirectiveFromDocument(doc) {\n return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc));\n}\nfunction hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) {\n if (nestedCheck === void 0) { nestedCheck = true; }\n return (!!selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(function (selection) {\n return hasDirectivesInSelection(directives, selection, nestedCheck);\n }));\n}\nfunction hasDirectivesInSelection(directives, selection, nestedCheck) {\n if (nestedCheck === void 0) { nestedCheck = true; }\n if (!isField(selection)) {\n return true;\n }\n if (!selection.directives) {\n return false;\n }\n return (selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck)));\n}\nfunction getArgumentMatcher(config) {\n return function argumentMatcher(argument) {\n return config.some(function (aConfig) {\n return argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument)));\n });\n };\n}\nexport function removeArgumentsFromDocument(config, doc) {\n var argMatcher = getArgumentMatcher(config);\n return nullIfDocIsEmpty(visit(doc, {\n OperationDefinition: {\n enter: function (node) {\n return __assign(__assign({}, node), { variableDefinitions: node.variableDefinitions ? node.variableDefinitions.filter(function (varDef) {\n return !config.some(function (arg) { return arg.name === varDef.variable.name.value; });\n }) : [] });\n },\n },\n Field: {\n enter: function (node) {\n var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; });\n if (shouldRemoveField) {\n var argMatchCount_1 = 0;\n if (node.arguments) {\n node.arguments.forEach(function (arg) {\n if (argMatcher(arg)) {\n argMatchCount_1 += 1;\n }\n });\n }\n if (argMatchCount_1 === 1) {\n return null;\n }\n }\n },\n },\n Argument: {\n enter: function (node) {\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }));\n}\nexport function removeFragmentSpreadFromDocument(config, doc) {\n function enter(node) {\n if (config.some(function (def) { return def.name === node.name.value; })) {\n return null;\n }\n }\n return nullIfDocIsEmpty(visit(doc, {\n FragmentSpread: { enter: enter },\n FragmentDefinition: { enter: enter },\n }));\n}\nfunction getAllFragmentSpreadsFromSelectionSet(selectionSet) {\n var allFragments = [];\n selectionSet.selections.forEach(function (selection) {\n if ((isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); });\n }\n else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n return allFragments;\n}\nexport function buildQueryFromSelectionSet(document) {\n var definition = getMainDefinition(document);\n var definitionOperation = definition.operation;\n if (definitionOperation === 'query') {\n return document;\n }\n var modifiedDoc = visit(document, {\n OperationDefinition: {\n enter: function (node) {\n return __assign(__assign({}, node), { operation: 'query' });\n },\n },\n });\n return modifiedDoc;\n}\nexport function removeClientSetsFromDocument(document) {\n checkDocument(document);\n var modifiedDoc = removeDirectivesFromDocument([\n {\n test: function (directive) { return directive.name.value === 'client'; },\n remove: true,\n },\n ], document);\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter: function (node) {\n if (node.selectionSet) {\n var isTypenameOnly = node.selectionSet.selections.every(function (selection) {\n return isField(selection) && selection.name.value === '__typename';\n });\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n return modifiedDoc;\n}\n//# sourceMappingURL=transform.js.map","import { __assign, __spreadArrays } from \"tslib\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function mergeDeep() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n return mergeDeepArray(sources);\n}\nexport function mergeDeepArray(sources) {\n var target = sources[0] || {};\n var count = sources.length;\n if (count > 1) {\n var merger = new DeepMerger();\n for (var i = 1; i < count; ++i) {\n target = merger.merge(target, sources[i]);\n }\n }\n return target;\n}\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object';\n}\nvar defaultReconciler = function (target, source, property) {\n return this.merge(target[property], source[property]);\n};\nvar DeepMerger = (function () {\n function DeepMerger(reconciler) {\n if (reconciler === void 0) { reconciler = defaultReconciler; }\n this.reconciler = reconciler;\n this.isObject = isObject;\n this.pastCopies = new Set();\n }\n DeepMerger.prototype.merge = function (target, source) {\n var _this = this;\n var context = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n context[_i - 2] = arguments[_i];\n }\n if (isObject(source) && isObject(target)) {\n Object.keys(source).forEach(function (sourceKey) {\n if (hasOwnProperty.call(target, sourceKey)) {\n var targetValue = target[sourceKey];\n if (source[sourceKey] !== targetValue) {\n var result = _this.reconciler.apply(_this, __spreadArrays([target, source, sourceKey], context));\n if (result !== targetValue) {\n target = _this.shallowCopyForMerge(target);\n target[sourceKey] = result;\n }\n }\n }\n else {\n target = _this.shallowCopyForMerge(target);\n target[sourceKey] = source[sourceKey];\n }\n });\n return target;\n }\n return source;\n };\n DeepMerger.prototype.shallowCopyForMerge = function (value) {\n if (isObject(value) && !this.pastCopies.has(value)) {\n if (Array.isArray(value)) {\n value = value.slice(0);\n }\n else {\n value = __assign({ __proto__: Object.getPrototypeOf(value) }, value);\n }\n this.pastCopies.add(value);\n }\n return value;\n };\n return DeepMerger;\n}());\nexport { DeepMerger };\n//# sourceMappingURL=mergeDeep.js.map","import Observable from 'zen-observable';\nimport 'symbol-observable';\nvar prototype = Observable.prototype;\nvar fakeObsSymbol = '@@observable';\nif (!prototype[fakeObsSymbol]) {\n prototype[fakeObsSymbol] = function () { return this; };\n}\nexport { Observable };\n//# sourceMappingURL=Observable.js.map","var toString = Object.prototype.toString;\nexport function cloneDeep(value) {\n return cloneDeepHelper(value);\n}\nfunction cloneDeepHelper(val, seen) {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n seen = seen || new Map;\n if (seen.has(val))\n return seen.get(val);\n var copy_1 = val.slice(0);\n seen.set(val, copy_1);\n copy_1.forEach(function (child, i) {\n copy_1[i] = cloneDeepHelper(child, seen);\n });\n return copy_1;\n }\n case \"[object Object]\": {\n seen = seen || new Map;\n if (seen.has(val))\n return seen.get(val);\n var copy_2 = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy_2);\n Object.keys(val).forEach(function (key) {\n copy_2[key] = cloneDeepHelper(val[key], seen);\n });\n return copy_2;\n }\n default:\n return val;\n }\n}\n//# sourceMappingURL=cloneDeep.js.map","import { isDevelopment, isTest } from \"./environment.js\";\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction deepFreeze(value) {\n var workSet = new Set([value]);\n workSet.forEach(function (obj) {\n if (isObject(obj)) {\n if (!Object.isFrozen(obj))\n Object.freeze(obj);\n Object.getOwnPropertyNames(obj).forEach(function (name) {\n if (isObject(obj[name]))\n workSet.add(obj[name]);\n });\n }\n });\n return value;\n}\nexport function maybeDeepFreeze(obj) {\n if (process.env.NODE_ENV !== \"production\" && (isDevelopment() || isTest())) {\n deepFreeze(obj);\n }\n return obj;\n}\n//# sourceMappingURL=maybeDeepFreeze.js.map","export function iterateObserversSafely(observers, method, argument) {\n var observersWithMethod = [];\n observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); });\n observersWithMethod.forEach(function (obs) { return obs[method](argument); });\n}\n//# sourceMappingURL=iteration.js.map","import { Observable } from \"./Observable.js\";\nexport function asyncMap(observable, mapFn, catchFn) {\n return new Observable(function (observer) {\n var next = observer.next, error = observer.error, complete = observer.complete;\n var activeCallbackCount = 0;\n var completed = false;\n var promiseQueue = {\n then: function (callback) {\n return new Promise(function (resolve) { return resolve(callback()); });\n },\n };\n function makeCallback(examiner, delegate) {\n if (examiner) {\n return function (arg) {\n ++activeCallbackCount;\n var both = function () { return examiner(arg); };\n promiseQueue = promiseQueue.then(both, both).then(function (result) {\n --activeCallbackCount;\n next && next.call(observer, result);\n if (completed) {\n handler.complete();\n }\n }, function (error) {\n --activeCallbackCount;\n throw error;\n }).catch(function (caught) {\n error && error.call(observer, caught);\n });\n };\n }\n else {\n return function (arg) { return delegate && delegate.call(observer, arg); };\n }\n }\n var handler = {\n next: makeCallback(mapFn, next),\n error: makeCallback(catchFn, error),\n complete: function () {\n completed = true;\n if (!activeCallbackCount) {\n complete && complete.call(observer);\n }\n },\n };\n var sub = observable.subscribe(handler);\n return function () { return sub.unsubscribe(); };\n });\n}\n//# sourceMappingURL=asyncMap.js.map","import { Observable } from \"./Observable.js\";\nexport function fixObservableSubclass(subclass) {\n function set(key) {\n Object.defineProperty(subclass, key, { value: Observable });\n }\n if (typeof Symbol === \"function\" && Symbol.species) {\n set(Symbol.species);\n }\n set(\"@@species\");\n return subclass;\n}\n//# sourceMappingURL=subclassing.js.map","import { __extends } from \"tslib\";\nimport { Observable } from \"./Observable.js\";\nimport { iterateObserversSafely } from \"./iteration.js\";\nimport { fixObservableSubclass } from \"./subclassing.js\";\nfunction isPromiseLike(value) {\n return value && typeof value.then === \"function\";\n}\nvar Concast = (function (_super) {\n __extends(Concast, _super);\n function Concast(sources) {\n var _this = _super.call(this, function (observer) {\n _this.addObserver(observer);\n return function () { return _this.removeObserver(observer); };\n }) || this;\n _this.observers = new Set();\n _this.addCount = 0;\n _this.promise = new Promise(function (resolve, reject) {\n _this.resolve = resolve;\n _this.reject = reject;\n });\n _this.handlers = {\n next: function (result) {\n if (_this.sub !== null) {\n _this.latest = [\"next\", result];\n iterateObserversSafely(_this.observers, \"next\", result);\n }\n },\n error: function (error) {\n var sub = _this.sub;\n if (sub !== null) {\n if (sub)\n Promise.resolve().then(function () { return sub.unsubscribe(); });\n _this.sub = null;\n _this.latest = [\"error\", error];\n _this.reject(error);\n iterateObserversSafely(_this.observers, \"error\", error);\n }\n },\n complete: function () {\n if (_this.sub !== null) {\n var value = _this.sources.shift();\n if (!value) {\n _this.sub = null;\n if (_this.latest &&\n _this.latest[0] === \"next\") {\n _this.resolve(_this.latest[1]);\n }\n else {\n _this.resolve();\n }\n iterateObserversSafely(_this.observers, \"complete\");\n }\n else if (isPromiseLike(value)) {\n value.then(function (obs) { return _this.sub = obs.subscribe(_this.handlers); });\n }\n else {\n _this.sub = value.subscribe(_this.handlers);\n }\n }\n },\n };\n _this.cancel = function (reason) {\n _this.reject(reason);\n _this.sources = [];\n _this.handlers.complete();\n };\n _this.promise.catch(function (_) { });\n if (typeof sources === \"function\") {\n sources = [new Observable(sources)];\n }\n if (isPromiseLike(sources)) {\n sources.then(function (iterable) { return _this.start(iterable); }, _this.handlers.error);\n }\n else {\n _this.start(sources);\n }\n return _this;\n }\n Concast.prototype.start = function (sources) {\n if (this.sub !== void 0)\n return;\n this.sources = Array.from(sources);\n this.handlers.complete();\n };\n Concast.prototype.deliverLastMessage = function (observer) {\n if (this.latest) {\n var nextOrError = this.latest[0];\n var method = observer[nextOrError];\n if (method) {\n method.call(observer, this.latest[1]);\n }\n if (this.sub === null &&\n nextOrError === \"next\" &&\n observer.complete) {\n observer.complete();\n }\n }\n };\n Concast.prototype.addObserver = function (observer) {\n if (!this.observers.has(observer)) {\n this.deliverLastMessage(observer);\n this.observers.add(observer);\n ++this.addCount;\n }\n };\n Concast.prototype.removeObserver = function (observer, quietly) {\n if (this.observers.delete(observer) &&\n --this.addCount < 1 &&\n !quietly) {\n this.handlers.error(new Error(\"Observable cancelled prematurely\"));\n }\n };\n Concast.prototype.cleanup = function (callback) {\n var _this = this;\n var called = false;\n var once = function () {\n if (!called) {\n called = true;\n _this.observers.delete(observer);\n callback();\n }\n };\n var observer = {\n next: once,\n error: once,\n complete: once,\n };\n var count = this.addCount;\n this.addObserver(observer);\n this.addCount = count;\n };\n return Concast;\n}(Observable));\nexport { Concast };\nfixObservableSubclass(Concast);\n//# sourceMappingURL=Concast.js.map","export function isNonEmptyArray(value) {\n return Array.isArray(value) && value.length > 0;\n}\n//# sourceMappingURL=arrays.js.map","export function graphQLResultHasError(result) {\n return (result.errors && result.errors.length > 0) || false;\n}\n//# sourceMappingURL=errorHandling.js.map","export var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' &&\n navigator.product === 'ReactNative');\n//# sourceMappingURL=canUse.js.map","export function compact() {\n var objects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objects[_i] = arguments[_i];\n }\n var result = Object.create(null);\n objects.forEach(function (obj) {\n if (!obj)\n return;\n Object.keys(obj).forEach(function (key) {\n var value = obj[key];\n if (value !== void 0) {\n result[key] = value;\n }\n });\n });\n return result;\n}\n//# sourceMappingURL=compact.js.map","import { __extends } from 'tslib';\n\nvar genericMessage = \"Invariant Violation\";\r\nvar _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {\r\n obj.__proto__ = proto;\r\n return obj;\r\n} : _a;\r\nvar InvariantError = /** @class */ (function (_super) {\r\n __extends(InvariantError, _super);\r\n function InvariantError(message) {\r\n if (message === void 0) { message = genericMessage; }\r\n var _this = _super.call(this, typeof message === \"number\"\r\n ? genericMessage + \": \" + message + \" (see https://github.com/apollographql/invariant-packages)\"\r\n : message) || this;\r\n _this.framesToPop = 1;\r\n _this.name = genericMessage;\r\n setPrototypeOf(_this, InvariantError.prototype);\r\n return _this;\r\n }\r\n return InvariantError;\r\n}(Error));\r\nfunction invariant(condition, message) {\r\n if (!condition) {\r\n throw new InvariantError(message);\r\n }\r\n}\r\nvar verbosityLevels = [\"log\", \"warn\", \"error\", \"silent\"];\r\nvar verbosityLevel = verbosityLevels.indexOf(\"log\");\r\nfunction wrapConsoleMethod(method) {\r\n return function () {\r\n if (verbosityLevels.indexOf(method) >= verbosityLevel) {\r\n return console[method].apply(console, arguments);\r\n }\r\n };\r\n}\r\n(function (invariant) {\r\n invariant.log = wrapConsoleMethod(\"log\");\r\n invariant.warn = wrapConsoleMethod(\"warn\");\r\n invariant.error = wrapConsoleMethod(\"error\");\r\n})(invariant || (invariant = {}));\r\nfunction setVerbosity(level) {\r\n var old = verbosityLevels[verbosityLevel];\r\n verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));\r\n return old;\r\n}\r\n// Code that uses ts-invariant with rollup-plugin-invariant may want to\r\n// import this process stub to avoid errors evaluating process.env.NODE_ENV.\r\n// However, because most ESM-to-CJS compilers will rewrite the process import\r\n// as tsInvariant.process, which prevents proper replacement by minifiers, we\r\n// also export processStub, so you can import { invariant, processStub } from\r\n// \"ts-invariant\" and assign processStub to a local variable named process.\r\nvar processStub = (typeof process === \"object\" &&\r\n typeof process.env === \"object\") ? process : { env: {} };\r\nvar invariant$1 = invariant;\n\nexport default invariant$1;\nexport { InvariantError, invariant, processStub as process, processStub, setVerbosity };\n//# sourceMappingURL=invariant.esm.js.map\n","export * from \"./core/index.js\";\nexport * from \"./react/index.js\";\n//# sourceMappingURL=index.js.map","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n","import reactDom from 'react-dom';\nimport react from 'react';\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction nullthrows(x, message) {\n if (x != null) {\n return x;\n }\n\n throw new Error(message !== null && message !== void 0 ? message : 'Got unexpected null or undefined');\n}\n\nvar Recoil_nullthrows = nullthrows;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction recoverableViolation(message, projectName, {\n error\n} = {}) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(message, error);\n }\n\n return null;\n}\n\nvar recoverableViolation_1 = recoverableViolation;\n\n// @oss-only\n\n\nvar Recoil_recoverableViolation = recoverableViolation_1;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Utilities for working with built-in Maps and Sets without mutating them.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction setByAddingToSet(set, v) {\n const next = new Set(set);\n next.add(v);\n return next;\n}\n\nfunction setByDeletingFromSet(set, v) {\n const next = new Set(set);\n next.delete(v);\n return next;\n}\n\nfunction mapBySettingInMap(map, k, v) {\n const next = new Map(map);\n next.set(k, v);\n return next;\n}\n\nfunction mapByUpdatingInMap(map, k, updater) {\n const next = new Map(map);\n next.set(k, updater(next.get(k)));\n return next;\n}\n\nfunction mapByDeletingFromMap(map, k) {\n const next = new Map(map);\n next.delete(k);\n return next;\n}\n\nfunction mapByDeletingMultipleFromMap(map, ks) {\n const next = new Map(map);\n ks.forEach(k => next.delete(k));\n return next;\n}\n\nvar Recoil_CopyOnWrite = {\n setByAddingToSet,\n setByDeletingFromSet,\n mapBySettingInMap,\n mapByUpdatingInMap,\n mapByDeletingFromMap,\n mapByDeletingMultipleFromMap\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Creates a new iterable whose output is generated by passing the input\n * iterable's values through the filter function.\n */\n\nfunction* filterIterable(iterable, predicate) {\n // Use generator to create iterable/iterator\n let index = 0;\n\n for (const value of iterable) {\n if (predicate(value, index++)) {\n yield value;\n }\n }\n}\n\nvar Recoil_filterIterable = filterIterable;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst gks = new Map().set('recoil_hamt_2020', true);\n\nfunction Recoil_gkx(gk) {\n var _gks$get;\n\n return (_gks$get = gks.get(gk)) !== null && _gks$get !== void 0 ? _gks$get : false;\n}\n\nRecoil_gkx.setPass = gk => {\n gks.set(gk, true);\n};\n\nRecoil_gkx.setFail = gk => {\n gks.set(gk, false);\n};\n\nvar Recoil_gkx_1 = Recoil_gkx; // @oss-only\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Creates a new iterable whose output is generated by passing the input\n * iterable's values through the mapper function.\n */\n\nfunction mapIterable(iterable, callback) {\n // Use generator to create iterable/iterator\n return function* () {\n let index = 0;\n\n for (const value of iterable) {\n yield callback(value, index++);\n }\n }();\n}\n\nvar Recoil_mapIterable = mapIterable;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction sprintf(format, ...args) {\n let index = 0;\n return format.replace(/%s/g, () => String(args[index++]));\n}\n\nvar sprintf_1 = sprintf;\n\nfunction expectationViolation(format, ...args) {\n if (process.env.NODE_ENV !== \"production\") {\n const message = sprintf_1.call(null, format, ...args);\n const error = new Error(message);\n error.name = 'Expectation Violation';\n console.error(error);\n }\n}\n\nvar expectationViolation_1 = expectationViolation;\n\n// @oss-only\n\n\nvar Recoil_expectationViolation = expectationViolation_1;\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n// eslint-disable-next-line no-unused-vars\nclass AbstractRecoilValue {\n constructor(newKey) {\n _defineProperty(this, \"key\", void 0);\n\n this.key = newKey;\n }\n\n}\n\nclass RecoilState extends AbstractRecoilValue {}\n\nclass RecoilValueReadOnly extends AbstractRecoilValue {}\n\nfunction isRecoilValue(x) {\n return x instanceof RecoilState || x instanceof RecoilValueReadOnly;\n}\n\nvar Recoil_RecoilValue = {\n AbstractRecoilValue,\n RecoilState,\n RecoilValueReadOnly,\n isRecoilValue\n};\n\nvar Recoil_RecoilValue_1 = Recoil_RecoilValue.AbstractRecoilValue;\nvar Recoil_RecoilValue_2 = Recoil_RecoilValue.RecoilState;\nvar Recoil_RecoilValue_3 = Recoil_RecoilValue.RecoilValueReadOnly;\nvar Recoil_RecoilValue_4 = Recoil_RecoilValue.isRecoilValue;\n\nvar Recoil_RecoilValue$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n AbstractRecoilValue: Recoil_RecoilValue_1,\n RecoilState: Recoil_RecoilValue_2,\n RecoilValueReadOnly: Recoil_RecoilValue_3,\n isRecoilValue: Recoil_RecoilValue_4\n});\n\nclass DefaultValue {}\n\nconst DEFAULT_VALUE = new DefaultValue();\n\nclass RecoilValueNotReady extends Error {\n constructor(key) {\n super(`Tried to set the value of Recoil selector ${key} using an updater function, but it is an async selector in a pending or error state; this is not supported.`);\n }\n\n}\n\n// flowlint-next-line unclear-type:off\nconst nodes = new Map(); // flowlint-next-line unclear-type:off\n\nconst recoilValues = new Map();\n/* eslint-disable no-redeclare */\n\nfunction recoilValuesForKeys(keys) {\n return Recoil_mapIterable(keys, key => Recoil_nullthrows(recoilValues.get(key)));\n}\n\nfunction registerNode(node) {\n if (nodes.has(node.key)) {\n const message = `Duplicate atom key \"${node.key}\". This is a FATAL ERROR in\n production. But it is safe to ignore this warning if it occurred because of\n hot module replacement.`; // TODO Need to figure out if there is a standard/open-source equivalent to see if hot module replacement is happening:\n // prettier-ignore\n // @fb-only: if (__DEV__) {\n // @fb-only: const isAcceptingUpdate = require('__debug').isAcceptingUpdate;\n // prettier-ignore\n // @fb-only: if (typeof isAcceptingUpdate !== 'function' || !isAcceptingUpdate()) {\n // @fb-only: expectationViolation(message, 'recoil');\n // @fb-only: }\n // prettier-ignore\n // @fb-only: } else {\n // @fb-only: recoverableViolation(message, 'recoil');\n // @fb-only: }\n\n console.warn(message); // @oss-only\n }\n\n nodes.set(node.key, node);\n const recoilValue = node.set == null ? new Recoil_RecoilValue$1.RecoilValueReadOnly(node.key) : new Recoil_RecoilValue$1.RecoilState(node.key);\n recoilValues.set(node.key, recoilValue);\n return recoilValue;\n}\n/* eslint-enable no-redeclare */\n\n\nclass NodeMissingError extends Error {} // flowlint-next-line unclear-type:off\n\n\nfunction getNode(key) {\n const node = nodes.get(key);\n\n if (node == null) {\n throw new NodeMissingError(`Missing definition for RecoilValue: \"${key}\"\"`);\n }\n\n return node;\n} // flowlint-next-line unclear-type:off\n\n\nfunction getNodeMaybe(key) {\n return nodes.get(key);\n}\n\nconst configDeletionHandlers = new Map();\n\nfunction deleteNodeConfigIfPossible(key) {\n var _node$shouldDeleteCon;\n\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const node = nodes.get(key);\n\n if (node === null || node === void 0 ? void 0 : (_node$shouldDeleteCon = node.shouldDeleteConfigOnRelease) === null || _node$shouldDeleteCon === void 0 ? void 0 : _node$shouldDeleteCon.call(node)) {\n var _getConfigDeletionHan;\n\n nodes.delete(key);\n (_getConfigDeletionHan = getConfigDeletionHandler(key)) === null || _getConfigDeletionHan === void 0 ? void 0 : _getConfigDeletionHan();\n configDeletionHandlers.delete(key);\n }\n}\n\nfunction setConfigDeletionHandler(key, fn) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n if (fn === undefined) {\n configDeletionHandlers.delete(key);\n } else {\n configDeletionHandlers.set(key, fn);\n }\n}\n\nfunction getConfigDeletionHandler(key) {\n return configDeletionHandlers.get(key);\n}\n\nvar Recoil_Node = {\n nodes,\n recoilValues,\n registerNode,\n getNode,\n getNodeMaybe,\n deleteNodeConfigIfPossible,\n setConfigDeletionHandler,\n getConfigDeletionHandler,\n recoilValuesForKeys,\n NodeMissingError,\n DefaultValue,\n DEFAULT_VALUE,\n RecoilValueNotReady\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nclass RetentionZone {}\n\nfunction retentionZone() {\n return new RetentionZone();\n}\n\nvar Recoil_RetentionZone = {\n RetentionZone,\n retentionZone\n};\n\nconst {\n setByAddingToSet: setByAddingToSet$1\n} = Recoil_CopyOnWrite;\n\n\n\n\n\n\n\nconst {\n getNode: getNode$1,\n getNodeMaybe: getNodeMaybe$1,\n recoilValuesForKeys: recoilValuesForKeys$1\n} = Recoil_Node;\n\nconst {\n RetentionZone: RetentionZone$1\n} = Recoil_RetentionZone; // flowlint-next-line unclear-type:off\n\n\nconst emptySet = Object.freeze(new Set());\n\nclass ReadOnlyRecoilValueError extends Error {}\n\nfunction initializeRetentionForNode(store, nodeKey, retainedBy) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return () => undefined;\n }\n\n const {\n nodesRetainedByZone\n } = store.getState().retention;\n\n function addToZone(zone) {\n let set = nodesRetainedByZone.get(zone);\n\n if (!set) {\n nodesRetainedByZone.set(zone, set = new Set());\n }\n\n set.add(nodeKey);\n }\n\n if (retainedBy instanceof RetentionZone$1) {\n addToZone(retainedBy);\n } else if (Array.isArray(retainedBy)) {\n for (const zone of retainedBy) {\n addToZone(zone);\n }\n }\n\n return () => {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const nodesRetainedByZone = store.getState().retention.nodesRetainedByZone;\n\n function deleteFromZone(zone) {\n const set = nodesRetainedByZone.get(zone);\n\n if (set) {\n set.delete(nodeKey);\n }\n\n if (set && set.size === 0) {\n nodesRetainedByZone.delete(zone);\n }\n }\n\n if (retainedBy instanceof RetentionZone$1) {\n deleteFromZone(retainedBy);\n } else if (Array.isArray(retainedBy)) {\n for (const zone of retainedBy) {\n deleteFromZone(zone);\n }\n }\n };\n}\n\nfunction initializeNodeIfNewToStore(store, treeState, key, trigger) {\n const storeState = store.getState();\n\n if (storeState.nodeCleanupFunctions.has(key)) {\n return;\n }\n\n const config = getNode$1(key);\n const retentionCleanup = initializeRetentionForNode(store, key, config.retainedBy);\n const nodeCleanup = config.init(store, treeState, trigger);\n storeState.nodeCleanupFunctions.set(key, () => {\n nodeCleanup();\n retentionCleanup();\n });\n}\n\nfunction cleanUpNode(store, key) {\n var _state$nodeCleanupFun;\n\n const state = store.getState();\n (_state$nodeCleanupFun = state.nodeCleanupFunctions.get(key)) === null || _state$nodeCleanupFun === void 0 ? void 0 : _state$nodeCleanupFun();\n state.nodeCleanupFunctions.delete(key);\n} // Get the current value loadable of a node and update the state.\n// Update dependencies and subscriptions for selectors.\n// Update saved value validation for atoms.\n\n\nfunction getNodeLoadable(store, state, key) {\n initializeNodeIfNewToStore(store, state, key, 'get');\n return getNode$1(key).get(store, state);\n} // Peek at the current value loadable for a node without any evaluation or state change\n\n\nfunction peekNodeLoadable(store, state, key) {\n return getNode$1(key).peek(store, state);\n} // Write value directly to state bypassing the Node interface as the node\n// definitions may not have been loaded yet when processing the initial snapshot.\n\n\nfunction setUnvalidatedAtomValue_DEPRECATED(state, key, newValue) {\n var _node$invalidate;\n\n const node = getNodeMaybe$1(key);\n node === null || node === void 0 ? void 0 : (_node$invalidate = node.invalidate) === null || _node$invalidate === void 0 ? void 0 : _node$invalidate.call(node, state);\n return { ...state,\n atomValues: state.atomValues.clone().delete(key),\n nonvalidatedAtoms: state.nonvalidatedAtoms.clone().set(key, newValue),\n dirtyAtoms: setByAddingToSet$1(state.dirtyAtoms, key)\n };\n} // Return the discovered dependencies and values to be written by setting\n// a node value. (Multiple values may be written due to selectors getting to\n// set upstreams; deps may be discovered because of reads in updater functions.)\n\n\nfunction setNodeValue(store, state, key, newValue) {\n const node = getNode$1(key);\n\n if (node.set == null) {\n throw new ReadOnlyRecoilValueError(`Attempt to set read-only RecoilValue: ${key}`);\n }\n\n const set = node.set; // so flow doesn't lose the above refinement.\n\n initializeNodeIfNewToStore(store, state, key, 'set');\n return set(store, state, newValue);\n}\n\nfunction peekNodeInfo(store, state, key) {\n var _graph$nodeDeps$get, _storeState$nodeToCom, _storeState$nodeToCom2;\n\n const storeState = store.getState();\n const graph = store.getGraph(state.version);\n const type = storeState.knownAtoms.has(key) ? 'atom' : storeState.knownSelectors.has(key) ? 'selector' : undefined;\n const downstreamNodes = Recoil_filterIterable(getDownstreamNodes(store, state, new Set([key])), nodeKey => nodeKey !== key);\n return {\n loadable: peekNodeLoadable(store, state, key),\n isActive: storeState.knownAtoms.has(key) || storeState.knownSelectors.has(key),\n isSet: type === 'selector' ? false : state.atomValues.has(key),\n isModified: state.dirtyAtoms.has(key),\n type,\n // Report current dependencies. If the node hasn't been evaluated, then\n // dependencies may be missing based on the current state.\n deps: recoilValuesForKeys$1((_graph$nodeDeps$get = graph.nodeDeps.get(key)) !== null && _graph$nodeDeps$get !== void 0 ? _graph$nodeDeps$get : []),\n // Reportsall \"current\" subscribers. Evaluating other nodes or\n // previous in-progress async evaluations may introduce new subscribers.\n subscribers: {\n nodes: recoilValuesForKeys$1(downstreamNodes),\n components: Recoil_mapIterable((_storeState$nodeToCom = (_storeState$nodeToCom2 = storeState.nodeToComponentSubscriptions.get(key)) === null || _storeState$nodeToCom2 === void 0 ? void 0 : _storeState$nodeToCom2.values()) !== null && _storeState$nodeToCom !== void 0 ? _storeState$nodeToCom : [], ([name]) => ({\n name\n }))\n }\n };\n} // Find all of the recursively dependent nodes\n\n\nfunction getDownstreamNodes(store, state, keys) {\n const visitedNodes = new Set();\n const visitingNodes = Array.from(keys);\n const graph = store.getGraph(state.version);\n\n for (let key = visitingNodes.pop(); key; key = visitingNodes.pop()) {\n var _graph$nodeToNodeSubs;\n\n visitedNodes.add(key);\n const subscribedNodes = (_graph$nodeToNodeSubs = graph.nodeToNodeSubscriptions.get(key)) !== null && _graph$nodeToNodeSubs !== void 0 ? _graph$nodeToNodeSubs : emptySet;\n\n for (const downstreamNode of subscribedNodes) {\n if (!visitedNodes.has(downstreamNode)) {\n visitingNodes.push(downstreamNode);\n }\n }\n }\n\n return visitedNodes;\n}\n\nvar Recoil_FunctionalCore = {\n getNodeLoadable,\n peekNodeLoadable,\n setNodeValue,\n cleanUpNode,\n setUnvalidatedAtomValue_DEPRECATED,\n peekNodeInfo,\n getDownstreamNodes,\n initializeNodeIfNewToStore\n};\n\nconst {\n getDownstreamNodes: getDownstreamNodes$1,\n getNodeLoadable: getNodeLoadable$1,\n setNodeValue: setNodeValue$1\n} = Recoil_FunctionalCore;\n\nconst {\n getNodeMaybe: getNodeMaybe$2\n} = Recoil_Node;\n\nconst {\n DefaultValue: DefaultValue$1,\n RecoilValueNotReady: RecoilValueNotReady$1\n} = Recoil_Node;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$1,\n RecoilState: RecoilState$1,\n RecoilValueReadOnly: RecoilValueReadOnly$1,\n isRecoilValue: isRecoilValue$1\n} = Recoil_RecoilValue$1;\n\nfunction getRecoilValueAsLoadable(store, {\n key\n}, treeState = store.getState().currentTree) {\n var _storeState$nextTree, _storeState$previousT;\n\n // Reading from an older tree can cause bugs because the dependencies that we\n // discover during the read are lost.\n const storeState = store.getState();\n\n if (!(treeState.version === storeState.currentTree.version || treeState.version === ((_storeState$nextTree = storeState.nextTree) === null || _storeState$nextTree === void 0 ? void 0 : _storeState$nextTree.version) || treeState.version === ((_storeState$previousT = storeState.previousTree) === null || _storeState$previousT === void 0 ? void 0 : _storeState$previousT.version))) {\n Recoil_recoverableViolation('Tried to read from a discarded tree');\n }\n\n const loadable = getNodeLoadable$1(store, treeState, key);\n return loadable;\n}\n\nfunction applyAtomValueWrites(atomValues, writes) {\n const result = atomValues.clone();\n writes.forEach((v, k) => {\n if (v.state === 'hasValue' && v.contents instanceof DefaultValue$1) {\n result.delete(k);\n } else {\n result.set(k, v);\n }\n });\n return result;\n}\n\nfunction valueFromValueOrUpdater(store, state, {\n key\n}, valueOrUpdater) {\n if (typeof valueOrUpdater === 'function') {\n // Updater form: pass in the current value. Throw if the current value\n // is unavailable (namely when updating an async selector that's\n // pending or errored):\n const current = getNodeLoadable$1(store, state, key);\n\n if (current.state === 'loading') {\n throw new RecoilValueNotReady$1(key);\n } else if (current.state === 'hasError') {\n throw current.contents;\n } // T itself may be a function, so our refinement is not sufficient:\n\n\n return valueOrUpdater(current.contents); // flowlint-line unclear-type:off\n } else {\n return valueOrUpdater;\n }\n}\n\nfunction applyAction(store, state, action) {\n if (action.type === 'set') {\n const {\n recoilValue,\n valueOrUpdater\n } = action;\n const newValue = valueFromValueOrUpdater(store, state, recoilValue, valueOrUpdater);\n const writes = setNodeValue$1(store, state, recoilValue.key, newValue);\n\n for (const [key, loadable] of writes.entries()) {\n writeLoadableToTreeState(state, key, loadable);\n }\n } else if (action.type === 'setLoadable') {\n const {\n recoilValue: {\n key\n },\n loadable\n } = action;\n writeLoadableToTreeState(state, key, loadable);\n } else if (action.type === 'markModified') {\n const {\n recoilValue: {\n key\n }\n } = action;\n state.dirtyAtoms.add(key);\n } else if (action.type === 'setUnvalidated') {\n var _node$invalidate;\n\n // Write value directly to state bypassing the Node interface as the node\n // definitions may not have been loaded yet when processing the initial snapshot.\n const {\n recoilValue: {\n key\n },\n unvalidatedValue\n } = action;\n const node = getNodeMaybe$2(key);\n node === null || node === void 0 ? void 0 : (_node$invalidate = node.invalidate) === null || _node$invalidate === void 0 ? void 0 : _node$invalidate.call(node, state);\n state.atomValues.delete(key);\n state.nonvalidatedAtoms.set(key, unvalidatedValue);\n state.dirtyAtoms.add(key);\n } else {\n Recoil_recoverableViolation(`Unknown action ${action.type}`);\n }\n}\n\nfunction writeLoadableToTreeState(state, key, loadable) {\n if (loadable.state === 'hasValue' && loadable.contents instanceof DefaultValue$1) {\n state.atomValues.delete(key);\n } else {\n state.atomValues.set(key, loadable);\n }\n\n state.dirtyAtoms.add(key);\n state.nonvalidatedAtoms.delete(key);\n}\n\nfunction applyActionsToStore(store, actions) {\n store.replaceState(state => {\n const newState = copyTreeState(state);\n\n for (const action of actions) {\n applyAction(store, newState, action);\n }\n\n invalidateDownstreams(store, newState);\n return newState;\n });\n}\n\nfunction queueOrPerformStateUpdate(store, action) {\n if (batchStack.length) {\n const actionsByStore = batchStack[batchStack.length - 1];\n let actions = actionsByStore.get(store);\n\n if (!actions) {\n actionsByStore.set(store, actions = []);\n }\n\n actions.push(action);\n } else {\n applyActionsToStore(store, [action]);\n }\n}\n\nconst batchStack = [];\n\nfunction batchStart() {\n const actionsByStore = new Map();\n batchStack.push(actionsByStore);\n return () => {\n for (const [store, actions] of actionsByStore) {\n applyActionsToStore(store, actions);\n }\n\n const popped = batchStack.pop();\n\n if (popped !== actionsByStore) {\n Recoil_recoverableViolation('Incorrect order of batch popping');\n }\n };\n}\n\nfunction copyTreeState(state) {\n return { ...state,\n atomValues: state.atomValues.clone(),\n nonvalidatedAtoms: state.nonvalidatedAtoms.clone(),\n dirtyAtoms: new Set(state.dirtyAtoms)\n };\n}\n\nfunction invalidateDownstreams(store, state) {\n // Inform any nodes that were changed or downstream of changes so that they\n // can clear out any caches as needed due to the update:\n const downstreams = getDownstreamNodes$1(store, state, state.dirtyAtoms);\n\n for (const key of downstreams) {\n var _getNodeMaybe, _getNodeMaybe$invalid;\n\n (_getNodeMaybe = getNodeMaybe$2(key)) === null || _getNodeMaybe === void 0 ? void 0 : (_getNodeMaybe$invalid = _getNodeMaybe.invalidate) === null || _getNodeMaybe$invalid === void 0 ? void 0 : _getNodeMaybe$invalid.call(_getNodeMaybe, state);\n }\n}\n\nfunction setRecoilValue(store, recoilValue, valueOrUpdater) {\n queueOrPerformStateUpdate(store, {\n type: 'set',\n recoilValue,\n valueOrUpdater\n });\n}\n\nfunction setRecoilValueLoadable(store, recoilValue, loadable) {\n if (loadable instanceof DefaultValue$1) {\n return setRecoilValue(store, recoilValue, loadable);\n }\n\n queueOrPerformStateUpdate(store, {\n type: 'setLoadable',\n recoilValue,\n loadable\n });\n}\n\nfunction markRecoilValueModified(store, recoilValue) {\n queueOrPerformStateUpdate(store, {\n type: 'markModified',\n recoilValue\n });\n}\n\nfunction setUnvalidatedRecoilValue(store, recoilValue, unvalidatedValue) {\n queueOrPerformStateUpdate(store, {\n type: 'setUnvalidated',\n recoilValue,\n unvalidatedValue\n });\n}\n\nlet subscriptionID = 0;\n\nfunction subscribeToRecoilValue(store, {\n key\n}, callback, componentDebugName = null) {\n const subID = subscriptionID++;\n const storeState = store.getState();\n\n if (!storeState.nodeToComponentSubscriptions.has(key)) {\n storeState.nodeToComponentSubscriptions.set(key, new Map());\n }\n\n Recoil_nullthrows(storeState.nodeToComponentSubscriptions.get(key)).set(subID, [componentDebugName !== null && componentDebugName !== void 0 ? componentDebugName : '', callback]);\n return {\n release: () => {\n const storeState = store.getState();\n const subs = storeState.nodeToComponentSubscriptions.get(key);\n\n if (subs === undefined || !subs.has(subID)) {\n Recoil_recoverableViolation(`Subscription missing at release time for atom ${key}. This is a bug in Recoil.`);\n return;\n }\n\n subs.delete(subID);\n\n if (subs.size === 0) {\n storeState.nodeToComponentSubscriptions.delete(key);\n }\n }\n };\n}\n\nvar Recoil_RecoilValueInterface = {\n RecoilValueReadOnly: RecoilValueReadOnly$1,\n AbstractRecoilValue: AbstractRecoilValue$1,\n RecoilState: RecoilState$1,\n getRecoilValueAsLoadable,\n setRecoilValue,\n setRecoilValueLoadable,\n markRecoilValueModified,\n setUnvalidatedRecoilValue,\n subscribeToRecoilValue,\n isRecoilValue: isRecoilValue$1,\n applyAtomValueWrites,\n // TODO Remove export when deprecating initialStoreState_DEPRECATED in RecoilRoot\n batchStart,\n invalidateDownstreams_FOR_TESTING: invalidateDownstreams\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is to export esstiential functions from react-dom\n * for our web build\n */\nconst {\n unstable_batchedUpdates\n} = reactDom;\n\nvar ReactBatchedUpdates = {\n unstable_batchedUpdates\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is to export esstiential functions from react-dom\n * for our web build\n */\n// @fb-only: const {unstable_batchedUpdates} = require('ReactDOMComet');\nconst {\n unstable_batchedUpdates: unstable_batchedUpdates$1\n} = ReactBatchedUpdates; // @oss-only\n\n\nvar Recoil_ReactBatchedUpdates = {\n unstable_batchedUpdates: unstable_batchedUpdates$1\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\nconst {\n batchStart: batchStart$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n unstable_batchedUpdates: unstable_batchedUpdates$2\n} = Recoil_ReactBatchedUpdates;\n\nlet batcher = unstable_batchedUpdates$2; // flowlint-next-line unclear-type:off\n\n/**\n * Sets the provided batcher function as the batcher function used by Recoil.\n *\n * Set the batcher to a custom batcher for your renderer,\n * if you use a renderer other than React DOM or React Native.\n */\nconst setBatcher = newBatcher => {\n batcher = newBatcher;\n};\n/**\n * Returns the current batcher function.\n */\n\n\nconst getBatcher = () => batcher;\n/**\n * Calls the current batcher function and passes the\n * provided callback function.\n */\n\n\nconst batchUpdates = callback => {\n batcher(() => {\n let batchEnd = () => undefined;\n\n try {\n batchEnd = batchStart$1();\n callback();\n } finally {\n batchEnd();\n }\n });\n};\n\nvar Recoil_Batching = {\n getBatcher,\n setBatcher,\n batchUpdates\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction enqueueExecution(s, f) {\n f();\n}\n\nvar Recoil_Queue = {\n enqueueExecution\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a set containing all of the values from the first set that are not\n * present in any of the subsequent sets.\n *\n * Note: this is written procedurally (i.e., without filterSet) for performant\n * use in tight loops.\n */\n\nfunction differenceSets(set, ...setsWithValuesToRemove) {\n const ret = new Set();\n\n FIRST: for (const value of set) {\n for (const otherSet of setsWithValuesToRemove) {\n if (otherSet.has(value)) {\n continue FIRST;\n }\n }\n\n ret.add(value);\n }\n\n return ret;\n}\n\nvar Recoil_differenceSets = differenceSets;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a new Map object with the same keys as the original, but with the\n * values replaced with the output of the given callback function.\n */\n\nfunction mapMap(map, callback) {\n const result = new Map();\n map.forEach((value, key) => {\n result.set(key, callback(value, key));\n });\n return result;\n}\n\nvar Recoil_mapMap = mapMap;\n\nfunction graph() {\n return {\n nodeDeps: new Map(),\n nodeToNodeSubscriptions: new Map()\n };\n}\n\nfunction cloneGraph(graph) {\n return {\n nodeDeps: Recoil_mapMap(graph.nodeDeps, s => new Set(s)),\n nodeToNodeSubscriptions: Recoil_mapMap(graph.nodeToNodeSubscriptions, s => new Set(s))\n };\n} // Note that this overwrites the deps of existing nodes, rather than unioning\n// the new deps with the old deps.\n\n\nfunction mergeDependencyMapIntoGraph(deps, graph, // If olderGraph is given then we will not overwrite changes made to the given\n// graph compared with olderGraph:\nolderGraph) {\n const {\n nodeDeps,\n nodeToNodeSubscriptions\n } = graph;\n deps.forEach((upstreams, downstream) => {\n const existingUpstreams = nodeDeps.get(downstream);\n\n if (existingUpstreams && olderGraph && existingUpstreams !== olderGraph.nodeDeps.get(downstream)) {\n return;\n } // Update nodeDeps:\n\n\n nodeDeps.set(downstream, new Set(upstreams)); // Add new deps to nodeToNodeSubscriptions:\n\n const addedUpstreams = existingUpstreams == null ? upstreams : Recoil_differenceSets(upstreams, existingUpstreams);\n addedUpstreams.forEach(upstream => {\n if (!nodeToNodeSubscriptions.has(upstream)) {\n nodeToNodeSubscriptions.set(upstream, new Set());\n }\n\n const existing = Recoil_nullthrows(nodeToNodeSubscriptions.get(upstream));\n existing.add(downstream);\n }); // Remove removed deps from nodeToNodeSubscriptions:\n\n if (existingUpstreams) {\n const removedUpstreams = Recoil_differenceSets(existingUpstreams, upstreams);\n removedUpstreams.forEach(upstream => {\n if (!nodeToNodeSubscriptions.has(upstream)) {\n return;\n }\n\n const existing = Recoil_nullthrows(nodeToNodeSubscriptions.get(upstream));\n existing.delete(downstream);\n\n if (existing.size === 0) {\n nodeToNodeSubscriptions.delete(upstream);\n }\n });\n }\n });\n}\n\nfunction saveDependencyMapToStore(dependencyMap, store, version) {\n var _storeState$nextTree, _storeState$previousT, _storeState$previousT2, _storeState$previousT3;\n\n const storeState = store.getState();\n\n if (!(version === storeState.currentTree.version || version === ((_storeState$nextTree = storeState.nextTree) === null || _storeState$nextTree === void 0 ? void 0 : _storeState$nextTree.version) || version === ((_storeState$previousT = storeState.previousTree) === null || _storeState$previousT === void 0 ? void 0 : _storeState$previousT.version))) {\n Recoil_recoverableViolation('Tried to save dependencies to a discarded tree');\n } // Merge the dependencies discovered into the store's dependency map\n // for the version that was read:\n\n\n const graph = store.getGraph(version);\n mergeDependencyMapIntoGraph(dependencyMap, graph); // If this version is not the latest version, also write these dependencies\n // into later versions if they don't already have their own:\n\n if (version === ((_storeState$previousT2 = storeState.previousTree) === null || _storeState$previousT2 === void 0 ? void 0 : _storeState$previousT2.version)) {\n const currentGraph = store.getGraph(storeState.currentTree.version);\n mergeDependencyMapIntoGraph(dependencyMap, currentGraph, graph);\n }\n\n if (version === ((_storeState$previousT3 = storeState.previousTree) === null || _storeState$previousT3 === void 0 ? void 0 : _storeState$previousT3.version) || version === storeState.currentTree.version) {\n var _storeState$nextTree2;\n\n const nextVersion = (_storeState$nextTree2 = storeState.nextTree) === null || _storeState$nextTree2 === void 0 ? void 0 : _storeState$nextTree2.version;\n\n if (nextVersion !== undefined) {\n const nextGraph = store.getGraph(nextVersion);\n mergeDependencyMapIntoGraph(dependencyMap, nextGraph, graph);\n }\n }\n}\n\nfunction mergeDepsIntoDependencyMap(from, into) {\n from.forEach((upstreamDeps, downstreamNode) => {\n if (!into.has(downstreamNode)) {\n into.set(downstreamNode, new Set());\n }\n\n const deps = Recoil_nullthrows(into.get(downstreamNode));\n upstreamDeps.forEach(dep => deps.add(dep));\n });\n}\n\nfunction addToDependencyMap(downstream, upstream, dependencyMap) {\n if (!dependencyMap.has(downstream)) {\n dependencyMap.set(downstream, new Set());\n }\n\n Recoil_nullthrows(dependencyMap.get(downstream)).add(upstream);\n}\n\nvar Recoil_Graph = {\n addToDependencyMap,\n cloneGraph,\n graph,\n mergeDepsIntoDependencyMap,\n saveDependencyMapToStore\n};\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar hamt_1 = createCommonjsModule(function (module) {\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n/**\n @fileOverview Hash Array Mapped Trie.\n\n Code based on: https://github.com/exclipy/pdata\n*/\n\n\nvar hamt = {}; // export\n\n/* Configuration\n ******************************************************************************/\n\nvar SIZE = 5;\nvar BUCKET_SIZE = Math.pow(2, SIZE);\nvar MASK = BUCKET_SIZE - 1;\nvar MAX_INDEX_NODE = BUCKET_SIZE / 2;\nvar MIN_ARRAY_NODE = BUCKET_SIZE / 4;\n/*\n ******************************************************************************/\n\nvar nothing = {};\n\nvar constant = function constant(x) {\n return function () {\n return x;\n };\n};\n/**\n Get 32 bit hash of string.\n\n Based on:\n http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery\n*/\n\n\nvar hash = hamt.hash = function (str) {\n var type = typeof str === 'undefined' ? 'undefined' : _typeof(str);\n if (type === 'number') return str;\n if (type !== 'string') str += '';\n var hash = 0;\n\n for (var i = 0, len = str.length; i < len; ++i) {\n var c = str.charCodeAt(i);\n hash = (hash << 5) - hash + c | 0;\n }\n\n return hash;\n};\n/* Bit Ops\n ******************************************************************************/\n\n/**\n Hamming weight.\n\n Taken from: http://jsperf.com/hamming-weight\n*/\n\n\nvar popcount = function popcount(x) {\n x -= x >> 1 & 0x55555555;\n x = (x & 0x33333333) + (x >> 2 & 0x33333333);\n x = x + (x >> 4) & 0x0f0f0f0f;\n x += x >> 8;\n x += x >> 16;\n return x & 0x7f;\n};\n\nvar hashFragment = function hashFragment(shift, h) {\n return h >>> shift & MASK;\n};\n\nvar toBitmap = function toBitmap(x) {\n return 1 << x;\n};\n\nvar fromBitmap = function fromBitmap(bitmap, bit) {\n return popcount(bitmap & bit - 1);\n};\n/* Array Ops\n ******************************************************************************/\n\n/**\n Set a value in an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to change.\n @param v New value\n @param arr Array.\n*/\n\n\nvar arrayUpdate = function arrayUpdate(mutate, at, v, arr) {\n var out = arr;\n\n if (!mutate) {\n var len = arr.length;\n out = new Array(len);\n\n for (var i = 0; i < len; ++i) {\n out[i] = arr[i];\n }\n }\n\n out[at] = v;\n return out;\n};\n/**\n Remove a value from an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to remove.\n @param arr Array.\n*/\n\n\nvar arraySpliceOut = function arraySpliceOut(mutate, at, arr) {\n var newLen = arr.length - 1;\n var i = 0;\n var g = 0;\n var out = arr;\n\n if (mutate) {\n i = g = at;\n } else {\n out = new Array(newLen);\n\n while (i < at) {\n out[g++] = arr[i++];\n }\n }\n\n ++i;\n\n while (i <= newLen) {\n out[g++] = arr[i++];\n }\n\n if (mutate) {\n out.length = newLen;\n }\n\n return out;\n};\n/**\n Insert a value into an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to insert at.\n @param v Value to insert,\n @param arr Array.\n*/\n\n\nvar arraySpliceIn = function arraySpliceIn(mutate, at, v, arr) {\n var len = arr.length;\n\n if (mutate) {\n var _i = len;\n\n while (_i >= at) {\n arr[_i--] = arr[_i];\n }\n\n arr[at] = v;\n return arr;\n }\n\n var i = 0,\n g = 0;\n var out = new Array(len + 1);\n\n while (i < at) {\n out[g++] = arr[i++];\n }\n\n out[at] = v;\n\n while (i < len) {\n out[++g] = arr[i++];\n }\n\n return out;\n};\n/* Node Structures\n ******************************************************************************/\n\n\nvar LEAF = 1;\nvar COLLISION = 2;\nvar INDEX = 3;\nvar ARRAY = 4;\n/**\n Empty node.\n*/\n\nvar empty = {\n __hamt_isEmpty: true\n};\n\nvar isEmptyNode = function isEmptyNode(x) {\n return x === empty || x && x.__hamt_isEmpty;\n};\n/**\n Leaf holding a value.\n\n @member edit Edit of the node.\n @member hash Hash of key.\n @member key Key.\n @member value Value stored.\n*/\n\n\nvar Leaf = function Leaf(edit, hash, key, value) {\n return {\n type: LEAF,\n edit: edit,\n hash: hash,\n key: key,\n value: value,\n _modify: Leaf__modify\n };\n};\n/**\n Leaf holding multiple values with the same hash but different keys.\n\n @member edit Edit of the node.\n @member hash Hash of key.\n @member children Array of collision children node.\n*/\n\n\nvar Collision = function Collision(edit, hash, children) {\n return {\n type: COLLISION,\n edit: edit,\n hash: hash,\n children: children,\n _modify: Collision__modify\n };\n};\n/**\n Internal node with a sparse set of children.\n\n Uses a bitmap and array to pack children.\n\n @member edit Edit of the node.\n @member mask Bitmap that encode the positions of children in the array.\n @member children Array of child nodes.\n*/\n\n\nvar IndexedNode = function IndexedNode(edit, mask, children) {\n return {\n type: INDEX,\n edit: edit,\n mask: mask,\n children: children,\n _modify: IndexedNode__modify\n };\n};\n/**\n Internal node with many children.\n\n @member edit Edit of the node.\n @member size Number of children.\n @member children Array of child nodes.\n*/\n\n\nvar ArrayNode = function ArrayNode(edit, size, children) {\n return {\n type: ARRAY,\n edit: edit,\n size: size,\n children: children,\n _modify: ArrayNode__modify\n };\n};\n/**\n Is `node` a leaf node?\n*/\n\n\nvar isLeaf = function isLeaf(node) {\n return node === empty || node.type === LEAF || node.type === COLLISION;\n};\n/* Internal node operations.\n ******************************************************************************/\n\n/**\n Expand an indexed node into an array node.\n\n @param edit Current edit.\n @param frag Index of added child.\n @param child Added child.\n @param mask Index node mask before child added.\n @param subNodes Index node children before child added.\n*/\n\n\nvar expand = function expand(edit, frag, child, bitmap, subNodes) {\n var arr = [];\n var bit = bitmap;\n var count = 0;\n\n for (var i = 0; bit; ++i) {\n if (bit & 1) arr[i] = subNodes[count++];\n bit >>>= 1;\n }\n\n arr[frag] = child;\n return ArrayNode(edit, count + 1, arr);\n};\n/**\n Collapse an array node into a indexed node.\n\n @param edit Current edit.\n @param count Number of elements in new array.\n @param removed Index of removed element.\n @param elements Array node children before remove.\n*/\n\n\nvar pack = function pack(edit, count, removed, elements) {\n var children = new Array(count - 1);\n var g = 0;\n var bitmap = 0;\n\n for (var i = 0, len = elements.length; i < len; ++i) {\n if (i !== removed) {\n var elem = elements[i];\n\n if (elem && !isEmptyNode(elem)) {\n children[g++] = elem;\n bitmap |= 1 << i;\n }\n }\n }\n\n return IndexedNode(edit, bitmap, children);\n};\n/**\n Merge two leaf nodes.\n\n @param shift Current shift.\n @param h1 Node 1 hash.\n @param n1 Node 1.\n @param h2 Node 2 hash.\n @param n2 Node 2.\n*/\n\n\nvar mergeLeaves = function mergeLeaves(edit, shift, h1, n1, h2, n2) {\n if (h1 === h2) return Collision(edit, h1, [n2, n1]);\n var subH1 = hashFragment(shift, h1);\n var subH2 = hashFragment(shift, h2);\n return IndexedNode(edit, toBitmap(subH1) | toBitmap(subH2), subH1 === subH2 ? [mergeLeaves(edit, shift + SIZE, h1, n1, h2, n2)] : subH1 < subH2 ? [n1, n2] : [n2, n1]);\n};\n/**\n Update an entry in a collision list.\n\n @param mutate Should mutation be used?\n @param edit Current edit.\n @param keyEq Key compare function.\n @param hash Hash of collision.\n @param list Collision list.\n @param f Update function.\n @param k Key to update.\n @param size Size ref.\n*/\n\n\nvar updateCollisionList = function updateCollisionList(mutate, edit, keyEq, h, list, f, k, size) {\n var len = list.length;\n\n for (var i = 0; i < len; ++i) {\n var child = list[i];\n\n if (keyEq(k, child.key)) {\n var value = child.value;\n\n var _newValue = f(value);\n\n if (_newValue === value) return list;\n\n if (_newValue === nothing) {\n --size.value;\n return arraySpliceOut(mutate, i, list);\n }\n\n return arrayUpdate(mutate, i, Leaf(edit, h, k, _newValue), list);\n }\n }\n\n var newValue = f();\n if (newValue === nothing) return list;\n ++size.value;\n return arrayUpdate(mutate, len, Leaf(edit, h, k, newValue), list);\n};\n\nvar canEditNode = function canEditNode(edit, node) {\n return edit === node.edit;\n};\n/* Editing\n ******************************************************************************/\n\n\nvar Leaf__modify = function Leaf__modify(edit, keyEq, shift, f, h, k, size) {\n if (keyEq(k, this.key)) {\n var _v = f(this.value);\n\n if (_v === this.value) return this;else if (_v === nothing) {\n --size.value;\n return empty;\n }\n\n if (canEditNode(edit, this)) {\n this.value = _v;\n return this;\n }\n\n return Leaf(edit, h, k, _v);\n }\n\n var v = f();\n if (v === nothing) return this;\n ++size.value;\n return mergeLeaves(edit, shift, this.hash, this, h, Leaf(edit, h, k, v));\n};\n\nvar Collision__modify = function Collision__modify(edit, keyEq, shift, f, h, k, size) {\n if (h === this.hash) {\n var canEdit = canEditNode(edit, this);\n var list = updateCollisionList(canEdit, edit, keyEq, this.hash, this.children, f, k, size);\n if (list === this.children) return this;\n return list.length > 1 ? Collision(edit, this.hash, list) : list[0]; // collapse single element collision list\n }\n\n var v = f();\n if (v === nothing) return this;\n ++size.value;\n return mergeLeaves(edit, shift, this.hash, this, h, Leaf(edit, h, k, v));\n};\n\nvar IndexedNode__modify = function IndexedNode__modify(edit, keyEq, shift, f, h, k, size) {\n var mask = this.mask;\n var children = this.children;\n var frag = hashFragment(shift, h);\n var bit = toBitmap(frag);\n var indx = fromBitmap(mask, bit);\n var exists = mask & bit;\n var current = exists ? children[indx] : empty;\n\n var child = current._modify(edit, keyEq, shift + SIZE, f, h, k, size);\n\n if (current === child) return this;\n var canEdit = canEditNode(edit, this);\n var bitmap = mask;\n var newChildren = void 0;\n\n if (exists && isEmptyNode(child)) {\n // remove\n bitmap &= ~bit;\n if (!bitmap) return empty;\n if (children.length <= 2 && isLeaf(children[indx ^ 1])) return children[indx ^ 1]; // collapse\n\n newChildren = arraySpliceOut(canEdit, indx, children);\n } else if (!exists && !isEmptyNode(child)) {\n // add\n if (children.length >= MAX_INDEX_NODE) return expand(edit, frag, child, mask, children);\n bitmap |= bit;\n newChildren = arraySpliceIn(canEdit, indx, child, children);\n } else {\n // modify\n newChildren = arrayUpdate(canEdit, indx, child, children);\n }\n\n if (canEdit) {\n this.mask = bitmap;\n this.children = newChildren;\n return this;\n }\n\n return IndexedNode(edit, bitmap, newChildren);\n};\n\nvar ArrayNode__modify = function ArrayNode__modify(edit, keyEq, shift, f, h, k, size) {\n var count = this.size;\n var children = this.children;\n var frag = hashFragment(shift, h);\n var child = children[frag];\n\n var newChild = (child || empty)._modify(edit, keyEq, shift + SIZE, f, h, k, size);\n\n if (child === newChild) return this;\n var canEdit = canEditNode(edit, this);\n var newChildren = void 0;\n\n if (isEmptyNode(child) && !isEmptyNode(newChild)) {\n // add\n ++count;\n newChildren = arrayUpdate(canEdit, frag, newChild, children);\n } else if (!isEmptyNode(child) && isEmptyNode(newChild)) {\n // remove\n --count;\n if (count <= MIN_ARRAY_NODE) return pack(edit, count, frag, children);\n newChildren = arrayUpdate(canEdit, frag, empty, children);\n } else {\n // modify\n newChildren = arrayUpdate(canEdit, frag, newChild, children);\n }\n\n if (canEdit) {\n this.size = count;\n this.children = newChildren;\n return this;\n }\n\n return ArrayNode(edit, count, newChildren);\n};\n\nempty._modify = function (edit, keyEq, shift, f, h, k, size) {\n var v = f();\n if (v === nothing) return empty;\n ++size.value;\n return Leaf(edit, h, k, v);\n};\n/*\n ******************************************************************************/\n\n\nfunction Map(editable, edit, config, root, size) {\n this._editable = editable;\n this._edit = edit;\n this._config = config;\n this._root = root;\n this._size = size;\n}\n\nMap.prototype.setTree = function (newRoot, newSize) {\n if (this._editable) {\n this._root = newRoot;\n this._size = newSize;\n return this;\n }\n\n return newRoot === this._root ? this : new Map(this._editable, this._edit, this._config, newRoot, newSize);\n};\n/* Queries\n ******************************************************************************/\n\n/**\n Lookup the value for `key` in `map` using a custom `hash`.\n\n Returns the value or `alt` if none.\n*/\n\n\nvar tryGetHash = hamt.tryGetHash = function (alt, hash, key, map) {\n var node = map._root;\n var shift = 0;\n var keyEq = map._config.keyEq;\n\n while (true) {\n switch (node.type) {\n case LEAF:\n {\n return keyEq(key, node.key) ? node.value : alt;\n }\n\n case COLLISION:\n {\n if (hash === node.hash) {\n var children = node.children;\n\n for (var i = 0, len = children.length; i < len; ++i) {\n var child = children[i];\n if (keyEq(key, child.key)) return child.value;\n }\n }\n\n return alt;\n }\n\n case INDEX:\n {\n var frag = hashFragment(shift, hash);\n var bit = toBitmap(frag);\n\n if (node.mask & bit) {\n node = node.children[fromBitmap(node.mask, bit)];\n shift += SIZE;\n break;\n }\n\n return alt;\n }\n\n case ARRAY:\n {\n node = node.children[hashFragment(shift, hash)];\n\n if (node) {\n shift += SIZE;\n break;\n }\n\n return alt;\n }\n\n default:\n return alt;\n }\n }\n};\n\nMap.prototype.tryGetHash = function (alt, hash, key) {\n return tryGetHash(alt, hash, key, this);\n};\n/**\n Lookup the value for `key` in `map` using internal hash function.\n\n @see `tryGetHash`\n*/\n\n\nvar tryGet = hamt.tryGet = function (alt, key, map) {\n return tryGetHash(alt, map._config.hash(key), key, map);\n};\n\nMap.prototype.tryGet = function (alt, key) {\n return tryGet(alt, key, this);\n};\n/**\n Lookup the value for `key` in `map` using a custom `hash`.\n\n Returns the value or `undefined` if none.\n*/\n\n\nvar getHash = hamt.getHash = function (hash, key, map) {\n return tryGetHash(undefined, hash, key, map);\n};\n\nMap.prototype.getHash = function (hash, key) {\n return getHash(hash, key, this);\n};\n/**\n Lookup the value for `key` in `map` using internal hash function.\n\n @see `get`\n*/\n\n\nvar get = hamt.get = function (key, map) {\n return tryGetHash(undefined, map._config.hash(key), key, map);\n};\n\nMap.prototype.get = function (key, alt) {\n return tryGet(alt, key, this);\n};\n/**\n Does an entry exist for `key` in `map`? Uses custom `hash`.\n*/\n\n\nvar hasHash = hamt.has = function (hash, key, map) {\n return tryGetHash(nothing, hash, key, map) !== nothing;\n};\n\nMap.prototype.hasHash = function (hash, key) {\n return hasHash(hash, key, this);\n};\n/**\n Does an entry exist for `key` in `map`? Uses internal hash function.\n*/\n\n\nvar has = hamt.has = function (key, map) {\n return hasHash(map._config.hash(key), key, map);\n};\n\nMap.prototype.has = function (key) {\n return has(key, this);\n};\n\nvar defKeyCompare = function defKeyCompare(x, y) {\n return x === y;\n};\n/**\n Create an empty map.\n\n @param config Configuration.\n*/\n\n\nhamt.make = function (config) {\n return new Map(0, 0, {\n keyEq: config && config.keyEq || defKeyCompare,\n hash: config && config.hash || hash\n }, empty, 0);\n};\n/**\n Empty map.\n*/\n\n\nhamt.empty = hamt.make();\n/**\n Does `map` contain any elements?\n*/\n\nvar isEmpty = hamt.isEmpty = function (map) {\n return map && !!isEmptyNode(map._root);\n};\n\nMap.prototype.isEmpty = function () {\n return isEmpty(this);\n};\n/* Updates\n ******************************************************************************/\n\n/**\n Alter the value stored for `key` in `map` using function `f` using\n custom hash.\n\n `f` is invoked with the current value for `k` if it exists,\n or no arguments if no such value exists. `modify` will always either\n update or insert a value into the map.\n\n Returns a map with the modified value. Does not alter `map`.\n*/\n\n\nvar modifyHash = hamt.modifyHash = function (f, hash, key, map) {\n var size = {\n value: map._size\n };\n\n var newRoot = map._root._modify(map._editable ? map._edit : NaN, map._config.keyEq, 0, f, hash, key, size);\n\n return map.setTree(newRoot, size.value);\n};\n\nMap.prototype.modifyHash = function (hash, key, f) {\n return modifyHash(f, hash, key, this);\n};\n/**\n Alter the value stored for `key` in `map` using function `f` using\n internal hash function.\n\n @see `modifyHash`\n*/\n\n\nvar modify = hamt.modify = function (f, key, map) {\n return modifyHash(f, map._config.hash(key), key, map);\n};\n\nMap.prototype.modify = function (key, f) {\n return modify(f, key, this);\n};\n/**\n Store `value` for `key` in `map` using custom `hash`.\n\n Returns a map with the modified value. Does not alter `map`.\n*/\n\n\nvar setHash = hamt.setHash = function (hash, key, value, map) {\n return modifyHash(constant(value), hash, key, map);\n};\n\nMap.prototype.setHash = function (hash, key, value) {\n return setHash(hash, key, value, this);\n};\n/**\n Store `value` for `key` in `map` using internal hash function.\n\n @see `setHash`\n*/\n\n\nvar set = hamt.set = function (key, value, map) {\n return setHash(map._config.hash(key), key, value, map);\n};\n\nMap.prototype.set = function (key, value) {\n return set(key, value, this);\n};\n/**\n Remove the entry for `key` in `map`.\n\n Returns a map with the value removed. Does not alter `map`.\n*/\n\n\nvar del = constant(nothing);\n\nvar removeHash = hamt.removeHash = function (hash, key, map) {\n return modifyHash(del, hash, key, map);\n};\n\nMap.prototype.removeHash = Map.prototype.deleteHash = function (hash, key) {\n return removeHash(hash, key, this);\n};\n/**\n Remove the entry for `key` in `map` using internal hash function.\n\n @see `removeHash`\n*/\n\n\nvar remove = hamt.remove = function (key, map) {\n return removeHash(map._config.hash(key), key, map);\n};\n\nMap.prototype.remove = Map.prototype.delete = function (key) {\n return remove(key, this);\n};\n/* Mutation\n ******************************************************************************/\n\n/**\n Mark `map` as mutable.\n */\n\n\nvar beginMutation = hamt.beginMutation = function (map) {\n return new Map(map._editable + 1, map._edit + 1, map._config, map._root, map._size);\n};\n\nMap.prototype.beginMutation = function () {\n return beginMutation(this);\n};\n/**\n Mark `map` as immutable.\n */\n\n\nvar endMutation = hamt.endMutation = function (map) {\n map._editable = map._editable && map._editable - 1;\n return map;\n};\n\nMap.prototype.endMutation = function () {\n return endMutation(this);\n};\n/**\n Mutate `map` within the context of `f`.\n @param f\n @param map HAMT\n*/\n\n\nvar mutate = hamt.mutate = function (f, map) {\n var transient = beginMutation(map);\n f(transient);\n return endMutation(transient);\n};\n\nMap.prototype.mutate = function (f) {\n return mutate(f, this);\n};\n/* Traversal\n ******************************************************************************/\n\n/**\n Apply a continuation.\n*/\n\n\nvar appk = function appk(k) {\n return k && lazyVisitChildren(k[0], k[1], k[2], k[3], k[4]);\n};\n/**\n Recursively visit all values stored in an array of nodes lazily.\n*/\n\n\nvar lazyVisitChildren = function lazyVisitChildren(len, children, i, f, k) {\n while (i < len) {\n var child = children[i++];\n if (child && !isEmptyNode(child)) return lazyVisit(child, f, [len, children, i, f, k]);\n }\n\n return appk(k);\n};\n/**\n Recursively visit all values stored in `node` lazily.\n*/\n\n\nvar lazyVisit = function lazyVisit(node, f, k) {\n switch (node.type) {\n case LEAF:\n return {\n value: f(node),\n rest: k\n };\n\n case COLLISION:\n case ARRAY:\n case INDEX:\n var children = node.children;\n return lazyVisitChildren(children.length, children, 0, f, k);\n\n default:\n return appk(k);\n }\n};\n\nvar DONE = {\n done: true\n};\n/**\n Javascript iterator over a map.\n*/\n\nfunction MapIterator(v) {\n this.v = v;\n}\n\nMapIterator.prototype.next = function () {\n if (!this.v) return DONE;\n var v0 = this.v;\n this.v = appk(v0.rest);\n return v0;\n};\n\nMapIterator.prototype[Symbol.iterator] = function () {\n return this;\n};\n/**\n Lazily visit each value in map with function `f`.\n*/\n\n\nvar visit = function visit(map, f) {\n return new MapIterator(lazyVisit(map._root, f));\n};\n/**\n Get a Javascsript iterator of `map`.\n\n Iterates over `[key, value]` arrays.\n*/\n\n\nvar buildPairs = function buildPairs(x) {\n return [x.key, x.value];\n};\n\nvar entries = hamt.entries = function (map) {\n return visit(map, buildPairs);\n};\n\nMap.prototype.entries = Map.prototype[Symbol.iterator] = function () {\n return entries(this);\n};\n/**\n Get array of all keys in `map`.\n\n Order is not guaranteed.\n*/\n\n\nvar buildKeys = function buildKeys(x) {\n return x.key;\n};\n\nvar keys = hamt.keys = function (map) {\n return visit(map, buildKeys);\n};\n\nMap.prototype.keys = function () {\n return keys(this);\n};\n/**\n Get array of all values in `map`.\n\n Order is not guaranteed, duplicates are preserved.\n*/\n\n\nvar buildValues = function buildValues(x) {\n return x.value;\n};\n\nvar values = hamt.values = Map.prototype.values = function (map) {\n return visit(map, buildValues);\n};\n\nMap.prototype.values = function () {\n return values(this);\n};\n/* Fold\n ******************************************************************************/\n\n/**\n Visit every entry in the map, aggregating data.\n\n Order of nodes is not guaranteed.\n\n @param f Function mapping accumulated value, value, and key to new value.\n @param z Starting value.\n @param m HAMT\n*/\n\n\nvar fold = hamt.fold = function (f, z, m) {\n var root = m._root;\n if (root.type === LEAF) return f(z, root.value, root.key);\n var toVisit = [root.children];\n var children = void 0;\n\n while (children = toVisit.pop()) {\n for (var i = 0, len = children.length; i < len;) {\n var child = children[i++];\n\n if (child && child.type) {\n if (child.type === LEAF) z = f(z, child.value, child.key);else toVisit.push(child.children);\n }\n }\n }\n\n return z;\n};\n\nMap.prototype.fold = function (f, z) {\n return fold(f, z, this);\n};\n/**\n Visit every entry in the map, aggregating data.\n\n Order of nodes is not guaranteed.\n\n @param f Function invoked with value and key\n @param map HAMT\n*/\n\n\nvar forEach = hamt.forEach = function (f, map) {\n return fold(function (_, value, key) {\n return f(value, key, map);\n }, null, map);\n};\n\nMap.prototype.forEach = function (f) {\n return forEach(f, this);\n};\n/* Aggregate\n ******************************************************************************/\n\n/**\n Get the number of entries in `map`.\n*/\n\n\nvar count = hamt.count = function (map) {\n return map._size;\n};\n\nMap.prototype.count = function () {\n return count(this);\n};\n\nObject.defineProperty(Map.prototype, 'size', {\n get: Map.prototype.count\n});\n/* Export\n ******************************************************************************/\n\nif ( module.exports) {\n module.exports = hamt;\n} else {\n undefined.hamt = hamt;\n}\n});\n\nclass BuiltInMap {\n constructor(existing) {\n _defineProperty(this, \"_map\", void 0);\n\n this._map = new Map(existing === null || existing === void 0 ? void 0 : existing.entries());\n }\n\n keys() {\n return this._map.keys();\n }\n\n entries() {\n return this._map.entries();\n }\n\n get(k) {\n return this._map.get(k);\n }\n\n has(k) {\n return this._map.has(k);\n }\n\n set(k, v) {\n this._map.set(k, v);\n\n return this;\n }\n\n delete(k) {\n this._map.delete(k);\n\n return this;\n }\n\n clone() {\n return persistentMap(this);\n }\n\n toMap() {\n return new Map(this._map);\n }\n\n}\n\nclass HashArrayMappedTrieMap {\n // Because hamt.empty is not a function there is no way to introduce type\n // parameters on it, so empty is typed as HAMTPlusMap.\n // flowlint-next-line unclear-type:off\n constructor(existing) {\n _defineProperty(this, \"_hamt\", hamt_1.empty.beginMutation());\n\n if (existing instanceof HashArrayMappedTrieMap) {\n const h = existing._hamt.endMutation();\n\n existing._hamt = h.beginMutation();\n this._hamt = h.beginMutation();\n } else if (existing) {\n for (const [k, v] of existing.entries()) {\n this._hamt.set(k, v);\n }\n }\n }\n\n keys() {\n return this._hamt.keys();\n }\n\n entries() {\n return this._hamt.entries();\n }\n\n get(k) {\n return this._hamt.get(k);\n }\n\n has(k) {\n return this._hamt.has(k);\n }\n\n set(k, v) {\n this._hamt.set(k, v);\n\n return this;\n }\n\n delete(k) {\n this._hamt.delete(k);\n\n return this;\n }\n\n clone() {\n return persistentMap(this);\n }\n\n toMap() {\n return new Map(this._hamt);\n }\n\n}\n\nfunction persistentMap(existing) {\n if (Recoil_gkx_1('recoil_hamt_2020')) {\n return new HashArrayMappedTrieMap(existing);\n } else {\n return new BuiltInMap(existing);\n }\n}\n\nvar Recoil_PersistentMap = {\n persistentMap\n};\n\nvar Recoil_PersistentMap_1 = Recoil_PersistentMap.persistentMap;\n\nvar Recoil_PersistentMap$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n persistentMap: Recoil_PersistentMap_1\n});\n\nconst {\n graph: graph$1\n} = Recoil_Graph;\n\nconst {\n persistentMap: persistentMap$1\n} = Recoil_PersistentMap$1; // flowlint-next-line unclear-type:off\n\n\nlet nextTreeStateVersion = 0;\n\nconst getNextTreeStateVersion = () => nextTreeStateVersion++;\n\nfunction makeEmptyTreeState() {\n const version = getNextTreeStateVersion();\n return {\n version,\n stateID: version,\n transactionMetadata: {},\n dirtyAtoms: new Set(),\n atomValues: persistentMap$1(),\n nonvalidatedAtoms: persistentMap$1()\n };\n}\n\nfunction makeEmptyStoreState() {\n const currentTree = makeEmptyTreeState();\n return {\n currentTree,\n nextTree: null,\n previousTree: null,\n knownAtoms: new Set(),\n knownSelectors: new Set(),\n transactionSubscriptions: new Map(),\n nodeTransactionSubscriptions: new Map(),\n nodeToComponentSubscriptions: new Map(),\n queuedComponentCallbacks_DEPRECATED: [],\n suspendedComponentResolvers: new Set(),\n graphsByVersion: new Map().set(currentTree.version, graph$1()),\n versionsUsedByComponent: new Map(),\n retention: {\n referenceCounts: new Map(),\n nodesRetainedByZone: new Map(),\n retainablesToCheckForRelease: new Set()\n },\n nodeCleanupFunctions: new Map()\n };\n}\n\nvar Recoil_State = {\n makeEmptyTreeState,\n makeEmptyStoreState,\n getNextTreeStateVersion\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction unionSets(...sets) {\n const result = new Set();\n\n for (const set of sets) {\n for (const value of set) {\n result.add(value);\n }\n }\n\n return result;\n}\n\nvar Recoil_unionSets = unionSets;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * The someSet() method tests whether some elements in the given Set pass the\n * test implemented by the provided function.\n */\n\nfunction someSet(set, callback, context) {\n const iterator = set.entries();\n let current = iterator.next();\n\n while (!current.done) {\n const entry = current.value;\n\n if (callback.call(context, entry[1], entry[0], set)) {\n return true;\n }\n\n current = iterator.next();\n }\n\n return false;\n}\n\nvar Recoil_someSet = someSet;\n\nconst {\n cleanUpNode: cleanUpNode$1\n} = Recoil_FunctionalCore;\n\nconst {\n deleteNodeConfigIfPossible: deleteNodeConfigIfPossible$1,\n getNode: getNode$2\n} = Recoil_Node;\n\nconst {\n RetentionZone: RetentionZone$2\n} = Recoil_RetentionZone;\n\nconst emptySet$1 = new Set();\n\nfunction releaseRetainablesNowOnCurrentTree(store, retainables) {\n const storeState = store.getState();\n const treeState = storeState.currentTree;\n\n if (storeState.nextTree) {\n Recoil_recoverableViolation('releaseNodesNowOnCurrentTree should only be called at the end of a batch');\n return; // leak memory rather than erase something that's about to be used.\n }\n\n const nodes = new Set();\n\n for (const r of retainables) {\n if (r instanceof RetentionZone$2) {\n for (const n of nodesRetainedByZone(storeState, r)) {\n nodes.add(n);\n }\n } else {\n nodes.add(r);\n }\n }\n\n const releasableNodes = findReleasableNodes(store, nodes);\n\n for (const node of releasableNodes) {\n releaseNode(store, treeState, node);\n }\n}\n\nfunction findReleasableNodes(store, searchFromNodes) {\n const storeState = store.getState();\n const treeState = storeState.currentTree;\n const graph = store.getGraph(treeState.version);\n const releasableNodes = new Set(); // mutated to collect answer\n\n const nonReleasableNodes = new Set();\n findReleasableNodesInner(searchFromNodes);\n return releasableNodes;\n\n function findReleasableNodesInner(searchFromNodes) {\n const releasableNodesFoundThisIteration = new Set();\n const downstreams = getDownstreamNodesInTopologicalOrder(store, treeState, searchFromNodes, releasableNodes, // don't descend into these\n nonReleasableNodes // don't descend into these\n ); // Find which of the downstream nodes are releasable and which are not:\n\n for (const node of downstreams) {\n var _storeState$retention;\n\n // Not releasable if configured to be retained forever:\n if (getNode$2(node).retainedBy === 'recoilRoot') {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if retained directly by a component:\n\n\n if (((_storeState$retention = storeState.retention.referenceCounts.get(node)) !== null && _storeState$retention !== void 0 ? _storeState$retention : 0) > 0) {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if retained by a zone:\n\n\n if (zonesThatCouldRetainNode(node).some(z => storeState.retention.referenceCounts.get(z))) {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if it has a non-releasable child (which will already be in\n // nonReleasableNodes because we are going in topological order):\n\n\n const nodeChildren = graph.nodeToNodeSubscriptions.get(node);\n\n if (nodeChildren && Recoil_someSet(nodeChildren, child => nonReleasableNodes.has(child))) {\n nonReleasableNodes.add(node);\n continue;\n }\n\n releasableNodes.add(node);\n releasableNodesFoundThisIteration.add(node);\n } // If we found any releasable nodes, we need to walk UP from those nodes to\n // find whether their parents can now be released as well:\n\n\n const parents = new Set();\n\n for (const node of releasableNodesFoundThisIteration) {\n for (const parent of (_graph$nodeDeps$get = graph.nodeDeps.get(node)) !== null && _graph$nodeDeps$get !== void 0 ? _graph$nodeDeps$get : emptySet$1) {\n var _graph$nodeDeps$get;\n\n if (!releasableNodes.has(parent)) {\n parents.add(parent);\n }\n }\n }\n\n if (parents.size) {\n findReleasableNodesInner(parents);\n }\n }\n} // Children before parents\n\n\nfunction getDownstreamNodesInTopologicalOrder(store, treeState, nodes, // Mutable set is destroyed in place\ndoNotDescendInto1, doNotDescendInto2) {\n const graph = store.getGraph(treeState.version);\n const answer = [];\n const visited = new Set();\n\n while (nodes.size > 0) {\n visit(Recoil_nullthrows(nodes.values().next().value));\n }\n\n return answer;\n\n function visit(node) {\n if (doNotDescendInto1.has(node) || doNotDescendInto2.has(node)) {\n nodes.delete(node);\n return;\n }\n\n if (visited.has(node)) {\n return;\n }\n\n const children = graph.nodeToNodeSubscriptions.get(node);\n\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n\n visited.add(node);\n nodes.delete(node);\n answer.push(node);\n }\n}\n\nfunction releaseNode(store, treeState, node) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n } // Atom effects, in-closure caches, etc.:\n\n\n cleanUpNode$1(store, node); // Delete from store state:\n\n const storeState = store.getState();\n storeState.knownAtoms.delete(node);\n storeState.knownSelectors.delete(node);\n storeState.nodeTransactionSubscriptions.delete(node);\n storeState.retention.referenceCounts.delete(node);\n const zones = zonesThatCouldRetainNode(node);\n\n for (const zone of zones) {\n var _storeState$retention2;\n\n (_storeState$retention2 = storeState.retention.nodesRetainedByZone.get(zone)) === null || _storeState$retention2 === void 0 ? void 0 : _storeState$retention2.delete(node);\n } // Note that we DO NOT delete from nodeToComponentSubscriptions because this\n // already happens when the last component that was retaining the node unmounts,\n // and this could happen either before or after that.\n // Delete from TreeState and dep graph:\n\n\n treeState.atomValues.delete(node);\n treeState.dirtyAtoms.delete(node);\n treeState.nonvalidatedAtoms.delete(node);\n const graph = storeState.graphsByVersion.get(treeState.version);\n\n if (graph) {\n const deps = graph.nodeDeps.get(node);\n\n if (deps !== undefined) {\n graph.nodeDeps.delete(node);\n\n for (const dep of deps) {\n var _graph$nodeToNodeSubs;\n\n (_graph$nodeToNodeSubs = graph.nodeToNodeSubscriptions.get(dep)) === null || _graph$nodeToNodeSubs === void 0 ? void 0 : _graph$nodeToNodeSubs.delete(node);\n }\n } // No need to delete sub's deps as there should be no subs at this point.\n // But an invariant would require deleting nodes in topological order.\n\n\n graph.nodeToNodeSubscriptions.delete(node);\n } // Node config (for family members only as their configs can be recreated, and\n // only if they are not retained within any other Stores):\n\n\n deleteNodeConfigIfPossible$1(node);\n}\n\nfunction nodesRetainedByZone(storeState, zone) {\n var _storeState$retention3;\n\n return (_storeState$retention3 = storeState.retention.nodesRetainedByZone.get(zone)) !== null && _storeState$retention3 !== void 0 ? _storeState$retention3 : emptySet$1;\n}\n\nfunction zonesThatCouldRetainNode(node) {\n const retainedBy = getNode$2(node).retainedBy;\n\n if (retainedBy === undefined || retainedBy === 'components' || retainedBy === 'recoilRoot') {\n return [];\n } else if (retainedBy instanceof RetentionZone$2) {\n return [retainedBy];\n } else {\n return retainedBy; // it's an array of zones\n }\n}\n\nfunction scheduleOrPerformPossibleReleaseOfRetainable(store, retainable) {\n const state = store.getState();\n\n if (state.nextTree) {\n state.retention.retainablesToCheckForRelease.add(retainable);\n } else {\n releaseRetainablesNowOnCurrentTree(store, new Set([retainable]));\n }\n}\n\nfunction updateRetainCount(store, retainable, delta) {\n var _map$get;\n\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const map = store.getState().retention.referenceCounts;\n const newCount = ((_map$get = map.get(retainable)) !== null && _map$get !== void 0 ? _map$get : 0) + delta;\n\n if (newCount === 0) {\n map.delete(retainable);\n scheduleOrPerformPossibleReleaseOfRetainable(store, retainable);\n } else {\n map.set(retainable, newCount);\n }\n}\n\nfunction releaseScheduledRetainablesNow(store) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const state = store.getState();\n releaseRetainablesNowOnCurrentTree(store, state.retention.retainablesToCheckForRelease);\n state.retention.retainablesToCheckForRelease.clear();\n}\n\nfunction retainedByOptionWithDefault(r) {\n // The default will change from 'recoilRoot' to 'components' in the future.\n return r === undefined ? 'recoilRoot' : r;\n}\n\nvar Recoil_Retention = {\n updateRetainCount,\n releaseScheduledRetainablesNow,\n retainedByOptionWithDefault\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Combines multiple Iterables into a single Iterable.\n * Traverses the input Iterables in the order provided and maintains the order\n * of their elements.\n *\n * Example:\n * ```\n * const r = Array.from(concatIterables(['a', 'b'], ['c'], ['d', 'e', 'f']));\n * r == ['a', 'b', 'c', 'd', 'e', 'f'];\n * ```\n */\n\nfunction* concatIterables(iters) {\n for (const iter of iters) {\n for (const val of iter) {\n yield val;\n }\n }\n}\n\nvar Recoil_concatIterables = concatIterables;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst isSSR = typeof window === 'undefined';\nconst isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative'; // eslint-disable-line fb-www/typeof-undefined\n\nvar Recoil_Environment = {\n isSSR,\n isReactNative\n};\n\nconst {\n isSSR: isSSR$1\n} = Recoil_Environment;\n\n\n\n\n\n\n\n\n\nconst {\n batchUpdates: batchUpdates$1\n} = Recoil_Batching;\n\nconst {\n initializeNodeIfNewToStore: initializeNodeIfNewToStore$1,\n peekNodeInfo: peekNodeInfo$1\n} = Recoil_FunctionalCore;\n\nconst {\n graph: graph$2\n} = Recoil_Graph;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$1,\n recoilValues: recoilValues$1,\n recoilValuesForKeys: recoilValuesForKeys$2\n} = Recoil_Node;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$2,\n getRecoilValueAsLoadable: getRecoilValueAsLoadable$1,\n setRecoilValue: setRecoilValue$1,\n setUnvalidatedRecoilValue: setUnvalidatedRecoilValue$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n getNextTreeStateVersion: getNextTreeStateVersion$1,\n makeEmptyStoreState: makeEmptyStoreState$1\n} = Recoil_State; // Opaque at this surface because it's part of the public API from here.\n\n\n// A \"Snapshot\" is \"read-only\" and captures a specific set of values of atoms.\n// However, the data-flow-graph and selector values may evolve as selector\n// evaluation functions are executed and async selectors resolve.\nclass Snapshot {\n constructor(storeState) {\n _defineProperty(this, \"_store\", void 0);\n\n _defineProperty(this, \"_refCount\", 0);\n\n _defineProperty(this, \"getLoadable\", recoilValue => {\n this.checkRefCount_INTERNAL();\n return getRecoilValueAsLoadable$1(this._store, recoilValue);\n });\n\n _defineProperty(this, \"getPromise\", recoilValue => {\n this.checkRefCount_INTERNAL();\n return this.getLoadable(recoilValue).toPromise();\n });\n\n _defineProperty(this, \"getNodes_UNSTABLE\", opt => {\n this.checkRefCount_INTERNAL(); // TODO Deal with modified selectors\n\n if ((opt === null || opt === void 0 ? void 0 : opt.isModified) === true) {\n if ((opt === null || opt === void 0 ? void 0 : opt.isInitialized) === false) {\n return [];\n }\n\n const state = this._store.getState().currentTree;\n\n return recoilValuesForKeys$2(state.dirtyAtoms);\n }\n\n const knownAtoms = this._store.getState().knownAtoms;\n\n const knownSelectors = this._store.getState().knownSelectors;\n\n return (opt === null || opt === void 0 ? void 0 : opt.isInitialized) == null ? recoilValues$1.values() : opt.isInitialized === true ? recoilValuesForKeys$2(Recoil_concatIterables([this._store.getState().knownAtoms, this._store.getState().knownSelectors])) : Recoil_filterIterable(recoilValues$1.values(), ({\n key\n }) => !knownAtoms.has(key) && !knownSelectors.has(key));\n });\n\n _defineProperty(this, \"getInfo_UNSTABLE\", ({\n key\n }) => {\n this.checkRefCount_INTERNAL();\n return peekNodeInfo$1(this._store, this._store.getState().currentTree, key);\n });\n\n _defineProperty(this, \"map\", mapper => {\n this.checkRefCount_INTERNAL();\n const mutableSnapshot = new MutableSnapshot(this);\n mapper(mutableSnapshot); // if removing batchUpdates from `set` add it here\n\n return cloneSnapshot(mutableSnapshot.getStore_INTERNAL());\n });\n\n _defineProperty(this, \"asyncMap\", async mapper => {\n this.checkRefCount_INTERNAL();\n const mutableSnapshot = new MutableSnapshot(this);\n await mapper(mutableSnapshot);\n return cloneSnapshot(mutableSnapshot.getStore_INTERNAL());\n });\n\n this._store = {\n getState: () => storeState,\n replaceState: replacer => {\n storeState.currentTree = replacer(storeState.currentTree); // no batching so nextTree is never active\n },\n getGraph: version => {\n const graphs = storeState.graphsByVersion;\n\n if (graphs.has(version)) {\n return Recoil_nullthrows(graphs.get(version));\n }\n\n const newGraph = graph$2();\n graphs.set(version, newGraph);\n return newGraph;\n },\n subscribeToTransactions: () => ({\n release: () => {}\n }),\n addTransactionMetadata: () => {\n throw new Error('Cannot subscribe to Snapshots');\n }\n }; // Initialize any nodes that are live in the parent store (primarily so that this\n // snapshot gets counted towards the node's live stores count).\n\n for (const nodeKey of this._store.getState().nodeCleanupFunctions.keys()) {\n initializeNodeIfNewToStore$1(this._store, storeState.currentTree, nodeKey, 'get');\n }\n\n this.retain();\n this.autorelease();\n }\n\n retain() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return () => undefined;\n }\n\n this._refCount++;\n let released = false;\n return () => {\n if (!released) {\n released = true;\n this.release();\n }\n };\n }\n\n autorelease() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n if (!isSSR$1) {\n window.setTimeout(() => this.release(), 0);\n }\n }\n\n release() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n this._refCount--;\n\n if (this._refCount === 0) ;\n }\n\n checkRefCount_INTERNAL() {\n if (Recoil_gkx_1('recoil_memory_managament_2020') && this._refCount <= 0) {\n if (process.env.NODE_ENV !== \"production\") {\n Recoil_recoverableViolation('Recoil Snapshots only last for the duration of the callback they are provided to. To keep a Snapshot longer, call its retain() method (and then call release() when you are done with it). This is currently a DEV-only warning but will become a real error soon. Please reach out to Dave McCabe for help fixing this. To temporarily suppress this warning add gk_disable=recoil_memory_managament_2020 to the URL.');\n } // What we will ship later:\n // throw new Error(\n // 'Recoil Snapshots only last for the duration of the callback they are provided to. To keep a Snapshot longer, call its retain() method (and then call release() when you are done with it).',\n // );\n\n }\n }\n\n getStore_INTERNAL() {\n this.checkRefCount_INTERNAL();\n return this._store;\n }\n\n getID() {\n this.checkRefCount_INTERNAL();\n return this.getID_INTERNAL();\n }\n\n getID_INTERNAL() {\n this.checkRefCount_INTERNAL();\n return this._store.getState().currentTree.stateID;\n } // We want to allow the methods to be destructured and used as accessors\n // eslint-disable-next-line fb-www/extra-arrow-initializer\n\n\n}\n\nfunction cloneStoreState(store, treeState, bumpVersion = false) {\n const storeState = store.getState();\n const version = bumpVersion ? getNextTreeStateVersion$1() : treeState.version;\n return {\n currentTree: bumpVersion ? {\n // TODO snapshots shouldn't really have versions because a new version number\n // is always assigned when the snapshot is gone to.\n version,\n stateID: version,\n transactionMetadata: { ...treeState.transactionMetadata\n },\n dirtyAtoms: new Set(treeState.dirtyAtoms),\n atomValues: treeState.atomValues.clone(),\n nonvalidatedAtoms: treeState.nonvalidatedAtoms.clone()\n } : treeState,\n nextTree: null,\n previousTree: null,\n knownAtoms: new Set(storeState.knownAtoms),\n // FIXME here's a copy\n knownSelectors: new Set(storeState.knownSelectors),\n // FIXME here's a copy\n transactionSubscriptions: new Map(),\n nodeTransactionSubscriptions: new Map(),\n nodeToComponentSubscriptions: new Map(),\n queuedComponentCallbacks_DEPRECATED: [],\n suspendedComponentResolvers: new Set(),\n graphsByVersion: new Map().set(version, store.getGraph(treeState.version)),\n versionsUsedByComponent: new Map(),\n retention: {\n referenceCounts: new Map(),\n nodesRetainedByZone: new Map(),\n retainablesToCheckForRelease: new Set()\n },\n nodeCleanupFunctions: new Map()\n };\n} // Factory to build a fresh snapshot\n\n\nfunction freshSnapshot(initializeState) {\n const snapshot = new Snapshot(makeEmptyStoreState$1());\n return initializeState != null ? snapshot.map(initializeState) : snapshot;\n} // Factory to clone a snapahot state\n\n\nfunction cloneSnapshot(store, version = 'current') {\n const storeState = store.getState();\n const treeState = version === 'current' ? storeState.currentTree : Recoil_nullthrows(storeState.previousTree);\n return new Snapshot(cloneStoreState(store, treeState));\n}\n\nclass MutableSnapshot extends Snapshot {\n constructor(snapshot) {\n super(cloneStoreState(snapshot.getStore_INTERNAL(), snapshot.getStore_INTERNAL().getState().currentTree, true));\n\n _defineProperty(this, \"set\", (recoilState, newValueOrUpdater) => {\n this.checkRefCount_INTERNAL(); // This batchUpdates ensures this `set` is applied immediately and you can\n // read the written value after calling `set`. I would like to remove this\n // behavior and only batch in `Snapshot.map`, but this would be a breaking\n // change potentially.\n\n batchUpdates$1(() => {\n setRecoilValue$1(this.getStore_INTERNAL(), recoilState, newValueOrUpdater);\n });\n });\n\n _defineProperty(this, \"reset\", recoilState => {\n this.checkRefCount_INTERNAL(); // See note at `set` about batched updates.\n\n batchUpdates$1(() => setRecoilValue$1(this.getStore_INTERNAL(), recoilState, DEFAULT_VALUE$1));\n });\n\n _defineProperty(this, \"setUnvalidatedAtomValues_DEPRECATED\", values => {\n this.checkRefCount_INTERNAL();\n const store = this.getStore_INTERNAL();\n batchUpdates$1(() => {\n for (const [k, v] of values.entries()) {\n setUnvalidatedRecoilValue$1(store, new AbstractRecoilValue$2(k), v);\n }\n });\n });\n } // We want to allow the methods to be destructured and used as accessors\n // eslint-disable-next-line fb-www/extra-arrow-initializer\n\n\n}\n\nvar Recoil_Snapshot = {\n Snapshot,\n MutableSnapshot,\n freshSnapshot,\n cloneSnapshot\n};\n\nvar Recoil_Snapshot_1 = Recoil_Snapshot.Snapshot;\nvar Recoil_Snapshot_2 = Recoil_Snapshot.MutableSnapshot;\nvar Recoil_Snapshot_3 = Recoil_Snapshot.freshSnapshot;\nvar Recoil_Snapshot_4 = Recoil_Snapshot.cloneSnapshot;\n\nvar Recoil_Snapshot$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Snapshot: Recoil_Snapshot_1,\n MutableSnapshot: Recoil_Snapshot_2,\n freshSnapshot: Recoil_Snapshot_3,\n cloneSnapshot: Recoil_Snapshot_4\n});\n\n// @fb-only: const RecoilusagelogEvent = require('RecoilusagelogEvent');\n// @fb-only: const RecoilUsageLogFalcoEvent = require('RecoilUsageLogFalcoEvent');\n// @fb-only: const URI = require('URI');\n\n\nconst {\n getNextTreeStateVersion: getNextTreeStateVersion$2,\n makeEmptyStoreState: makeEmptyStoreState$2\n} = Recoil_State;\n\n\n\n\n\n // @fb-only: const recoverableViolation = require('../util/Recoil_recoverableViolation');\n\n\n\n\nconst {\n cleanUpNode: cleanUpNode$2,\n getDownstreamNodes: getDownstreamNodes$2,\n setNodeValue: setNodeValue$2,\n setUnvalidatedAtomValue_DEPRECATED: setUnvalidatedAtomValue_DEPRECATED$1\n} = Recoil_FunctionalCore;\n\nconst {\n graph: graph$3\n} = Recoil_Graph;\n\nconst {\n cloneGraph: cloneGraph$1\n} = Recoil_Graph;\n\nconst {\n applyAtomValueWrites: applyAtomValueWrites$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n releaseScheduledRetainablesNow: releaseScheduledRetainablesNow$1\n} = Recoil_Retention;\n\nconst {\n freshSnapshot: freshSnapshot$1\n} = Recoil_Snapshot$1;\n\n\n\nconst {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState\n} = react;\n\nfunction notInAContext() {\n throw new Error('This component must be used inside a component.');\n}\n\nconst defaultStore = Object.freeze({\n getState: notInAContext,\n replaceState: notInAContext,\n getGraph: notInAContext,\n subscribeToTransactions: notInAContext,\n addTransactionMetadata: notInAContext\n});\nlet stateReplacerIsBeingExecuted = false;\n\nfunction startNextTreeIfNeeded(storeState) {\n if (stateReplacerIsBeingExecuted) {\n throw new Error('An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.');\n }\n\n if (storeState.nextTree === null) {\n const version = storeState.currentTree.version;\n const nextVersion = getNextTreeStateVersion$2();\n storeState.nextTree = { ...storeState.currentTree,\n version: nextVersion,\n stateID: nextVersion,\n dirtyAtoms: new Set(),\n transactionMetadata: {}\n };\n storeState.graphsByVersion.set(nextVersion, cloneGraph$1(Recoil_nullthrows(storeState.graphsByVersion.get(version))));\n }\n}\n\nconst AppContext = react.createContext({\n current: defaultStore\n});\n\nconst useStoreRef = () => useContext(AppContext);\n\nconst MutableSourceContext = react.createContext(null); // TODO T2710559282599660\n\nfunction useRecoilMutableSource() {\n const mutableSource = useContext(MutableSourceContext);\n\n if (mutableSource == null) {\n Recoil_expectationViolation('Attempted to use a Recoil hook outside of a . ' + ' must be an ancestor of any component that uses ' + 'Recoil hooks.');\n }\n\n return mutableSource;\n}\n\nfunction sendEndOfBatchNotifications(store) {\n const storeState = store.getState();\n const treeState = storeState.currentTree; // Inform transaction subscribers of the transaction:\n\n const dirtyAtoms = treeState.dirtyAtoms;\n\n if (dirtyAtoms.size) {\n // Execute Node-specific subscribers before global subscribers\n for (const [key, subscriptions] of storeState.nodeTransactionSubscriptions) {\n if (dirtyAtoms.has(key)) {\n for (const [_, subscription] of subscriptions) {\n subscription(store);\n }\n }\n }\n\n for (const [_, subscription] of storeState.transactionSubscriptions) {\n subscription(store);\n } // Components that are subscribed to the dirty atom:\n\n\n const dependentNodes = getDownstreamNodes$2(store, treeState, dirtyAtoms);\n\n for (const key of dependentNodes) {\n const comps = storeState.nodeToComponentSubscriptions.get(key);\n\n if (comps) {\n for (const [_subID, [_debugName, callback]] of comps) {\n callback(treeState);\n }\n }\n } // Wake all suspended components so the right one(s) can try to re-render.\n // We need to wake up components not just when some asynchronous selector\n // resolved, but also when changing synchronous values because this may cause\n // a selector to change from asynchronous to synchronous, in which case there\n // would be no follow-up asynchronous resolution to wake us up.\n // TODO OPTIMIZATION Only wake up related downstream components\n\n\n storeState.suspendedComponentResolvers.forEach(cb => cb());\n } // Special behavior ONLY invoked by useInterface.\n // FIXME delete queuedComponentCallbacks_DEPRECATED when deleting useInterface.\n\n\n storeState.queuedComponentCallbacks_DEPRECATED.forEach(cb => cb(treeState));\n storeState.queuedComponentCallbacks_DEPRECATED.splice(0, storeState.queuedComponentCallbacks_DEPRECATED.length);\n}\n/*\n * The purpose of the Batcher is to observe when React batches end so that\n * Recoil state changes can be batched. Whenever Recoil state changes, we call\n * setState on the batcher. Then we wait for that change to be committed, which\n * signifies the end of the batch. That's when we respond to the Recoil change.\n */\n\n\nfunction Batcher({\n setNotifyBatcherOfChange\n}) {\n const storeRef = useStoreRef();\n const [_, setState] = useState([]);\n setNotifyBatcherOfChange(() => setState({}));\n useEffect(() => {\n // enqueueExecution runs this function immediately; it is only used to\n // manipulate the order of useEffects during tests, since React seems to\n // call useEffect in an unpredictable order sometimes.\n Recoil_Queue.enqueueExecution('Batcher', () => {\n const storeState = storeRef.current.getState();\n const {\n nextTree\n } = storeState; // Ignore commits that are not because of Recoil transactions -- namely,\n // because something above RecoilRoot re-rendered:\n\n if (nextTree === null) {\n return;\n } // nextTree is now committed -- note that copying and reset occurs when\n // a transaction begins, in startNextTreeIfNeeded:\n\n\n storeState.previousTree = storeState.currentTree;\n storeState.currentTree = nextTree;\n storeState.nextTree = null;\n sendEndOfBatchNotifications(storeRef.current);\n const discardedVersion = Recoil_nullthrows(storeState.previousTree).version;\n storeState.graphsByVersion.delete(discardedVersion);\n storeState.previousTree = null;\n\n if (Recoil_gkx_1('recoil_memory_managament_2020')) {\n releaseScheduledRetainablesNow$1(storeRef.current);\n }\n });\n }); // If an asynchronous selector resolves after the Batcher is unmounted,\n // notifyBatcherOfChange will still be called. An error gets thrown whenever\n // setState is called after a component is already unmounted, so this sets\n // notifyBatcherOfChange to be a no-op.\n\n useEffect(() => {\n return () => {\n setNotifyBatcherOfChange(() => {});\n };\n }, [setNotifyBatcherOfChange]);\n return null;\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined' && !window.$recoilDebugStates) {\n window.$recoilDebugStates = [];\n }\n} // When removing this deprecated function, remove stateBySettingRecoilValue\n// which will no longer be needed.\n\n\nfunction initialStoreState_DEPRECATED(store, initializeState) {\n const initial = makeEmptyStoreState$2();\n initializeState({\n // $FlowFixMe[escaped-generic]\n set: (atom, value) => {\n const state = initial.currentTree;\n const writes = setNodeValue$2(store, state, atom.key, value);\n const writtenNodes = new Set(writes.keys());\n const nonvalidatedAtoms = state.nonvalidatedAtoms.clone();\n\n for (const n of writtenNodes) {\n nonvalidatedAtoms.delete(n);\n }\n\n initial.currentTree = { ...state,\n dirtyAtoms: Recoil_unionSets(state.dirtyAtoms, writtenNodes),\n atomValues: applyAtomValueWrites$1(state.atomValues, writes),\n // NB: PLEASE un-export applyAtomValueWrites when deleting this code\n nonvalidatedAtoms\n };\n },\n setUnvalidatedAtomValues: atomValues => {\n // FIXME replace this with a mutative loop\n atomValues.forEach((v, k) => {\n initial.currentTree = setUnvalidatedAtomValue_DEPRECATED$1(initial.currentTree, k, v);\n });\n }\n });\n return initial;\n}\n\nfunction initialStoreState(initializeState) {\n const snapshot = freshSnapshot$1().map(initializeState);\n return snapshot.getStore_INTERNAL().getState();\n}\n\nlet nextID = 0;\n\nfunction RecoilRoot({\n initializeState_DEPRECATED,\n initializeState,\n store_INTERNAL: storeProp,\n // For use with React \"context bridging\"\n children\n}) {\n var _createMutableSource;\n\n // prettier-ignore\n // @fb-only: useEffect(() => {\n // @fb-only: if (gkx('recoil_usage_logging')) {\n // @fb-only: try {\n // @fb-only: RecoilUsageLogFalcoEvent.log(() => ({\n // @fb-only: type: RecoilusagelogEvent.RECOIL_ROOT_MOUNTED,\n // @fb-only: path: URI.getRequestURI().getPath(),\n // @fb-only: }));\n // @fb-only: } catch {\n // @fb-only: recoverableViolation(\n // @fb-only: 'Error when logging Recoil Usage event',\n // @fb-only: 'recoil',\n // @fb-only: );\n // @fb-only: }\n // @fb-only: }\n // @fb-only: }, []);\n let storeState; // eslint-disable-line prefer-const\n\n const getGraph = version => {\n const graphs = storeState.current.graphsByVersion;\n\n if (graphs.has(version)) {\n return Recoil_nullthrows(graphs.get(version));\n }\n\n const newGraph = graph$3();\n graphs.set(version, newGraph);\n return newGraph;\n };\n\n const subscribeToTransactions = (callback, key) => {\n if (key == null) {\n // Global transaction subscriptions\n const {\n transactionSubscriptions\n } = storeRef.current.getState();\n const id = nextID++;\n transactionSubscriptions.set(id, callback);\n return {\n release: () => {\n transactionSubscriptions.delete(id);\n }\n };\n } else {\n // Node-specific transaction subscriptions:\n const {\n nodeTransactionSubscriptions\n } = storeRef.current.getState();\n\n if (!nodeTransactionSubscriptions.has(key)) {\n nodeTransactionSubscriptions.set(key, new Map());\n }\n\n const id = nextID++;\n Recoil_nullthrows(nodeTransactionSubscriptions.get(key)).set(id, callback);\n return {\n release: () => {\n const subs = nodeTransactionSubscriptions.get(key);\n\n if (subs) {\n subs.delete(id);\n\n if (subs.size === 0) {\n nodeTransactionSubscriptions.delete(key);\n }\n }\n }\n };\n }\n };\n\n const addTransactionMetadata = metadata => {\n startNextTreeIfNeeded(storeRef.current.getState());\n\n for (const k of Object.keys(metadata)) {\n Recoil_nullthrows(storeRef.current.getState().nextTree).transactionMetadata[k] = metadata[k];\n }\n };\n\n const replaceState = replacer => {\n const storeState = storeRef.current.getState();\n startNextTreeIfNeeded(storeState); // Use replacer to get the next state:\n\n const nextTree = Recoil_nullthrows(storeState.nextTree);\n let replaced;\n\n try {\n stateReplacerIsBeingExecuted = true;\n replaced = replacer(nextTree);\n } finally {\n stateReplacerIsBeingExecuted = false;\n }\n\n if (replaced === nextTree) {\n return;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined') {\n window.$recoilDebugStates.push(replaced); // TODO this shouldn't happen here because it's not batched\n }\n } // Save changes to nextTree and schedule a React update:\n\n\n storeState.nextTree = replaced;\n Recoil_nullthrows(notifyBatcherOfChange.current)();\n };\n\n const notifyBatcherOfChange = useRef(null);\n const setNotifyBatcherOfChange = useCallback(x => {\n notifyBatcherOfChange.current = x;\n }, [notifyBatcherOfChange]); // FIXME T2710559282599660\n\n const createMutableSource = (_createMutableSource = react.createMutableSource) !== null && _createMutableSource !== void 0 ? _createMutableSource : // flowlint-line unclear-type:off\n react.unstable_createMutableSource; // flowlint-line unclear-type:off\n\n const store = storeProp !== null && storeProp !== void 0 ? storeProp : {\n getState: () => storeState.current,\n replaceState,\n getGraph,\n subscribeToTransactions,\n addTransactionMetadata\n };\n const storeRef = useRef(store);\n storeState = useRef(initializeState_DEPRECATED != null ? initialStoreState_DEPRECATED(store, initializeState_DEPRECATED) : initializeState != null ? initialStoreState(initializeState) : makeEmptyStoreState$2());\n const mutableSource = useMemo(() => createMutableSource ? createMutableSource(storeState, () => storeState.current.currentTree.version) : null, [createMutableSource, storeState]); // Cleanup when the is unmounted\n\n useEffect(() => () => {\n for (const atomKey of storeRef.current.getState().knownAtoms) {\n cleanUpNode$2(storeRef.current, atomKey);\n }\n }, []);\n return /*#__PURE__*/react.createElement(AppContext.Provider, {\n value: storeRef\n }, /*#__PURE__*/react.createElement(MutableSourceContext.Provider, {\n value: mutableSource\n }, /*#__PURE__*/react.createElement(Batcher, {\n setNotifyBatcherOfChange: setNotifyBatcherOfChange\n }), children));\n}\n\nvar Recoil_RecoilRoot_react = {\n useStoreRef,\n useRecoilMutableSource,\n RecoilRoot,\n sendEndOfBatchNotifications_FOR_TESTING: sendEndOfBatchNotifications\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a map containing all of the keys + values from the original map where\n * the given callback returned true.\n */\n\nfunction filterMap(map, callback) {\n const result = new Map();\n\n for (const [key, value] of map) {\n if (callback(value, key)) {\n result.set(key, value);\n }\n }\n\n return result;\n}\n\nvar Recoil_filterMap = filterMap;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a set containing all of the values from the original set where\n * the given callback returned true.\n */\n\nfunction filterSet(set, callback) {\n const result = new Set();\n\n for (const value of set) {\n if (callback(value)) {\n result.add(value);\n }\n }\n\n return result;\n}\n\nvar Recoil_filterSet = filterSet;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n\nvar invariant_1 = invariant;\n\n// @oss-only\n\n\nvar Recoil_invariant = invariant_1;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction mergeMaps(...maps) {\n const result = new Map();\n\n for (let i = 0; i < maps.length; i++) {\n const iterator = maps[i].keys();\n let nextKey;\n\n while (!(nextKey = iterator.next()).done) {\n // $FlowFixMe[incompatible-call] - map/iterator knows nothing about flow types\n result.set(nextKey.value, maps[i].get(nextKey.value));\n }\n }\n /* $FlowFixMe[incompatible-return] (>=0.66.0 site=www,mobile) This comment\n * suppresses an error found when Flow v0.66 was deployed. To see the error\n * delete this comment and run Flow. */\n\n\n return result;\n}\n\nvar Recoil_mergeMaps = mergeMaps;\n\nvar _useMutableSource;\n\n // FIXME T2710559282599660\n\n\nconst useMutableSource = // flowlint-line unclear-type:off\n(_useMutableSource = react.useMutableSource) !== null && _useMutableSource !== void 0 ? _useMutableSource : react.unstable_useMutableSource; // flowlint-line unclear-type:off\n\nfunction mutableSourceExists() {\n return useMutableSource && !(typeof window !== 'undefined' && window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE);\n}\n\nvar Recoil_mutableSource = {\n mutableSourceExists,\n useMutableSource\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction shallowArrayEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0, l = a.length; i < l; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nvar Recoil_shallowArrayEqual = shallowArrayEqual;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * MIT License\n *\n * Copyright (c) 2014-2019 Georg Tavonius\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst UNKNOWN_FUNCTION = '';\n/**\n * This parses the different stack traces and puts them into one format\n * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit)\n */\n\nfunction stackTraceParser(stackString) {\n const lines = stackString.split('\\n');\n return lines.reduce((stack, line) => {\n const parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);\n\n if (parseResult) {\n stack.push(parseResult);\n }\n\n return stack;\n }, []);\n}\n\nconst chromeRe = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRe = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nfunction parseChrome(line) {\n const parts = chromeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n const isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n const submatch = chromeEvalRe.exec(parts[2]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n\n parts[3] = submatch[2]; // line\n\n parts[4] = submatch[3]; // column\n }\n\n return {\n file: !isNative ? parts[2] : null,\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: isNative ? [parts[2]] : [],\n lineNumber: parts[3] ? +parts[3] : null,\n column: parts[4] ? +parts[4] : null\n };\n}\n\nconst winjsRe = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseWinjs(line) {\n const parts = winjsRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nconst geckoRe = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRe = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nfunction parseGecko(line) {\n const parts = geckoRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n const submatch = geckoEvalRe.exec(parts[3]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: parts[2] ? parts[2].split(',') : [],\n lineNumber: parts[4] ? +parts[4] : null,\n column: parts[5] ? +parts[5] : null\n };\n}\n\nconst javaScriptCoreRe = /^\\s*(?:([^@]*)(?:\\((.*?)\\))?@)?(\\S.*?):(\\d+)(?::(\\d+))?\\s*$/i;\n\nfunction parseJSC(line) {\n const parts = javaScriptCoreRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[4],\n column: parts[5] ? +parts[5] : null\n };\n}\n\nconst nodeRe = /^\\s*at (?:((?:\\[object object\\])?[^\\\\/]+(?: \\[as \\S+\\])?) )?\\(?(.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseNode(line) {\n const parts = nodeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nvar Recoil_stackTraceParser = stackTraceParser;\n\nconst {\n useRef: useRef$1\n} = react;\n\nfunction useComponentName() {\n const nameRef = useRef$1();\n\n if (process.env.NODE_ENV !== \"production\") {\n if (Recoil_gkx_1('recoil_infer_component_names')) {\n var _nameRef$current;\n\n if (nameRef.current === undefined) {\n // There is no blessed way to determine the calling React component from\n // within a hook. This hack uses the fact that hooks must start with 'use'\n // and that hooks are either called by React Components or other hooks. It\n // follows therefore, that to find the calling component, you simply need\n // to look down the stack and find the first function which doesn't start\n // with 'use'. We are only enabling this in dev for now, since once the\n // codebase is minified, the naming assumptions no longer hold true.\n const frames = Recoil_stackTraceParser(new Error().stack);\n\n for (const {\n methodName\n } of frames) {\n // I observed cases where the frame was of the form 'Object.useXXX'\n // hence why I'm searching for hooks following a word boundary\n if (!methodName.match(/\\buse[^\\b]+$/)) {\n return nameRef.current = methodName;\n }\n }\n\n nameRef.current = null;\n }\n\n return (_nameRef$current = nameRef.current) !== null && _nameRef$current !== void 0 ? _nameRef$current : '';\n }\n } // @fb-only: return \"\";\n\n\n return ''; // @oss-only\n}\n\nvar Recoil_useComponentName = useComponentName;\n\nconst {\n batchUpdates: batchUpdates$2\n} = Recoil_Batching;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$2,\n getNode: getNode$3,\n nodes: nodes$1\n} = Recoil_Node;\n\nconst {\n useRecoilMutableSource: useRecoilMutableSource$1,\n useStoreRef: useStoreRef$1\n} = Recoil_RecoilRoot_react;\n\nconst {\n isRecoilValue: isRecoilValue$2\n} = Recoil_RecoilValue$1;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$3,\n getRecoilValueAsLoadable: getRecoilValueAsLoadable$2,\n setRecoilValue: setRecoilValue$2,\n setRecoilValueLoadable: setRecoilValueLoadable$1,\n setUnvalidatedRecoilValue: setUnvalidatedRecoilValue$2,\n subscribeToRecoilValue: subscribeToRecoilValue$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n updateRetainCount: updateRetainCount$1\n} = Recoil_Retention;\n\nconst {\n RetentionZone: RetentionZone$3\n} = Recoil_RetentionZone;\n\nconst {\n Snapshot: Snapshot$1,\n cloneSnapshot: cloneSnapshot$1\n} = Recoil_Snapshot$1;\n\nconst {\n setByAddingToSet: setByAddingToSet$2\n} = Recoil_CopyOnWrite;\n\n\n\nconst {\n isSSR: isSSR$2\n} = Recoil_Environment;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n mutableSourceExists: mutableSourceExists$1,\n useMutableSource: useMutableSource$1\n} = Recoil_mutableSource;\n\n\n\n\n\n\n\n\n\nconst {\n useCallback: useCallback$1,\n useEffect: useEffect$1,\n useMemo: useMemo$1,\n useRef: useRef$2,\n useState: useState$1\n} = react; // Components that aren't mounted after suspending for this long will be assumed\n// to be discarded and their resources released.\n\n\nconst SUSPENSE_TIMEOUT_MS = 120000;\n\nfunction handleLoadable(loadable, atom, storeRef) {\n // We can't just throw the promise we are waiting on to Suspense. If the\n // upstream dependencies change it may produce a state in which the component\n // can render, but it would still be suspended on a Promise that may never resolve.\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n const promise = new Promise(resolve => {\n storeRef.current.getState().suspendedComponentResolvers.add(resolve);\n });\n throw promise;\n } else if (loadable.state === 'hasError') {\n throw loadable.contents;\n } else {\n throw new Error(`Invalid value of loadable atom \"${atom.key}\"`);\n }\n}\n\nfunction validateRecoilValue(recoilValue, hookName) {\n if (!isRecoilValue$2(recoilValue)) {\n throw new Error(`Invalid argument to ${hookName}: expected an atom or selector but got ${String(recoilValue)}`);\n }\n}\n\n/**\n * Various things are broken with useRecoilInterface, particularly concurrent mode\n * and memory management. They will not be fixed.\n * */\nfunction useRecoilInterface_DEPRECATED() {\n const storeRef = useStoreRef$1();\n const [_, forceUpdate] = useState$1([]);\n const recoilValuesUsed = useRef$2(new Set());\n recoilValuesUsed.current = new Set(); // Track the RecoilValues used just during this render\n\n const previousSubscriptions = useRef$2(new Set());\n const subscriptions = useRef$2(new Map());\n const unsubscribeFrom = useCallback$1(key => {\n const sub = subscriptions.current.get(key);\n\n if (sub) {\n sub.release();\n subscriptions.current.delete(key);\n }\n }, [subscriptions]);\n const componentName = Recoil_useComponentName();\n useEffect$1(() => {\n const store = storeRef.current;\n\n function updateState(_state, key) {\n if (!subscriptions.current.has(key)) {\n return;\n }\n\n forceUpdate([]);\n }\n\n Recoil_differenceSets(recoilValuesUsed.current, previousSubscriptions.current).forEach(key => {\n if (subscriptions.current.has(key)) {\n Recoil_expectationViolation(`Double subscription to RecoilValue \"${key}\"`);\n return;\n }\n\n const sub = subscribeToRecoilValue$1(store, new AbstractRecoilValue$3(key), state => {\n updateState(state, key);\n }, componentName);\n subscriptions.current.set(key, sub);\n /**\n * Since we're subscribing in an effect we need to update to the latest\n * value of the atom since it may have changed since we rendered. We can\n * go ahead and do that now, unless we're in the middle of a batch --\n * in which case we should do it at the end of the batch, due to the\n * following edge case: Suppose an atom is updated in another useEffect\n * of this same component. Then the following sequence of events occur:\n * 1. Atom is updated and subs fired (but we may not be subscribed\n * yet depending on order of effects, so we miss this) Updated value\n * is now in nextTree, but not currentTree.\n * 2. This effect happens. We subscribe and update.\n * 3. From the update we re-render and read currentTree, with old value.\n * 4. Batcher's effect sets currentTree to nextTree.\n * In this sequence we miss the update. To avoid that, add the update\n * to queuedComponentCallback if a batch is in progress.\n */\n // FIXME delete queuedComponentCallbacks_DEPRECATED when deleting useInterface.\n\n const state = store.getState();\n\n if (state.nextTree) {\n store.getState().queuedComponentCallbacks_DEPRECATED.push(() => {\n updateState(store.getState(), key);\n });\n } else {\n updateState(store.getState(), key);\n }\n });\n Recoil_differenceSets(previousSubscriptions.current, recoilValuesUsed.current).forEach(key => {\n unsubscribeFrom(key);\n });\n previousSubscriptions.current = recoilValuesUsed.current;\n });\n useEffect$1(() => {\n const subs = subscriptions.current;\n return () => subs.forEach((_, key) => unsubscribeFrom(key));\n }, [unsubscribeFrom]);\n return useMemo$1(() => {\n function useSetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useSetRecoilState');\n }\n\n return newValueOrUpdater => {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n };\n }\n\n function useResetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useResetRecoilState');\n }\n\n return () => setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n }\n\n function useRecoilValueLoadable(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n if (!recoilValuesUsed.current.has(recoilValue.key)) {\n recoilValuesUsed.current = setByAddingToSet$2(recoilValuesUsed.current, recoilValue.key);\n } // TODO Restore optimization to memoize lookup\n\n\n return getRecoilValueAsLoadable$2(storeRef.current, recoilValue);\n }\n\n function useRecoilValue(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValue');\n }\n\n const loadable = useRecoilValueLoadable(recoilValue); // $FlowFixMe[escaped-generic]\n\n return handleLoadable(loadable, recoilValue, storeRef);\n }\n\n function useRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilState');\n }\n\n return [useRecoilValue(recoilState), useSetRecoilState(recoilState)];\n }\n\n function useRecoilStateLoadable(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilStateLoadable');\n }\n\n return [useRecoilValueLoadable(recoilState), useSetRecoilState(recoilState)];\n }\n\n return {\n getRecoilValue: useRecoilValue,\n getRecoilValueLoadable: useRecoilValueLoadable,\n getRecoilState: useRecoilState,\n getRecoilStateLoadable: useRecoilStateLoadable,\n getSetRecoilState: useSetRecoilState,\n getResetRecoilState: useResetRecoilState\n };\n }, [recoilValuesUsed, storeRef]);\n}\n\nconst recoilComponentGetRecoilValueCount_FOR_TESTING = {\n current: 0\n};\n\nfunction useRecoilValueLoadable_MUTABLESOURCE(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n const storeRef = useStoreRef$1();\n const getLoadable = useCallback$1(() => {\n const store = storeRef.current;\n const treeState = store.getState().currentTree;\n return getRecoilValueAsLoadable$2(store, recoilValue, treeState);\n }, [storeRef, recoilValue]);\n const getLoadableWithTesting = useCallback$1(() => {\n if (process.env.NODE_ENV !== \"production\") {\n recoilComponentGetRecoilValueCount_FOR_TESTING.current++;\n }\n\n return getLoadable();\n }, [getLoadable]);\n const componentName = Recoil_useComponentName();\n const subscribe = useCallback$1((_storeState, callback) => {\n const store = storeRef.current;\n const subscription = subscribeToRecoilValue$1(store, recoilValue, () => {\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return callback();\n } // Only re-render if the value has changed.\n // This will evaluate the atom/selector now as well as when the\n // component renders, but that may help with prefetching.\n\n\n const newLoadable = getLoadable();\n\n if (!prevLoadableRef.current.is(newLoadable)) {\n callback();\n }\n }, componentName);\n return subscription.release;\n }, [storeRef, recoilValue, componentName, getLoadable]);\n const source = useRecoilMutableSource$1();\n const loadable = useMutableSource$1(source, getLoadableWithTesting, subscribe);\n const prevLoadableRef = useRef$2(loadable);\n useEffect$1(() => {\n prevLoadableRef.current = loadable;\n });\n return loadable;\n}\n\nfunction useRecoilValueLoadable_LEGACY(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n const storeRef = useStoreRef$1();\n const [_, forceUpdate] = useState$1([]);\n const componentName = Recoil_useComponentName();\n useEffect$1(() => {\n const store = storeRef.current;\n const storeState = store.getState();\n const subscription = subscribeToRecoilValue$1(store, recoilValue, _state => {\n var _prevLoadableRef$curr;\n\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return forceUpdate([]);\n }\n\n const newLoadable = getRecoilValueAsLoadable$2(store, recoilValue, store.getState().currentTree);\n\n if (!((_prevLoadableRef$curr = prevLoadableRef.current) === null || _prevLoadableRef$curr === void 0 ? void 0 : _prevLoadableRef$curr.is(newLoadable))) {\n forceUpdate(newLoadable);\n }\n }, componentName);\n /**\n * Since we're subscribing in an effect we need to update to the latest\n * value of the atom since it may have changed since we rendered. We can\n * go ahead and do that now, unless we're in the middle of a batch --\n * in which case we should do it at the end of the batch, due to the\n * following edge case: Suppose an atom is updated in another useEffect\n * of this same component. Then the following sequence of events occur:\n * 1. Atom is updated and subs fired (but we may not be subscribed\n * yet depending on order of effects, so we miss this) Updated value\n * is now in nextTree, but not currentTree.\n * 2. This effect happens. We subscribe and update.\n * 3. From the update we re-render and read currentTree, with old value.\n * 4. Batcher's effect sets currentTree to nextTree.\n * In this sequence we miss the update. To avoid that, add the update\n * to queuedComponentCallback if a batch is in progress.\n */\n\n if (storeState.nextTree) {\n store.getState().queuedComponentCallbacks_DEPRECATED.push(() => {\n prevLoadableRef.current = null;\n forceUpdate([]);\n });\n } else {\n var _prevLoadableRef$curr2;\n\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return forceUpdate([]);\n }\n\n const newLoadable = getRecoilValueAsLoadable$2(store, recoilValue, store.getState().currentTree);\n\n if (!((_prevLoadableRef$curr2 = prevLoadableRef.current) === null || _prevLoadableRef$curr2 === void 0 ? void 0 : _prevLoadableRef$curr2.is(newLoadable))) {\n forceUpdate(newLoadable);\n }\n }\n\n return subscription.release;\n }, [componentName, recoilValue, storeRef]);\n const loadable = getRecoilValueAsLoadable$2(storeRef.current, recoilValue);\n const prevLoadableRef = useRef$2(loadable);\n useEffect$1(() => {\n prevLoadableRef.current = loadable;\n });\n return loadable;\n}\n/**\n Like useRecoilValue(), but either returns the value if available or\n just undefined if not available for any reason, such as pending or error.\n*/\n\n\nfunction useRecoilValueLoadable(recoilValue) {\n if (Recoil_gkx_1('recoil_memory_managament_2020')) {\n // eslint-disable-next-line fb-www/react-hooks\n useRetain(recoilValue);\n }\n\n if (mutableSourceExists$1()) {\n // eslint-disable-next-line fb-www/react-hooks\n return useRecoilValueLoadable_MUTABLESOURCE(recoilValue);\n } else {\n // eslint-disable-next-line fb-www/react-hooks\n return useRecoilValueLoadable_LEGACY(recoilValue);\n }\n}\n/**\n Returns the value represented by the RecoilValue.\n If the value is pending, it will throw a Promise to suspend the component,\n if the value is an error it will throw it for the nearest React error boundary.\n This will also subscribe the component for any updates in the value.\n */\n\n\nfunction useRecoilValue(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValue');\n }\n\n const storeRef = useStoreRef$1();\n const loadable = useRecoilValueLoadable(recoilValue); // $FlowFixMe[escaped-generic]\n\n return handleLoadable(loadable, recoilValue, storeRef);\n}\n/**\n Returns a function that allows the value of a RecoilState to be updated, but does\n not subscribe the component to changes to that RecoilState.\n*/\n\n\nfunction useSetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useSetRecoilState');\n }\n\n const storeRef = useStoreRef$1();\n return useCallback$1(newValueOrUpdater => {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n }, [storeRef, recoilState]);\n}\n/**\n Returns a function that will reset the value of a RecoilState to its default\n*/\n\n\nfunction useResetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useResetRecoilState');\n }\n\n const storeRef = useStoreRef$1();\n return useCallback$1(() => {\n setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n }, [storeRef, recoilState]);\n}\n/**\n Equivalent to useState(). Allows the value of the RecoilState to be read and written.\n Subsequent updates to the RecoilState will cause the component to re-render. If the\n RecoilState is pending, this will suspend the component and initiate the\n retrieval of the value. If evaluating the RecoilState resulted in an error, this will\n throw the error so that the nearest React error boundary can catch it.\n*/\n\n\nfunction useRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilState');\n }\n\n return [useRecoilValue(recoilState), useSetRecoilState(recoilState)];\n}\n/**\n Like useRecoilState(), but does not cause Suspense or React error handling. Returns\n an object that indicates whether the RecoilState is available, pending, or\n unavailable due to an error.\n*/\n\n\nfunction useRecoilStateLoadable(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilStateLoadable');\n }\n\n return [useRecoilValueLoadable(recoilState), useSetRecoilState(recoilState)];\n}\n\nfunction useTransactionSubscription(callback) {\n const storeRef = useStoreRef$1();\n useEffect$1(() => {\n const sub = storeRef.current.subscribeToTransactions(callback);\n return sub.release;\n }, [callback, storeRef]);\n}\n\nfunction externallyVisibleAtomValuesInState(state) {\n const atomValues = state.atomValues.toMap();\n const persistedAtomContentsValues = Recoil_mapMap(Recoil_filterMap(atomValues, (v, k) => {\n const node = getNode$3(k);\n const persistence = node.persistence_UNSTABLE;\n return persistence != null && persistence.type !== 'none' && v.state === 'hasValue';\n }), v => v.contents); // Merge in nonvalidated atoms; we may not have defs for them but they will\n // all have persistence on or they wouldn't be there in the first place.\n\n return Recoil_mergeMaps(state.nonvalidatedAtoms.toMap(), persistedAtomContentsValues);\n}\n\n/**\n Calls the given callback after any atoms have been modified and the consequent\n component re-renders have been committed. This is intended for persisting\n the values of the atoms to storage. The stored values can then be restored\n using the useSetUnvalidatedAtomValues hook.\n\n The callback receives the following info:\n\n atomValues: The current value of every atom that is both persistable (persistence\n type not set to 'none') and whose value is available (not in an\n error or loading state).\n\n previousAtomValues: The value of every persistable and available atom before\n the transaction began.\n\n atomInfo: A map containing the persistence settings for each atom. Every key\n that exists in atomValues will also exist in atomInfo.\n\n modifiedAtoms: The set of atoms that were written to during the transaction.\n\n transactionMetadata: Arbitrary information that was added via the\n useSetUnvalidatedAtomValues hook. Useful for ignoring the useSetUnvalidatedAtomValues\n transaction, to avoid loops.\n*/\nfunction useTransactionObservation_DEPRECATED(callback) {\n useTransactionSubscription(useCallback$1(store => {\n let previousTree = store.getState().previousTree;\n const currentTree = store.getState().currentTree;\n\n if (!previousTree) {\n Recoil_recoverableViolation('Transaction subscribers notified without a previous tree being present -- this is a bug in Recoil');\n previousTree = store.getState().currentTree; // attempt to trundle on\n }\n\n const atomValues = externallyVisibleAtomValuesInState(currentTree);\n const previousAtomValues = externallyVisibleAtomValuesInState(previousTree);\n const atomInfo = Recoil_mapMap(nodes$1, node => {\n var _node$persistence_UNS, _node$persistence_UNS2, _node$persistence_UNS3, _node$persistence_UNS4;\n\n return {\n persistence_UNSTABLE: {\n type: (_node$persistence_UNS = (_node$persistence_UNS2 = node.persistence_UNSTABLE) === null || _node$persistence_UNS2 === void 0 ? void 0 : _node$persistence_UNS2.type) !== null && _node$persistence_UNS !== void 0 ? _node$persistence_UNS : 'none',\n backButton: (_node$persistence_UNS3 = (_node$persistence_UNS4 = node.persistence_UNSTABLE) === null || _node$persistence_UNS4 === void 0 ? void 0 : _node$persistence_UNS4.backButton) !== null && _node$persistence_UNS3 !== void 0 ? _node$persistence_UNS3 : false\n }\n };\n }); // Filter on existance in atomValues so that externally-visible rules\n // are also applied to modified atoms (specifically exclude selectors):\n\n const modifiedAtoms = Recoil_filterSet(currentTree.dirtyAtoms, k => atomValues.has(k) || previousAtomValues.has(k));\n callback({\n atomValues,\n previousAtomValues,\n atomInfo,\n modifiedAtoms,\n transactionMetadata: { ...currentTree.transactionMetadata\n }\n });\n }, [callback]));\n}\n\nfunction useRecoilTransactionObserver(callback) {\n useTransactionSubscription(useCallback$1(store => {\n const snapshot = cloneSnapshot$1(store, 'current');\n const previousSnapshot = cloneSnapshot$1(store, 'previous');\n callback({\n snapshot,\n previousSnapshot\n });\n }, [callback]));\n}\n\nfunction usePrevious(value) {\n const ref = useRef$2();\n useEffect$1(() => {\n ref.current = value;\n });\n return ref.current;\n} // Return a snapshot of the current state and subscribe to all state changes\n\n\nfunction useRecoilSnapshot() {\n const storeRef = useStoreRef$1();\n const [snapshot, setSnapshot] = useState$1(() => cloneSnapshot$1(storeRef.current));\n const previousSnapshot = usePrevious(snapshot);\n const timeoutID = useRef$2();\n useEffect$1(() => {\n if (timeoutID.current && !isSSR$2) {\n window.clearTimeout(timeoutID.current);\n }\n\n return snapshot.retain();\n }, [snapshot]);\n useTransactionSubscription(useCallback$1(store => setSnapshot(cloneSnapshot$1(store)), []));\n\n if (previousSnapshot !== snapshot && !isSSR$2) {\n if (timeoutID.current) {\n previousSnapshot === null || previousSnapshot === void 0 ? void 0 : previousSnapshot.release();\n window.clearTimeout(timeoutID.current);\n }\n\n snapshot.retain();\n timeoutID.current = window.setTimeout(() => {\n snapshot.release();\n timeoutID.current = null;\n }, SUSPENSE_TIMEOUT_MS);\n }\n\n return snapshot;\n}\n\nfunction useGotoRecoilSnapshot() {\n const storeRef = useStoreRef$1();\n return useCallback$1(snapshot => {\n var _storeState$nextTree;\n\n const storeState = storeRef.current.getState();\n const prev = (_storeState$nextTree = storeState.nextTree) !== null && _storeState$nextTree !== void 0 ? _storeState$nextTree : storeState.currentTree;\n const next = snapshot.getStore_INTERNAL().getState().currentTree;\n batchUpdates$2(() => {\n const keysToUpdate = new Set();\n\n for (const keys of [prev.atomValues.keys(), next.atomValues.keys()]) {\n for (const key of keys) {\n var _prev$atomValues$get, _next$atomValues$get;\n\n if (((_prev$atomValues$get = prev.atomValues.get(key)) === null || _prev$atomValues$get === void 0 ? void 0 : _prev$atomValues$get.contents) !== ((_next$atomValues$get = next.atomValues.get(key)) === null || _next$atomValues$get === void 0 ? void 0 : _next$atomValues$get.contents) && getNode$3(key).shouldRestoreFromSnapshots) {\n keysToUpdate.add(key);\n }\n }\n }\n\n keysToUpdate.forEach(key => {\n setRecoilValueLoadable$1(storeRef.current, new AbstractRecoilValue$3(key), next.atomValues.has(key) ? Recoil_nullthrows(next.atomValues.get(key)) : DEFAULT_VALUE$2);\n });\n storeRef.current.replaceState(state => {\n return { ...state,\n stateID: snapshot.getID_INTERNAL()\n };\n });\n });\n }, [storeRef]);\n}\n\nfunction useSetUnvalidatedAtomValues() {\n const storeRef = useStoreRef$1();\n return (values, transactionMetadata = {}) => {\n batchUpdates$2(() => {\n storeRef.current.addTransactionMetadata(transactionMetadata);\n values.forEach((value, key) => setUnvalidatedRecoilValue$2(storeRef.current, new AbstractRecoilValue$3(key), value));\n });\n };\n}\n\nclass Sentinel {}\n\nconst SENTINEL = new Sentinel();\n\nfunction useRecoilCallback(fn, deps) {\n const storeRef = useStoreRef$1();\n const gotoSnapshot = useGotoRecoilSnapshot();\n return useCallback$1((...args) => {\n function set(recoilState, newValueOrUpdater) {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n }\n\n function reset(recoilState) {\n setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n } // Use currentTree for the snapshot to show the currently committed state\n\n\n const snapshot = cloneSnapshot$1(storeRef.current);\n let ret = SENTINEL;\n batchUpdates$2(() => {\n const errMsg = 'useRecoilCallback expects a function that returns a function: ' + 'it accepts a function of the type (RecoilInterface) => T = R ' + 'and returns a callback function T => R, where RecoilInterface is an ' + 'object {snapshot, set, ...} and T and R are the argument and return ' + 'types of the callback you want to create. Please see the docs ' + 'at recoiljs.org for details.';\n\n if (typeof fn !== 'function') {\n throw new Error(errMsg);\n } // flowlint-next-line unclear-type:off\n\n\n const cb = fn({\n set,\n reset,\n snapshot,\n gotoSnapshot\n });\n\n if (typeof cb !== 'function') {\n throw new Error(errMsg);\n }\n\n ret = cb(...args);\n });\n !!(ret instanceof Sentinel) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'batchUpdates should return immediately') : Recoil_invariant(false) : void 0;\n return ret;\n }, deps != null ? [...deps, storeRef] : undefined // eslint-disable-line fb-www/react-hooks-deps\n );\n} // I don't see a way to avoid the any type here because we want to accept readable\n// and writable values with any type parameter, but normally with writable ones\n// RecoilState is not a subtype of RecoilState.\n\n\n// flowlint-line unclear-type:off\nfunction useRetain(toRetain) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n } // eslint-disable-next-line fb-www/react-hooks\n\n\n return useRetain_ACTUAL(toRetain);\n}\n\nfunction useRetain_ACTUAL(toRetain) {\n const array = Array.isArray(toRetain) ? toRetain : [toRetain];\n const retainables = array.map(a => a instanceof RetentionZone$3 ? a : a.key);\n const storeRef = useStoreRef$1();\n useEffect$1(() => {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const store = storeRef.current;\n\n if (timeoutID.current && !isSSR$2) {\n // Already performed a temporary retain on render, simply cancel the release\n // of that temporary retain.\n window.clearTimeout(timeoutID.current);\n timeoutID.current = null;\n } else {\n // Log this since it's not clear that there's any scenario where it should happen.\n Recoil_recoverableViolation('Did not retain recoil value on render, or committed after timeout elapsed. This is fine, but odd.');\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, 1);\n }\n }\n\n return () => {\n for (const r of retainables) {\n updateRetainCount$1(store, r, -1);\n }\n }; // eslint-disable-next-line fb-www/react-hooks-deps\n }, [storeRef, ...retainables]); // We want to retain if the component suspends. This is terrible but the Suspense\n // API affords us no better option. If we suspend and never commit after some\n // seconds, then release. The 'actual' retain/release in the effect above\n // cancels this.\n\n const timeoutID = useRef$2();\n const previousRetainables = usePrevious(retainables);\n\n if (!isSSR$2 && (previousRetainables === undefined || !Recoil_shallowArrayEqual(previousRetainables, retainables))) {\n const store = storeRef.current;\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, 1);\n }\n\n if (previousRetainables) {\n for (const r of previousRetainables) {\n updateRetainCount$1(store, r, -1);\n }\n }\n\n if (timeoutID.current) {\n window.clearTimeout(timeoutID.current);\n }\n\n timeoutID.current = window.setTimeout(() => {\n timeoutID.current = null;\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, -1);\n }\n }, SUSPENSE_TIMEOUT_MS);\n }\n}\n\nvar Recoil_Hooks = {\n recoilComponentGetRecoilValueCount_FOR_TESTING,\n useGotoRecoilSnapshot,\n useRecoilCallback,\n useRecoilInterface: useRecoilInterface_DEPRECATED,\n useRecoilSnapshot,\n useRecoilState,\n useRecoilStateLoadable,\n useRecoilTransactionObserver,\n useRecoilValue,\n useRecoilValueLoadable,\n useRetain,\n useResetRecoilState,\n useSetRecoilState,\n useSetUnvalidatedAtomValues,\n useTransactionObservation_DEPRECATED,\n useTransactionSubscription_DEPRECATED: useTransactionSubscription\n};\n\nconst {\n peekNodeInfo: peekNodeInfo$2\n} = Recoil_FunctionalCore;\n\nconst {\n useStoreRef: useStoreRef$2\n} = Recoil_RecoilRoot_react;\n\nfunction useGetRecoilValueInfo() {\n const storeRef = useStoreRef$2();\n return ({\n key\n }) => peekNodeInfo$2(storeRef.current, storeRef.current.getState().currentTree, key);\n}\n\nvar Recoil_useGetRecoilValueInfo = useGetRecoilValueInfo;\n\nconst {\n RecoilRoot: RecoilRoot$1,\n useStoreRef: useStoreRef$3\n} = Recoil_RecoilRoot_react;\n\n\n\nconst {\n useMemo: useMemo$2\n} = react;\n\nfunction useRecoilBridgeAcrossReactRoots() {\n const store = useStoreRef$3().current;\n return useMemo$2(() => {\n function RecoilBridge({\n children\n }) {\n return /*#__PURE__*/react.createElement(RecoilRoot$1, {\n store_INTERNAL: store\n }, children);\n }\n\n return RecoilBridge;\n }, [store]);\n}\n\nvar Recoil_useRecoilBridgeAcrossReactRoots = useRecoilBridgeAcrossReactRoots;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n// Split declaration and implementation to allow this function to pretend to\n// check for actual instance of Promise instead of something with a `then`\n// method.\n// eslint-disable-next-line no-redeclare\nfunction isPromise(p) {\n return !!p && typeof p.then === 'function';\n}\n\nvar Recoil_isPromise = isPromise;\n\n// TODO Convert Loadable to a Class to allow for runtime type detection.\n// Containing static factories of withValue(), withError(), withPromise(), and all()\n\n\nclass Canceled {}\n\nconst CANCELED = new Canceled();\nconst loadableAccessors = {\n /**\n * if loadable has a value (state === 'hasValue'), return that value.\n * Otherwise, throw the (unwrapped) promise or the error.\n */\n getValue() {\n if (this.state === 'loading') {\n throw this.contents.then(({\n __value\n }) => __value);\n }\n\n if (this.state !== 'hasValue') {\n throw this.contents;\n }\n\n return this.contents;\n },\n\n toPromise() {\n return this.state === 'hasValue' ? Promise.resolve(this.contents) : this.state === 'hasError' ? Promise.reject(this.contents) : this.contents.then(({\n __value\n }) => __value);\n },\n\n valueMaybe() {\n return this.state === 'hasValue' ? this.contents : undefined;\n },\n\n valueOrThrow() {\n if (this.state !== 'hasValue') {\n const error = new Error(`Loadable expected value, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents;\n },\n\n errorMaybe() {\n return this.state === 'hasError' ? this.contents : undefined;\n },\n\n errorOrThrow() {\n if (this.state !== 'hasError') {\n const error = new Error(`Loadable expected error, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents;\n },\n\n promiseMaybe() {\n return this.state === 'loading' ? this.contents.then(({\n __value\n }) => __value) : undefined;\n },\n\n promiseOrThrow() {\n if (this.state !== 'loading') {\n const error = new Error(`Loadable expected promise, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents.then(({\n __value\n }) => __value);\n },\n\n is(other) {\n return other.state === this.state && other.contents === this.contents;\n },\n\n // TODO Unit tests\n // TODO Convert Loadable to a Class to better support chaining\n // by returning a Loadable from a map function\n map(map) {\n if (this.state === 'hasError') {\n return this;\n }\n\n if (this.state === 'hasValue') {\n try {\n const next = map(this.contents); // TODO if next instanceof Loadable, then return next\n\n return Recoil_isPromise(next) ? loadableWithPromise(next) : loadableWithValue(next);\n } catch (e) {\n return Recoil_isPromise(e) ? // If we \"suspended\", then try again.\n // errors and subsequent retries will be handled in 'loading' case\n loadableWithPromise(e.next(() => map(this.contents))) : loadableWithError(e);\n }\n }\n\n if (this.state === 'loading') {\n return loadableWithPromise(this.contents // TODO if map returns a loadable, then return the value or promise or throw the error\n .then(map).catch(e => {\n if (Recoil_isPromise(e)) {\n // we were \"suspended,\" try again\n return e.then(() => map(this.contents));\n }\n\n throw e;\n }));\n }\n\n const error = new Error('Invalid Loadable state'); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n};\n\nfunction loadableWithValue(value) {\n // Build objects this way since Flow doesn't support disjoint unions for class properties\n return Object.freeze({\n state: 'hasValue',\n contents: value,\n ...loadableAccessors\n });\n}\n\nfunction loadableWithError(error) {\n return Object.freeze({\n state: 'hasError',\n contents: error,\n ...loadableAccessors\n });\n}\n\nfunction loadableWithPromise(promise) {\n return Object.freeze({\n state: 'loading',\n contents: promise,\n ...loadableAccessors\n });\n}\n\nfunction loadableLoading() {\n return loadableWithPromise(new Promise(() => {}));\n}\n\nfunction loadableAll(inputs) {\n return inputs.every(i => i.state === 'hasValue') ? loadableWithValue(inputs.map(i => i.contents)) : inputs.some(i => i.state === 'hasError') ? loadableWithError(Recoil_nullthrows(inputs.find(i => i.state === 'hasError'), 'Invalid loadable passed to loadableAll').contents) : loadableWithPromise(Promise.all(inputs.map(i => i.contents)).then(value => ({\n __value: value\n })));\n}\n\nvar Recoil_Loadable = {\n loadableWithValue,\n loadableWithError,\n loadableWithPromise,\n loadableLoading,\n loadableAll,\n Canceled,\n CANCELED\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction isNode(object) {\n var _ownerDocument, _doc$defaultView;\n\n if (typeof window === 'undefined') {\n return false;\n }\n\n const doc = object != null ? (_ownerDocument = object.ownerDocument) !== null && _ownerDocument !== void 0 ? _ownerDocument : object : document;\n const defaultView = (_doc$defaultView = doc.defaultView) !== null && _doc$defaultView !== void 0 ? _doc$defaultView : window;\n return !!(object != null && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));\n}\n\nvar Recoil_isNode = isNode;\n\nconst {\n isReactNative: isReactNative$1,\n isSSR: isSSR$3\n} = Recoil_Environment;\n\n\n\n\n\nfunction shouldNotBeFrozen(value) {\n // Primitives and functions:\n if (value === null || typeof value !== 'object') {\n return true;\n } // React elements:\n\n\n switch (typeof value.$$typeof) {\n case 'symbol':\n return true;\n\n case 'number':\n return true;\n } // Immutable structures:\n\n\n if (value['@@__IMMUTABLE_ITERABLE__@@'] != null || value['@@__IMMUTABLE_KEYED__@@'] != null || value['@@__IMMUTABLE_INDEXED__@@'] != null || value['@@__IMMUTABLE_ORDERED__@@'] != null || value['@@__IMMUTABLE_RECORD__@@'] != null) {\n return true;\n } // DOM nodes:\n\n\n if (Recoil_isNode(value)) {\n return true;\n }\n\n if (Recoil_isPromise(value)) {\n return true;\n }\n\n if (value instanceof Error) {\n return true;\n }\n\n if (ArrayBuffer.isView(value)) {\n return true;\n } // Some environments, just as Jest, don't work with the instanceof check\n\n\n if (!isSSR$3 && !isReactNative$1 && ( // $FlowFixMe(site=recoil) Window does not have a FlowType definition https://github.com/facebook/flow/issues/6709\n value === window || value instanceof Window)) {\n return true;\n }\n\n return false;\n} // Recursively freeze a value to enforce it is read-only.\n// This may also have minimal performance improvements for enumerating\n// objects (based on browser implementations, of course)\n\n\nfunction deepFreezeValue(value) {\n if (typeof value !== 'object' || shouldNotBeFrozen(value)) {\n return;\n }\n\n Object.freeze(value); // Make all properties read-only\n\n for (const key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) {\n const prop = value[key]; // Prevent infinite recurssion for circular references.\n\n if (typeof prop === 'object' && prop != null && !Object.isFrozen(prop)) {\n deepFreezeValue(prop);\n }\n }\n }\n\n Object.seal(value); // This also makes existing properties non-configurable.\n}\n\nvar Recoil_deepFreezeValue = deepFreezeValue;\n\nconst TIME_WARNING_THRESHOLD_MS = 15;\n\nfunction stringify(x, opt, key) {\n // A optimization to avoid the more expensive JSON.stringify() for simple strings\n // This may lose protection for u2028 and u2029, though.\n if (typeof x === 'string' && !x.includes('\"') && !x.includes('\\\\')) {\n return `\"${x}\"`;\n } // Handle primitive types\n\n\n switch (typeof x) {\n case 'undefined':\n return '';\n // JSON.stringify(undefined) returns undefined, but we always want to return a string\n\n case 'boolean':\n return x ? 'true' : 'false';\n\n case 'number':\n case 'symbol':\n // case 'bigint': // BigInt is not supported in www\n return String(x);\n\n case 'string':\n // Add surrounding quotes and escape internal quotes\n return JSON.stringify(x);\n\n case 'function':\n if ((opt === null || opt === void 0 ? void 0 : opt.allowFunctions) !== true) {\n throw new Error('Attempt to serialize function in a Recoil cache key');\n }\n\n return `__FUNCTION(${x.name})__`;\n }\n\n if (x === null) {\n return 'null';\n } // Fallback case for unknown types\n\n\n if (typeof x !== 'object') {\n var _JSON$stringify;\n\n return (_JSON$stringify = JSON.stringify(x)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : '';\n } // Deal with all promises as equivalent for now.\n\n\n if (Recoil_isPromise(x)) {\n return '__PROMISE__';\n } // Arrays handle recursive stringification\n\n\n if (Array.isArray(x)) {\n return `[${x.map((v, i) => stringify(v, opt, i.toString()))}]`;\n } // If an object defines a toJSON() method, then use that to override the\n // serialization. This matches the behavior of JSON.stringify().\n // Pass the key for compatibility.\n // Immutable.js collections define this method to allow us to serialize them.\n\n\n if (typeof x.toJSON === 'function') {\n // flowlint-next-line unclear-type: off\n return stringify(x.toJSON(key), opt, key);\n } // For built-in Maps, sort the keys in a stable order instead of the\n // default insertion order. Support non-string keys.\n\n\n if (x instanceof Map) {\n const obj = {};\n\n for (const [k, v] of x) {\n // Stringify will escape any nested quotes\n obj[typeof k === 'string' ? k : stringify(k, opt)] = v;\n }\n\n return stringify(obj, opt, key);\n } // For built-in Sets, sort the keys in a stable order instead of the\n // default insertion order.\n\n\n if (x instanceof Set) {\n return stringify(Array.from(x).sort((a, b) => stringify(a, opt).localeCompare(stringify(b, opt))), opt, key);\n } // Anything else that is iterable serialize as an Array.\n\n\n if (Symbol !== undefined && x[Symbol.iterator] != null && typeof x[Symbol.iterator] === 'function') {\n // flowlint-next-line unclear-type: off\n return stringify(Array.from(x), opt, key);\n } // For all other Objects, sort the keys in a stable order.\n\n\n return `{${Object.keys(x).filter(key => x[key] !== undefined).sort() // stringify the key to add quotes and escape any nested slashes or quotes.\n .map(key => `${stringify(key, opt)}:${stringify(x[key], opt, key)}`).join(',')}}`;\n} // Utility similar to JSON.stringify() except:\n// * Serialize built-in Sets as an Array\n// * Serialize built-in Maps as an Object. Supports non-string keys.\n// * Serialize other iterables as arrays\n// * Sort the keys of Objects and Maps to have a stable order based on string conversion.\n// This overrides their default insertion order.\n// * Still uses toJSON() of any object to override serialization\n// * Support Symbols (though don't guarantee uniqueness)\n// * We could support BigInt, but Flow doesn't seem to like it.\n// See Recoil_stableStringify-test.js for examples\n\n\nfunction stableStringify(x, opt = {\n allowFunctions: false\n}) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined') {\n const startTime = window.performance ? window.performance.now() : 0;\n const str = stringify(x, opt);\n const endTime = window.performance ? window.performance.now() : 0;\n\n if (endTime - startTime > TIME_WARNING_THRESHOLD_MS) {\n /* eslint-disable fb-www/no-console */\n console.groupCollapsed(`Recoil: Spent ${endTime - startTime}ms computing a cache key`);\n console.warn(x, str);\n console.groupEnd();\n /* eslint-enable fb-www/no-console */\n }\n\n return str;\n }\n }\n\n return stringify(x, opt);\n}\n\nvar Recoil_stableStringify = stableStringify;\n\nclass TreeCache {\n constructor(options) {\n var _options$onHit, _options$onSet, _options$mapNodeValue;\n\n _defineProperty(this, \"_numLeafs\", void 0);\n\n _defineProperty(this, \"_root\", void 0);\n\n _defineProperty(this, \"_onHit\", void 0);\n\n _defineProperty(this, \"_onSet\", void 0);\n\n _defineProperty(this, \"_mapNodeValue\", void 0);\n\n this._numLeafs = 0;\n this._root = null;\n this._onHit = (_options$onHit = options === null || options === void 0 ? void 0 : options.onHit) !== null && _options$onHit !== void 0 ? _options$onHit : () => {};\n this._onSet = (_options$onSet = options === null || options === void 0 ? void 0 : options.onSet) !== null && _options$onSet !== void 0 ? _options$onSet : () => {};\n this._mapNodeValue = (_options$mapNodeValue = options === null || options === void 0 ? void 0 : options.mapNodeValue) !== null && _options$mapNodeValue !== void 0 ? _options$mapNodeValue : val => val;\n }\n\n size() {\n return this._numLeafs;\n } // TODO: nodeCount(): number\n\n\n root() {\n return this._root;\n }\n\n get(getNodeValue, handlers) {\n var _this$getLeafNode;\n\n return (_this$getLeafNode = this.getLeafNode(getNodeValue, handlers)) === null || _this$getLeafNode === void 0 ? void 0 : _this$getLeafNode.value;\n }\n\n getLeafNode(getNodeValue, handlers) {\n return findLeaf(this.root(), nodeKey => this._mapNodeValue(getNodeValue(nodeKey)), {\n onNodeVisit: node => {\n handlers === null || handlers === void 0 ? void 0 : handlers.onNodeVisit(node);\n\n if (node.type === 'leaf') {\n this._onHit(node);\n }\n }\n });\n }\n\n set(route, value, handlers) {\n let leafNode;\n const newRoot = addLeaf(this.root(), route.map(([nodeKey, nodeValue]) => [nodeKey, this._mapNodeValue(nodeValue)]), null, value, null, {\n onNodeVisit: node => {\n handlers === null || handlers === void 0 ? void 0 : handlers.onNodeVisit(node);\n\n if (node.type === 'leaf') {\n leafNode = node;\n }\n }\n });\n\n if (!this.root()) {\n this._root = newRoot;\n }\n\n this._numLeafs++;\n\n this._onSet(Recoil_nullthrows(leafNode));\n }\n\n delete(node) {\n if (!this.root()) {\n return false;\n }\n\n const root = Recoil_nullthrows(this.root());\n const existsInTree = pruneNodeFromTree(root, node, node.parent);\n\n if (!existsInTree) {\n return false;\n }\n\n if (node === root || root.type === 'branch' && !root.branches.size) {\n this._root = null;\n this._numLeafs = 0;\n return true;\n }\n\n this._numLeafs -= countDownstreamLeaves(node);\n return true;\n }\n\n clear() {\n this._numLeafs = 0;\n this._root = null;\n }\n\n}\n\nconst findLeaf = (root, getNodeValue, handlers) => {\n var _handlers$onNodeVisit;\n\n if (root == null) {\n return undefined;\n }\n\n handlers === null || handlers === void 0 ? void 0 : (_handlers$onNodeVisit = handlers.onNodeVisit) === null || _handlers$onNodeVisit === void 0 ? void 0 : _handlers$onNodeVisit.call(handlers, root);\n\n if (root.type === 'leaf') {\n return root;\n }\n\n const nodeValue = getNodeValue(root.nodeKey);\n return findLeaf(root.branches.get(nodeValue), getNodeValue, handlers);\n};\n\nconst addLeaf = (root, route, parent, value, branchKey, handlers) => {\n var _handlers$onNodeVisit2;\n\n let node;\n\n if (root == null) {\n if (route.length === 0) {\n node = {\n type: 'leaf',\n value,\n parent,\n branchKey\n };\n } else {\n const [path, ...rest] = route;\n const [nodeKey, nodeValue] = path;\n node = {\n type: 'branch',\n nodeKey,\n parent,\n branches: new Map(),\n branchKey\n };\n node.branches.set(nodeValue, addLeaf(null, rest, node, value, nodeValue, handlers));\n }\n } else {\n node = root;\n\n if (route.length) {\n const [path, ...rest] = route;\n const [nodeKey, nodeValue] = path;\n !(root.type === 'branch' && root.nodeKey === nodeKey) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Existing cache must have a branch midway through the route with matching node key') : Recoil_invariant(false) : void 0;\n root.branches.set(nodeValue, addLeaf(root.branches.get(nodeValue), rest, root, value, nodeValue, handlers));\n }\n }\n\n handlers === null || handlers === void 0 ? void 0 : (_handlers$onNodeVisit2 = handlers.onNodeVisit) === null || _handlers$onNodeVisit2 === void 0 ? void 0 : _handlers$onNodeVisit2.call(handlers, node);\n return node;\n};\n\nconst pruneNodeFromTree = (root, node, parent) => {\n if (!parent) {\n return root === node;\n }\n\n parent.branches.delete(node.branchKey);\n return pruneUpstreamBranches(root, parent, parent.parent);\n};\n\nconst pruneUpstreamBranches = (root, branchNode, parent) => {\n if (!parent) {\n return root === branchNode;\n }\n\n if (branchNode.branches.size === 0) {\n parent.branches.delete(branchNode.branchKey);\n }\n\n return pruneUpstreamBranches(root, parent, parent.parent);\n};\n\nconst countDownstreamLeaves = node => node.type === 'leaf' ? 1 : Array.from(node.branches.values()).reduce((sum, currNode) => sum + countDownstreamLeaves(currNode), 0);\n\nvar Recoil_TreeCache = {\n TreeCache\n};\n\nvar Recoil_TreeCache_1 = Recoil_TreeCache.TreeCache;\n\nvar Recoil_TreeCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n TreeCache: Recoil_TreeCache_1\n});\n\nclass LRUCache {\n constructor(options) {\n var _options$mapKey;\n\n _defineProperty(this, \"_maxSize\", void 0);\n\n _defineProperty(this, \"_size\", void 0);\n\n _defineProperty(this, \"_head\", void 0);\n\n _defineProperty(this, \"_tail\", void 0);\n\n _defineProperty(this, \"_map\", void 0);\n\n _defineProperty(this, \"_keyMapper\", void 0);\n\n this._maxSize = options.maxSize;\n this._size = 0;\n this._head = null;\n this._tail = null;\n this._map = new Map();\n this._keyMapper = (_options$mapKey = options.mapKey) !== null && _options$mapKey !== void 0 ? _options$mapKey : v => v;\n }\n\n head() {\n return this._head;\n }\n\n tail() {\n return this._tail;\n }\n\n size() {\n return this._size;\n }\n\n maxSize() {\n return this._maxSize;\n }\n\n has(key) {\n return this._map.has(this._keyMapper(key));\n }\n\n get(key) {\n const mappedKey = this._keyMapper(key);\n\n const node = this._map.get(mappedKey);\n\n if (!node) {\n return undefined;\n }\n\n this.set(key, node.value);\n return node.value;\n }\n\n set(key, val) {\n const mappedKey = this._keyMapper(key);\n\n const existingNode = this._map.get(mappedKey);\n\n if (existingNode) {\n this.delete(key);\n }\n\n const head = this.head();\n const node = {\n key,\n right: head,\n left: null,\n value: val\n };\n\n if (head) {\n head.left = node;\n } else {\n this._tail = node;\n }\n\n this._map.set(mappedKey, node);\n\n this._head = node;\n this._size++;\n\n this._maybeDeleteLRU();\n }\n\n _maybeDeleteLRU() {\n if (this.size() > this.maxSize()) {\n this.deleteLru();\n }\n }\n\n deleteLru() {\n const tail = this.tail();\n\n if (tail) {\n this.delete(tail.key);\n }\n }\n\n delete(key) {\n const mappedKey = this._keyMapper(key);\n\n if (!this._size || !this._map.has(mappedKey)) {\n return;\n }\n\n const node = Recoil_nullthrows(this._map.get(mappedKey));\n const right = node.right;\n const left = node.left;\n\n if (right) {\n right.left = node.left;\n }\n\n if (left) {\n left.right = node.right;\n }\n\n if (node === this.head()) {\n this._head = right;\n }\n\n if (node === this.tail()) {\n this._tail = left;\n }\n\n this._map.delete(mappedKey);\n\n this._size--;\n }\n\n clear() {\n this._size = 0;\n this._head = null;\n this._tail = null;\n this._map = new Map();\n }\n\n}\n\nvar Recoil_LRUCache = {\n LRUCache\n};\n\nvar Recoil_LRUCache_1 = Recoil_LRUCache.LRUCache;\n\nvar Recoil_LRUCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n LRUCache: Recoil_LRUCache_1\n});\n\nconst {\n LRUCache: LRUCache$1\n} = Recoil_LRUCache$1;\n\nconst {\n TreeCache: TreeCache$1\n} = Recoil_TreeCache$1;\n\nfunction treeCacheLRU(maxSize, mapNodeValue = v => v) {\n const lruCache = new LRUCache$1({\n maxSize\n });\n const cache = new TreeCache$1({\n mapNodeValue,\n onHit: node => {\n lruCache.set(node, true);\n },\n onSet: node => {\n const lruNode = lruCache.tail();\n lruCache.set(node, true);\n\n if (lruNode && cache.size() > maxSize) {\n cache.delete(lruNode.key);\n }\n }\n });\n return cache;\n}\n\nvar Recoil_treeCacheLRU = treeCacheLRU;\n\nconst {\n TreeCache: TreeCache$2\n} = Recoil_TreeCache$1;\n\n\n\nconst defaultPolicy = {\n equality: 'reference',\n eviction: 'none',\n maxSize: Infinity\n};\n\nfunction treeCacheFromPolicy({\n equality = defaultPolicy.equality,\n eviction = defaultPolicy.eviction,\n maxSize = defaultPolicy.maxSize\n} = defaultPolicy) {\n const valueMapper = getValueMapper(equality);\n const treeCache = getTreeCache(eviction, maxSize, valueMapper);\n return treeCache;\n}\n\nfunction getValueMapper(equality) {\n switch (equality) {\n case 'reference':\n return val => val;\n\n case 'value':\n return val => Recoil_stableStringify(val);\n }\n\n throw new Error(`Unrecognized equality policy ${equality}`);\n}\n\nfunction getTreeCache(eviction, maxSize, mapNodeValue) {\n switch (eviction) {\n case 'none':\n return new TreeCache$2({\n mapNodeValue\n });\n\n case 'lru':\n return Recoil_treeCacheLRU(Recoil_nullthrows(maxSize), mapNodeValue);\n }\n\n throw new Error(`Unrecognized eviction policy ${eviction}`);\n}\n\nvar Recoil_treeCacheFromPolicy = treeCacheFromPolicy;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is a stub for some integration into FB internal stuff\n */\nfunction startPerfBlock(_id) {\n return () => null;\n}\n\nvar Recoil_PerformanceTimings = {\n startPerfBlock\n};\n\nconst {\n CANCELED: CANCELED$1,\n Canceled: Canceled$1,\n loadableWithError: loadableWithError$1,\n loadableWithPromise: loadableWithPromise$1,\n loadableWithValue: loadableWithValue$1\n} = Recoil_Loadable;\n\n\n\nconst {\n getNodeLoadable: getNodeLoadable$2,\n peekNodeLoadable: peekNodeLoadable$1,\n setNodeValue: setNodeValue$3\n} = Recoil_FunctionalCore;\n\nconst {\n saveDependencyMapToStore: saveDependencyMapToStore$1\n} = Recoil_Graph;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$3,\n RecoilValueNotReady: RecoilValueNotReady$2,\n getConfigDeletionHandler: getConfigDeletionHandler$1,\n registerNode: registerNode$1\n} = Recoil_Node;\n\nconst {\n isRecoilValue: isRecoilValue$3\n} = Recoil_RecoilValue$1;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$4\n} = Recoil_RecoilValue$1;\n\nconst {\n setRecoilValueLoadable: setRecoilValueLoadable$2\n} = Recoil_RecoilValueInterface;\n\nconst {\n retainedByOptionWithDefault: retainedByOptionWithDefault$1\n} = Recoil_Retention;\n\n\n\n\n\n\n\n\n\n\n\nconst {\n startPerfBlock: startPerfBlock$1\n} = Recoil_PerformanceTimings;\n\n\n\nconst dependencyStack = []; // for detecting circular dependencies.\n\nconst waitingStores = new Map();\n/* eslint-disable no-redeclare */\n\nconst getNewExecutionId = (() => {\n let executionId = 0;\n return () => executionId++;\n})();\n\nfunction getInitialExecutionInfo() {\n return {\n depValuesDiscoveredSoFarDuringAsyncWork: null,\n latestLoadable: null,\n latestExecutionId: null,\n stateVersion: null\n };\n}\n\nfunction selector(options) {\n const {\n key,\n get,\n cachePolicy_UNSTABLE: cachePolicy\n } = options;\n const set = options.set != null ? options.set : undefined; // flow\n\n const cache = Recoil_treeCacheFromPolicy(cachePolicy !== null && cachePolicy !== void 0 ? cachePolicy : {\n equality: 'reference',\n eviction: 'none'\n });\n const retainedBy = retainedByOptionWithDefault$1(options.retainedBy_UNSTABLE);\n const executionInfoMap = new Map();\n let liveStoresCount = 0;\n\n function selectorIsLive() {\n return !Recoil_gkx_1('recoil_memory_managament_2020') || liveStoresCount > 0;\n }\n\n function getExecutionInfo(store) {\n if (!executionInfoMap.has(store)) {\n executionInfoMap.set(store, getInitialExecutionInfo());\n }\n\n return Recoil_nullthrows(executionInfoMap.get(store));\n }\n\n function selectorInit(store) {\n liveStoresCount++;\n store.getState().knownSelectors.add(key); // FIXME remove knownSelectors?\n\n return () => {\n liveStoresCount--;\n store.getState().knownSelectors.delete(key);\n executionInfoMap.delete(store);\n };\n }\n\n function selectorShouldDeleteConfigOnRelease() {\n return getConfigDeletionHandler$1(key) !== undefined && !selectorIsLive();\n }\n\n function notifyStoreWhenAsyncSettles(store, loadable, executionId) {\n if (loadable.state === 'loading') {\n let stores = waitingStores.get(executionId);\n\n if (stores == null) {\n waitingStores.set(executionId, stores = new Set());\n }\n\n stores.add(store);\n }\n }\n\n function notifyStoresOfSettledAsync(newLoadable, executionId) {\n const stores = waitingStores.get(executionId);\n\n if (stores !== undefined) {\n for (const store of stores) {\n setRecoilValueLoadable$2(store, new AbstractRecoilValue$4(key), newLoadable);\n }\n\n waitingStores.delete(executionId);\n }\n }\n\n function getCachedNodeLoadable(store, state, key) {\n if (state.atomValues.has(key)) {\n return Recoil_nullthrows(state.atomValues.get(key));\n }\n\n const loadable = getNodeLoadable$2(store, state, key);\n const isKeyPointingToSelector = store.getState().knownSelectors.has(key);\n\n if (loadable.state !== 'loading' && isKeyPointingToSelector) {\n state.atomValues.set(key, loadable);\n }\n\n return loadable;\n }\n /**\n * This function attaches a then() and a catch() to a promise that was\n * returned from a selector's get() (either explicitly or implicitly by\n * running a function that uses the \"async\" keyword). If a selector's get()\n * returns a promise, we have two possibilities:\n *\n * 1. The promise will resolve, in which case it will have completely finished\n * executing without any remaining pending dependencies. No more retries\n * are needed and we can proceed with updating the cache and notifying\n * subscribers (if it is the latest execution, otherwise only the cache\n * will be updated and subscriptions will not be fired). This is the case\n * handled by the attached then() handler.\n *\n * 2. The promise will throw because it either has an error or it came across\n * an async dependency that has not yet resolved, in which case we will\n * call wrapDepdencyPromise(), whose responsibility is to handle dependency\n * promises. This case is handled by the attached catch() handler.\n *\n * Both branches will eventually resolve to the final result of the selector\n * (or an error if a real error occurred).\n *\n * The execution will run to completion even if it is stale, and its value\n * will be cached. But stale executions will not update global state or update\n * executionInfo as that is the responsibility of the 'latest' execution.\n *\n * Note this function should not be passed a promise that was thrown--AKA a\n * dependency promise. Dependency promises should be passed to\n * wrapPendingDependencyPromise()).\n */\n\n\n function wrapPendingPromise(store, promise, state, depValues, executionId) {\n return promise.then(value => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n const loadable = loadableWithValue$1(value);\n maybeFreezeValue(value);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n return {\n __value: value,\n __key: key\n };\n }).catch(errorOrPromise => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n if (isLatestExecution(store, executionId)) {\n updateExecutionInfoDepValues(depValues, store, executionId);\n }\n\n if (Recoil_isPromise(errorOrPromise)) {\n return wrapPendingDependencyPromise(store, errorOrPromise, state, depValues, executionId);\n }\n\n const loadable = loadableWithError$1(errorOrPromise);\n maybeFreezeValue(errorOrPromise);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n throw errorOrPromise;\n });\n }\n /**\n * This function attaches a then() and a catch() to a promise that was\n * thrown from a selector's get(). If a selector's get() throws a promise,\n * we have two possibilities:\n *\n * 1. The promise will resolve, meaning one of our selector's dependencies is\n * now available and we should \"retry\" our get() by running it again. This\n * is the case handled by the attached then() handler.\n *\n * 2. The promise will throw because something went wrong with the dependency\n * promise (in other words a real error occurred). This case is handled by\n * the attached catch() handler. If the dependency promise throws, it is\n * _always_ a real error and not another dependency promise (any dependency\n * promises would have been handled upstream).\n *\n * The then() branch will eventually resolve to the final result of the\n * selector (or an error if a real error occurs), and the catch() will always\n * resolve to an error because the dependency promise is a promise that was\n * wrapped upstream, meaning it will only resolve to its real value or to a\n * real error.\n *\n * The execution will run to completion even if it is stale, and its value\n * will be cached. But stale executions will not update global state or update\n * executionInfo as that is the responsibility of the 'latest' execution.\n *\n * Note this function should not be passed a promise that was returned from\n * get(). The intention is that this function is only passed promises that\n * were thrown due to a pending dependency. Promises returned by get() should\n * be passed to wrapPendingPromise() instead.\n */\n\n\n function wrapPendingDependencyPromise(store, promise, state, existingDeps, executionId) {\n return promise.then(resolvedDep => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n if (resolvedDep instanceof Canceled$1) {\n Recoil_recoverableViolation('Selector was released while it had dependencies');\n return CANCELED$1;\n }\n\n const {\n __key: resolvedDepKey,\n __value: depValue\n } = resolvedDep !== null && resolvedDep !== void 0 ? resolvedDep : {};\n /**\n * We need to bypass the selector dep cache if the resolved dep was a\n * user-thrown promise because the selector dep cache will contain the\n * stale values of dependencies, causing an infinite evaluation loop.\n */\n\n let bypassSelectorDepCacheOnReevaluation = true;\n\n if (resolvedDepKey != null) {\n /**\n * Note for async atoms, this means we are changing the atom's value\n * in the store for the given version. This should be alright because\n * the version of state is now stale and a new version will have\n * already been triggered by the atom being resolved (see this logic\n * in Recoil_atom.js)\n */\n state.atomValues.set(resolvedDepKey, loadableWithValue$1(depValue));\n /**\n * We've added the resolved dependency to the selector dep cache, so\n * there's no need to bypass the cache\n */\n\n bypassSelectorDepCacheOnReevaluation = false;\n }\n\n const [loadable, depValues] = evaluateSelectorGetter(store, state, executionId, bypassSelectorDepCacheOnReevaluation);\n\n if (isLatestExecution(store, executionId)) {\n updateExecutionInfoDepValues(depValues, store, executionId);\n }\n\n maybeFreezeLoadableContents(loadable);\n\n if (loadable.state !== 'loading') {\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n }\n\n if (loadable.state === 'hasError') {\n throw loadable.contents;\n }\n\n if (loadable.state === 'hasValue') {\n return {\n __value: loadable.contents,\n __key: key\n };\n }\n /**\n * Returning promise here without wrapping as the wrapepr logic was\n * already done when we called evaluateSelectorGetter() to get this\n * loadable\n */\n\n\n return loadable.contents;\n }).catch(error => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n const loadable = loadableWithError$1(error);\n maybeFreezeValue(error);\n setCache(state, depValuesToDepRoute(existingDeps), loadableWithError$1(error));\n setDepsInStore(store, state, new Set(existingDeps.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n throw error;\n });\n }\n\n function setLoadableInStoreToNotifyDeps(store, loadable, executionId) {\n if (isLatestExecution(store, executionId)) {\n setExecutionInfo(loadable, store);\n notifyStoresOfSettledAsync(loadable, executionId);\n }\n }\n\n function setDepsInStore(store, state, deps, executionId) {\n var _store$getState, _store$getState$curre, _store$getState2, _store$getState2$next;\n\n if (isLatestExecution(store, executionId) || state.version === ((_store$getState = store.getState()) === null || _store$getState === void 0 ? void 0 : (_store$getState$curre = _store$getState.currentTree) === null || _store$getState$curre === void 0 ? void 0 : _store$getState$curre.version) || state.version === ((_store$getState2 = store.getState()) === null || _store$getState2 === void 0 ? void 0 : (_store$getState2$next = _store$getState2.nextTree) === null || _store$getState2$next === void 0 ? void 0 : _store$getState2$next.version)) {\n var _store$getState$nextT, _store$getState3, _store$getState3$next;\n\n saveDependencyMapToStore$1(new Map([[key, deps]]), store, (_store$getState$nextT = (_store$getState3 = store.getState()) === null || _store$getState3 === void 0 ? void 0 : (_store$getState3$next = _store$getState3.nextTree) === null || _store$getState3$next === void 0 ? void 0 : _store$getState3$next.version) !== null && _store$getState$nextT !== void 0 ? _store$getState$nextT : store.getState().currentTree.version);\n }\n }\n\n function setNewDepInStore(store, state, deps, newDepKey, executionId) {\n deps.add(newDepKey);\n setDepsInStore(store, state, deps, executionId);\n }\n\n function evaluateSelectorGetter(store, state, executionId, bypassSelectorDepCache = false) {\n const endPerfBlock = startPerfBlock$1(key); // TODO T63965866: use execution ID here\n\n let result;\n let resultIsError = false;\n let loadable;\n const depValues = new Map();\n /**\n * Starting a fresh set of deps that we'll be using to update state. We're\n * starting a new set versus adding it in existing state deps because\n * the version of state that we update deps for may be a more recent version\n * than the version the selector was called with. This is because the latest\n * execution will update the deps of the current/latest version of state (\n * this is safe to do because the fact that the selector is the latest\n * execution means the deps we discover below are our best guess at the\n * deps for the current/latest state in the store)\n */\n\n const deps = new Set();\n setDepsInStore(store, state, deps, executionId);\n\n function getRecoilValue(recoilValue) {\n const {\n key: depKey\n } = recoilValue;\n setNewDepInStore(store, state, deps, depKey, executionId);\n const depLoadable = bypassSelectorDepCache ? getNodeLoadable$2(store, state, depKey) : getCachedNodeLoadable(store, state, depKey);\n depValues.set(depKey, depLoadable);\n\n if (depLoadable.state === 'hasValue') {\n return depLoadable.contents;\n }\n\n throw depLoadable.contents;\n }\n\n try {\n result = get({\n get: getRecoilValue\n });\n result = isRecoilValue$3(result) ? getRecoilValue(result) : result;\n\n if (Recoil_isPromise(result)) {\n result = wrapPendingPromise(store, // $FlowFixMe[incompatible-call]\n result, state, depValues, executionId).finally(endPerfBlock);\n } else {\n endPerfBlock();\n }\n } catch (errorOrDepPromise) {\n result = errorOrDepPromise;\n\n if (Recoil_isPromise(result)) {\n result = wrapPendingDependencyPromise(store, // $FlowFixMe[incompatible-call]\n result, state, depValues, executionId).finally(endPerfBlock);\n } else {\n resultIsError = true;\n endPerfBlock();\n }\n }\n\n if (resultIsError) {\n loadable = loadableWithError$1(result);\n } else if (Recoil_isPromise(result)) {\n // $FlowFixMe[incompatible-call]\n loadable = loadableWithPromise$1(result);\n } else {\n // $FlowFixMe[incompatible-call]\n loadable = loadableWithValue$1(result);\n }\n\n maybeFreezeLoadableContents(loadable);\n return [loadable, depValues];\n }\n\n function getValFromCacheAndUpdatedDownstreamDeps(store, state) {\n const depsAfterCacheDone = new Set();\n const executionInfo = getExecutionInfo(store);\n const cachedVal = cache.get(nodeKey => {\n !(typeof nodeKey === 'string') ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Cache nodeKey is type string') : Recoil_invariant(false) : void 0;\n const loadable = getCachedNodeLoadable(store, state, nodeKey);\n return loadable.contents;\n }, {\n onNodeVisit: node => {\n if (node.type === 'branch' && node.nodeKey !== key && typeof node.nodeKey === 'string') {\n depsAfterCacheDone.add(node.nodeKey);\n }\n }\n });\n /**\n * Ensure store contains correct dependencies if we hit the cache so that\n * the store deps and cache are in sync for a given state. This is important\n * because store deps are normally updated when new executions are created,\n * but cache hits don't trigger new executions but they still _may_ signifiy\n * a change in deps in the store if the store deps for this state are empty\n * or stale.\n */\n\n if (cachedVal) {\n setDepsInStore(store, state, depsAfterCacheDone, executionInfo.latestExecutionId);\n }\n\n return cachedVal;\n }\n /**\n * FIXME: dep keys should take into account the state of the loadable to\n * prevent the edge case where a loadable with an error and a loadable with\n * an error as a value are treated as the same thing incorrectly. For example\n * these two should be treated differently:\n *\n * selector({key: '', get: () => new Error('hi')});\n * selector({key: '', get () => {throw new Error('hi')}});\n *\n * With current implementation they are treated the same\n */\n\n\n function depValuesToDepRoute(depValues) {\n return Array.from(depValues.entries()).map(([key, valLoadable]) => [key, valLoadable.contents]);\n }\n\n function getValFromRunningNewExecutionAndUpdatedDeps(store, state) {\n const newExecutionId = getNewExecutionId();\n const [loadable, newDepValues] = evaluateSelectorGetter(store, state, newExecutionId);\n setExecutionInfo(loadable, store, newDepValues, newExecutionId, state);\n maybeSetCacheWithLoadable(state, depValuesToDepRoute(newDepValues), loadable);\n notifyStoreWhenAsyncSettles(store, loadable, newExecutionId);\n return loadable;\n }\n /**\n * Given a tree state, this function returns the \"selector result\", which is\n * defined as a size-2 tuple of [DependencyMap, Loadable].\n *\n * The selector's get() function will only be re-evaluated if _both_ of the\n * following statements are true:\n *\n * 1. The current dep values from the given state produced a cache key that\n * was not found in the cache.\n * 2. There is no currently running async execution OR there is an\n * async execution that is running, but after comparing the dep values in\n * the given state with the dep values that the execution has discovered so\n * far we find that at least one dep value has changed, in which case we\n * start a new execution (the previously running execution will continue to\n * run to completion, but only the new execution will be deemed the\n * 'latest' execution, meaning it will be the only execution that will\n * update global state when it is finished. Any non-latest executions will\n * run to completion and update the selector cache but not global state).\n */\n\n\n function getSelectorValAndUpdatedDeps(store, state) {\n const cachedVal = getValFromCacheAndUpdatedDownstreamDeps(store, state);\n\n if (cachedVal != null) {\n setExecutionInfo(cachedVal, store);\n return cachedVal;\n }\n\n const inProgressExecutionInfo = getExecutionInfoOfInProgressExecution(store, state); // FIXME: this won't work with custom caching b/c it uses separate cache\n\n if (inProgressExecutionInfo) {\n const executionInfo = inProgressExecutionInfo;\n notifyStoreWhenAsyncSettles(store, Recoil_nullthrows(executionInfo.latestLoadable), Recoil_nullthrows(executionInfo.latestExecutionId)); // FIXME: check after the fact to see if we made the right choice by waiting\n\n return Recoil_nullthrows(executionInfo.latestLoadable);\n }\n\n return getValFromRunningNewExecutionAndUpdatedDeps(store, state);\n }\n /**\n * Searches execution info across all stores to see if there is an in-progress\n * execution whose dependency values match the values of the requesting store.\n */\n\n\n function getExecutionInfoOfInProgressExecution(store, state) {\n var _Array$from$find;\n\n const [, executionInfo] = (_Array$from$find = Array.from(executionInfoMap.entries()).find(([, executionInfo]) => {\n return executionInfo.latestLoadable != null && executionInfo.latestExecutionId != null && !haveAsyncDepsChanged(store, state);\n })) !== null && _Array$from$find !== void 0 ? _Array$from$find : [];\n return executionInfo;\n }\n\n const mapOfCheckedVersions = new Map();\n\n function haveAsyncDepsChanged(store, state) {\n var _executionInfo$depVal, _mapOfCheckedVersions;\n\n const executionInfo = getExecutionInfo(store);\n const oldDepValues = (_executionInfo$depVal = executionInfo.depValuesDiscoveredSoFarDuringAsyncWork) !== null && _executionInfo$depVal !== void 0 ? _executionInfo$depVal : new Map();\n const cachedDepValuesCheckedForThisVersion = Array(((_mapOfCheckedVersions = mapOfCheckedVersions.get(state.version)) !== null && _mapOfCheckedVersions !== void 0 ? _mapOfCheckedVersions : new Map()).entries());\n const isCachedVersionSame = mapOfCheckedVersions.has(state.version) && cachedDepValuesCheckedForThisVersion.length === oldDepValues.size && cachedDepValuesCheckedForThisVersion.every(([nodeKey, nodeVal]) => {\n return oldDepValues.get(nodeKey) === nodeVal;\n });\n\n if (oldDepValues == null || state.version === executionInfo.stateVersion || isCachedVersionSame) {\n return false;\n }\n\n mapOfCheckedVersions.set(state.version, new Map(oldDepValues));\n return Array.from(oldDepValues).some(([nodeKey, oldVal]) => {\n const loadable = getCachedNodeLoadable(store, state, nodeKey);\n return loadable.contents !== oldVal.contents &&\n /**\n * FIXME: in the condition below we're making the assumption that a\n * dependency that goes from loading to having a value is always because\n * the dependency resolved to that value, so we don't count it as a dep\n * change as the normal retry loop will handle retrying in response to a\n * resolved async dep. This is an incorrect assumption for the edge case\n * where there is an async selector that is loading, and while it is\n * loading one of its dependencies changes, triggering a new execution,\n * and that new execution produces a value synchronously (we don't make\n * that assumption for asynchronous work b/c it's guaranteed that a\n * loadable that goes from 'loading' to 'loading' in a new loadable is\n * a dep change).\n */\n !(oldVal.state === 'loading' && loadable.state !== 'loading');\n });\n }\n /**\n * This function will update the selector's execution info when the selector\n * has either finished running an execution or has started a new execution. If\n * the given loadable is in a 'loading' state, the intention is that a new\n * execution has started. Otherwise, the intention is that an execution has\n * just finished.\n */\n\n\n function setExecutionInfo(loadable, store, depValues, newExecutionId, state) {\n const executionInfo = getExecutionInfo(store);\n\n if (loadable.state === 'loading') {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = depValues;\n executionInfo.latestExecutionId = newExecutionId;\n executionInfo.latestLoadable = loadable;\n executionInfo.stateVersion = state === null || state === void 0 ? void 0 : state.version;\n } else {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = null;\n executionInfo.latestExecutionId = null;\n executionInfo.latestLoadable = null;\n executionInfo.stateVersion = null;\n }\n }\n /**\n * Conditionally updates the cache with a given loadable.\n *\n * We only cache loadables that are not loading because our cache keys are\n * based on dep values, which are in an unfinished state for loadables that\n * have a 'loading' state (new deps may be discovered while the selector\n * runs its async code). We never want to cache partial dependencies b/c it\n * could lead to errors, such as prematurely returning the result based on a\n * partial list of deps-- we need the full list of deps to ensure that we\n * are returning the correct result from cache.\n */\n\n\n function maybeSetCacheWithLoadable(state, depRoute, loadable) {\n if (loadable.state !== 'loading') {\n setCache(state, depRoute, loadable);\n }\n }\n\n function updateExecutionInfoDepValues(depValues, store, executionId) {\n const executionInfo = getExecutionInfo(store);\n\n if (isLatestExecution(store, executionId)) {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = depValues;\n }\n }\n\n function clearExecutionInfo(store, executionId) {\n if (isLatestExecution(store, executionId)) {\n executionInfoMap.delete(store);\n }\n }\n\n function isLatestExecution(store, executionId) {\n const executionInfo = getExecutionInfo(store);\n return executionId === executionInfo.latestExecutionId;\n }\n\n function maybeFreezeLoadableContents(loadable) {\n if (loadable.state !== 'loading') {\n maybeFreezeValue(loadable.contents);\n }\n }\n\n function maybeFreezeValue(val) {\n if (process.env.NODE_ENV !== \"production\") {\n if (Boolean(options.dangerouslyAllowMutability) === false) {\n Recoil_deepFreezeValue(val);\n }\n }\n }\n\n function setCache(state, cacheRoute, loadable) {\n state.atomValues.set(key, loadable);\n cache.set(cacheRoute, loadable);\n }\n\n function detectCircularDependencies(fn) {\n if (dependencyStack.includes(key)) {\n const message = `Recoil selector has circular dependencies: ${dependencyStack.slice(dependencyStack.indexOf(key)).join(' \\u2192 ')}`;\n return loadableWithError$1(new Error(message));\n }\n\n dependencyStack.push(key);\n\n try {\n return fn();\n } finally {\n dependencyStack.pop();\n }\n }\n\n function selectorPeek(store, state) {\n const cacheVal = cache.get(nodeKey => {\n !(typeof nodeKey === 'string') ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Cache nodeKey is type string') : Recoil_invariant(false) : void 0;\n const peek = peekNodeLoadable$1(store, state, nodeKey);\n return peek === null || peek === void 0 ? void 0 : peek.contents;\n });\n return cacheVal;\n }\n\n function selectorGet(store, state) {\n return detectCircularDependencies(() => getSelectorValAndUpdatedDeps(store, state));\n }\n\n function invalidateSelector(state) {\n state.atomValues.delete(key);\n }\n\n if (set != null) {\n function selectorSet(store, state, newValue) {\n let syncSelectorSetFinished = false;\n const writes = new Map();\n\n function getRecoilValue({\n key\n }) {\n if (syncSelectorSetFinished) {\n throw new Error('Recoil: Async selector sets are not currently supported.');\n }\n\n const loadable = getCachedNodeLoadable(store, state, key);\n\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n throw new RecoilValueNotReady$2(key);\n } else {\n throw loadable.contents;\n }\n }\n\n function setRecoilState(recoilState, valueOrUpdater) {\n if (syncSelectorSetFinished) {\n throw new Error('Recoil: Async selector sets are not currently supported.');\n }\n\n const newValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict type S from being a function itself without losing support for opaque types\n // flowlint-next-line unclear-type:off\n valueOrUpdater(getRecoilValue(recoilState)) : valueOrUpdater;\n const upstreamWrites = setNodeValue$3(store, state, recoilState.key, newValue);\n upstreamWrites.forEach((v, k) => writes.set(k, v));\n }\n\n function resetRecoilState(recoilState) {\n setRecoilState(recoilState, DEFAULT_VALUE$3);\n }\n\n const ret = set({\n set: setRecoilState,\n get: getRecoilValue,\n reset: resetRecoilState\n }, newValue); // set should be a void method, but if the user makes it `async`, then it\n // will return a Promise, which we don't currently support.\n\n if (ret !== undefined) {\n throw Recoil_isPromise(ret) ? new Error('Recoil: Async selector sets are not currently supported.') : new Error('Recoil: selector set should be a void function.');\n }\n\n syncSelectorSetFinished = true;\n return writes;\n }\n\n return registerNode$1({\n key,\n peek: selectorPeek,\n get: selectorGet,\n set: selectorSet,\n init: selectorInit,\n invalidate: invalidateSelector,\n shouldDeleteConfigOnRelease: selectorShouldDeleteConfigOnRelease,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false,\n retainedBy\n });\n } else {\n return registerNode$1({\n key,\n peek: selectorPeek,\n get: selectorGet,\n init: selectorInit,\n invalidate: invalidateSelector,\n shouldDeleteConfigOnRelease: selectorShouldDeleteConfigOnRelease,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false,\n retainedBy\n });\n }\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selector = selector;\n\n// @fb-only: const {scopedAtom} = require('Recoil_ScopedAtom');\nconst {\n loadableWithError: loadableWithError$2,\n loadableWithPromise: loadableWithPromise$2,\n loadableWithValue: loadableWithValue$2\n} = Recoil_Loadable;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$4,\n DefaultValue: DefaultValue$2,\n getConfigDeletionHandler: getConfigDeletionHandler$2,\n registerNode: registerNode$2,\n setConfigDeletionHandler: setConfigDeletionHandler$1\n} = Recoil_Node;\n\nconst {\n isRecoilValue: isRecoilValue$4\n} = Recoil_RecoilValue$1;\n\nconst {\n markRecoilValueModified: markRecoilValueModified$1,\n setRecoilValue: setRecoilValue$3,\n setRecoilValueLoadable: setRecoilValueLoadable$3\n} = Recoil_RecoilValueInterface;\n\nconst {\n retainedByOptionWithDefault: retainedByOptionWithDefault$2\n} = Recoil_Retention;\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction baseAtom(options) {\n const {\n key,\n persistence_UNSTABLE: persistence\n } = options;\n const retainedBy = retainedByOptionWithDefault$2(options.retainedBy_UNSTABLE);\n let liveStoresCount = 0;\n let defaultLoadable = Recoil_isPromise(options.default) ? loadableWithPromise$2(options.default.then(value => {\n defaultLoadable = loadableWithValue$2(value); // TODO Temporary disable Flow due to pending selector_NEW refactor\n\n const promiseInfo = {\n __key: key,\n __value: value\n };\n return promiseInfo;\n }).catch(error => {\n defaultLoadable = loadableWithError$2(error);\n throw error;\n })) : loadableWithValue$2(options.default);\n let cachedAnswerForUnvalidatedValue = undefined; // Cleanup handlers for this atom\n // Rely on stable reference equality of the store to use it as a key per \n\n const cleanupEffectsByStore = new Map();\n\n function wrapPendingPromise(store, promise) {\n const wrappedPromise = promise.then(value => {\n var _store$getState$nextT, _state$atomValues$get;\n\n const state = (_store$getState$nextT = store.getState().nextTree) !== null && _store$getState$nextT !== void 0 ? _store$getState$nextT : store.getState().currentTree;\n\n if (((_state$atomValues$get = state.atomValues.get(key)) === null || _state$atomValues$get === void 0 ? void 0 : _state$atomValues$get.contents) === wrappedPromise) {\n setRecoilValue$3(store, node, value);\n }\n\n return {\n __key: key,\n __value: value\n };\n }).catch(error => {\n var _store$getState$nextT2, _state$atomValues$get2;\n\n const state = (_store$getState$nextT2 = store.getState().nextTree) !== null && _store$getState$nextT2 !== void 0 ? _store$getState$nextT2 : store.getState().currentTree;\n\n if (((_state$atomValues$get2 = state.atomValues.get(key)) === null || _state$atomValues$get2 === void 0 ? void 0 : _state$atomValues$get2.contents) === wrappedPromise) {\n setRecoilValueLoadable$3(store, node, loadableWithError$2(error));\n }\n\n throw error;\n });\n return wrappedPromise;\n }\n\n function initAtom(store, initState, trigger) {\n liveStoresCount++;\n const alreadyKnown = store.getState().knownAtoms.has(key);\n store.getState().knownAtoms.add(key); // Setup async defaults to notify subscribers when they resolve\n\n if (defaultLoadable.state === 'loading') {\n const notifyDefaultSubscribers = () => {\n var _store$getState$nextT3;\n\n const state = (_store$getState$nextT3 = store.getState().nextTree) !== null && _store$getState$nextT3 !== void 0 ? _store$getState$nextT3 : store.getState().currentTree;\n\n if (!state.atomValues.has(key)) {\n markRecoilValueModified$1(store, node);\n }\n };\n\n defaultLoadable.contents.then(notifyDefaultSubscribers).catch(notifyDefaultSubscribers);\n } // Run Atom Effects\n // This state is scoped by Store, since this is in the initAtom() closure\n\n\n let initValue = DEFAULT_VALUE$4;\n let pendingSetSelf = null;\n\n if (options.effects_UNSTABLE != null && !alreadyKnown) {\n let duringInit = true;\n\n const setSelf = effect => valueOrUpdater => {\n if (duringInit) {\n const currentValue = initValue instanceof DefaultValue$2 || Recoil_isPromise(initValue) ? defaultLoadable.state === 'hasValue' ? defaultLoadable.contents : DEFAULT_VALUE$4 : initValue;\n initValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict T from being a function without losing support for opaque types\n valueOrUpdater(currentValue) // flowlint-line unclear-type:off\n : valueOrUpdater;\n } else {\n if (Recoil_isPromise(valueOrUpdater)) {\n throw new Error('Setting atoms to async values is not implemented.');\n }\n\n if (typeof valueOrUpdater !== 'function') {\n pendingSetSelf = {\n effect,\n value: valueOrUpdater\n };\n }\n\n setRecoilValue$3(store, node, typeof valueOrUpdater === 'function' ? currentValue => {\n const newValue = // cast to any because we can't restrict T from being a function without losing support for opaque types\n valueOrUpdater(currentValue); // flowlint-line unclear-type:off\n\n pendingSetSelf = {\n effect,\n value: newValue\n };\n return newValue;\n } : valueOrUpdater);\n }\n };\n\n const resetSelf = effect => () => setSelf(effect)(DEFAULT_VALUE$4);\n\n const onSet = effect => handler => {\n store.subscribeToTransactions(currentStore => {\n var _pendingSetSelf3;\n\n // eslint-disable-next-line prefer-const\n let {\n currentTree,\n previousTree\n } = currentStore.getState();\n\n if (!previousTree) {\n Recoil_recoverableViolation('Transaction subscribers notified without a next tree being present -- this is a bug in Recoil');\n previousTree = currentTree; // attempt to trundle on\n }\n\n const newLoadable = currentTree.atomValues.get(key);\n\n if (newLoadable == null || newLoadable.state === 'hasValue') {\n var _previousTree$atomVal, _pendingSetSelf, _pendingSetSelf2;\n\n const newValue = newLoadable != null ? newLoadable.contents : DEFAULT_VALUE$4;\n const oldLoadable = (_previousTree$atomVal = previousTree.atomValues.get(key)) !== null && _previousTree$atomVal !== void 0 ? _previousTree$atomVal : defaultLoadable;\n const oldValue = oldLoadable.state === 'hasValue' ? oldLoadable.contents : DEFAULT_VALUE$4; // TODO This isn't actually valid, use as a placeholder for now.\n // Ignore atom value changes that were set via setSelf() in the same effect.\n // We will still properly call the handler if there was a subsequent\n // set from something other than an atom effect which was batched\n // with the `setSelf()` call. However, we may incorrectly ignore\n // the handler if the subsequent batched call happens to set the\n // atom to the exact same value as the `setSelf()`. But, in that\n // case, it was kind of a noop, so the semantics are debatable..\n\n if (((_pendingSetSelf = pendingSetSelf) === null || _pendingSetSelf === void 0 ? void 0 : _pendingSetSelf.effect) !== effect || ((_pendingSetSelf2 = pendingSetSelf) === null || _pendingSetSelf2 === void 0 ? void 0 : _pendingSetSelf2.value) !== newValue) {\n handler(newValue, oldValue);\n }\n }\n\n if (((_pendingSetSelf3 = pendingSetSelf) === null || _pendingSetSelf3 === void 0 ? void 0 : _pendingSetSelf3.effect) === effect) {\n pendingSetSelf = null;\n }\n }, key);\n };\n\n for (const effect of (_options$effects_UNST = options.effects_UNSTABLE) !== null && _options$effects_UNST !== void 0 ? _options$effects_UNST : []) {\n var _options$effects_UNST;\n\n const cleanup = effect({\n node,\n trigger,\n setSelf: setSelf(effect),\n resetSelf: resetSelf(effect),\n onSet: onSet(effect)\n });\n\n if (cleanup != null) {\n cleanupEffectsByStore.set(store, cleanup);\n }\n }\n\n duringInit = false;\n } // Mutate initial state in place since we know there are no other subscribers\n // since we are the ones initializing on first use.\n\n\n if (!(initValue instanceof DefaultValue$2)) {\n var _store$getState$nextT4;\n\n const initLoadable = Recoil_isPromise(initValue) ? loadableWithPromise$2(wrapPendingPromise(store, initValue)) : loadableWithValue$2(initValue);\n initState.atomValues.set(key, initLoadable); // If there is a pending transaction, then also mutate the next state tree.\n // This could happen if the atom was first initialized in an action that\n // also updated some other atom's state.\n\n (_store$getState$nextT4 = store.getState().nextTree) === null || _store$getState$nextT4 === void 0 ? void 0 : _store$getState$nextT4.atomValues.set(key, initLoadable);\n }\n\n return () => {\n var _cleanupEffectsByStor;\n\n liveStoresCount--;\n (_cleanupEffectsByStor = cleanupEffectsByStore.get(store)) === null || _cleanupEffectsByStor === void 0 ? void 0 : _cleanupEffectsByStor();\n cleanupEffectsByStore.delete(store);\n store.getState().knownAtoms.delete(key); // FIXME remove knownAtoms?\n };\n }\n\n function peekAtom(_store, state) {\n var _ref, _state$atomValues$get3, _cachedAnswerForUnval;\n\n return (_ref = (_state$atomValues$get3 = state.atomValues.get(key)) !== null && _state$atomValues$get3 !== void 0 ? _state$atomValues$get3 : (_cachedAnswerForUnval = cachedAnswerForUnvalidatedValue) === null || _cachedAnswerForUnval === void 0 ? void 0 : _cachedAnswerForUnval[1]) !== null && _ref !== void 0 ? _ref : defaultLoadable;\n }\n\n function getAtom(_store, state) {\n if (state.atomValues.has(key)) {\n // Atom value is stored in state:\n return Recoil_nullthrows(state.atomValues.get(key));\n } else if (state.nonvalidatedAtoms.has(key)) {\n // Atom value is stored but needs validation before use.\n // We might have already validated it and have a cached validated value:\n if (cachedAnswerForUnvalidatedValue != null) {\n return cachedAnswerForUnvalidatedValue;\n }\n\n if (persistence == null) {\n Recoil_expectationViolation(`Tried to restore a persisted value for atom ${key} but it has no persistence settings.`);\n return defaultLoadable;\n }\n\n const nonvalidatedValue = state.nonvalidatedAtoms.get(key);\n const validatorResult = persistence.validator(nonvalidatedValue, DEFAULT_VALUE$4);\n const validatedValueLoadable = validatorResult instanceof DefaultValue$2 ? defaultLoadable : loadableWithValue$2(validatorResult);\n cachedAnswerForUnvalidatedValue = validatedValueLoadable;\n return cachedAnswerForUnvalidatedValue;\n } else {\n return defaultLoadable;\n }\n }\n\n function invalidateAtom() {\n cachedAnswerForUnvalidatedValue = undefined;\n }\n\n function setAtom(_store, state, newValue) {\n // Bail out if we're being set to the existing value, or if we're being\n // reset but have no stored value (validated or unvalidated) to reset from:\n if (state.atomValues.has(key)) {\n const existing = Recoil_nullthrows(state.atomValues.get(key));\n\n if (existing.state === 'hasValue' && newValue === existing.contents) {\n return new Map();\n }\n } else if (!state.nonvalidatedAtoms.has(key) && newValue instanceof DefaultValue$2) {\n return new Map();\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (options.dangerouslyAllowMutability !== true) {\n Recoil_deepFreezeValue(newValue);\n }\n }\n\n cachedAnswerForUnvalidatedValue = undefined; // can be released now if it was previously in use\n\n return new Map().set(key, loadableWithValue$2(newValue));\n }\n\n function shouldDeleteConfigOnReleaseAtom() {\n return getConfigDeletionHandler$2(key) !== undefined && liveStoresCount <= 0;\n }\n\n const node = registerNode$2({\n key,\n peek: peekAtom,\n get: getAtom,\n set: setAtom,\n init: initAtom,\n invalidate: invalidateAtom,\n shouldDeleteConfigOnRelease: shouldDeleteConfigOnReleaseAtom,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n persistence_UNSTABLE: options.persistence_UNSTABLE ? {\n type: options.persistence_UNSTABLE.type,\n backButton: options.persistence_UNSTABLE.backButton\n } : undefined,\n shouldRestoreFromSnapshots: true,\n retainedBy\n });\n return node;\n} // prettier-ignore\n\n\nfunction atom(options) {\n const {\n default: optionsDefault,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n ...restOptions\n } = options;\n\n if (isRecoilValue$4(optionsDefault) // Continue to use atomWithFallback for promise defaults for scoped atoms\n // for now, since scoped atoms don't support async defaults\n // @fb-only: || (isPromise(optionsDefault) && scopeRules_APPEND_ONLY_READ_THE_DOCS)\n ) {\n return atomWithFallback({ ...restOptions,\n default: optionsDefault // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n\n }); // @fb-only: } else if (scopeRules_APPEND_ONLY_READ_THE_DOCS && !isPromise(optionsDefault)) {\n // @fb-only: return scopedAtom({\n // @fb-only: ...restOptions,\n // @fb-only: default: optionsDefault,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: });\n } else {\n return baseAtom({ ...restOptions,\n default: optionsDefault\n });\n }\n}\n\nfunction atomWithFallback(options) {\n const base = atom({ ...options,\n default: DEFAULT_VALUE$4,\n persistence_UNSTABLE: options.persistence_UNSTABLE === undefined ? undefined : { ...options.persistence_UNSTABLE,\n validator: storedValue => storedValue instanceof DefaultValue$2 ? storedValue : Recoil_nullthrows(options.persistence_UNSTABLE).validator(storedValue, DEFAULT_VALUE$4)\n },\n // TODO Hack for now.\n // flowlint-next-line unclear-type: off\n effects_UNSTABLE: options.effects_UNSTABLE\n });\n const sel = Recoil_selector({\n key: `${options.key}__withFallback`,\n get: ({\n get\n }) => {\n const baseValue = get(base);\n return baseValue instanceof DefaultValue$2 ? options.default : baseValue;\n },\n set: ({\n set\n }, newValue) => set(base, newValue),\n dangerouslyAllowMutability: options.dangerouslyAllowMutability\n });\n setConfigDeletionHandler$1(sel.key, getConfigDeletionHandler$2(options.key));\n return sel;\n}\n\nvar Recoil_atom = atom;\n\n/**\n * (c) Facebook, Inc. and its affiliates. Confidential and proprietary.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nclass MapCache {\n constructor(options) {\n var _options$mapKey;\n\n _defineProperty(this, \"_map\", void 0);\n\n _defineProperty(this, \"_keyMapper\", void 0);\n\n this._map = new Map();\n this._keyMapper = (_options$mapKey = options === null || options === void 0 ? void 0 : options.mapKey) !== null && _options$mapKey !== void 0 ? _options$mapKey : v => v;\n }\n\n size() {\n return this._map.size;\n }\n\n has(key) {\n return this._map.has(this._keyMapper(key));\n }\n\n get(key) {\n return this._map.get(this._keyMapper(key));\n }\n\n set(key, val) {\n this._map.set(this._keyMapper(key), val);\n }\n\n delete(key) {\n this._map.delete(this._keyMapper(key));\n }\n\n clear() {\n this._map.clear();\n }\n\n}\n\nvar Recoil_MapCache = {\n MapCache\n};\n\nvar Recoil_MapCache_1 = Recoil_MapCache.MapCache;\n\nvar Recoil_MapCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MapCache: Recoil_MapCache_1\n});\n\nconst {\n LRUCache: LRUCache$2\n} = Recoil_LRUCache$1;\n\nconst {\n MapCache: MapCache$1\n} = Recoil_MapCache$1;\n\nconst defaultPolicy$1 = {\n equality: 'reference',\n eviction: 'none',\n maxSize: Infinity\n};\n\nfunction cacheFromPolicy({\n equality = defaultPolicy$1.equality,\n eviction = defaultPolicy$1.eviction,\n maxSize = defaultPolicy$1.maxSize\n} = defaultPolicy$1) {\n const valueMapper = getValueMapper$1(equality);\n const cache = getCache(eviction, maxSize, valueMapper);\n return cache;\n}\n\nfunction getValueMapper$1(equality) {\n switch (equality) {\n case 'reference':\n return val => val;\n\n case 'value':\n return val => Recoil_stableStringify(val);\n }\n\n throw new Error(`Unrecognized equality policy ${equality}`);\n}\n\nfunction getCache(eviction, maxSize, mapKey) {\n switch (eviction) {\n case 'none':\n return new MapCache$1({\n mapKey\n });\n\n case 'lru':\n return new LRUCache$2({\n mapKey,\n maxSize: Recoil_nullthrows(maxSize)\n });\n }\n\n throw new Error(`Unrecognized eviction policy ${eviction}`);\n}\n\nvar Recoil_cacheFromPolicy = cacheFromPolicy;\n\nconst {\n setConfigDeletionHandler: setConfigDeletionHandler$2\n} = Recoil_Node;\n\n\n\n // Keep in mind the parameter needs to be serializable as a cahche key\n// using Recoil_stableStringify\n\n\n// Add a unique index to each selector in case the cache implementation allows\n// duplicate keys based on equivalent stringified parameters\nlet nextIndex = 0;\n/* eslint-disable no-redeclare */\n\n// Return a function that returns members of a family of selectors of the same type\n// E.g.,\n//\n// const s = selectorFamily(...);\n// s({a: 1}) => a selector\n// s({a: 2}) => a different selector\n//\n// By default, the selectors are distinguished by distinct values of the\n// parameter based on value equality, not reference equality. This allows using\n// object literals or other equivalent objects at callsites to not create\n// duplicate cache entries. This behavior may be overridden with the\n// cacheImplementationForParams option.\nfunction selectorFamily(options) {\n var _options$cachePolicyF;\n\n const selectorCache = Recoil_cacheFromPolicy((_options$cachePolicyF = options.cachePolicyForParams_UNSTABLE) !== null && _options$cachePolicyF !== void 0 ? _options$cachePolicyF : {\n equality: 'value',\n eviction: 'none'\n });\n return params => {\n var _stableStringify;\n\n const cachedSelector = selectorCache.get(params);\n\n if (cachedSelector != null) {\n return cachedSelector;\n }\n\n const myKey = `${options.key}__selectorFamily/${(_stableStringify = Recoil_stableStringify(params, {\n // It is possible to use functions in parameters if the user uses\n // a cache with reference equality thanks to the incrementing index.\n allowFunctions: true\n })) !== null && _stableStringify !== void 0 ? _stableStringify : 'void'}/${nextIndex++}`; // Append index in case values serialize to the same key string\n\n const myGet = callbacks => options.get(params)(callbacks);\n\n const myCachePolicy = options.cachePolicy_UNSTABLE;\n const retainedBy = typeof options.retainedBy_UNSTABLE === 'function' ? options.retainedBy_UNSTABLE(params) : options.retainedBy_UNSTABLE;\n let newSelector;\n\n if (options.set != null) {\n const set = options.set;\n\n const mySet = (callbacks, newValue) => set(params)(callbacks, newValue);\n\n newSelector = Recoil_selector({\n key: myKey,\n get: myGet,\n set: mySet,\n cachePolicy_UNSTABLE: myCachePolicy,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: retainedBy\n });\n } else {\n newSelector = Recoil_selector({\n key: myKey,\n get: myGet,\n cachePolicy_UNSTABLE: myCachePolicy,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: retainedBy\n });\n }\n\n selectorCache.set(params, newSelector);\n setConfigDeletionHandler$2(newSelector.key, () => {\n selectorCache.delete(params);\n });\n return newSelector;\n };\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selectorFamily = selectorFamily;\n\n// @fb-only: const {parameterizedScopedAtomLegacy} = require('Recoil_ScopedAtom');\n\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$5,\n DefaultValue: DefaultValue$3,\n setConfigDeletionHandler: setConfigDeletionHandler$3\n} = Recoil_Node;\n/*\nA function which returns an atom based on the input parameter.\n\nEach unique parameter returns a unique atom. E.g.,\n\n const f = atomFamily(...);\n f({a: 1}) => an atom\n f({a: 2}) => a different atom\n\nThis allows components to persist local, private state using atoms. Each\ninstance of the component may have a different key, which it uses as the\nparameter for a family of atoms; in this way, each component will have\nits own atom not shared by other instances. These state keys may be composed\ninto children's state keys as well.\n*/\n\n\nfunction atomFamily(options) {\n var _options$cachePolicyF;\n\n const atomCache = Recoil_cacheFromPolicy((_options$cachePolicyF = options.cachePolicyForParams_UNSTABLE) !== null && _options$cachePolicyF !== void 0 ? _options$cachePolicyF : {\n equality: 'value',\n eviction: 'none'\n }); // An atom to represent any legacy atoms that we can upgrade to an atomFamily\n\n const legacyAtomOptions = {\n key: options.key,\n // Legacy atoms just used the plain key directly\n default: DEFAULT_VALUE$5,\n persistence_UNSTABLE: options.persistence_UNSTABLE\n };\n let legacyAtom; // prettier-ignore\n // @fb-only: if (\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS\n // @fb-only: ) {\n // @fb-only: legacyAtom = parameterizedScopedAtomLegacy({\n // @fb-only: ...legacyAtomOptions,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS:\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: });\n // @fb-only: } else {\n\n legacyAtom = Recoil_atom(legacyAtomOptions); // @fb-only: }\n // Selector to calculate the default value based on any persisted legacy atoms\n // that were upgraded to a atomFamily\n\n const atomFamilyDefault = Recoil_selectorFamily({\n key: `${options.key}__atomFamily/Default`,\n get: param => ({\n get\n }) => {\n const legacyValue = get(typeof legacyAtom === 'function' ? legacyAtom(param) : legacyAtom); // Atom was upgraded from a non-parameterized atom\n\n if (!(legacyValue instanceof DefaultValue$3)) {\n return legacyValue;\n } // There's no legacy atom value, so use the user-specified default\n\n\n return typeof options.default === 'function' ? // The default was parameterized\n // Flow doesn't know that T isn't a function, so we need to case to any\n options.default(param) // flowlint-line unclear-type:off\n : // Default may be a static value, promise, or RecoilValue\n options.default;\n },\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: options.retainedBy_UNSTABLE\n }); // Simple atomFamily implementation to cache individual atoms based\n // on the parameter value equality.\n\n return params => {\n var _stableStringify;\n\n const cachedAtom = atomCache.get(params);\n\n if (cachedAtom != null) {\n return cachedAtom;\n }\n\n const {\n cachePolicyForParams_UNSTABLE,\n ...atomOptions\n } = options;\n const newAtom = Recoil_atom({ ...atomOptions,\n key: `${options.key}__${(_stableStringify = Recoil_stableStringify(params)) !== null && _stableStringify !== void 0 ? _stableStringify : 'void'}`,\n default: atomFamilyDefault(params),\n retainedBy_UNSTABLE: typeof options.retainedBy_UNSTABLE === 'function' ? options.retainedBy_UNSTABLE(params) : options.retainedBy_UNSTABLE,\n effects_UNSTABLE: typeof options.effects_UNSTABLE === 'function' ? options.effects_UNSTABLE(params) : options.effects_UNSTABLE // prettier-ignore\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS: mapScopeRules(\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: params,\n // @fb-only: ),\n\n });\n atomCache.set(params, newAtom);\n setConfigDeletionHandler$3(newAtom.key, () => {\n atomCache.delete(params);\n });\n return newAtom;\n };\n}\n\nvar Recoil_atomFamily = atomFamily;\n\n// flowlint-next-line unclear-type:off\n\n\nconst constantSelector = Recoil_selectorFamily({\n key: '__constant',\n get: constant => () => constant,\n cachePolicyForParams_UNSTABLE: {\n equality: 'reference'\n }\n}); // Function that returns a selector which always produces the\n// same constant value. It may be called multiple times with the\n// same value, based on reference equality, and will provide the\n// same selector.\n\nfunction constSelector(constant) {\n return constantSelector(constant);\n}\n\nvar Recoil_constSelector = constSelector;\n\n// flowlint-next-line unclear-type:off\n\n\nconst throwingSelector = Recoil_selectorFamily({\n key: '__error',\n get: message => () => {\n throw new Error(message);\n },\n cachePolicyForParams_UNSTABLE: {\n equality: 'reference'\n }\n}); // Function that returns a selector which always throws an error\n// with the provided message.\n\nfunction errorSelector(message) {\n return throwingSelector(message);\n}\n\nvar Recoil_errorSelector = errorSelector;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Wraps another recoil value and prevents writing to it.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction readOnlySelector(atom) {\n // flowlint-next-line unclear-type: off\n return atom;\n}\n\nvar Recoil_readOnlySelector = readOnlySelector;\n\nconst {\n loadableWithError: loadableWithError$3,\n loadableWithPromise: loadableWithPromise$3,\n loadableWithValue: loadableWithValue$3\n} = Recoil_Loadable;\n\n\n\n /////////////////\n// TRUTH TABLE\n/////////////////\n// Dependencies waitForNone waitForAny waitForAll waitForAllSettled\n// [loading, loading] [Promise, Promise] Promise Promise Promise\n// [value, loading] [value, Promise] [value, Promise] Promise Promise\n// [value, value] [value, value] [value, value] [value, value] [value, value]\n//\n// [error, loading] [Error, Promise] [Error, Promise] Error Promise\n// [error, error] [Error, Error] [Error, Error] Error [error, error]\n// [value, error] [value, Error] [value, Error] Error [value, error]\n// Issue parallel requests for all dependencies and return the current\n// status if they have results, have some error, or are still pending.\n\n\nfunction concurrentRequests(getRecoilValue, deps) {\n const results = Array(deps.length).fill(undefined);\n const exceptions = Array(deps.length).fill(undefined);\n\n for (const [i, dep] of deps.entries()) {\n try {\n results[i] = getRecoilValue(dep);\n } catch (e) {\n // exceptions can either be Promises of pending results or real errors\n exceptions[i] = e;\n }\n }\n\n return [results, exceptions];\n}\n\nfunction isError(exp) {\n return exp != null && !Recoil_isPromise(exp);\n}\n\nfunction unwrapDependencies(dependencies) {\n return Array.isArray(dependencies) ? dependencies : Object.getOwnPropertyNames(dependencies).map(key => dependencies[key]);\n}\n\nfunction getValueFromLoadablePromiseResult(result) {\n if (result != null && typeof result === 'object' && result.hasOwnProperty('__value')) {\n return result.__value;\n }\n\n return result;\n}\n\nfunction wrapResults(dependencies, results) {\n return Array.isArray(dependencies) ? results : // Object.getOwnPropertyNames() has consistent key ordering with ES6\n Object.getOwnPropertyNames(dependencies).reduce((out, key, idx) => ({ ...out,\n [key]: results[idx]\n }), {});\n}\n\nfunction wrapLoadables(dependencies, results, exceptions) {\n const output = exceptions.map((exception, idx) => exception == null ? loadableWithValue$3(results[idx]) : Recoil_isPromise(exception) ? loadableWithPromise$3(exception) : loadableWithError$3(exception));\n return wrapResults(dependencies, output);\n}\n\nfunction combineAsyncResultsWithSyncResults(syncResults, asyncResults) {\n return asyncResults.map((result, idx) =>\n /**\n * it's important we use === undefined as opposed to == null, because the\n * resolved value of the async promise could be `null`, in which case we\n * don't want to use syncResults[idx], which would be undefined. If async\n * promise resolves to `undefined`, that's ok because `syncResults[idx]`\n * will also be `undefined`. That's a little hacky, but it works.\n */\n result === undefined ? syncResults[idx] : result);\n} // Selector that requests all dependencies in parallel and immediately returns\n// current results without waiting.\n\n\nconst waitForNone = Recoil_selectorFamily({\n key: '__waitForNone',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // Always return the current status of the results; never block.\n\n return wrapLoadables(dependencies, results, exceptions);\n }\n}); // Selector that requests all dependencies in parallel and waits for at least\n// one to be available before returning results. It will only error if all\n// dependencies have errors.\n\nconst waitForAny = Recoil_selectorFamily({\n key: '__waitForAny',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If any results are available, value or error, return the current status\n\n if (exceptions.some(exp => !Recoil_isPromise(exp))) {\n return wrapLoadables(dependencies, results, exceptions);\n } // Otherwise, return a promise that will resolve when the next result is\n // available, whichever one happens to be next. But, if all pending\n // dependencies end up with errors, then reject the promise.\n\n\n return new Promise(resolve => {\n for (const [i, exp] of exceptions.entries()) {\n if (Recoil_isPromise(exp)) {\n exp.then(result => {\n results[i] = getValueFromLoadablePromiseResult(result);\n exceptions[i] = undefined;\n resolve(wrapLoadables(dependencies, results, exceptions));\n }).catch(error => {\n exceptions[i] = error;\n resolve(wrapLoadables(dependencies, results, exceptions));\n });\n }\n }\n });\n }\n}); // Selector that requests all dependencies in parallel and waits for all to be\n// available before returning a value. It will error if any dependencies error.\n\nconst waitForAll = Recoil_selectorFamily({\n key: '__waitForAll',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If all results are available, return the results\n\n if (exceptions.every(exp => exp == null)) {\n return wrapResults(dependencies, results);\n } // If we have any errors, throw the first error\n\n\n const error = exceptions.find(isError);\n\n if (error != null) {\n throw error;\n } // Otherwise, return a promise that will resolve when all results are available\n\n\n return Promise.all(exceptions).then(exceptionResults => wrapResults(dependencies, combineAsyncResultsWithSyncResults(results, exceptionResults).map(getValueFromLoadablePromiseResult)));\n }\n});\nconst waitForAllSettled = Recoil_selectorFamily({\n key: '__waitForAllSettled',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If all results are available, return the results\n\n if (exceptions.every(exp => !Recoil_isPromise(exp))) {\n return wrapLoadables(dependencies, results, exceptions);\n } // Wait for all results to settle\n\n\n return Promise.all(exceptions.map((exp, i) => Recoil_isPromise(exp) ? exp.then(result => {\n results[i] = getValueFromLoadablePromiseResult(result);\n exceptions[i] = undefined;\n }).catch(error => {\n results[i] = undefined;\n exceptions[i] = error;\n }) : null)) // Then wrap them as loadables\n .then(() => wrapLoadables(dependencies, results, exceptions));\n }\n});\nconst noWait = Recoil_selectorFamily({\n key: '__noWait',\n get: dependency => ({\n get\n }) => {\n try {\n return loadableWithValue$3(get(dependency));\n } catch (exception) {\n return Recoil_isPromise(exception) ? loadableWithPromise$3(exception) : loadableWithError$3(exception);\n }\n }\n});\nvar Recoil_WaitFor = {\n waitForNone,\n waitForAny,\n waitForAll,\n waitForAllSettled,\n noWait\n};\n\nconst {\n batchUpdates: batchUpdates$3,\n setBatcher: setBatcher$1\n} = Recoil_Batching;\n\nconst {\n DefaultValue: DefaultValue$4\n} = Recoil_Node;\n\nconst {\n RecoilRoot: RecoilRoot$2\n} = Recoil_RecoilRoot_react;\n\nconst {\n isRecoilValue: isRecoilValue$5\n} = Recoil_RecoilValue$1;\n\nconst {\n retentionZone: retentionZone$1\n} = Recoil_RetentionZone;\n\nconst {\n freshSnapshot: freshSnapshot$2\n} = Recoil_Snapshot$1;\n\nconst {\n useGotoRecoilSnapshot: useGotoRecoilSnapshot$1,\n useRecoilCallback: useRecoilCallback$1,\n useRecoilSnapshot: useRecoilSnapshot$1,\n useRecoilState: useRecoilState$1,\n useRecoilStateLoadable: useRecoilStateLoadable$1,\n useRecoilTransactionObserver: useRecoilTransactionObserver$1,\n useRecoilValue: useRecoilValue$1,\n useRecoilValueLoadable: useRecoilValueLoadable$1,\n useResetRecoilState: useResetRecoilState$1,\n useRetain: useRetain$1,\n useSetRecoilState: useSetRecoilState$1,\n useSetUnvalidatedAtomValues: useSetUnvalidatedAtomValues$1,\n useTransactionObservation_DEPRECATED: useTransactionObservation_DEPRECATED$1\n} = Recoil_Hooks;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n noWait: noWait$1,\n waitForAll: waitForAll$1,\n waitForAllSettled: waitForAllSettled$1,\n waitForAny: waitForAny$1,\n waitForNone: waitForNone$1\n} = Recoil_WaitFor;\n\nvar Recoil_index = {\n // Types\n DefaultValue: DefaultValue$4,\n // Components\n RecoilRoot: RecoilRoot$2,\n useRecoilBridgeAcrossReactRoots_UNSTABLE: Recoil_useRecoilBridgeAcrossReactRoots,\n // RecoilValues\n atom: Recoil_atom,\n selector: Recoil_selector,\n // Other factories\n retentionZone: retentionZone$1,\n // Convenience RecoilValues\n atomFamily: Recoil_atomFamily,\n selectorFamily: Recoil_selectorFamily,\n constSelector: Recoil_constSelector,\n errorSelector: Recoil_errorSelector,\n readOnlySelector: Recoil_readOnlySelector,\n // Hooks that accept RecoilValues\n useRecoilValue: useRecoilValue$1,\n useRecoilValueLoadable: useRecoilValueLoadable$1,\n useRecoilState: useRecoilState$1,\n useRecoilStateLoadable: useRecoilStateLoadable$1,\n useSetRecoilState: useSetRecoilState$1,\n useResetRecoilState: useResetRecoilState$1,\n useGetRecoilValueInfo_UNSTABLE: Recoil_useGetRecoilValueInfo,\n useRetain: useRetain$1,\n // Hooks for asynchronous Recoil\n useRecoilCallback: useRecoilCallback$1,\n // Hooks for Snapshots\n useGotoRecoilSnapshot: useGotoRecoilSnapshot$1,\n useRecoilSnapshot: useRecoilSnapshot$1,\n useRecoilTransactionObserver_UNSTABLE: useRecoilTransactionObserver$1,\n useTransactionObservation_UNSTABLE: useTransactionObservation_DEPRECATED$1,\n useSetUnvalidatedAtomValues_UNSTABLE: useSetUnvalidatedAtomValues$1,\n // Concurrency Helpers\n noWait: noWait$1,\n waitForNone: waitForNone$1,\n waitForAny: waitForAny$1,\n waitForAll: waitForAll$1,\n waitForAllSettled: waitForAllSettled$1,\n // Other functions\n isRecoilValue: isRecoilValue$5,\n // Batching\n batchUpdates: batchUpdates$3,\n setBatcher: setBatcher$1,\n // Snapshot Utils\n snapshot_UNSTABLE: freshSnapshot$2\n};\nvar Recoil_index_1 = Recoil_index.DefaultValue;\nvar Recoil_index_2 = Recoil_index.RecoilRoot;\nvar Recoil_index_3 = Recoil_index.useRecoilBridgeAcrossReactRoots_UNSTABLE;\nvar Recoil_index_4 = Recoil_index.atom;\nvar Recoil_index_5 = Recoil_index.selector;\nvar Recoil_index_6 = Recoil_index.retentionZone;\nvar Recoil_index_7 = Recoil_index.atomFamily;\nvar Recoil_index_8 = Recoil_index.selectorFamily;\nvar Recoil_index_9 = Recoil_index.constSelector;\nvar Recoil_index_10 = Recoil_index.errorSelector;\nvar Recoil_index_11 = Recoil_index.readOnlySelector;\nvar Recoil_index_12 = Recoil_index.useRecoilValue;\nvar Recoil_index_13 = Recoil_index.useRecoilValueLoadable;\nvar Recoil_index_14 = Recoil_index.useRecoilState;\nvar Recoil_index_15 = Recoil_index.useRecoilStateLoadable;\nvar Recoil_index_16 = Recoil_index.useSetRecoilState;\nvar Recoil_index_17 = Recoil_index.useResetRecoilState;\nvar Recoil_index_18 = Recoil_index.useGetRecoilValueInfo_UNSTABLE;\nvar Recoil_index_19 = Recoil_index.useRetain;\nvar Recoil_index_20 = Recoil_index.useRecoilCallback;\nvar Recoil_index_21 = Recoil_index.useGotoRecoilSnapshot;\nvar Recoil_index_22 = Recoil_index.useRecoilSnapshot;\nvar Recoil_index_23 = Recoil_index.useRecoilTransactionObserver_UNSTABLE;\nvar Recoil_index_24 = Recoil_index.useTransactionObservation_UNSTABLE;\nvar Recoil_index_25 = Recoil_index.useSetUnvalidatedAtomValues_UNSTABLE;\nvar Recoil_index_26 = Recoil_index.noWait;\nvar Recoil_index_27 = Recoil_index.waitForNone;\nvar Recoil_index_28 = Recoil_index.waitForAny;\nvar Recoil_index_29 = Recoil_index.waitForAll;\nvar Recoil_index_30 = Recoil_index.waitForAllSettled;\nvar Recoil_index_31 = Recoil_index.isRecoilValue;\nvar Recoil_index_32 = Recoil_index.batchUpdates;\nvar Recoil_index_33 = Recoil_index.setBatcher;\nvar Recoil_index_34 = Recoil_index.snapshot_UNSTABLE;\n\nexport default Recoil_index;\nexport { Recoil_index_1 as DefaultValue, Recoil_index_2 as RecoilRoot, Recoil_index_4 as atom, Recoil_index_7 as atomFamily, Recoil_index_32 as batchUpdates, Recoil_index_9 as constSelector, Recoil_index_10 as errorSelector, Recoil_index_31 as isRecoilValue, Recoil_index_26 as noWait, Recoil_index_11 as readOnlySelector, Recoil_index_6 as retentionZone, Recoil_index_5 as selector, Recoil_index_8 as selectorFamily, Recoil_index_33 as setBatcher, Recoil_index_34 as snapshot_UNSTABLE, Recoil_index_18 as useGetRecoilValueInfo_UNSTABLE, Recoil_index_21 as useGotoRecoilSnapshot, Recoil_index_3 as useRecoilBridgeAcrossReactRoots_UNSTABLE, Recoil_index_20 as useRecoilCallback, Recoil_index_22 as useRecoilSnapshot, Recoil_index_14 as useRecoilState, Recoil_index_15 as useRecoilStateLoadable, Recoil_index_23 as useRecoilTransactionObserver_UNSTABLE, Recoil_index_12 as useRecoilValue, Recoil_index_13 as useRecoilValueLoadable, Recoil_index_17 as useResetRecoilState, Recoil_index_19 as useRetain, Recoil_index_16 as useSetRecoilState, Recoil_index_25 as useSetUnvalidatedAtomValues_UNSTABLE, Recoil_index_24 as useTransactionObservation_UNSTABLE, Recoil_index_29 as waitForAll, Recoil_index_30 as waitForAllSettled, Recoil_index_28 as waitForAny, Recoil_index_27 as waitForNone };\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useNotify = exports.useMediaUiTheme = exports.useMediaUi = exports.useIntl = exports.createUseMediaUiStyles = exports.NotifyProvider = exports.MediaUiThemeProvider = exports.MediaUiProvider = exports.IntlProvider = exports.Helper = exports.Events = exports.Components = void 0;\nvar provider_1 = require(\"./provider\");\nObject.defineProperty(exports, \"IntlProvider\", { enumerable: true, get: function () { return provider_1.IntlProvider; } });\nObject.defineProperty(exports, \"MediaUiProvider\", { enumerable: true, get: function () { return provider_1.MediaUiProvider; } });\nObject.defineProperty(exports, \"MediaUiThemeProvider\", { enumerable: true, get: function () { return provider_1.MediaUiThemeProvider; } });\nObject.defineProperty(exports, \"NotifyProvider\", { enumerable: true, get: function () { return provider_1.NotifyProvider; } });\nObject.defineProperty(exports, \"createUseMediaUiStyles\", { enumerable: true, get: function () { return provider_1.createUseMediaUiStyles; } });\nObject.defineProperty(exports, \"useIntl\", { enumerable: true, get: function () { return provider_1.useIntl; } });\nObject.defineProperty(exports, \"useMediaUi\", { enumerable: true, get: function () { return provider_1.useMediaUi; } });\nObject.defineProperty(exports, \"useMediaUiTheme\", { enumerable: true, get: function () { return provider_1.useMediaUiTheme; } });\nObject.defineProperty(exports, \"useNotify\", { enumerable: true, get: function () { return provider_1.useNotify; } });\nvar Events = __importStar(require(\"./events\"));\nexports.Events = Events;\nvar Components = __importStar(require(\"./components\"));\nexports.Components = Components;\nvar Helper = __importStar(require(\"./helper\"));\nexports.Helper = Helper;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useUpdateTag = exports.useUpdateAssetCollection = exports.useUpdateAsset = exports.useUntagAsset = exports.useTagsQuery = exports.useSetAssetTags = exports.useSetAssetCollections = exports.useSelectedTag = exports.useSelectedAssetCollection = exports.useSelectedAsset = exports.useSelectTag = exports.useSelectAssetSource = exports.useSelectAssetCollection = exports.useSelectAsset = exports.useImportAsset = exports.useEvent = exports.useDeleteTag = exports.useDeleteAssetCollection = exports.useDeleteAsset = exports.useCreateTag = exports.useCreateAssetCollection = exports.useConfigQuery = exports.useAssetsQuery = exports.useAssetSourcesQuery = exports.useAssetQuery = exports.useAssetCountQuery = exports.useAssetCollectionsQuery = void 0;\nvar useAssetCollectionsQuery_1 = __importDefault(require(\"./useAssetCollectionsQuery\"));\nexports.useAssetCollectionsQuery = useAssetCollectionsQuery_1.default;\nvar useAssetCountQuery_1 = __importDefault(require(\"./useAssetCountQuery\"));\nexports.useAssetCountQuery = useAssetCountQuery_1.default;\nvar useAssetQuery_1 = __importDefault(require(\"./useAssetQuery\"));\nexports.useAssetQuery = useAssetQuery_1.default;\nvar useAssetSourcesQuery_1 = __importDefault(require(\"./useAssetSourcesQuery\"));\nexports.useAssetSourcesQuery = useAssetSourcesQuery_1.default;\nvar useAssetsQuery_1 = __importDefault(require(\"./useAssetsQuery\"));\nexports.useAssetsQuery = useAssetsQuery_1.default;\nvar useConfigQuery_1 = __importDefault(require(\"./useConfigQuery\"));\nexports.useConfigQuery = useConfigQuery_1.default;\nvar useCreateAssetCollection_1 = __importDefault(require(\"./useCreateAssetCollection\"));\nexports.useCreateAssetCollection = useCreateAssetCollection_1.default;\nvar useCreateTag_1 = __importDefault(require(\"./useCreateTag\"));\nexports.useCreateTag = useCreateTag_1.default;\nvar useDeleteAsset_1 = __importDefault(require(\"./useDeleteAsset\"));\nexports.useDeleteAsset = useDeleteAsset_1.default;\nvar useDeleteAssetCollection_1 = __importDefault(require(\"./useDeleteAssetCollection\"));\nexports.useDeleteAssetCollection = useDeleteAssetCollection_1.default;\nvar useDeleteTag_1 = __importDefault(require(\"./useDeleteTag\"));\nexports.useDeleteTag = useDeleteTag_1.default;\nvar useEvent_1 = __importDefault(require(\"./useEvent\"));\nexports.useEvent = useEvent_1.default;\nvar useImportAsset_1 = __importDefault(require(\"./useImportAsset\"));\nexports.useImportAsset = useImportAsset_1.default;\nvar useSelectAsset_1 = __importDefault(require(\"./useSelectAsset\"));\nexports.useSelectAsset = useSelectAsset_1.default;\nvar useSelectAssetCollection_1 = __importDefault(require(\"./useSelectAssetCollection\"));\nexports.useSelectAssetCollection = useSelectAssetCollection_1.default;\nvar useSelectAssetSource_1 = __importDefault(require(\"./useSelectAssetSource\"));\nexports.useSelectAssetSource = useSelectAssetSource_1.default;\nvar useSelectTag_1 = __importDefault(require(\"./useSelectTag\"));\nexports.useSelectTag = useSelectTag_1.default;\nvar useSelectedAsset_1 = __importDefault(require(\"./useSelectedAsset\"));\nexports.useSelectedAsset = useSelectedAsset_1.default;\nvar useSelectedAssetCollection_1 = __importDefault(require(\"./useSelectedAssetCollection\"));\nexports.useSelectedAssetCollection = useSelectedAssetCollection_1.default;\nvar useSelectedTag_1 = __importDefault(require(\"./useSelectedTag\"));\nexports.useSelectedTag = useSelectedTag_1.default;\nvar useSetAssetCollections_1 = __importDefault(require(\"./useSetAssetCollections\"));\nexports.useSetAssetCollections = useSetAssetCollections_1.default;\nvar useSetAssetTags_1 = __importDefault(require(\"./useSetAssetTags\"));\nexports.useSetAssetTags = useSetAssetTags_1.default;\nvar useTagsQuery_1 = __importDefault(require(\"./useTagsQuery\"));\nexports.useTagsQuery = useTagsQuery_1.default;\nvar useUntagAsset_1 = __importDefault(require(\"./useUntagAsset\"));\nexports.useUntagAsset = useUntagAsset_1.default;\nvar useUpdateAsset_1 = __importDefault(require(\"./useUpdateAsset\"));\nexports.useUpdateAsset = useUpdateAsset_1.default;\nvar useUpdateAssetCollection_1 = __importDefault(require(\"./useUpdateAssetCollection\"));\nexports.useUpdateAssetCollection = useUpdateAssetCollection_1.default;\nvar useUpdateTag_1 = __importDefault(require(\"./useUpdateTag\"));\nexports.useUpdateTag = useUpdateTag_1.default;\n","import { isReference, isField, DeepMerger, resultKeyNameFromField, shouldInclude, } from \"../../utilities/index.js\";\nexport var hasOwn = Object.prototype.hasOwnProperty;\nexport function getTypenameFromStoreObject(store, objectOrReference) {\n return isReference(objectOrReference)\n ? store.get(objectOrReference.__ref, \"__typename\")\n : objectOrReference && objectOrReference.__typename;\n}\nexport var TypeOrFieldNameRegExp = /^[_a-z][_0-9a-z]*/i;\nexport function fieldNameFromStoreName(storeFieldName) {\n var match = storeFieldName.match(TypeOrFieldNameRegExp);\n return match ? match[0] : storeFieldName;\n}\nexport function selectionSetMatchesResult(selectionSet, result, variables) {\n if (result && typeof result === \"object\") {\n return Array.isArray(result)\n ? result.every(function (item) { return selectionSetMatchesResult(selectionSet, item, variables); })\n : selectionSet.selections.every(function (field) {\n if (isField(field) && shouldInclude(field, variables)) {\n var key = resultKeyNameFromField(field);\n return hasOwn.call(result, key) &&\n (!field.selectionSet ||\n selectionSetMatchesResult(field.selectionSet, result[key], variables));\n }\n return true;\n });\n }\n return false;\n}\nexport function storeValueIsStoreObject(value) {\n return value !== null &&\n typeof value === \"object\" &&\n !isReference(value) &&\n !Array.isArray(value);\n}\nexport function makeProcessedFieldsMerger() {\n return new DeepMerger;\n}\n//# sourceMappingURL=helpers.js.map","var _a = Object.prototype, toString = _a.toString, hasOwnProperty = _a.hasOwnProperty;\r\nvar fnToStr = Function.prototype.toString;\r\nvar previousComparisons = new Map();\r\n/**\r\n * Performs a deep equality check on two JavaScript values, tolerating cycles.\r\n */\r\nfunction equal(a, b) {\r\n try {\r\n return check(a, b);\r\n }\r\n finally {\r\n previousComparisons.clear();\r\n }\r\n}\r\nfunction check(a, b) {\r\n // If the two values are strictly equal, our job is easy.\r\n if (a === b) {\r\n return true;\r\n }\r\n // Object.prototype.toString returns a representation of the runtime type of\r\n // the given value that is considerably more precise than typeof.\r\n var aTag = toString.call(a);\r\n var bTag = toString.call(b);\r\n // If the runtime types of a and b are different, they could maybe be equal\r\n // under some interpretation of equality, but for simplicity and performance\r\n // we just return false instead.\r\n if (aTag !== bTag) {\r\n return false;\r\n }\r\n switch (aTag) {\r\n case '[object Array]':\r\n // Arrays are a lot like other objects, but we can cheaply compare their\r\n // lengths as a short-cut before comparing their elements.\r\n if (a.length !== b.length)\r\n return false;\r\n // Fall through to object case...\r\n case '[object Object]': {\r\n if (previouslyCompared(a, b))\r\n return true;\r\n var aKeys = definedKeys(a);\r\n var bKeys = definedKeys(b);\r\n // If `a` and `b` have a different number of enumerable keys, they\r\n // must be different.\r\n var keyCount = aKeys.length;\r\n if (keyCount !== bKeys.length)\r\n return false;\r\n // Now make sure they have the same keys.\r\n for (var k = 0; k < keyCount; ++k) {\r\n if (!hasOwnProperty.call(b, aKeys[k])) {\r\n return false;\r\n }\r\n }\r\n // Finally, check deep equality of all child properties.\r\n for (var k = 0; k < keyCount; ++k) {\r\n var key = aKeys[k];\r\n if (!check(a[key], b[key])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n case '[object Error]':\r\n return a.name === b.name && a.message === b.message;\r\n case '[object Number]':\r\n // Handle NaN, which is !== itself.\r\n if (a !== a)\r\n return b !== b;\r\n // Fall through to shared +a === +b case...\r\n case '[object Boolean]':\r\n case '[object Date]':\r\n return +a === +b;\r\n case '[object RegExp]':\r\n case '[object String]':\r\n return a == \"\" + b;\r\n case '[object Map]':\r\n case '[object Set]': {\r\n if (a.size !== b.size)\r\n return false;\r\n if (previouslyCompared(a, b))\r\n return true;\r\n var aIterator = a.entries();\r\n var isMap = aTag === '[object Map]';\r\n while (true) {\r\n var info = aIterator.next();\r\n if (info.done)\r\n break;\r\n // If a instanceof Set, aValue === aKey.\r\n var _a = info.value, aKey = _a[0], aValue = _a[1];\r\n // So this works the same way for both Set and Map.\r\n if (!b.has(aKey)) {\r\n return false;\r\n }\r\n // However, we care about deep equality of values only when dealing\r\n // with Map structures.\r\n if (isMap && !check(aValue, b.get(aKey))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n case '[object AsyncFunction]':\r\n case '[object GeneratorFunction]':\r\n case '[object AsyncGeneratorFunction]':\r\n case '[object Function]': {\r\n var aCode = fnToStr.call(a);\r\n if (aCode !== fnToStr.call(b)) {\r\n return false;\r\n }\r\n // We consider non-native functions equal if they have the same code\r\n // (native functions require === because their code is censored).\r\n // Note that this behavior is not entirely sound, since !== function\r\n // objects with the same code can behave differently depending on\r\n // their closure scope. However, any function can behave differently\r\n // depending on the values of its input arguments (including this)\r\n // and its calling context (including its closure scope), even\r\n // though the function object is === to itself; and it is entirely\r\n // possible for functions that are not === to behave exactly the\r\n // same under all conceivable circumstances. Because none of these\r\n // factors are statically decidable in JavaScript, JS function\r\n // equality is not well-defined. This ambiguity allows us to\r\n // consider the best possible heuristic among various imperfect\r\n // options, and equating non-native functions that have the same\r\n // code has enormous practical benefits, such as when comparing\r\n // functions that are repeatedly passed as fresh function\r\n // expressions within objects that are otherwise deeply equal. Since\r\n // any function created from the same syntactic expression (in the\r\n // same code location) will always stringify to the same code\r\n // according to fnToStr.call, we can reasonably expect these\r\n // repeatedly passed function expressions to have the same code, and\r\n // thus behave \"the same\" (with all the caveats mentioned above),\r\n // even though the runtime function objects are !== to one another.\r\n return !endsWith(aCode, nativeCodeSuffix);\r\n }\r\n }\r\n // Otherwise the values are not equal.\r\n return false;\r\n}\r\nfunction definedKeys(obj) {\r\n // Remember that the second argument to Array.prototype.filter will be\r\n // used as `this` within the callback function.\r\n return Object.keys(obj).filter(isDefinedKey, obj);\r\n}\r\nfunction isDefinedKey(key) {\r\n return this[key] !== void 0;\r\n}\r\nvar nativeCodeSuffix = \"{ [native code] }\";\r\nfunction endsWith(full, suffix) {\r\n var fromIndex = full.length - suffix.length;\r\n return fromIndex >= 0 &&\r\n full.indexOf(suffix, fromIndex) === fromIndex;\r\n}\r\nfunction previouslyCompared(a, b) {\r\n // Though cyclic references can make an object graph appear infinite from the\r\n // perspective of a depth-first traversal, the graph still contains a finite\r\n // number of distinct object references. We use the previousComparisons cache\r\n // to avoid comparing the same pair of object references more than once, which\r\n // guarantees termination (even if we end up comparing every object in one\r\n // graph to every object in the other graph, which is extremely unlikely),\r\n // while still allowing weird isomorphic structures (like rings with different\r\n // lengths) a chance to pass the equality test.\r\n var bSet = previousComparisons.get(a);\r\n if (bSet) {\r\n // Return true here because we can be sure false will be returned somewhere\r\n // else if the objects are not equivalent.\r\n if (bSet.has(b))\r\n return true;\r\n }\r\n else {\r\n previousComparisons.set(a, bSet = new Set);\r\n }\r\n bSet.add(b);\r\n return false;\r\n}\n\nexport default equal;\nexport { equal };\n//# sourceMappingURL=equality.esm.js.map\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export var NetworkStatus;\n(function (NetworkStatus) {\n NetworkStatus[NetworkStatus[\"loading\"] = 1] = \"loading\";\n NetworkStatus[NetworkStatus[\"setVariables\"] = 2] = \"setVariables\";\n NetworkStatus[NetworkStatus[\"fetchMore\"] = 3] = \"fetchMore\";\n NetworkStatus[NetworkStatus[\"refetch\"] = 4] = \"refetch\";\n NetworkStatus[NetworkStatus[\"poll\"] = 6] = \"poll\";\n NetworkStatus[NetworkStatus[\"ready\"] = 7] = \"ready\";\n NetworkStatus[NetworkStatus[\"error\"] = 8] = \"error\";\n})(NetworkStatus || (NetworkStatus = {}));\nexport function isNetworkRequestInFlight(networkStatus) {\n return networkStatus ? networkStatus < 7 : false;\n}\n//# sourceMappingURL=networkStatus.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.selectedTagIdState = exports.selectedSortOrderState = exports.selectedMediaTypeState = exports.selectedInspectorViewState = exports.selectedAssetIdState = exports.selectedAssetCollectionIdState = exports.searchTermState = exports.loadingState = exports.initialLoadCompleteState = exports.currentPageState = void 0;\nvar currentPageState_1 = __importDefault(require(\"./currentPageState\"));\nexports.currentPageState = currentPageState_1.default;\nvar initialLoadComplete_1 = __importDefault(require(\"./initialLoadComplete\"));\nexports.initialLoadCompleteState = initialLoadComplete_1.default;\nvar loadingState_1 = __importDefault(require(\"./loadingState\"));\nexports.loadingState = loadingState_1.default;\nvar searchTermState_1 = __importDefault(require(\"./searchTermState\"));\nexports.searchTermState = searchTermState_1.default;\nvar selectedAssetCollectionIdState_1 = __importDefault(require(\"./selectedAssetCollectionIdState\"));\nexports.selectedAssetCollectionIdState = selectedAssetCollectionIdState_1.default;\nvar selectedAssetIdState_1 = __importDefault(require(\"./selectedAssetIdState\"));\nexports.selectedAssetIdState = selectedAssetIdState_1.default;\nvar selectedInspectorViewState_1 = __importDefault(require(\"./selectedInspectorViewState\"));\nexports.selectedInspectorViewState = selectedInspectorViewState_1.default;\nvar selectedMediaTypeState_1 = __importDefault(require(\"./selectedMediaTypeState\"));\nexports.selectedMediaTypeState = selectedMediaTypeState_1.default;\nvar selectedSortOrderState_1 = __importDefault(require(\"./selectedSortOrderState\"));\nexports.selectedSortOrderState = selectedSortOrderState_1.default;\nvar selectedTagIdState_1 = __importDefault(require(\"./selectedTagIdState\"));\nexports.selectedTagIdState = selectedTagIdState_1.default;\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _extends from '@babel/runtime/helpers/esm/extends';\nimport isInBrowser from 'is-in-browser';\nimport warning from 'tiny-warning';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\n\nvar plainObjectConstrurctor = {}.constructor;\nfunction cloneStyle(style) {\n if (style == null || typeof style !== 'object') return style;\n if (Array.isArray(style)) return style.map(cloneStyle);\n if (style.constructor !== plainObjectConstrurctor) return style;\n var newStyle = {};\n\n for (var name in style) {\n newStyle[name] = cloneStyle(style[name]);\n }\n\n return newStyle;\n}\n\n/**\n * Create a rule instance.\n */\n\nfunction createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}\n\nvar join = function join(value, by) {\n var result = '';\n\n for (var i = 0; i < value.length; i++) {\n // Remove !important from the value, it will be readded later.\n if (value[i] === '!important') break;\n if (result) result += by;\n result += value[i];\n }\n\n return result;\n};\n\n/**\n * Converts array values to string.\n *\n * `margin: [['5px', '10px']]` > `margin: 5px 10px;`\n * `border: ['1px', '2px']` > `border: 1px, 2px;`\n * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`\n * `color: ['red', !important]` > `color: red !important;`\n */\nvar toCssValue = function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n};\n\n/**\n * Indent a string.\n * http://jsperf.com/array-join-vs-for\n */\nfunction indentStr(str, indent) {\n var result = '';\n\n for (var index = 0; index < indent; index++) {\n result += ' ';\n }\n\n return result + str;\n}\n/**\n * Converts a Rule to CSS string.\n */\n\n\nfunction toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}\n\nvar escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\nvar nativeEscape = typeof CSS !== 'undefined' && CSS.escape;\nvar escape = (function (str) {\n return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\\\$1');\n});\n\nvar BaseStyleRule =\n/*#__PURE__*/\nfunction () {\n function BaseStyleRule(key, style, options) {\n this.type = 'style';\n this.key = void 0;\n this.isProcessed = false;\n this.style = void 0;\n this.renderer = void 0;\n this.renderable = void 0;\n this.options = void 0;\n var sheet = options.sheet,\n Renderer = options.Renderer;\n this.key = key;\n this.options = options;\n this.style = style;\n if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer();\n }\n /**\n * Get or set a style property.\n */\n\n\n var _proto = BaseStyleRule.prototype;\n\n _proto.prop = function prop(name, value, options) {\n // It's a getter.\n if (value === undefined) return this.style[name]; // Don't do anything if the value has not changed.\n\n var force = options ? options.force : false;\n if (!force && this.style[name] === value) return this;\n var newValue = value;\n\n if (!options || options.process !== false) {\n newValue = this.options.jss.plugins.onChangeValue(value, name, this);\n }\n\n var isEmpty = newValue == null || newValue === false;\n var isDefined = name in this.style; // Value is empty and wasn't defined before.\n\n if (isEmpty && !isDefined && !force) return this; // We are going to remove this value.\n\n var remove = isEmpty && isDefined;\n if (remove) delete this.style[name];else this.style[name] = newValue; // Renderable is defined if StyleSheet option `link` is true.\n\n if (this.renderable && this.renderer) {\n if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, newValue);\n return this;\n }\n\n var sheet = this.options.sheet;\n\n if (sheet && sheet.attached) {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Rule is not linked. Missing sheet option \"link: true\".') : void 0;\n }\n\n return this;\n };\n\n return BaseStyleRule;\n}();\nvar StyleRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(StyleRule, _BaseStyleRule);\n\n function StyleRule(key, style, options) {\n var _this;\n\n _this = _BaseStyleRule.call(this, key, style, options) || this;\n _this.selectorText = void 0;\n _this.id = void 0;\n _this.renderable = void 0;\n var selector = options.selector,\n scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n\n if (selector) {\n _this.selectorText = selector;\n } else if (scoped !== false) {\n _this.id = generateId(_assertThisInitialized(_assertThisInitialized(_this)), sheet);\n _this.selectorText = \".\" + escape(_this.id);\n }\n\n return _this;\n }\n /**\n * Set selector string.\n * Attention: use this with caution. Most browsers didn't implement\n * selectorText setter, so this may result in rerendering of entire Style Sheet.\n */\n\n\n var _proto2 = StyleRule.prototype;\n\n /**\n * Apply rule to an element inline.\n */\n _proto2.applyTo = function applyTo(renderable) {\n var renderer = this.renderer;\n\n if (renderer) {\n var json = this.toJSON();\n\n for (var prop in json) {\n renderer.setProperty(renderable, prop, json[prop]);\n }\n }\n\n return this;\n }\n /**\n * Returns JSON representation of the rule.\n * Fallbacks are not supported.\n * Useful for inline styles.\n */\n ;\n\n _proto2.toJSON = function toJSON() {\n var json = {};\n\n for (var prop in this.style) {\n var value = this.style[prop];\n if (typeof value !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = toCssValue(value);\n }\n\n return json;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto2.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.selectorText, this.style, opts);\n };\n\n _createClass(StyleRule, [{\n key: \"selector\",\n set: function set(selector) {\n if (selector === this.selectorText) return;\n this.selectorText = selector;\n var renderer = this.renderer,\n renderable = this.renderable;\n if (!renderable || !renderer) return;\n var hasChanged = renderer.setSelector(renderable, selector); // If selector setter is not implemented, rerender the rule.\n\n if (!hasChanged) {\n renderer.replaceRule(renderable, this);\n }\n }\n /**\n * Get selector string.\n */\n ,\n get: function get() {\n return this.selectorText;\n }\n }]);\n\n return StyleRule;\n}(BaseStyleRule);\nvar pluginStyleRule = {\n onCreateRule: function onCreateRule(name, style, options) {\n if (name[0] === '@' || options.parent && options.parent.type === 'keyframes') {\n return null;\n }\n\n return new StyleRule(name, style, options);\n }\n};\n\nvar defaultToStringOptions = {\n indent: 1,\n children: true\n};\nvar atRegExp = /@([\\w-]+)/;\n/**\n * Conditional rule for @media, @supports\n */\n\nvar ConditionalRule =\n/*#__PURE__*/\nfunction () {\n function ConditionalRule(key, styles, options) {\n this.type = 'conditional';\n this.at = void 0;\n this.key = void 0;\n this.query = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n var atMatch = key.match(atRegExp);\n this.at = atMatch ? atMatch[1] : 'unknown'; // Key might contain a unique suffix in case the `name` passed by user was duplicate.\n\n this.query = options.name || \"@\" + this.at;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = ConditionalRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions.indent;\n if (options.children == null) options.children = defaultToStringOptions.children;\n\n if (options.children === false) {\n return this.query + \" {}\";\n }\n\n var children = this.rules.toString(options);\n return children ? this.query + \" {\\n\" + children + \"\\n}\" : '';\n };\n\n return ConditionalRule;\n}();\nvar keyRegExp = /@media|@supports\\s+/;\nvar pluginConditionalRule = {\n onCreateRule: function onCreateRule(key, styles, options) {\n return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;\n }\n};\n\nvar defaultToStringOptions$1 = {\n indent: 1,\n children: true\n};\nvar nameRegExp = /@keyframes\\s+([\\w-]+)/;\n/**\n * Rule for @keyframes\n */\n\nvar KeyframesRule =\n/*#__PURE__*/\nfunction () {\n function KeyframesRule(key, frames, options) {\n this.type = 'keyframes';\n this.at = '@keyframes';\n this.key = void 0;\n this.name = void 0;\n this.id = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n var nameMatch = key.match(nameRegExp);\n\n if (nameMatch && nameMatch[1]) {\n this.name = nameMatch[1];\n } else {\n this.name = 'noname';\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Bad keyframes name \" + key) : void 0;\n }\n\n this.key = this.type + \"-\" + this.name;\n this.options = options;\n var scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n this.id = scoped === false ? this.name : escape(generateId(this, sheet));\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in frames) {\n this.rules.add(name, frames[name], _extends({}, options, {\n parent: this\n }));\n }\n\n this.rules.process();\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = KeyframesRule.prototype;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions$1;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions$1.indent;\n if (options.children == null) options.children = defaultToStringOptions$1.children;\n\n if (options.children === false) {\n return this.at + \" \" + this.id + \" {}\";\n }\n\n var children = this.rules.toString(options);\n if (children) children = \"\\n\" + children + \"\\n\";\n return this.at + \" \" + this.id + \" {\" + children + \"}\";\n };\n\n return KeyframesRule;\n}();\nvar keyRegExp$1 = /@keyframes\\s+/;\nvar refRegExp = /\\$([\\w-]+)/g;\n\nvar findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {\n if (typeof val === 'string') {\n return val.replace(refRegExp, function (match, name) {\n if (name in keyframes) {\n return keyframes[name];\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced keyframes rule \\\"\" + name + \"\\\" is not defined.\") : void 0;\n return match;\n });\n }\n\n return val;\n};\n/**\n * Replace the reference for a animation name.\n */\n\n\nvar replaceRef = function replaceRef(style, prop, keyframes) {\n var value = style[prop];\n var refKeyframe = findReferencedKeyframe(value, keyframes);\n\n if (refKeyframe !== value) {\n style[prop] = refKeyframe;\n }\n};\n\nvar plugin = {\n onCreateRule: function onCreateRule(key, frames, options) {\n return typeof key === 'string' && keyRegExp$1.test(key) ? new KeyframesRule(key, frames, options) : null;\n },\n // Animation name ref replacer.\n onProcessStyle: function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style' || !sheet) return style;\n if ('animation-name' in style) replaceRef(style, 'animation-name', sheet.keyframes);\n if ('animation' in style) replaceRef(style, 'animation', sheet.keyframes);\n return style;\n },\n onChangeValue: function onChangeValue(val, prop, rule) {\n var sheet = rule.options.sheet;\n\n if (!sheet) {\n return val;\n }\n\n switch (prop) {\n case 'animation':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n case 'animation-name':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n default:\n return val;\n }\n }\n};\n\nvar KeyframeRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(KeyframeRule, _BaseStyleRule);\n\n function KeyframeRule() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _BaseStyleRule.call.apply(_BaseStyleRule, [this].concat(args)) || this;\n _this.renderable = void 0;\n return _this;\n }\n\n var _proto = KeyframeRule.prototype;\n\n /**\n * Generates a CSS string.\n */\n _proto.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.key, this.style, opts);\n };\n\n return KeyframeRule;\n}(BaseStyleRule);\nvar pluginKeyframeRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n if (options.parent && options.parent.type === 'keyframes') {\n return new KeyframeRule(key, style, options);\n }\n\n return null;\n }\n};\n\nvar FontFaceRule =\n/*#__PURE__*/\nfunction () {\n function FontFaceRule(key, style, options) {\n this.type = 'font-face';\n this.at = '@font-face';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = FontFaceRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.style)) {\n var str = '';\n\n for (var index = 0; index < this.style.length; index++) {\n str += toCss(this.at, this.style[index]);\n if (this.style[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return toCss(this.at, this.style, options);\n };\n\n return FontFaceRule;\n}();\nvar keyRegExp$2 = /@font-face/;\nvar pluginFontFaceRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return keyRegExp$2.test(key) ? new FontFaceRule(key, style, options) : null;\n }\n};\n\nvar ViewportRule =\n/*#__PURE__*/\nfunction () {\n function ViewportRule(key, style, options) {\n this.type = 'viewport';\n this.at = '@viewport';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = ViewportRule.prototype;\n\n _proto.toString = function toString(options) {\n return toCss(this.key, this.style, options);\n };\n\n return ViewportRule;\n}();\nvar pluginViewportRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return key === '@viewport' || key === '@-ms-viewport' ? new ViewportRule(key, style, options) : null;\n }\n};\n\nvar SimpleRule =\n/*#__PURE__*/\nfunction () {\n function SimpleRule(key, value, options) {\n this.type = 'simple';\n this.key = void 0;\n this.value = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.value = value;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n // eslint-disable-next-line no-unused-vars\n\n\n var _proto = SimpleRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.value)) {\n var str = '';\n\n for (var index = 0; index < this.value.length; index++) {\n str += this.key + \" \" + this.value[index] + \";\";\n if (this.value[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return this.key + \" \" + this.value + \";\";\n };\n\n return SimpleRule;\n}();\nvar keysMap = {\n '@charset': true,\n '@import': true,\n '@namespace': true\n};\nvar pluginSimpleRule = {\n onCreateRule: function onCreateRule(key, value, options) {\n return key in keysMap ? new SimpleRule(key, value, options) : null;\n }\n};\n\nvar plugins = [pluginStyleRule, pluginConditionalRule, plugin, pluginKeyframeRule, pluginFontFaceRule, pluginViewportRule, pluginSimpleRule];\n\nvar defaultUpdateOptions = {\n process: true\n};\nvar forceUpdateOptions = {\n force: true,\n process: true\n /**\n * Contains rules objects and allows adding/removing etc.\n * Is used for e.g. by `StyleSheet` or `ConditionalRule`.\n */\n\n};\n\nvar RuleList =\n/*#__PURE__*/\nfunction () {\n // Rules registry for access by .get() method.\n // It contains the same rule registered by name and by selector.\n // Original styles object.\n // Used to ensure correct rules order.\n function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }\n /**\n * Create and register rule.\n *\n * Will not render after Style Sheet was rendered the first time.\n */\n\n\n var _proto = RuleList.prototype;\n\n _proto.add = function add(name, decl, ruleOptions) {\n var _this$options = this.options,\n parent = _this$options.parent,\n sheet = _this$options.sheet,\n jss = _this$options.jss,\n Renderer = _this$options.Renderer,\n generateId = _this$options.generateId,\n scoped = _this$options.scoped;\n\n var options = _extends({\n classes: this.classes,\n parent: parent,\n sheet: sheet,\n jss: jss,\n Renderer: Renderer,\n generateId: generateId,\n scoped: scoped,\n name: name,\n keyframes: this.keyframes,\n selector: undefined\n }, ruleOptions); // When user uses .createStyleSheet(), duplicate names are not possible, but\n // `sheet.addRule()` opens the door for any duplicate rule name. When this happens\n // we need to make the key unique within this RuleList instance scope.\n\n\n var key = name;\n\n if (name in this.raw) {\n key = name + \"-d\" + this.counter++;\n } // We need to save the original decl before creating the rule\n // because cache plugin needs to use it as a key to return a cached rule.\n\n\n this.raw[key] = decl;\n\n if (key in this.classes) {\n // E.g. rules inside of @media container\n options.selector = \".\" + escape(this.classes[key]);\n }\n\n var rule = createRule(key, decl, options);\n if (!rule) return null;\n this.register(rule);\n var index = options.index === undefined ? this.index.length : options.index;\n this.index.splice(index, 0, rule);\n return rule;\n }\n /**\n * Get a rule.\n */\n ;\n\n _proto.get = function get(name) {\n return this.map[name];\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.remove = function remove(rule) {\n this.unregister(rule);\n delete this.raw[rule.key];\n this.index.splice(this.index.indexOf(rule), 1);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.index.indexOf(rule);\n }\n /**\n * Run `onProcessRule()` plugins on every rule.\n */\n ;\n\n _proto.process = function process() {\n var plugins = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop\n // we end up with very hard-to-track-down side effects.\n\n this.index.slice(0).forEach(plugins.onProcessRule, plugins);\n }\n /**\n * Register a rule in `.map`, `.classes` and `.keyframes` maps.\n */\n ;\n\n _proto.register = function register(rule) {\n this.map[rule.key] = rule;\n\n if (rule instanceof StyleRule) {\n this.map[rule.selector] = rule;\n if (rule.id) this.classes[rule.key] = rule.id;\n } else if (rule instanceof KeyframesRule && this.keyframes) {\n this.keyframes[rule.name] = rule.id;\n }\n }\n /**\n * Unregister a rule.\n */\n ;\n\n _proto.unregister = function unregister(rule) {\n delete this.map[rule.key];\n\n if (rule instanceof StyleRule) {\n delete this.map[rule.selector];\n delete this.classes[rule.key];\n } else if (rule instanceof KeyframesRule) {\n delete this.keyframes[rule.name];\n }\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var name;\n var data;\n var options;\n\n if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {\n name = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe[invalid-tuple-index]\n\n data = arguments.length <= 1 ? undefined : arguments[1]; // $FlowFixMe[invalid-tuple-index]\n\n options = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n data = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe[invalid-tuple-index]\n\n options = arguments.length <= 1 ? undefined : arguments[1];\n name = null;\n }\n\n if (name) {\n this.updateOne(this.map[name], data, options);\n } else {\n for (var index = 0; index < this.index.length; index++) {\n this.updateOne(this.index[index], data, options);\n }\n }\n }\n /**\n * Execute plugins, update rule props.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n if (options === void 0) {\n options = defaultUpdateOptions;\n }\n\n var _this$options2 = this.options,\n plugins = _this$options2.jss.plugins,\n sheet = _this$options2.sheet; // It is a rules container like for e.g. ConditionalRule.\n\n if (rule.rules instanceof RuleList) {\n rule.rules.update(data, options);\n return;\n }\n\n var styleRule = rule;\n var style = styleRule.style;\n plugins.onUpdate(data, rule, sheet, options); // We rely on a new `style` ref in case it was mutated during onUpdate hook.\n\n if (options.process && style && style !== styleRule.style) {\n // We need to run the plugins in case new `style` relies on syntax plugins.\n plugins.onProcessStyle(styleRule.style, styleRule, sheet); // Update and add props.\n\n for (var prop in styleRule.style) {\n var nextValue = styleRule.style[prop];\n var prevValue = style[prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (nextValue !== prevValue) {\n styleRule.prop(prop, nextValue, forceUpdateOptions);\n }\n } // Remove props.\n\n\n for (var _prop in style) {\n var _nextValue = styleRule.style[_prop];\n var _prevValue = style[_prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (_nextValue == null && _nextValue !== _prevValue) {\n styleRule.prop(_prop, null, forceUpdateOptions);\n }\n }\n }\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n var str = '';\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n\n for (var index = 0; index < this.index.length; index++) {\n var rule = this.index[index];\n var css = rule.toString(options); // No need to render an empty rule.\n\n if (!css && !link) continue;\n if (str) str += '\\n';\n str += css;\n }\n\n return str;\n };\n\n return RuleList;\n}();\n\nvar StyleSheet =\n/*#__PURE__*/\nfunction () {\n function StyleSheet(styles, options) {\n this.options = void 0;\n this.deployed = void 0;\n this.attached = void 0;\n this.rules = void 0;\n this.renderer = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.queue = void 0;\n this.attached = false;\n this.deployed = false;\n this.classes = {};\n this.keyframes = {};\n this.options = _extends({}, options, {\n sheet: this,\n parent: this,\n classes: this.classes,\n keyframes: this.keyframes\n });\n\n if (options.Renderer) {\n this.renderer = new options.Renderer(this);\n }\n\n this.rules = new RuleList(this.options);\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Attach renderable to the render tree.\n */\n\n\n var _proto = StyleSheet.prototype;\n\n _proto.attach = function attach() {\n if (this.attached) return this;\n if (this.renderer) this.renderer.attach();\n this.attached = true; // Order is important, because we can't use insertRule API if style element is not attached.\n\n if (!this.deployed) this.deploy();\n return this;\n }\n /**\n * Remove renderable from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.attached) return this;\n if (this.renderer) this.renderer.detach();\n this.attached = false;\n return this;\n }\n /**\n * Add a rule to the current stylesheet.\n * Will insert a rule also after the stylesheet has been rendered first time.\n */\n ;\n\n _proto.addRule = function addRule(name, decl, options) {\n var queue = this.queue; // Plugins can create rules.\n // In order to preserve the right order, we need to queue all `.addRule` calls,\n // which happen after the first `rules.add()` call.\n\n if (this.attached && !queue) this.queue = [];\n var rule = this.rules.add(name, decl, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n\n if (this.attached) {\n if (!this.deployed) return rule; // Don't insert rule directly if there is no stringified version yet.\n // It will be inserted all together when .attach is called.\n\n if (queue) queue.push(rule);else {\n this.insertRule(rule);\n\n if (this.queue) {\n this.queue.forEach(this.insertRule, this);\n this.queue = undefined;\n }\n }\n return rule;\n } // We can't add rules to a detached style node.\n // We will redeploy the sheet once user will attach it.\n\n\n this.deployed = false;\n return rule;\n }\n /**\n * Insert rule into the StyleSheet\n */\n ;\n\n _proto.insertRule = function insertRule(rule) {\n if (this.renderer) {\n this.renderer.insertRule(rule);\n }\n }\n /**\n * Create and add rules.\n * Will render also after Style Sheet was rendered the first time.\n */\n ;\n\n _proto.addRules = function addRules(styles, options) {\n var added = [];\n\n for (var name in styles) {\n var rule = this.addRule(name, styles[name], options);\n if (rule) added.push(rule);\n }\n\n return added;\n }\n /**\n * Get a rule by name.\n */\n ;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Delete a rule by name.\n * Returns `true`: if rule has been deleted from the DOM.\n */\n ;\n\n _proto.deleteRule = function deleteRule(name) {\n var rule = typeof name === 'object' ? name : this.rules.get(name);\n\n if (!rule || // Style sheet was created without link: true and attached, in this case we\n // won't be able to remove the CSS rule from the DOM.\n this.attached && !rule.renderable) {\n return false;\n }\n\n this.rules.remove(rule);\n\n if (this.attached && rule.renderable && this.renderer) {\n return this.renderer.deleteRule(rule.renderable);\n }\n\n return true;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Deploy pure CSS string to a renderable.\n */\n ;\n\n _proto.deploy = function deploy() {\n if (this.renderer) this.renderer.deploy();\n this.deployed = true;\n return this;\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var _this$rules;\n\n (_this$rules = this.rules).update.apply(_this$rules, arguments);\n\n return this;\n }\n /**\n * Updates a single rule.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n this.rules.updateOne(rule, data, options);\n return this;\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n return this.rules.toString(options);\n };\n\n return StyleSheet;\n}();\n\nvar PluginsRegistry =\n/*#__PURE__*/\nfunction () {\n function PluginsRegistry() {\n this.plugins = {\n internal: [],\n external: []\n };\n this.registry = void 0;\n }\n\n var _proto = PluginsRegistry.prototype;\n\n /**\n * Call `onCreateRule` hooks and return an object if returned by a hook.\n */\n _proto.onCreateRule = function onCreateRule(name, decl, options) {\n for (var i = 0; i < this.registry.onCreateRule.length; i++) {\n var rule = this.registry.onCreateRule[i](name, decl, options);\n if (rule) return rule;\n }\n\n return null;\n }\n /**\n * Call `onProcessRule` hooks.\n */\n ;\n\n _proto.onProcessRule = function onProcessRule(rule) {\n if (rule.isProcessed) return;\n var sheet = rule.options.sheet;\n\n for (var i = 0; i < this.registry.onProcessRule.length; i++) {\n this.registry.onProcessRule[i](rule, sheet);\n }\n\n if (rule.style) this.onProcessStyle(rule.style, rule, sheet);\n rule.isProcessed = true;\n }\n /**\n * Call `onProcessStyle` hooks.\n */\n ;\n\n _proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {\n for (var i = 0; i < this.registry.onProcessStyle.length; i++) {\n // $FlowFixMe[prop-missing]\n rule.style = this.registry.onProcessStyle[i](rule.style, rule, sheet);\n }\n }\n /**\n * Call `onProcessSheet` hooks.\n */\n ;\n\n _proto.onProcessSheet = function onProcessSheet(sheet) {\n for (var i = 0; i < this.registry.onProcessSheet.length; i++) {\n this.registry.onProcessSheet[i](sheet);\n }\n }\n /**\n * Call `onUpdate` hooks.\n */\n ;\n\n _proto.onUpdate = function onUpdate(data, rule, sheet, options) {\n for (var i = 0; i < this.registry.onUpdate.length; i++) {\n this.registry.onUpdate[i](data, rule, sheet, options);\n }\n }\n /**\n * Call `onChangeValue` hooks.\n */\n ;\n\n _proto.onChangeValue = function onChangeValue(value, prop, rule) {\n var processedValue = value;\n\n for (var i = 0; i < this.registry.onChangeValue.length; i++) {\n processedValue = this.registry.onChangeValue[i](processedValue, prop, rule);\n }\n\n return processedValue;\n }\n /**\n * Register a plugin.\n */\n ;\n\n _proto.use = function use(newPlugin, options) {\n if (options === void 0) {\n options = {\n queue: 'external'\n };\n }\n\n var plugins = this.plugins[options.queue]; // Avoids applying same plugin twice, at least based on ref.\n\n if (plugins.indexOf(newPlugin) !== -1) {\n return;\n }\n\n plugins.push(newPlugin);\n this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {\n for (var name in plugin) {\n if (name in registry) {\n registry[name].push(plugin[name]);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown hook \\\"\" + name + \"\\\".\") : void 0;\n }\n }\n\n return registry;\n }, {\n onCreateRule: [],\n onProcessRule: [],\n onProcessStyle: [],\n onProcessSheet: [],\n onChangeValue: [],\n onUpdate: []\n });\n };\n\n return PluginsRegistry;\n}();\n\n/**\n * Sheets registry to access them all at one place.\n */\nvar SheetsRegistry =\n/*#__PURE__*/\nfunction () {\n function SheetsRegistry() {\n this.registry = [];\n }\n\n var _proto = SheetsRegistry.prototype;\n\n /**\n * Register a Style Sheet.\n */\n _proto.add = function add(sheet) {\n var registry = this.registry;\n var index = sheet.options.index;\n if (registry.indexOf(sheet) !== -1) return;\n\n if (registry.length === 0 || index >= this.index) {\n registry.push(sheet);\n return;\n } // Find a position.\n\n\n for (var i = 0; i < registry.length; i++) {\n if (registry[i].options.index > index) {\n registry.splice(i, 0, sheet);\n return;\n }\n }\n }\n /**\n * Reset the registry.\n */\n ;\n\n _proto.reset = function reset() {\n this.registry = [];\n }\n /**\n * Remove a Style Sheet.\n */\n ;\n\n _proto.remove = function remove(sheet) {\n var index = this.registry.indexOf(sheet);\n this.registry.splice(index, 1);\n }\n /**\n * Convert all attached sheets to a CSS string.\n */\n ;\n\n _proto.toString = function toString(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n attached = _ref.attached,\n options = _objectWithoutPropertiesLoose(_ref, [\"attached\"]);\n\n var css = '';\n\n for (var i = 0; i < this.registry.length; i++) {\n var sheet = this.registry[i];\n\n if (attached != null && sheet.attached !== attached) {\n continue;\n }\n\n if (css) css += '\\n';\n css += sheet.toString(options);\n }\n\n return css;\n };\n\n _createClass(SheetsRegistry, [{\n key: \"index\",\n\n /**\n * Current highest index number.\n */\n get: function get() {\n return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index;\n }\n }]);\n\n return SheetsRegistry;\n}();\n\n/**\n * This is a global sheets registry. Only DomRenderer will add sheets to it.\n * On the server one should use an own SheetsRegistry instance and add the\n * sheets to it, because you need to make sure to create a new registry for\n * each request in order to not leak sheets across requests.\n */\n\nvar registry = new SheetsRegistry();\n\n/* eslint-disable */\n\n/**\n * Now that `globalThis` is available on most platforms\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility)\n * we check for `globalThis` first. `globalThis` is necessary for jss\n * to run in Agoric's secure version of JavaScript (SES). Under SES,\n * `globalThis` exists, but `window`, `self`, and `Function('return\n * this')()` are all undefined for security reasons.\n *\n * https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n */\nvar globalThis$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' && window.Math === Math ? window : typeof self !== 'undefined' && self.Math === Math ? self : Function('return this')();\n\nvar ns = '2f1acc6c3a606b082e5eef5e54414ffb';\nif (globalThis$1[ns] == null) globalThis$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify\n// the current version with just one short number and use it for classes generation\n// we use a counter. Also it is more accurate, because user can manually reevaluate\n// the module.\n\nvar moduleId = globalThis$1[ns]++;\n\nvar maxRules = 1e10;\n\n/**\n * Returns a function which generates unique class names based on counters.\n * When new generator function is created, rule counter is reseted.\n * We need to reset the rule counter for SSR for each request.\n */\nvar createGenerateId = function createGenerateId(options) {\n if (options === void 0) {\n options = {};\n }\n\n var ruleCounter = 0;\n return function (rule, sheet) {\n ruleCounter += 1;\n\n if (ruleCounter > maxRules) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] You might have a memory leak. Rule counter is at \" + ruleCounter + \".\") : void 0;\n }\n\n var jssId = '';\n var prefix = '';\n\n if (sheet) {\n if (sheet.options.classNamePrefix) {\n prefix = sheet.options.classNamePrefix;\n }\n\n if (sheet.options.jss.id != null) {\n jssId = String(sheet.options.jss.id);\n }\n }\n\n if (options.minify) {\n // Using \"c\" because a number can't be the first char in a class name.\n return \"\" + (prefix || 'c') + moduleId + jssId + ruleCounter;\n }\n\n return prefix + rule.key + \"-\" + moduleId + (jssId ? \"-\" + jssId : '') + \"-\" + ruleCounter;\n };\n};\n\n/**\n * Cache the value from the first time a function is called.\n */\nvar memoize = function memoize(fn) {\n var value;\n return function () {\n if (!value) value = fn();\n return value;\n };\n};\n\n/**\n * Get a style property value.\n */\nvar getPropertyValue = function getPropertyValue(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n return cssRule.attributeStyleMap.get(prop);\n }\n\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n};\n\n/**\n * Set a style property.\n */\nvar setProperty = function setProperty(cssRule, prop, value) {\n try {\n var cssValue = value;\n\n if (Array.isArray(value)) {\n cssValue = toCssValue(value, true);\n\n if (value[value.length - 1] === '!important') {\n cssRule.style.setProperty(prop, cssValue, 'important');\n return true;\n }\n } // Support CSSTOM.\n\n\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.set(prop, cssValue);\n } else {\n cssRule.style.setProperty(prop, cssValue);\n }\n } catch (err) {\n // IE may throw if property is unknown.\n return false;\n }\n\n return true;\n};\n\n/**\n * Remove a style property.\n */\nvar removeProperty = function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") : void 0;\n }\n};\n\n/**\n * Set the selector.\n */\nvar setSelector = function setSelector(cssRule, selectorText) {\n cssRule.selectorText = selectorText; // Return false if setter was not successful.\n // Currently works in chrome only.\n\n return cssRule.selectorText === selectorText;\n};\n/**\n * Gets the `head` element upon the first call and caches it.\n * We assume it can't be null.\n */\n\n\nvar getHead = memoize(function () {\n return document.querySelector('head');\n});\n/**\n * Find attached sheet with an index higher than the passed one.\n */\n\nfunction findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find attached sheet with the highest index.\n */\n\n\nfunction findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find a comment with \"jss\" inside.\n */\n\n\nfunction findCommentNode(text) {\n var head = getHead();\n\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n\n return null;\n}\n\n/**\n * Find a node before which we can insert the sheet.\n */\nfunction findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}\n/**\n * Insert style element into the DOM.\n */\n\n\nfunction insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}\n/**\n * Read jss nonce setting from the page if the user has set it.\n */\n\n\nvar getNonce = memoize(function () {\n var node = document.querySelector('meta[property=\"csp-nonce\"]');\n return node ? node.getAttribute('content') : null;\n});\n\nvar _insertRule = function insertRule(container, rule, index) {\n try {\n if ('insertRule' in container) {\n var c = container;\n c.insertRule(rule, index);\n } // Keyframes rule.\n else if ('appendRule' in container) {\n var _c = container;\n\n _c.appendRule(rule);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] \" + err.message) : void 0;\n return false;\n }\n\n return container.cssRules[index];\n};\n\nvar getValidRuleInsertionIndex = function getValidRuleInsertionIndex(container, index) {\n var maxIndex = container.cssRules.length; // In case previous insertion fails, passed index might be wrong\n\n if (index === undefined || index > maxIndex) {\n // eslint-disable-next-line no-param-reassign\n return maxIndex;\n }\n\n return index;\n};\n\nvar createStyle = function createStyle() {\n var el = document.createElement('style'); // Without it, IE will have a broken source order specificity if we\n // insert rules after we insert the style tag.\n // It seems to kick-off the source order specificity algorithm.\n\n el.textContent = '\\n';\n return el;\n};\n\nvar DomRenderer =\n/*#__PURE__*/\nfunction () {\n // HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696\n // Will be empty if link: true option is not set, because\n // it is only for use together with insertRule API.\n function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = [];\n // There is no sheet when the renderer is used from a standalone StyleRule.\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }\n /**\n * Insert style element into render tree.\n */\n\n\n var _proto = DomRenderer.prototype;\n\n _proto.attach = function attach() {\n // In the case the element node is external and it is already in the DOM.\n if (this.element.parentNode || !this.sheet) return;\n insertStyle(this.element, this.sheet.options); // When rules are inserted using `insertRule` API, after `sheet.detach().attach()`\n // most browsers create a new CSSStyleSheet, except of all IEs.\n\n var deployed = Boolean(this.sheet && this.sheet.deployed);\n\n if (this.hasInsertedRules && deployed) {\n this.hasInsertedRules = false;\n this.deploy();\n }\n }\n /**\n * Remove style element from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.sheet) return;\n var parentNode = this.element.parentNode;\n if (parentNode) parentNode.removeChild(this.element); // In the most browsers, rules inserted using insertRule() API will be lost when style element is removed.\n // Though IE will keep them and we need a consistent behavior.\n\n if (this.sheet.options.link) {\n this.cssRules = [];\n this.element.textContent = '\\n';\n }\n }\n /**\n * Inject CSS string into element.\n */\n ;\n\n _proto.deploy = function deploy() {\n var sheet = this.sheet;\n if (!sheet) return;\n\n if (sheet.options.link) {\n this.insertRules(sheet.rules);\n return;\n }\n\n this.element.textContent = \"\\n\" + sheet.toString() + \"\\n\";\n }\n /**\n * Insert RuleList into an element.\n */\n ;\n\n _proto.insertRules = function insertRules(rules, nativeParent) {\n for (var i = 0; i < rules.index.length; i++) {\n this.insertRule(rules.index[i], i, nativeParent);\n }\n }\n /**\n * Insert a rule into element.\n */\n ;\n\n _proto.insertRule = function insertRule(rule, index, nativeParent) {\n if (nativeParent === void 0) {\n nativeParent = this.element.sheet;\n }\n\n if (rule.rules) {\n var parent = rule;\n var latestNativeParent = nativeParent;\n\n if (rule.type === 'conditional' || rule.type === 'keyframes') {\n var _insertionIndex = getValidRuleInsertionIndex(nativeParent, index); // We need to render the container without children first.\n\n\n latestNativeParent = _insertRule(nativeParent, parent.toString({\n children: false\n }), _insertionIndex);\n\n if (latestNativeParent === false) {\n return false;\n }\n\n this.refCssRule(rule, _insertionIndex, latestNativeParent);\n }\n\n this.insertRules(parent.rules, latestNativeParent);\n return latestNativeParent;\n }\n\n var ruleStr = rule.toString();\n if (!ruleStr) return false;\n var insertionIndex = getValidRuleInsertionIndex(nativeParent, index);\n\n var nativeRule = _insertRule(nativeParent, ruleStr, insertionIndex);\n\n if (nativeRule === false) {\n return false;\n }\n\n this.hasInsertedRules = true;\n this.refCssRule(rule, insertionIndex, nativeRule);\n return nativeRule;\n };\n\n _proto.refCssRule = function refCssRule(rule, index, cssRule) {\n rule.renderable = cssRule; // We only want to reference the top level rules, deleteRule API doesn't support removing nested rules\n // like rules inside media queries or keyframes\n\n if (rule.options.parent instanceof StyleSheet) {\n this.cssRules[index] = cssRule;\n }\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.deleteRule = function deleteRule(cssRule) {\n var sheet = this.element.sheet;\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return true;\n }\n /**\n * Get index of a CSS Rule.\n */\n ;\n\n _proto.indexOf = function indexOf(cssRule) {\n return this.cssRules.indexOf(cssRule);\n }\n /**\n * Generate a new CSS rule and replace the existing one.\n *\n * Only used for some old browsers because they can't set a selector.\n */\n ;\n\n _proto.replaceRule = function replaceRule(cssRule, rule) {\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n this.element.sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return this.insertRule(rule, index);\n }\n /**\n * Get all rules elements.\n */\n ;\n\n _proto.getRules = function getRules() {\n return this.element.sheet.cssRules;\n };\n\n return DomRenderer;\n}();\n\nvar instanceCounter = 0;\n\nvar Jss =\n/*#__PURE__*/\nfunction () {\n function Jss(options) {\n this.id = instanceCounter++;\n this.version = \"10.6.0\";\n this.plugins = new PluginsRegistry();\n this.options = {\n id: {\n minify: false\n },\n createGenerateId: createGenerateId,\n Renderer: isInBrowser ? DomRenderer : null,\n plugins: []\n };\n this.generateId = createGenerateId({\n minify: false\n });\n\n for (var i = 0; i < plugins.length; i++) {\n this.plugins.use(plugins[i], {\n queue: 'internal'\n });\n }\n\n this.setup(options);\n }\n /**\n * Prepares various options, applies plugins.\n * Should not be used twice on the same instance, because there is no plugins\n * deduplication logic.\n */\n\n\n var _proto = Jss.prototype;\n\n _proto.setup = function setup(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.createGenerateId) {\n this.options.createGenerateId = options.createGenerateId;\n }\n\n if (options.id) {\n this.options.id = _extends({}, this.options.id, options.id);\n }\n\n if (options.createGenerateId || options.id) {\n this.generateId = this.options.createGenerateId(this.options.id);\n }\n\n if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint;\n\n if ('Renderer' in options) {\n this.options.Renderer = options.Renderer;\n } // eslint-disable-next-line prefer-spread\n\n\n if (options.plugins) this.use.apply(this, options.plugins);\n return this;\n }\n /**\n * Create a Style Sheet.\n */\n ;\n\n _proto.createStyleSheet = function createStyleSheet(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n index = _options.index;\n\n if (typeof index !== 'number') {\n index = registry.index === 0 ? 0 : registry.index + 1;\n }\n\n var sheet = new StyleSheet(styles, _extends({}, options, {\n jss: this,\n generateId: options.generateId || this.generateId,\n insertionPoint: this.options.insertionPoint,\n Renderer: this.options.Renderer,\n index: index\n }));\n this.plugins.onProcessSheet(sheet);\n return sheet;\n }\n /**\n * Detach the Style Sheet and remove it from the registry.\n */\n ;\n\n _proto.removeStyleSheet = function removeStyleSheet(sheet) {\n sheet.detach();\n registry.remove(sheet);\n return this;\n }\n /**\n * Create a rule without a Style Sheet.\n * [Deprecated] will be removed in the next major version.\n */\n ;\n\n _proto.createRule = function createRule$1(name, style, options) {\n if (style === void 0) {\n style = {};\n }\n\n if (options === void 0) {\n options = {};\n }\n\n // Enable rule without name for inline styles.\n if (typeof name === 'object') {\n // $FlowFixMe[incompatible-call]\n return this.createRule(undefined, name, style);\n } // $FlowFixMe[incompatible-type]\n\n\n var ruleOptions = _extends({}, options, {\n name: name,\n jss: this,\n Renderer: this.options.Renderer\n });\n\n if (!ruleOptions.generateId) ruleOptions.generateId = this.generateId;\n if (!ruleOptions.classes) ruleOptions.classes = {};\n if (!ruleOptions.keyframes) ruleOptions.keyframes = {};\n\n var rule = createRule(name, style, ruleOptions);\n\n if (rule) this.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Register plugin. Passed function will be invoked with a rule instance.\n */\n ;\n\n _proto.use = function use() {\n var _this = this;\n\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n plugins.forEach(function (plugin) {\n _this.plugins.use(plugin);\n });\n return this;\n };\n\n return Jss;\n}();\n\n/**\n * Extracts a styles object with only props that contain function values.\n */\nfunction getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}\n\n/**\n * SheetsManager is like a WeakMap which is designed to count StyleSheet\n * instances and attach/detach automatically.\n */\nvar SheetsManager =\n/*#__PURE__*/\nfunction () {\n function SheetsManager() {\n this.length = 0;\n this.sheets = new WeakMap();\n }\n\n var _proto = SheetsManager.prototype;\n\n _proto.get = function get(key) {\n var entry = this.sheets.get(key);\n return entry && entry.sheet;\n };\n\n _proto.add = function add(key, sheet) {\n if (this.sheets.has(key)) return;\n this.length++;\n this.sheets.set(key, {\n sheet: sheet,\n refs: 0\n });\n };\n\n _proto.manage = function manage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs === 0) {\n entry.sheet.attach();\n }\n\n entry.refs++;\n return entry.sheet;\n }\n\n warning(false, \"[JSS] SheetsManager: can't find sheet to manage\");\n return undefined;\n };\n\n _proto.unmanage = function unmanage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs > 0) {\n entry.refs--;\n if (entry.refs === 0) entry.sheet.detach();\n }\n } else {\n warning(false, \"SheetsManager: can't find sheet to unmanage\");\n }\n };\n\n _createClass(SheetsManager, [{\n key: \"size\",\n get: function get() {\n return this.length;\n }\n }]);\n\n return SheetsManager;\n}();\n\n/**\n * A better abstraction over CSS.\n *\n * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present\n * @website https://github.com/cssinjs/jss\n * @license MIT\n */\n\n/**\n * Export a constant indicating if this browser has CSSTOM support.\n * https://developers.google.com/web/updates/2018/03/cssom\n */\nvar hasCSSTOMSupport = typeof CSS === 'object' && CSS != null && 'number' in CSS;\n/**\n * Creates a new instance of Jss.\n */\n\nvar create = function create(options) {\n return new Jss(options);\n};\n/**\n * A global Jss instance.\n */\n\nvar jss = create();\n\nexport default jss;\nexport { RuleList, SheetsManager, SheetsRegistry, create, createGenerateId, createRule, getDynamicStyles, hasCSSTOMSupport, registry as sheets, toCssValue };\n","import invariant from \"./invariant.mjs\";\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\n/**\n * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`\n */\n\nexport default function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n}\n","export default function invariant(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message != null ? message : 'Unexpected invariant triggered.');\n }\n}\n","import defineInspect from \"../jsutils/defineInspect.mjs\";\n\n/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport var Location = /*#__PURE__*/function () {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n function Location(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n var _proto = Location.prototype;\n\n _proto.toJSON = function toJSON() {\n return {\n start: this.start,\n end: this.end\n };\n };\n\n return Location;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Location);\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport var Token = /*#__PURE__*/function () {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }\n\n var _proto2 = Token.prototype;\n\n _proto2.toJSON = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n };\n\n return Token;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Token);\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n return maybeNode != null && typeof maybeNode.kind === 'string';\n}\n/**\n * The list of all possible AST node types.\n */\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TAGS = exports.TAG = exports.SET_SELECTED_ASSET_SOURCE_ID = exports.SELECTED_ASSET_SOURCE_ID = exports.CONFIG = exports.ASSET_SOURCES = exports.ASSET_COUNT = exports.ASSET_COLLECTIONS = exports.ASSET_COLLECTION = exports.ASSETS = exports.ASSET = void 0;\nvar asset_1 = __importDefault(require(\"./asset\"));\nexports.ASSET = asset_1.default;\nvar assets_1 = __importDefault(require(\"./assets\"));\nexports.ASSETS = assets_1.default;\nvar assetCollection_1 = __importDefault(require(\"./assetCollection\"));\nexports.ASSET_COLLECTION = assetCollection_1.default;\nvar assetCollections_1 = __importDefault(require(\"./assetCollections\"));\nexports.ASSET_COLLECTIONS = assetCollections_1.default;\nvar assetCount_1 = __importDefault(require(\"./assetCount\"));\nexports.ASSET_COUNT = assetCount_1.default;\nvar assetSources_1 = __importDefault(require(\"./assetSources\"));\nexports.ASSET_SOURCES = assetSources_1.default;\nvar config_1 = __importDefault(require(\"./config\"));\nexports.CONFIG = config_1.default;\nvar tag_1 = __importDefault(require(\"./tag\"));\nexports.TAG = tag_1.default;\nvar tags_1 = __importDefault(require(\"./tags\"));\nexports.TAGS = tags_1.default;\nvar selectedAssetSource_1 = require(\"./selectedAssetSource\");\nObject.defineProperty(exports, \"SELECTED_ASSET_SOURCE_ID\", { enumerable: true, get: function () { return selectedAssetSource_1.SELECTED_ASSET_SOURCE_ID; } });\nObject.defineProperty(exports, \"SET_SELECTED_ASSET_SOURCE_ID\", { enumerable: true, get: function () { return selectedAssetSource_1.SET_SELECTED_ASSET_SOURCE_ID; } });\n","// A [trie](https://en.wikipedia.org/wiki/Trie) data structure that holds\r\n// object keys weakly, yet can also hold non-object keys, unlike the\r\n// native `WeakMap`.\r\n// If no makeData function is supplied, the looked-up data will be an empty,\r\n// null-prototype Object.\r\nvar defaultMakeData = function () { return Object.create(null); };\r\n// Useful for processing arguments objects as well as arrays.\r\nvar _a = Array.prototype, forEach = _a.forEach, slice = _a.slice;\r\nvar Trie = /** @class */ (function () {\r\n function Trie(weakness, makeData) {\r\n if (weakness === void 0) { weakness = true; }\r\n if (makeData === void 0) { makeData = defaultMakeData; }\r\n this.weakness = weakness;\r\n this.makeData = makeData;\r\n }\r\n Trie.prototype.lookup = function () {\r\n var array = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n array[_i] = arguments[_i];\r\n }\r\n return this.lookupArray(array);\r\n };\r\n Trie.prototype.lookupArray = function (array) {\r\n var node = this;\r\n forEach.call(array, function (key) { return node = node.getChildTrie(key); });\r\n return node.data || (node.data = this.makeData(slice.call(array)));\r\n };\r\n Trie.prototype.getChildTrie = function (key) {\r\n var map = this.weakness && isObjRef(key)\r\n ? this.weak || (this.weak = new WeakMap())\r\n : this.strong || (this.strong = new Map());\r\n var child = map.get(key);\r\n if (!child)\r\n map.set(key, child = new Trie(this.weakness, this.makeData));\r\n return child;\r\n };\r\n return Trie;\r\n}());\r\nfunction isObjRef(value) {\r\n switch (typeof value) {\r\n case \"object\":\r\n if (value === null)\r\n break;\r\n // Fall through to return true...\r\n case \"function\":\r\n return true;\r\n }\r\n return false;\r\n}\n\nexport { Trie };\n//# sourceMappingURL=trie.esm.js.map\n","import { Trie } from '@wry/trie';\nexport { Trie as KeyTrie } from '@wry/trie';\nimport { Slot } from '@wry/context';\nexport { asyncFromGen, bind as bindContext, noContext, setTimeout } from '@wry/context';\n\nfunction defaultDispose() { }\r\nvar Cache = /** @class */ (function () {\r\n function Cache(max, dispose) {\r\n if (max === void 0) { max = Infinity; }\r\n if (dispose === void 0) { dispose = defaultDispose; }\r\n this.max = max;\r\n this.dispose = dispose;\r\n this.map = new Map();\r\n this.newest = null;\r\n this.oldest = null;\r\n }\r\n Cache.prototype.has = function (key) {\r\n return this.map.has(key);\r\n };\r\n Cache.prototype.get = function (key) {\r\n var node = this.getNode(key);\r\n return node && node.value;\r\n };\r\n Cache.prototype.getNode = function (key) {\r\n var node = this.map.get(key);\r\n if (node && node !== this.newest) {\r\n var older = node.older, newer = node.newer;\r\n if (newer) {\r\n newer.older = older;\r\n }\r\n if (older) {\r\n older.newer = newer;\r\n }\r\n node.older = this.newest;\r\n node.older.newer = node;\r\n node.newer = null;\r\n this.newest = node;\r\n if (node === this.oldest) {\r\n this.oldest = newer;\r\n }\r\n }\r\n return node;\r\n };\r\n Cache.prototype.set = function (key, value) {\r\n var node = this.getNode(key);\r\n if (node) {\r\n return node.value = value;\r\n }\r\n node = {\r\n key: key,\r\n value: value,\r\n newer: null,\r\n older: this.newest\r\n };\r\n if (this.newest) {\r\n this.newest.newer = node;\r\n }\r\n this.newest = node;\r\n this.oldest = this.oldest || node;\r\n this.map.set(key, node);\r\n return node.value;\r\n };\r\n Cache.prototype.clean = function () {\r\n while (this.oldest && this.map.size > this.max) {\r\n this.delete(this.oldest.key);\r\n }\r\n };\r\n Cache.prototype.delete = function (key) {\r\n var node = this.map.get(key);\r\n if (node) {\r\n if (node === this.newest) {\r\n this.newest = node.older;\r\n }\r\n if (node === this.oldest) {\r\n this.oldest = node.newer;\r\n }\r\n if (node.newer) {\r\n node.newer.older = node.older;\r\n }\r\n if (node.older) {\r\n node.older.newer = node.newer;\r\n }\r\n this.map.delete(key);\r\n this.dispose(node.value, key);\r\n return true;\r\n }\r\n return false;\r\n };\r\n return Cache;\r\n}());\n\nvar parentEntrySlot = new Slot();\n\nfunction maybeUnsubscribe(entryOrDep) {\r\n var unsubscribe = entryOrDep.unsubscribe;\r\n if (typeof unsubscribe === \"function\") {\r\n entryOrDep.unsubscribe = void 0;\r\n unsubscribe();\r\n }\r\n}\n\nvar emptySetPool = [];\r\nvar POOL_TARGET_SIZE = 100;\r\n// Since this package might be used browsers, we should avoid using the\r\n// Node built-in assert module.\r\nfunction assert(condition, optionalMessage) {\r\n if (!condition) {\r\n throw new Error(optionalMessage || \"assertion failure\");\r\n }\r\n}\r\nfunction valueIs(a, b) {\r\n var len = a.length;\r\n return (\r\n // Unknown values are not equal to each other.\r\n len > 0 &&\r\n // Both values must be ordinary (or both exceptional) to be equal.\r\n len === b.length &&\r\n // The underlying value or exception must be the same.\r\n a[len - 1] === b[len - 1]);\r\n}\r\nfunction valueGet(value) {\r\n switch (value.length) {\r\n case 0: throw new Error(\"unknown value\");\r\n case 1: return value[0];\r\n case 2: throw value[1];\r\n }\r\n}\r\nfunction valueCopy(value) {\r\n return value.slice(0);\r\n}\r\nvar Entry = /** @class */ (function () {\r\n function Entry(fn) {\r\n this.fn = fn;\r\n this.parents = new Set();\r\n this.childValues = new Map();\r\n // When this Entry has children that are dirty, this property becomes\r\n // a Set containing other Entry objects, borrowed from emptySetPool.\r\n // When the set becomes empty, it gets recycled back to emptySetPool.\r\n this.dirtyChildren = null;\r\n this.dirty = true;\r\n this.recomputing = false;\r\n this.value = [];\r\n this.deps = null;\r\n ++Entry.count;\r\n }\r\n Entry.prototype.peek = function () {\r\n if (this.value.length === 1 && !mightBeDirty(this)) {\r\n return this.value[0];\r\n }\r\n };\r\n // This is the most important method of the Entry API, because it\r\n // determines whether the cached this.value can be returned immediately,\r\n // or must be recomputed. The overall performance of the caching system\r\n // depends on the truth of the following observations: (1) this.dirty is\r\n // usually false, (2) this.dirtyChildren is usually null/empty, and thus\r\n // (3) valueGet(this.value) is usually returned without recomputation.\r\n Entry.prototype.recompute = function (args) {\r\n assert(!this.recomputing, \"already recomputing\");\r\n rememberParent(this);\r\n return mightBeDirty(this)\r\n ? reallyRecompute(this, args)\r\n : valueGet(this.value);\r\n };\r\n Entry.prototype.setDirty = function () {\r\n if (this.dirty)\r\n return;\r\n this.dirty = true;\r\n this.value.length = 0;\r\n reportDirty(this);\r\n forgetChildren(this);\r\n // We can go ahead and unsubscribe here, since any further dirty\r\n // notifications we receive will be redundant, and unsubscribing may\r\n // free up some resources, e.g. file watchers.\r\n maybeUnsubscribe(this);\r\n };\r\n Entry.prototype.dispose = function () {\r\n var _this = this;\r\n forgetChildren(this);\r\n maybeUnsubscribe(this);\r\n // Because this entry has been kicked out of the cache (in index.js),\r\n // we've lost the ability to find out if/when this entry becomes dirty,\r\n // whether that happens through a subscription, because of a direct call\r\n // to entry.setDirty(), or because one of its children becomes dirty.\r\n // Because of this loss of future information, we have to assume the\r\n // worst (that this entry might have become dirty very soon), so we must\r\n // immediately mark this entry's parents as dirty. Normally we could\r\n // just call entry.setDirty() rather than calling parent.setDirty() for\r\n // each parent, but that would leave this entry in parent.childValues\r\n // and parent.dirtyChildren, which would prevent the child from being\r\n // truly forgotten.\r\n this.parents.forEach(function (parent) {\r\n parent.setDirty();\r\n forgetChild(parent, _this);\r\n });\r\n };\r\n Entry.prototype.dependOn = function (dep) {\r\n dep.add(this);\r\n if (!this.deps) {\r\n this.deps = emptySetPool.pop() || new Set();\r\n }\r\n this.deps.add(dep);\r\n };\r\n Entry.prototype.forgetDeps = function () {\r\n var _this = this;\r\n if (this.deps) {\r\n this.deps.forEach(function (dep) { return dep.delete(_this); });\r\n this.deps.clear();\r\n emptySetPool.push(this.deps);\r\n this.deps = null;\r\n }\r\n };\r\n Entry.count = 0;\r\n return Entry;\r\n}());\r\nfunction rememberParent(child) {\r\n var parent = parentEntrySlot.getValue();\r\n if (parent) {\r\n child.parents.add(parent);\r\n if (!parent.childValues.has(child)) {\r\n parent.childValues.set(child, []);\r\n }\r\n if (mightBeDirty(child)) {\r\n reportDirtyChild(parent, child);\r\n }\r\n else {\r\n reportCleanChild(parent, child);\r\n }\r\n return parent;\r\n }\r\n}\r\nfunction reallyRecompute(entry, args) {\r\n forgetChildren(entry);\r\n // Set entry as the parent entry while calling recomputeNewValue(entry).\r\n parentEntrySlot.withValue(entry, recomputeNewValue, [entry, args]);\r\n if (maybeSubscribe(entry, args)) {\r\n // If we successfully recomputed entry.value and did not fail to\r\n // (re)subscribe, then this Entry is no longer explicitly dirty.\r\n setClean(entry);\r\n }\r\n return valueGet(entry.value);\r\n}\r\nfunction recomputeNewValue(entry, args) {\r\n entry.recomputing = true;\r\n // Set entry.value as unknown.\r\n entry.value.length = 0;\r\n try {\r\n // If entry.fn succeeds, entry.value will become a normal Value.\r\n entry.value[0] = entry.fn.apply(null, args);\r\n }\r\n catch (e) {\r\n // If entry.fn throws, entry.value will become exceptional.\r\n entry.value[1] = e;\r\n }\r\n // Either way, this line is always reached.\r\n entry.recomputing = false;\r\n}\r\nfunction mightBeDirty(entry) {\r\n return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size);\r\n}\r\nfunction setClean(entry) {\r\n entry.dirty = false;\r\n if (mightBeDirty(entry)) {\r\n // This Entry may still have dirty children, in which case we can't\r\n // let our parents know we're clean just yet.\r\n return;\r\n }\r\n reportClean(entry);\r\n}\r\nfunction reportDirty(child) {\r\n child.parents.forEach(function (parent) { return reportDirtyChild(parent, child); });\r\n}\r\nfunction reportClean(child) {\r\n child.parents.forEach(function (parent) { return reportCleanChild(parent, child); });\r\n}\r\n// Let a parent Entry know that one of its children may be dirty.\r\nfunction reportDirtyChild(parent, child) {\r\n // Must have called rememberParent(child) before calling\r\n // reportDirtyChild(parent, child).\r\n assert(parent.childValues.has(child));\r\n assert(mightBeDirty(child));\r\n if (!parent.dirtyChildren) {\r\n parent.dirtyChildren = emptySetPool.pop() || new Set;\r\n }\r\n else if (parent.dirtyChildren.has(child)) {\r\n // If we already know this child is dirty, then we must have already\r\n // informed our own parents that we are dirty, so we can terminate\r\n // the recursion early.\r\n return;\r\n }\r\n parent.dirtyChildren.add(child);\r\n reportDirty(parent);\r\n}\r\n// Let a parent Entry know that one of its children is no longer dirty.\r\nfunction reportCleanChild(parent, child) {\r\n // Must have called rememberChild(child) before calling\r\n // reportCleanChild(parent, child).\r\n assert(parent.childValues.has(child));\r\n assert(!mightBeDirty(child));\r\n var childValue = parent.childValues.get(child);\r\n if (childValue.length === 0) {\r\n parent.childValues.set(child, valueCopy(child.value));\r\n }\r\n else if (!valueIs(childValue, child.value)) {\r\n parent.setDirty();\r\n }\r\n removeDirtyChild(parent, child);\r\n if (mightBeDirty(parent)) {\r\n return;\r\n }\r\n reportClean(parent);\r\n}\r\nfunction removeDirtyChild(parent, child) {\r\n var dc = parent.dirtyChildren;\r\n if (dc) {\r\n dc.delete(child);\r\n if (dc.size === 0) {\r\n if (emptySetPool.length < POOL_TARGET_SIZE) {\r\n emptySetPool.push(dc);\r\n }\r\n parent.dirtyChildren = null;\r\n }\r\n }\r\n}\r\n// Removes all children from this entry and returns an array of the\r\n// removed children.\r\nfunction forgetChildren(parent) {\r\n if (parent.childValues.size > 0) {\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n });\r\n }\r\n // Remove this parent Entry from any sets to which it was added by the\r\n // addToSet method.\r\n parent.forgetDeps();\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n}\r\nfunction forgetChild(parent, child) {\r\n child.parents.delete(parent);\r\n parent.childValues.delete(child);\r\n removeDirtyChild(parent, child);\r\n}\r\nfunction maybeSubscribe(entry, args) {\r\n if (typeof entry.subscribe === \"function\") {\r\n try {\r\n maybeUnsubscribe(entry); // Prevent double subscriptions.\r\n entry.unsubscribe = entry.subscribe.apply(null, args);\r\n }\r\n catch (e) {\r\n // If this Entry has a subscribe function and it threw an exception\r\n // (or an unsubscribe function it previously returned now throws),\r\n // return false to indicate that we were not able to subscribe (or\r\n // unsubscribe), and this Entry should remain dirty.\r\n entry.setDirty();\r\n return false;\r\n }\r\n }\r\n // Returning true indicates either that there was no entry.subscribe\r\n // function or that it succeeded.\r\n return true;\r\n}\n\nfunction dep(options) {\r\n var depsByKey = new Map();\r\n var subscribe = options && options.subscribe;\r\n function depend(key) {\r\n var parent = parentEntrySlot.getValue();\r\n if (parent) {\r\n var dep_1 = depsByKey.get(key);\r\n if (!dep_1) {\r\n depsByKey.set(key, dep_1 = new Set);\r\n }\r\n parent.dependOn(dep_1);\r\n if (typeof subscribe === \"function\") {\r\n maybeUnsubscribe(dep_1);\r\n dep_1.unsubscribe = subscribe(key);\r\n }\r\n }\r\n }\r\n depend.dirty = function dirty(key) {\r\n var dep = depsByKey.get(key);\r\n if (dep) {\r\n dep.forEach(function (entry) { return entry.setDirty(); });\r\n depsByKey.delete(key);\r\n maybeUnsubscribe(dep);\r\n }\r\n };\r\n return depend;\r\n}\n\n// The defaultMakeCacheKey function is remarkably powerful, because it gives\r\n// a unique object for any shallow-identical list of arguments. If you need\r\n// to implement a custom makeCacheKey function, you may find it helpful to\r\n// delegate the final work to defaultMakeCacheKey, which is why we export it\r\n// here. However, you may want to avoid defaultMakeCacheKey if your runtime\r\n// does not support WeakMap, or you have the ability to return a string key.\r\n// In those cases, just write your own custom makeCacheKey functions.\r\nvar keyTrie = new Trie(typeof WeakMap === \"function\");\r\nfunction defaultMakeCacheKey() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return keyTrie.lookupArray(args);\r\n}\r\nvar caches = new Set();\r\nfunction wrap(originalFunction, options) {\r\n if (options === void 0) { options = Object.create(null); }\r\n var cache = new Cache(options.max || Math.pow(2, 16), function (entry) { return entry.dispose(); });\r\n var keyArgs = options.keyArgs;\r\n var makeCacheKey = options.makeCacheKey || defaultMakeCacheKey;\r\n function optimistic() {\r\n var key = makeCacheKey.apply(null, keyArgs ? keyArgs.apply(null, arguments) : arguments);\r\n if (key === void 0) {\r\n return originalFunction.apply(null, arguments);\r\n }\r\n var entry = cache.get(key);\r\n if (!entry) {\r\n cache.set(key, entry = new Entry(originalFunction));\r\n entry.subscribe = options.subscribe;\r\n }\r\n var value = entry.recompute(Array.prototype.slice.call(arguments));\r\n // Move this entry to the front of the least-recently used queue,\r\n // since we just finished computing its value.\r\n cache.set(key, entry);\r\n caches.add(cache);\r\n // Clean up any excess entries in the cache, but only if there is no\r\n // active parent entry, meaning we're not in the middle of a larger\r\n // computation that might be flummoxed by the cleaning.\r\n if (!parentEntrySlot.hasValue()) {\r\n caches.forEach(function (cache) { return cache.clean(); });\r\n caches.clear();\r\n }\r\n return value;\r\n }\r\n function lookup() {\r\n var key = makeCacheKey.apply(null, arguments);\r\n if (key !== void 0) {\r\n return cache.get(key);\r\n }\r\n }\r\n optimistic.dirty = function () {\r\n var entry = lookup.apply(null, arguments);\r\n if (entry) {\r\n entry.setDirty();\r\n }\r\n };\r\n optimistic.peek = function () {\r\n var entry = lookup.apply(null, arguments);\r\n if (entry) {\r\n return entry.peek();\r\n }\r\n };\r\n optimistic.forget = function () {\r\n var key = makeCacheKey.apply(null, arguments);\r\n return key !== void 0 && cache.delete(key);\r\n };\r\n return optimistic;\r\n}\n\nexport { defaultMakeCacheKey, dep, wrap };\n//# sourceMappingURL=bundle.esm.js.map\n","import { Observable } from \"../../utilities/index.js\";\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\n//# sourceMappingURL=fromError.js.map","import { invariant } from 'ts-invariant';\nexport function toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Promise Wrapper does not support multiple results from Observable\");\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n//# sourceMappingURL=toPromise.js.map","import { Observable } from \"../../utilities/index.js\";\nexport function fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n//# sourceMappingURL=fromPromise.js.map","export var throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\n//# sourceMappingURL=throwServerError.js.map","import { InvariantError } from 'ts-invariant';\nexport function validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(26) : new InvariantError(\"illegal argument: \" + key);\n }\n }\n return operation;\n}\n//# sourceMappingURL=validateOperation.js.map","import { __assign } from \"tslib\";\nexport function createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign(__assign({}, context), next(context));\n }\n else {\n context = __assign(__assign({}, context), next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map","import { getOperationName } from \"../../utilities/index.js\";\nexport function transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n return transformedOperation;\n}\n//# sourceMappingURL=transformOperation.js.map","export { empty } from \"./empty.js\";\nexport { from } from \"./from.js\";\nexport { split } from \"./split.js\";\nexport { concat } from \"./concat.js\";\nexport { execute } from \"./execute.js\";\nexport { ApolloLink } from \"./ApolloLink.js\";\nexport * from \"./types.js\";\n//# sourceMappingURL=index.js.map","import { __extends } from \"tslib\";\nimport { isNonEmptyArray } from \"../utilities/index.js\";\nexport function isApolloError(err) {\n return err.hasOwnProperty('graphQLErrors');\n}\nvar generateErrorMessage = function (err) {\n var message = '';\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach(function (graphQLError) {\n var errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += errorMessage + \"\\n\";\n });\n }\n if (err.networkError) {\n message += err.networkError.message + \"\\n\";\n }\n message = message.replace(/\\n$/, '');\n return message;\n};\nvar ApolloError = (function (_super) {\n __extends(ApolloError, _super);\n function ApolloError(_a) {\n var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;\n var _this = _super.call(this, errorMessage) || this;\n _this.graphQLErrors = graphQLErrors || [];\n _this.networkError = networkError || null;\n _this.message = errorMessage || generateErrorMessage(_this);\n _this.extraInfo = extraInfo;\n _this.__proto__ = ApolloError.prototype;\n return _this;\n }\n return ApolloError;\n}(Error));\nexport { ApolloError };\n//# sourceMappingURL=index.js.map","import React from 'react';\nimport { canUseWeakMap } from \"../../utilities/index.js\";\nvar cache = new (canUseWeakMap ? WeakMap : Map)();\nexport function getApolloContext() {\n var context = cache.get(React.createContext);\n if (!context) {\n context = React.createContext({});\n context.displayName = 'ApolloContext';\n cache.set(React.createContext, context);\n }\n return context;\n}\nexport { getApolloContext as resetApolloContext };\n//# sourceMappingURL=ApolloContext.js.map","import React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from \"./ApolloContext.js\";\nexport var ApolloConsumer = function (props) {\n var ApolloContext = getApolloContext();\n return React.createElement(ApolloContext.Consumer, null, function (context) {\n process.env.NODE_ENV === \"production\" ? invariant(context && context.client, 27) : invariant(context && context.client, 'Could not find \"client\" in the context of ApolloConsumer. ' +\n 'Wrap the root component in an .');\n return props.children(context.client);\n });\n};\n//# sourceMappingURL=ApolloConsumer.js.map","import React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from \"./ApolloContext.js\";\nexport var ApolloProvider = function (_a) {\n var client = _a.client, children = _a.children;\n var ApolloContext = getApolloContext();\n return React.createElement(ApolloContext.Consumer, null, function (context) {\n if (context === void 0) { context = {}; }\n if (client && context.client !== client) {\n context = Object.assign({}, context, { client: client });\n }\n process.env.NODE_ENV === \"production\" ? invariant(context.client, 28) : invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.');\n return (React.createElement(ApolloContext.Provider, { value: context }, children));\n });\n};\n//# sourceMappingURL=ApolloProvider.js.map","import { invariant } from 'ts-invariant';\nexport var DocumentType;\n(function (DocumentType) {\n DocumentType[DocumentType[\"Query\"] = 0] = \"Query\";\n DocumentType[DocumentType[\"Mutation\"] = 1] = \"Mutation\";\n DocumentType[DocumentType[\"Subscription\"] = 2] = \"Subscription\";\n})(DocumentType || (DocumentType = {}));\nvar cache = new Map();\nexport function operationName(type) {\n var name;\n switch (type) {\n case DocumentType.Query:\n name = 'Query';\n break;\n case DocumentType.Mutation:\n name = 'Mutation';\n break;\n case DocumentType.Subscription:\n name = 'Subscription';\n break;\n }\n return name;\n}\nexport function parser(document) {\n var cached = cache.get(document);\n if (cached)\n return cached;\n var variables, type, name;\n process.env.NODE_ENV === \"production\" ? invariant(!!document && !!document.kind, 34) : invariant(!!document && !!document.kind, \"Argument of \" + document + \" passed to parser was not a valid GraphQL \" +\n \"DocumentNode. You may need to use 'graphql-tag' or another method \" +\n \"to convert your operation into a document\");\n var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; });\n var queries = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'query';\n });\n var mutations = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'mutation';\n });\n var subscriptions = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'subscription';\n });\n process.env.NODE_ENV === \"production\" ? invariant(!fragments.length ||\n (queries.length || mutations.length || subscriptions.length), 35) : invariant(!fragments.length ||\n (queries.length || mutations.length || subscriptions.length), \"Passing only a fragment to 'graphql' is not yet supported. \" +\n \"You must include a query, subscription or mutation as well\");\n process.env.NODE_ENV === \"production\" ? invariant(queries.length + mutations.length + subscriptions.length <= 1, 36) : invariant(queries.length + mutations.length + subscriptions.length <= 1, \"react-apollo only supports a query, subscription, or a mutation per HOC. \" +\n (document + \" had \" + queries.length + \" queries, \" + subscriptions.length + \" \") +\n (\"subscriptions and \" + mutations.length + \" mutations. \") +\n \"You can use 'compose' to join multiple operation types to a component\");\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length)\n type = DocumentType.Subscription;\n var definitions = queries.length\n ? queries\n : mutations.length\n ? mutations\n : subscriptions;\n process.env.NODE_ENV === \"production\" ? invariant(definitions.length === 1, 37) : invariant(definitions.length === 1, \"react-apollo only supports one definition per HOC. \" + document + \" had \" +\n (definitions.length + \" definitions. \") +\n \"You can use 'compose' to join multiple operation types to a component\");\n var definition = definitions[0];\n variables = definition.variableDefinitions || [];\n if (definition.name && definition.name.kind === 'Name') {\n name = definition.name.value;\n }\n else {\n name = 'data';\n }\n var payload = { name: name, type: type, variables: variables };\n cache.set(document, payload);\n return payload;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UPDATE_TAG = exports.UPDATE_ASSET_COLLECTION = exports.UPDATE_ASSET = exports.UNTAG_ASSET = exports.TAG_ASSET = exports.SET_ASSET_TAGS = exports.SET_ASSET_COLLECTIONS = exports.IMPORT_ASSET = exports.DELETE_TAG = exports.DELETE_ASSET_COLLECTION = exports.DELETE_ASSET = exports.CREATE_TAG = exports.CREATE_ASSET_COLLECTION = void 0;\nvar createAssetCollection_1 = __importDefault(require(\"./createAssetCollection\"));\nexports.CREATE_ASSET_COLLECTION = createAssetCollection_1.default;\nvar createTag_1 = __importDefault(require(\"./createTag\"));\nexports.CREATE_TAG = createTag_1.default;\nvar deleteAsset_1 = __importDefault(require(\"./deleteAsset\"));\nexports.DELETE_ASSET = deleteAsset_1.default;\nvar deleteAssetCollection_1 = __importDefault(require(\"./deleteAssetCollection\"));\nexports.DELETE_ASSET_COLLECTION = deleteAssetCollection_1.default;\nvar deleteTag_1 = __importDefault(require(\"./deleteTag\"));\nexports.DELETE_TAG = deleteTag_1.default;\nvar importAsset_1 = __importDefault(require(\"./importAsset\"));\nexports.IMPORT_ASSET = importAsset_1.default;\nvar setAssetCollections_1 = __importDefault(require(\"./setAssetCollections\"));\nexports.SET_ASSET_COLLECTIONS = setAssetCollections_1.default;\nvar setAssetTags_1 = __importDefault(require(\"./setAssetTags\"));\nexports.SET_ASSET_TAGS = setAssetTags_1.default;\nvar tagAsset_1 = __importDefault(require(\"./tagAsset\"));\nexports.TAG_ASSET = tagAsset_1.default;\nvar untagAsset_1 = __importDefault(require(\"./untagAsset\"));\nexports.UNTAG_ASSET = untagAsset_1.default;\nvar updateAsset_1 = __importDefault(require(\"./updateAsset\"));\nexports.UPDATE_ASSET = updateAsset_1.default;\nvar updateAssetCollection_1 = __importDefault(require(\"./updateAssetCollection\"));\nexports.UPDATE_ASSET_COLLECTION = updateAssetCollection_1.default;\nvar updateTag_1 = __importDefault(require(\"./updateTag\"));\nexports.UPDATE_TAG = updateTag_1.default;\n","import { __extends } from \"tslib\";\nimport { InvariantError, invariant } from 'ts-invariant';\nimport { Observable } from \"../../utilities/index.js\";\nimport { validateOperation, createOperation, transformOperation, } from \"../utils/index.js\";\nfunction passthrough(op, forward) {\n return (forward ? forward(op) : Observable.of());\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nvar LinkError = (function (_super) {\n __extends(LinkError, _super);\n function LinkError(message, link) {\n var _this = _super.call(this, message) || this;\n _this.link = link;\n return _this;\n }\n return LinkError;\n}(Error));\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.empty = function () {\n return new ApolloLink(function () { return Observable.of(); });\n };\n ApolloLink.from = function (links) {\n if (links.length === 0)\n return ApolloLink.empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n };\n ApolloLink.split = function (test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n };\n ApolloLink.execute = function (link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n };\n ApolloLink.concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n process.env.NODE_ENV === \"production\" || invariant.warn(new LinkError(\"You are calling concat on a terminating link, which will have no effect\", firstLink));\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n };\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return ApolloLink.concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(21) : new InvariantError('request is not implemented');\n };\n ApolloLink.prototype.onError = function (error, observer) {\n if (observer && observer.error) {\n observer.error(error);\n return false;\n }\n throw error;\n };\n ApolloLink.prototype.setOnError = function (fn) {\n this.onError = fn;\n return this;\n };\n return ApolloLink;\n}());\nexport { ApolloLink };\n//# sourceMappingURL=ApolloLink.js.map","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ASSET_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nvar assetSource_1 = require(\"./assetSource\");\nvar iptcProperty_1 = require(\"./iptcProperty\");\nvar file_1 = require(\"./file\");\nvar tag_1 = require(\"./tag\");\n// TODO: Somehow extend `isInClipboard` from clipboard feature package\nexports.ASSET_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment AssetProps on Asset {\\n id\\n localId\\n assetSource {\\n ...AssetSourceProps\\n }\\n imported\\n label\\n caption\\n filename\\n tags {\\n ...TagProps\\n }\\n collections {\\n id\\n title\\n }\\n copyrightNotice\\n lastModified\\n iptcProperties {\\n ...IptcPropertyProps\\n }\\n width\\n height\\n file {\\n ...FileProps\\n }\\n thumbnailUrl\\n previewUrl\\n isInClipboard @client\\n isInUse @include(if: $includeUsage)\\n }\\n \", \"\\n \", \"\\n \", \"\\n \", \"\\n\"], [\"\\n fragment AssetProps on Asset {\\n id\\n localId\\n assetSource {\\n ...AssetSourceProps\\n }\\n imported\\n label\\n caption\\n filename\\n tags {\\n ...TagProps\\n }\\n collections {\\n id\\n title\\n }\\n copyrightNotice\\n lastModified\\n iptcProperties {\\n ...IptcPropertyProps\\n }\\n width\\n height\\n file {\\n ...FileProps\\n }\\n thumbnailUrl\\n previewUrl\\n isInClipboard @client\\n isInUse @include(if: $includeUsage)\\n }\\n \", \"\\n \", \"\\n \", \"\\n \", \"\\n\"])), assetSource_1.ASSET_SOURCE_FRAGMENT, iptcProperty_1.IPTC_PROPERTY_FRAGMENT, file_1.FILE_FRAGMENT, tag_1.TAG_FRAGMENT);\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PropertyListItem = exports.PropertyList = exports.IconLabel = exports.Column = exports.AssetLabel = void 0;\nvar AssetLabel_1 = __importDefault(require(\"./AssetLabel\"));\nexports.AssetLabel = AssetLabel_1.default;\nvar Column_1 = __importDefault(require(\"./Column\"));\nexports.Column = Column_1.default;\nvar IconLabel_1 = __importDefault(require(\"./IconLabel\"));\nexports.IconLabel = IconLabel_1.default;\nvar PropertyList_1 = __importDefault(require(\"./PropertyList\"));\nexports.PropertyList = PropertyList_1.default;\nvar PropertyListItem_1 = __importDefault(require(\"./PropertyListItem\"));\nexports.PropertyListItem = PropertyListItem_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MainViewState = exports.mainViewState = exports.createTagDialogState = exports.createAssetCollectionDialogState = void 0;\nvar createAssetCollectionDialogState_1 = __importDefault(require(\"./createAssetCollectionDialogState\"));\nexports.createAssetCollectionDialogState = createAssetCollectionDialogState_1.default;\nvar createTagDialogState_1 = __importDefault(require(\"./createTagDialogState\"));\nexports.createTagDialogState = createTagDialogState_1.default;\nvar mainViewState_1 = require(\"./mainViewState\");\nObject.defineProperty(exports, \"mainViewState\", { enumerable: true, get: function () { return mainViewState_1.mainViewState; } });\nObject.defineProperty(exports, \"MainViewState\", { enumerable: true, get: function () { return mainViewState_1.MainViewState; } });\n","var isProduction = process.env.NODE_ENV === 'production';\nfunction warning(condition, message) {\n if (!isProduction) {\n if (condition) {\n return;\n }\n\n var text = \"Warning: \" + message;\n\n if (typeof console !== 'undefined') {\n console.warn(text);\n }\n\n try {\n throw Error(text);\n } catch (x) {}\n }\n}\n\nexport default warning;\n","export { ApolloClient, mergeOptions, } from \"./ApolloClient.js\";\nexport { ObservableQuery, } from \"./ObservableQuery.js\";\nexport { NetworkStatus } from \"./networkStatus.js\";\nexport * from \"./types.js\";\nexport { isApolloError, ApolloError } from \"../errors/index.js\";\nexport { Cache, ApolloCache, InMemoryCache, MissingFieldError, defaultDataIdFromObject, makeVar, } from \"../cache/index.js\";\nexport * from \"../cache/inmemory/types.js\";\nexport * from \"../link/core/index.js\";\nexport * from \"../link/http/index.js\";\nexport { fromError, toPromise, fromPromise, throwServerError, } from \"../link/utils/index.js\";\nexport { Observable, isReference, makeReference, } from \"../utilities/index.js\";\nimport { setVerbosity } from \"ts-invariant\";\nexport { setVerbosity as setLogVerbosity };\nsetVerbosity(\"log\");\nimport gql from 'graphql-tag';\nexport var resetCaches = gql.resetCaches, disableFragmentWarnings = gql.disableFragmentWarnings, enableExperimentalFragmentVariables = gql.enableExperimentalFragmentVariables, disableExperimentalFragmentVariables = gql.disableExperimentalFragmentVariables;\nexport { gql };\n//# sourceMappingURL=index.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nfunction readFromConsumerApi(key) {\n return function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][\"@\" + key]) {\n return (_a = window['@Neos:HostPluginAPI'])[\"@\" + key].apply(_a, tslib_1.__spread(args));\n }\n throw new Error(\"You are trying to read from a consumer api that hasn't been initialized yet!\");\n };\n}\nexports[\"default\"] = readFromConsumerApi;\n//# sourceMappingURL=readFromConsumerApi.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useClipboard = exports.clipboardVisibleState = exports.buildResolvers = exports.ClipboardWatcher = exports.ClipboardItem = exports.ClipboardActions = exports.ClipboardToggle = exports.CLIPBOARD = exports.TOGGLE_CLIPBOARD_STATE = void 0;\nvar clipboardVisibleState_1 = __importDefault(require(\"./state/clipboardVisibleState\"));\nexports.clipboardVisibleState = clipboardVisibleState_1.default;\nvar ClipboardQuery_1 = require(\"./queries/ClipboardQuery\");\nObject.defineProperty(exports, \"CLIPBOARD\", { enumerable: true, get: function () { return ClipboardQuery_1.CLIPBOARD; } });\nObject.defineProperty(exports, \"TOGGLE_CLIPBOARD_STATE\", { enumerable: true, get: function () { return ClipboardQuery_1.TOGGLE_CLIPBOARD_STATE; } });\nvar useClipboard_1 = __importDefault(require(\"./hooks/useClipboard\"));\nexports.useClipboard = useClipboard_1.default;\nvar ClipboardToggle_1 = __importDefault(require(\"./components/ClipboardToggle\"));\nexports.ClipboardToggle = ClipboardToggle_1.default;\nvar ClipboardItem_1 = __importDefault(require(\"./components/ClipboardItem\"));\nexports.ClipboardItem = ClipboardItem_1.default;\nvar ClipboardActions_1 = __importDefault(require(\"./components/ClipboardActions\"));\nexports.ClipboardActions = ClipboardActions_1.default;\nvar ClipboardWatcher_1 = __importDefault(require(\"./components/ClipboardWatcher\"));\nexports.ClipboardWatcher = ClipboardWatcher_1.default;\nvar mutation_1 = __importDefault(require(\"./resolvers/mutation\"));\nexports.buildResolvers = mutation_1.default;\n","export { ApolloCache } from \"./core/cache.js\";\nexport { Cache } from \"./core/types/Cache.js\";\nexport { MissingFieldError } from \"./core/types/common.js\";\nexport { isReference, makeReference, } from \"../utilities/index.js\";\nexport { InMemoryCache, } from \"./inmemory/inMemoryCache.js\";\nexport { makeVar, cacheSlot, } from \"./inmemory/reactiveVars.js\";\nexport { defaultDataIdFromObject, } from \"./inmemory/policies.js\";\nexport * from \"./inmemory/types.js\";\n//# sourceMappingURL=index.js.map","// This currentContext variable will only be used if the makeSlotClass\r\n// function is called, which happens only if this is the first copy of the\r\n// @wry/context package to be imported.\r\nvar currentContext = null;\r\n// This unique internal object is used to denote the absence of a value\r\n// for a given Slot, and is never exposed to outside code.\r\nvar MISSING_VALUE = {};\r\nvar idCounter = 1;\r\n// Although we can't do anything about the cost of duplicated code from\r\n// accidentally bundling multiple copies of the @wry/context package, we can\r\n// avoid creating the Slot class more than once using makeSlotClass.\r\nvar makeSlotClass = function () { return /** @class */ (function () {\r\n function Slot() {\r\n // If you have a Slot object, you can find out its slot.id, but you cannot\r\n // guess the slot.id of a Slot you don't have access to, thanks to the\r\n // randomized suffix.\r\n this.id = [\r\n \"slot\",\r\n idCounter++,\r\n Date.now(),\r\n Math.random().toString(36).slice(2),\r\n ].join(\":\");\r\n }\r\n Slot.prototype.hasValue = function () {\r\n for (var context_1 = currentContext; context_1; context_1 = context_1.parent) {\r\n // We use the Slot object iself as a key to its value, which means the\r\n // value cannot be obtained without a reference to the Slot object.\r\n if (this.id in context_1.slots) {\r\n var value = context_1.slots[this.id];\r\n if (value === MISSING_VALUE)\r\n break;\r\n if (context_1 !== currentContext) {\r\n // Cache the value in currentContext.slots so the next lookup will\r\n // be faster. This caching is safe because the tree of contexts and\r\n // the values of the slots are logically immutable.\r\n currentContext.slots[this.id] = value;\r\n }\r\n return true;\r\n }\r\n }\r\n if (currentContext) {\r\n // If a value was not found for this Slot, it's never going to be found\r\n // no matter how many times we look it up, so we might as well cache\r\n // the absence of the value, too.\r\n currentContext.slots[this.id] = MISSING_VALUE;\r\n }\r\n return false;\r\n };\r\n Slot.prototype.getValue = function () {\r\n if (this.hasValue()) {\r\n return currentContext.slots[this.id];\r\n }\r\n };\r\n Slot.prototype.withValue = function (value, callback, \r\n // Given the prevalence of arrow functions, specifying arguments is likely\r\n // to be much more common than specifying `this`, hence this ordering:\r\n args, thisArg) {\r\n var _a;\r\n var slots = (_a = {\r\n __proto__: null\r\n },\r\n _a[this.id] = value,\r\n _a);\r\n var parent = currentContext;\r\n currentContext = { parent: parent, slots: slots };\r\n try {\r\n // Function.prototype.apply allows the arguments array argument to be\r\n // omitted or undefined, so args! is fine here.\r\n return callback.apply(thisArg, args);\r\n }\r\n finally {\r\n currentContext = parent;\r\n }\r\n };\r\n // Capture the current context and wrap a callback function so that it\r\n // reestablishes the captured context when called.\r\n Slot.bind = function (callback) {\r\n var context = currentContext;\r\n return function () {\r\n var saved = currentContext;\r\n try {\r\n currentContext = context;\r\n return callback.apply(this, arguments);\r\n }\r\n finally {\r\n currentContext = saved;\r\n }\r\n };\r\n };\r\n // Immediately run a callback function without any captured context.\r\n Slot.noContext = function (callback, \r\n // Given the prevalence of arrow functions, specifying arguments is likely\r\n // to be much more common than specifying `this`, hence this ordering:\r\n args, thisArg) {\r\n if (currentContext) {\r\n var saved = currentContext;\r\n try {\r\n currentContext = null;\r\n // Function.prototype.apply allows the arguments array argument to be\r\n // omitted or undefined, so args! is fine here.\r\n return callback.apply(thisArg, args);\r\n }\r\n finally {\r\n currentContext = saved;\r\n }\r\n }\r\n else {\r\n return callback.apply(thisArg, args);\r\n }\r\n };\r\n return Slot;\r\n}()); };\r\n// We store a single global implementation of the Slot class as a permanent\r\n// non-enumerable symbol property of the Array constructor. This obfuscation\r\n// does nothing to prevent access to the Slot class, but at least it ensures\r\n// the implementation (i.e. currentContext) cannot be tampered with, and all\r\n// copies of the @wry/context package (hopefully just one) will share the\r\n// same Slot implementation. Since the first copy of the @wry/context package\r\n// to be imported wins, this technique imposes a very high cost for any\r\n// future breaking changes to the Slot class.\r\nvar globalKey = \"@wry/context:Slot\";\r\nvar host = Array;\r\nvar Slot = host[globalKey] || function () {\r\n var Slot = makeSlotClass();\r\n try {\r\n Object.defineProperty(host, globalKey, {\r\n value: host[globalKey] = Slot,\r\n enumerable: false,\r\n writable: false,\r\n configurable: false,\r\n });\r\n }\r\n finally {\r\n return Slot;\r\n }\r\n}();\n\nvar bind = Slot.bind, noContext = Slot.noContext;\r\nfunction setTimeoutWithContext(callback, delay) {\r\n return setTimeout(bind(callback), delay);\r\n}\r\n// Turn any generator function into an async function (using yield instead\r\n// of await), with context automatically preserved across yields.\r\nfunction asyncFromGen(genFn) {\r\n return function () {\r\n var gen = genFn.apply(this, arguments);\r\n var boundNext = bind(gen.next);\r\n var boundThrow = bind(gen.throw);\r\n return new Promise(function (resolve, reject) {\r\n function invoke(method, argument) {\r\n try {\r\n var result = method.call(gen, argument);\r\n }\r\n catch (error) {\r\n return reject(error);\r\n }\r\n var next = result.done ? resolve : invokeNext;\r\n if (isPromiseLike(result.value)) {\r\n result.value.then(next, result.done ? reject : invokeThrow);\r\n }\r\n else {\r\n next(result.value);\r\n }\r\n }\r\n var invokeNext = function (value) { return invoke(boundNext, value); };\r\n var invokeThrow = function (error) { return invoke(boundThrow, error); };\r\n invokeNext();\r\n });\r\n };\r\n}\r\nfunction isPromiseLike(value) {\r\n return value && typeof value.then === \"function\";\r\n}\r\n// If you use the fibers npm package to implement coroutines in Node.js,\r\n// you should call this function at least once to ensure context management\r\n// remains coherent across any yields.\r\nvar wrappedFibers = [];\r\nfunction wrapYieldingFiberMethods(Fiber) {\r\n // There can be only one implementation of Fiber per process, so this array\r\n // should never grow longer than one element.\r\n if (wrappedFibers.indexOf(Fiber) < 0) {\r\n var wrap = function (obj, method) {\r\n var fn = obj[method];\r\n obj[method] = function () {\r\n return noContext(fn, arguments, this);\r\n };\r\n };\r\n // These methods can yield, according to\r\n // https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100\r\n wrap(Fiber, \"yield\");\r\n wrap(Fiber.prototype, \"run\");\r\n wrap(Fiber.prototype, \"throwInto\");\r\n wrappedFibers.push(Fiber);\r\n }\r\n return Fiber;\r\n}\n\nexport { Slot, asyncFromGen, bind, noContext, setTimeoutWithContext as setTimeout, wrapYieldingFiberMethods };\n//# sourceMappingURL=context.esm.js.map\n","import { dep } from \"optimism\";\nimport { Slot } from \"@wry/context\";\nexport var cacheSlot = new Slot();\nfunction consumeAndIterate(set, callback) {\n if (set.size) {\n var items_1 = [];\n set.forEach(function (item) { return items_1.push(item); });\n set.clear();\n items_1.forEach(callback);\n }\n}\nvar cacheInfoMap = new WeakMap();\nfunction getCacheInfo(cache) {\n var info = cacheInfoMap.get(cache);\n if (!info) {\n cacheInfoMap.set(cache, info = {\n vars: new Set,\n dep: dep(),\n });\n }\n return info;\n}\nexport function forgetCache(cache) {\n getCacheInfo(cache).vars.forEach(function (rv) { return rv.forgetCache(cache); });\n}\nexport function recallCache(cache) {\n getCacheInfo(cache).vars.forEach(function (rv) { return rv.attachCache(cache); });\n}\nexport function makeVar(value) {\n var caches = new Set();\n var listeners = new Set();\n var rv = function (newValue) {\n if (arguments.length > 0) {\n if (value !== newValue) {\n value = newValue;\n caches.forEach(function (cache) {\n getCacheInfo(cache).dep.dirty(rv);\n broadcast(cache);\n });\n consumeAndIterate(listeners, function (listener) { return listener(value); });\n }\n }\n else {\n var cache = cacheSlot.getValue();\n if (cache) {\n attach(cache);\n getCacheInfo(cache).dep(rv);\n }\n }\n return value;\n };\n rv.onNextChange = function (listener) {\n listeners.add(listener);\n return function () {\n listeners.delete(listener);\n };\n };\n var attach = rv.attachCache = function (cache) {\n caches.add(cache);\n getCacheInfo(cache).vars.add(rv);\n return rv;\n };\n rv.forgetCache = function (cache) { return caches.delete(cache); };\n return rv;\n}\nfunction broadcast(cache) {\n if (cache.broadcastWatches) {\n cache.broadcastWatches();\n }\n}\n//# sourceMappingURL=reactiveVars.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexport var isBrowser = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\" && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === 'object' && document.nodeType === 9;\n\nexport default isBrowser;\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TAG_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.TAG_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment TagProps on Tag {\\n id\\n label\\n }\\n\"], [\"\\n fragment TagProps on Tag {\\n id\\n label\\n }\\n\"])));\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useUnusedAssetCountQuery = exports.useUnusedAssetsQuery = exports.useAssetUsagesQuery = exports.showUnusedAssetsState = exports.assetUsageDetailsModalState = exports.UsageDetailsMetadataType = exports.USAGE_DETAILS_GROUP_FRAGMENT = exports.UNUSED_ASSETS = exports.AssetUsagesToggleButton = exports.AssetUsagesModal = exports.ASSET_USAGE_DETAILS = void 0;\nvar assetUsages_1 = __importDefault(require(\"./queries/assetUsages\"));\nexports.ASSET_USAGE_DETAILS = assetUsages_1.default;\nvar unusedAssets_1 = __importDefault(require(\"./queries/unusedAssets\"));\nexports.UNUSED_ASSETS = unusedAssets_1.default;\nvar usageDetailsGroupFragment_1 = __importDefault(require(\"./fragments/usageDetailsGroupFragment\"));\nexports.USAGE_DETAILS_GROUP_FRAGMENT = usageDetailsGroupFragment_1.default;\nvar UsageDetails_1 = require(\"./interfaces/UsageDetails\");\nObject.defineProperty(exports, \"UsageDetailsMetadataType\", { enumerable: true, get: function () { return UsageDetails_1.UsageDetailsMetadataType; } });\nvar AssetUsagesModal_1 = __importDefault(require(\"./components/AssetUsagesModal\"));\nexports.AssetUsagesModal = AssetUsagesModal_1.default;\nvar AssetUsagesToggleButton_1 = __importDefault(require(\"./components/AssetUsagesToggleButton\"));\nexports.AssetUsagesToggleButton = AssetUsagesToggleButton_1.default;\nvar assetUsageDetailsModalState_1 = __importDefault(require(\"./state/assetUsageDetailsModalState\"));\nexports.assetUsageDetailsModalState = assetUsageDetailsModalState_1.default;\nvar showUnusedAssetsState_1 = __importDefault(require(\"./state/showUnusedAssetsState\"));\nexports.showUnusedAssetsState = showUnusedAssetsState_1.default;\nvar useAssetUsages_1 = __importDefault(require(\"./hooks/useAssetUsages\"));\nexports.useAssetUsagesQuery = useAssetUsages_1.default;\nvar useUnusedAssetsQuery_1 = __importDefault(require(\"./hooks/useUnusedAssetsQuery\"));\nexports.useUnusedAssetsQuery = useUnusedAssetsQuery_1.default;\nvar useUnusedAssetCountQuery_1 = __importDefault(require(\"./queries/useUnusedAssetCountQuery\"));\nexports.useUnusedAssetCountQuery = useUnusedAssetCountQuery_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Main = exports.AssetActions = exports.ListViewItem = exports.ListView = exports.Thumbnail = exports.ThumbnailView = void 0;\nvar AssetActions_1 = __importDefault(require(\"./AssetActions\"));\nexports.AssetActions = AssetActions_1.default;\nvar ListView_1 = __importDefault(require(\"./ListView\"));\nexports.ListView = ListView_1.default;\nvar ListViewItem_1 = __importDefault(require(\"./ListViewItem\"));\nexports.ListViewItem = ListViewItem_1.default;\nvar Main_1 = __importDefault(require(\"./Main\"));\nexports.Main = Main_1.default;\nvar Thumbnail_1 = __importDefault(require(\"./Thumbnail\"));\nexports.Thumbnail = Thumbnail_1.default;\nvar ThumbnailView_1 = __importDefault(require(\"./ThumbnailView\"));\nexports.ThumbnailView = ThumbnailView_1.default;\n","var MissingFieldError = (function () {\n function MissingFieldError(message, path, query, clientOnly, variables) {\n this.message = message;\n this.path = path;\n this.query = query;\n this.clientOnly = clientOnly;\n this.variables = variables;\n }\n return MissingFieldError;\n}());\nexport { MissingFieldError };\n//# sourceMappingURL=common.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport default function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}\n","// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nexport var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';\n","/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}\n","import { getLocation } from \"./location.mjs\";\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printLocation(location) {\n return printSourceLocation(location.source, getLocation(location.source, location.start));\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {\n var prefix = _ref2[0];\n return prefix.length;\n }));\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction leftPad(len, str) {\n return whitespace(len - str.length) + str;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// FIXME:\n// flowlint uninitialized-instance-property:off\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport { getLocation } from \"../language/location.mjs\";\nimport { printLocation, printSourceLocation } from \"../language/printLocation.mjs\";\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport var GraphQLError = /*#__PURE__*/function (_Error) {\n _inherits(GraphQLError, _Error);\n\n var _super = _createSuper(GraphQLError);\n\n /**\n * A message describing the Error for debugging purposes.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n *\n * Note: should be treated as readonly, despite invariant usage.\n */\n\n /**\n * An array of { line, column } locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {\n var _locations2, _source2, _positions2, _extensions2;\n\n var _this;\n\n _classCallCheck(this, GraphQLError);\n\n _this = _super.call(this, message); // Compute list of blame nodes.\n\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var _nodes$0$loc;\n\n _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return getLocation(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(getLocation(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions;\n\n if (_extensions == null && originalError != null) {\n var originalExtensions = originalError.extensions;\n\n if (isObjectLike(originalExtensions)) {\n _extensions = originalExtensions;\n }\n }\n\n Object.defineProperties(_assertThisInitialized(_this), {\n name: {\n value: 'GraphQLError'\n },\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: _locations != null\n },\n path: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path !== null && path !== void 0 ? path : undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: path != null\n },\n nodes: {\n value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined\n },\n source: {\n value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined\n },\n positions: {\n value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: _extensions != null\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError !== null && originalError !== void 0 && originalError.stack) {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n return _possibleConstructorReturn(_this);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);\n } else {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n\n return _this;\n }\n\n _createClass(GraphQLError, [{\n key: \"toString\",\n value: function toString() {\n return printError(this);\n } // FIXME: workaround to not break chai comparisons, should be remove in v16\n // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n }, {\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Object';\n }\n }]);\n\n return GraphQLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\n\nexport function printError(error) {\n var output = error.message;\n\n if (error.nodes) {\n for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) {\n var node = _error$nodes2[_i2];\n\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (error.source && error.locations) {\n for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) {\n var location = _error$locations2[_i4];\n output += '\\n\\n' + printSourceLocation(error.source, location);\n }\n }\n\n return output;\n}\n","import { GraphQLError } from \"./GraphQLError.mjs\";\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(\"Syntax Error: \".concat(description), undefined, source, [position]);\n}\n","/**\n * The set of allowed kind values for AST nodes.\n */\nexport var Kind = Object.freeze({\n // Name\n NAME: 'Name',\n // Document\n DOCUMENT: 'Document',\n OPERATION_DEFINITION: 'OperationDefinition',\n VARIABLE_DEFINITION: 'VariableDefinition',\n SELECTION_SET: 'SelectionSet',\n FIELD: 'Field',\n ARGUMENT: 'Argument',\n // Fragments\n FRAGMENT_SPREAD: 'FragmentSpread',\n INLINE_FRAGMENT: 'InlineFragment',\n FRAGMENT_DEFINITION: 'FragmentDefinition',\n // Values\n VARIABLE: 'Variable',\n INT: 'IntValue',\n FLOAT: 'FloatValue',\n STRING: 'StringValue',\n BOOLEAN: 'BooleanValue',\n NULL: 'NullValue',\n ENUM: 'EnumValue',\n LIST: 'ListValue',\n OBJECT: 'ObjectValue',\n OBJECT_FIELD: 'ObjectField',\n // Directives\n DIRECTIVE: 'Directive',\n // Types\n NAMED_TYPE: 'NamedType',\n LIST_TYPE: 'ListType',\n NON_NULL_TYPE: 'NonNullType',\n // Type System Definitions\n SCHEMA_DEFINITION: 'SchemaDefinition',\n OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',\n // Type Definitions\n SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',\n OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',\n FIELD_DEFINITION: 'FieldDefinition',\n INPUT_VALUE_DEFINITION: 'InputValueDefinition',\n INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',\n UNION_TYPE_DEFINITION: 'UnionTypeDefinition',\n ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',\n ENUM_VALUE_DEFINITION: 'EnumValueDefinition',\n INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',\n // Directive Definitions\n DIRECTIVE_DEFINITION: 'DirectiveDefinition',\n // Type System Extensions\n SCHEMA_EXTENSION: 'SchemaExtension',\n // Type Extensions\n SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',\n OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',\n INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',\n UNION_TYPE_EXTENSION: 'UnionTypeExtension',\n ENUM_TYPE_EXTENSION: 'EnumTypeExtension',\n INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'\n});\n/**\n * The enum type representing the possible kind values of AST nodes.\n */\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport var TokenKind = Object.freeze({\n SOF: '',\n EOF: '',\n BANG: '!',\n DOLLAR: '$',\n AMP: '&',\n PAREN_L: '(',\n PAREN_R: ')',\n SPREAD: '...',\n COLON: ':',\n EQUALS: '=',\n AT: '@',\n BRACKET_L: '[',\n BRACKET_R: ']',\n BRACE_L: '{',\n PIPE: '|',\n BRACE_R: '}',\n NAME: 'Name',\n INT: 'Int',\n FLOAT: 'Float',\n STRING: 'String',\n BLOCK_STRING: 'BlockString',\n COMMENT: 'Comment'\n});\n/**\n * The enum type representing the token kinds values.\n */\n","export default function devAssert(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */\n// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n// See: https://webpack.js.org/guides/production/\nexport default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n// eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n} : // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (value) {\n var valueClass = value.constructor;\n var className = constructor.name;\n\n if (className && valueClass && valueClass.name === className) {\n throw new Error(\"Cannot use \".concat(className, \" \\\"\").concat(value, \"\\\" from another module or realm.\\n\\nEnsure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory. If different versions of \\\"graphql\\\" are the dependencies of other\\nrelied on modules, use \\\"resolutions\\\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \\\"graphql\\\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.\"));\n }\n }\n\n return false;\n};\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport var Source = /*#__PURE__*/function () {\n function Source(body) {\n var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';\n var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n line: 1,\n column: 1\n };\n typeof body === 'string' || devAssert(0, \"Body must be a string. Received: \".concat(inspect(body), \".\"));\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');\n this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n\n _createClass(Source, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Source';\n }\n }]);\n\n return Source;\n}();\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","/**\n * The set of allowed directive location values.\n */\nexport var DirectiveLocation = Object.freeze({\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n});\n/**\n * The enum type representing the directive location values.\n */\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Token } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"./blockString.mjs\";\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport var Lexer = /*#__PURE__*/function () {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n\n var _proto = Lexer.prototype;\n\n _proto.advance = function advance() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n ;\n\n _proto.lookahead = function lookahead() {\n var token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n var _token$next;\n\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n };\n\n return Lexer;\n}();\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;\n}\n\nfunction printCharCode(code) {\n return (// NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n \"\\\"\\\\u\".concat(('00' + code.toString(16).toUpperCase()).slice(-4), \"\\\"\")\n );\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\n\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // \n\n case 9: // \\t\n\n case 32: // \n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}\n/**\n * Report a message that an unexpected character was encountered.\n */\n\n\nfunction unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?';\n }\n\n return \"Cannot parse the unexpected character \".concat(printCharCode(code), \".\");\n}\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\n\n\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\n\n\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++position);\n\n if (code >= 48 && code <= 57) {\n throw syntaxError(source, position, \"Invalid number, unexpected digit after 0: \".concat(printCharCode(code), \".\"));\n }\n } else {\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n code = body.charCodeAt(++position);\n\n if (code === 43 || code === 45) {\n // + -\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n\n if (code === 46 || isNameStart(code)) {\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n }\n\n return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));\n}\n/**\n * Returns the new position in the source after reading digits.\n */\n\n\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\n return position;\n }\n\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n}\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\n\n\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += body.slice(chunkStart, position);\n return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n ++position;\n\n if (code === 92) {\n // \\\n value += body.slice(chunkStart, position - 1);\n code = body.charCodeAt(position);\n\n switch (code) {\n case 34:\n value += '\"';\n break;\n\n case 47:\n value += '/';\n break;\n\n case 92:\n value += '\\\\';\n break;\n\n case 98:\n value += '\\b';\n break;\n\n case 102:\n value += '\\f';\n break;\n\n case 110:\n value += '\\n';\n break;\n\n case 114:\n value += '\\r';\n break;\n\n case 116:\n value += '\\t';\n break;\n\n case 117:\n {\n // uXXXX\n var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));\n\n if (charCode < 0) {\n var invalidSequence = body.slice(position + 1, position + 5);\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\u\".concat(invalidSequence, \".\"));\n }\n\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n }\n\n default:\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\\".concat(String.fromCharCode(code), \".\"));\n }\n\n ++position;\n chunkStart = position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\n\n\nfunction readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Converts four hexadecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\n\n\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\n\n\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\n\n\nfunction readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z\n\n\nfunction isNameStart(code) {\n return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;\n}\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Kind } from \"./kinds.mjs\";\nimport { Location } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { Source, isSource } from \"./source.mjs\";\nimport { DirectiveLocation } from \"./directiveLocation.mjs\";\nimport { Lexer, isPunctuatorTokenKind } from \"./lexer.mjs\";\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n var parser = new Parser(source, options);\n return parser.parseDocument();\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport var Parser = /*#__PURE__*/function () {\n function Parser(source, options) {\n var sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n\n var _proto = Parser.prototype;\n\n _proto.parseName = function parseName() {\n var token = this.expectToken(TokenKind.NAME);\n return {\n kind: Kind.NAME,\n value: token.value,\n loc: this.loc(token)\n };\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n ;\n\n _proto.parseDocument = function parseDocument() {\n var start = this._lexer.token;\n return {\n kind: Kind.DOCUMENT,\n definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),\n loc: this.loc(start)\n };\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\n ;\n\n _proto.parseDefinition = function parseDefinition() {\n if (this.peek(TokenKind.NAME)) {\n switch (this._lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return this.parseTypeSystemDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n } else if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } else if (this.peekDescription()) {\n return this.parseTypeSystemDefinition();\n }\n\n throw this.unexpected();\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n ;\n\n _proto.parseOperationDefinition = function parseOperationDefinition() {\n var start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n var operation = this.parseOperationType();\n var name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * OperationType : one of query mutation subscription\n */\n ;\n\n _proto.parseOperationType = function parseOperationType() {\n var operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return 'query';\n\n case 'mutation':\n return 'mutation';\n\n case 'subscription':\n return 'subscription';\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n ;\n\n _proto.parseVariableDefinitions = function parseVariableDefinitions() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseVariableDefinition = function parseVariableDefinition() {\n var start = this._lexer.token;\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,\n directives: this.parseDirectives(true),\n loc: this.loc(start)\n };\n }\n /**\n * Variable : $ Name\n */\n ;\n\n _proto.parseVariable = function parseVariable() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n }\n /**\n * SelectionSet : { Selection+ }\n */\n ;\n\n _proto.parseSelectionSet = function parseSelectionSet() {\n var start = this._lexer.token;\n return {\n kind: Kind.SELECTION_SET,\n selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n ;\n\n _proto.parseSelection = function parseSelection() {\n return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n ;\n\n _proto.parseField = function parseField() {\n var start = this._lexer.token;\n var nameOrAlias = this.parseName();\n var alias;\n var name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: Kind.FIELD,\n alias: alias,\n name: name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,\n loc: this.loc(start)\n };\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n ;\n\n _proto.parseArguments = function parseArguments(isConst) {\n var item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseArgument = function parseArgument() {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.ARGUMENT,\n name: name,\n value: this.parseValueLiteral(false),\n loc: this.loc(start)\n };\n };\n\n _proto.parseConstArgument = function parseConstArgument() {\n var start = this._lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: this.parseName(),\n value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n ;\n\n _proto.parseFragment = function parseFragment() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n var hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n ;\n\n _proto.parseFragmentDefinition = function parseFragmentDefinition() {\n var _this$_options;\n\n var start = this._lexer.token;\n this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentName : Name but not `on`\n */\n ;\n\n _proto.parseFragmentName = function parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n ;\n\n _proto.parseValueLiteral = function parseValueLiteral(isConst) {\n var token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this._lexer.advance();\n\n return {\n kind: Kind.INT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.FLOAT:\n this._lexer.advance();\n\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this._lexer.advance();\n\n switch (token.value) {\n case 'true':\n return {\n kind: Kind.BOOLEAN,\n value: true,\n loc: this.loc(token)\n };\n\n case 'false':\n return {\n kind: Kind.BOOLEAN,\n value: false,\n loc: this.loc(token)\n };\n\n case 'null':\n return {\n kind: Kind.NULL,\n loc: this.loc(token)\n };\n\n default:\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: this.loc(token)\n };\n }\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return this.parseVariable();\n }\n\n break;\n }\n\n throw this.unexpected();\n };\n\n _proto.parseStringLiteral = function parseStringLiteral() {\n var token = this._lexer.token;\n\n this._lexer.advance();\n\n return {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n loc: this.loc(token)\n };\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n ;\n\n _proto.parseList = function parseList(isConst) {\n var _this = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this.parseValueLiteral(isConst);\n };\n\n return {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\n ;\n\n _proto.parseObject = function parseObject(isConst) {\n var _this2 = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this2.parseObjectField(isConst);\n };\n\n return {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseObjectField = function parseObjectField(isConst) {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.OBJECT_FIELD,\n name: name,\n value: this.parseValueLiteral(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n ;\n\n _proto.parseDirectives = function parseDirectives(isConst) {\n var directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n /**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\n ;\n\n _proto.parseDirective = function parseDirective(isConst) {\n var start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n ;\n\n _proto.parseTypeReference = function parseTypeReference() {\n var start = this._lexer.token;\n var type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n type = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = {\n kind: Kind.LIST_TYPE,\n type: type,\n loc: this.loc(start)\n };\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return {\n kind: Kind.NON_NULL_TYPE,\n type: type,\n loc: this.loc(start)\n };\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n ;\n\n _proto.parseNamedType = function parseNamedType() {\n var start = this._lexer.token;\n return {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Type Definition section.\n\n /**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n }\n\n throw this.unexpected(keywordToken);\n };\n\n _proto.peekDescription = function peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n ;\n\n _proto.parseDescription = function parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n */\n ;\n\n _proto.parseSchemaDefinition = function parseSchemaDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n return {\n kind: Kind.SCHEMA_DEFINITION,\n description: description,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n ;\n\n _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {\n var start = this._lexer.token;\n var operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n var type = this.parseNamedType();\n return {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n ;\n\n _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n ;\n\n _proto.parseImplementsInterfaces = function parseImplementsInterfaces() {\n var _this$_options2;\n\n if (!this.expectOptionalKeyword('implements')) {\n return [];\n }\n\n if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {\n var types = []; // Optional leading ampersand\n\n this.expectOptionalToken(TokenKind.AMP);\n\n do {\n types.push(this.parseNamedType());\n } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));\n\n return types;\n }\n\n return this.delimitedMany(TokenKind.AMP, this.parseNamedType);\n }\n /**\n * FieldsDefinition : { FieldDefinition+ }\n */\n ;\n\n _proto.parseFieldsDefinition = function parseFieldsDefinition() {\n var _this$_options3;\n\n // Legacy support for the SDL?\n if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {\n this._lexer.advance();\n\n this._lexer.advance();\n\n return [];\n }\n\n return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n ;\n\n _proto.parseFieldDefinition = function parseFieldDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n ;\n\n _proto.parseArgumentDefs = function parseArgumentDefs() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseInputValueDef = function parseInputValueDef() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseValueLiteral(true);\n }\n\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n ;\n\n _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n return {\n kind: Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n ;\n\n _proto.parseUnionMemberTypes = function parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n ;\n\n _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n return {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\n ;\n\n _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\n ;\n\n _proto.parseEnumValueDefinition = function parseEnumValueDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n ;\n\n _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n return {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\n ;\n\n _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemExtension = function parseTypeSystemExtension() {\n var keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n */\n ;\n\n _proto.parseSchemaExtension = function parseSchemaExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCHEMA_EXTENSION,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n ;\n\n _proto.parseScalarTypeExtension = function parseScalarTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n ;\n\n _proto.parseObjectTypeExtension = function parseObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n ;\n\n _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n ;\n\n _proto.parseUnionTypeExtension = function parseUnionTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n ;\n\n _proto.parseEnumTypeExtension = function parseEnumTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n ;\n\n _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n */\n ;\n\n _proto.parseDirectiveDefinition = function parseDirectiveDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n var repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n var locations = this.parseDirectiveLocations();\n return {\n kind: Kind.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n repeatable: repeatable,\n locations: locations,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n ;\n\n _proto.parseDirectiveLocations = function parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n ;\n\n _proto.parseDirectiveLocation = function parseDirectiveLocation() {\n var start = this._lexer.token;\n var name = this.parseName();\n\n if (DirectiveLocation[name.value] !== undefined) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a location object, used to identify the place in the source that created a given parsed object.\n */\n ;\n\n _proto.loc = function loc(startToken) {\n var _this$_options4;\n\n if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {\n return new Location(startToken, this._lexer.lastToken, this._lexer.source);\n }\n }\n /**\n * Determines if the next token is of a given kind\n */\n ;\n\n _proto.peek = function peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectToken = function expectToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n throw syntaxError(this._lexer.source, token.start, \"Expected \".concat(getTokenKindDesc(kind), \", found \").concat(getTokenDesc(token), \".\"));\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and return undefined.\n */\n ;\n\n _proto.expectOptionalToken = function expectOptionalToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n return undefined;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectKeyword = function expectKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n } else {\n throw syntaxError(this._lexer.source, token.start, \"Expected \\\"\".concat(value, \"\\\", found \").concat(getTokenDesc(token), \".\"));\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n ;\n\n _proto.expectOptionalKeyword = function expectOptionalKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n ;\n\n _proto.unexpected = function unexpected(atToken) {\n var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(this._lexer.source, token.start, \"Unexpected \".concat(getTokenDesc(token), \".\"));\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.any = function any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.many = function many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n ;\n\n _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n };\n\n return Parser;\n}();\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n var value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? \" \\\"\".concat(value, \"\\\"\") : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? \"\\\"\".concat(kind, \"\\\"\") : kind;\n}\n","import { __assign } from \"tslib\";\nimport { parse } from 'graphql';\nvar docCache = new Map();\nvar fragmentSourceMap = new Map();\nvar printFragmentWarnings = true;\nvar experimentalFragmentVariables = false;\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\nfunction processFragments(ast) {\n var seenKeys = new Set();\n var definitions = [];\n ast.definitions.forEach(function (fragmentDefinition) {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n var sourceKeySet = fragmentSourceMap.get(fragmentName);\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n }\n else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n sourceKeySet.add(sourceKey);\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n }\n else {\n definitions.push(fragmentDefinition);\n }\n });\n return __assign(__assign({}, ast), { definitions: definitions });\n}\nfunction stripLoc(doc) {\n var workSet = new Set(doc.definitions);\n workSet.forEach(function (node) {\n if (node.loc)\n delete node.loc;\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n var loc = doc.loc;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n return doc;\n}\nfunction parseDocument(source) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n var parsed = parse(source, {\n experimentalFragmentVariables: experimentalFragmentVariables\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(cacheKey, stripLoc(processFragments(parsed)));\n }\n return docCache.get(cacheKey);\n}\nexport function gql(literals) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof literals === 'string') {\n literals = [literals];\n }\n var result = literals[0];\n args.forEach(function (arg, i) {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n }\n else {\n result += arg;\n }\n result += literals[i + 1];\n });\n return parseDocument(result);\n}\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\nvar extras = {\n gql: gql,\n resetCaches: resetCaches,\n disableFragmentWarnings: disableFragmentWarnings,\n enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables: disableExperimentalFragmentVariables\n};\n(function (gql_1) {\n gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;\n})(gql || (gql = {}));\ngql[\"default\"] = gql;\nexport default gql;\n//# sourceMappingURL=index.js.map","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Dialog = void 0;\nvar Dialog_1 = require(\"./Dialog\");\nObject.defineProperty(exports, \"Dialog\", { enumerable: true, get: function () { return Dialog_1.Dialog; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useAssetCount = exports.useViewModeSelection = exports.VIEW_MODES = void 0;\nvar useViewModeSelection_1 = __importStar(require(\"./useViewModeSelection\"));\nexports.useViewModeSelection = useViewModeSelection_1.default;\nObject.defineProperty(exports, \"VIEW_MODES\", { enumerable: true, get: function () { return useViewModeSelection_1.VIEW_MODES; } });\nvar useAssetCount_1 = __importDefault(require(\"./useAssetCount\"));\nexports.useAssetCount = useAssetCount_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uploadDialogVisibleState = void 0;\nvar uploadDialogVisibleState_1 = __importDefault(require(\"./uploadDialogVisibleState\"));\nexports.uploadDialogVisibleState = uploadDialogVisibleState_1.default;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UPLOAD_TYPE = void 0;\nvar recoil_1 = require(\"recoil\");\nvar UPLOAD_TYPE;\n(function (UPLOAD_TYPE) {\n UPLOAD_TYPE[\"new\"] = \"new\";\n UPLOAD_TYPE[\"update\"] = \"update\";\n})(UPLOAD_TYPE = exports.UPLOAD_TYPE || (exports.UPLOAD_TYPE = {}));\nvar uploadDialogVisibleState = recoil_1.atom({\n key: 'uploadDialogState',\n default: {\n visible: false,\n uploadType: UPLOAD_TYPE.new,\n },\n});\nexports.default = uploadDialogVisibleState;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TagSelectBoxAssetCollection = exports.TagSelectBoxAsset = exports.TagSelectBox = exports.TagInspector = exports.MetadataView = exports.IptcMetadataInspector = exports.CollectionSelectBox = exports.AssetCollectionInspector = exports.AssetInspector = void 0;\nvar AssetInspector_1 = __importDefault(require(\"./AssetInspector\"));\nexports.AssetInspector = AssetInspector_1.default;\nvar AssetCollectionInspector_1 = __importDefault(require(\"./AssetCollectionInspector\"));\nexports.AssetCollectionInspector = AssetCollectionInspector_1.default;\nvar IptcMetadataInspector_1 = __importDefault(require(\"./IptcMetadataInspector\"));\nexports.IptcMetadataInspector = IptcMetadataInspector_1.default;\nvar MetadataView_1 = __importDefault(require(\"./MetadataView\"));\nexports.MetadataView = MetadataView_1.default;\nvar TagInspector_1 = __importDefault(require(\"./TagInspector\"));\nexports.TagInspector = TagInspector_1.default;\nvar TagSelectBox_1 = __importDefault(require(\"./TagSelectBox\"));\nexports.TagSelectBox = TagSelectBox_1.default;\nvar TagSelectBoxAsset_1 = __importDefault(require(\"./TagSelectBoxAsset\"));\nexports.TagSelectBoxAsset = TagSelectBoxAsset_1.default;\nvar TagSelectBoxAssetCollection_1 = __importDefault(require(\"./TagSelectBoxAssetCollection\"));\nexports.TagSelectBoxAssetCollection = TagSelectBoxAssetCollection_1.default;\nvar CollectionSelectBox_1 = __importDefault(require(\"./CollectionSelectBox\"));\nexports.CollectionSelectBox = CollectionSelectBox_1.default;\n","import { throwServerError } from \"../utils/index.js\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function parseAndCheckHttpResponse(operations) {\n return function (response) { return response\n .text()\n .then(function (bodyText) {\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n var parseError = err;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n throw parseError;\n }\n })\n .then(function (result) {\n if (response.status >= 300) {\n throwServerError(response, result, \"Response not successful: Received status code \" + response.status);\n }\n if (!Array.isArray(result) &&\n !hasOwnProperty.call(result, 'data') &&\n !hasOwnProperty.call(result, 'errors')) {\n throwServerError(response, result, \"Server response was missing for query '\" + (Array.isArray(operations)\n ? operations.map(function (op) { return op.operationName; })\n : operations.operationName) + \"'.\");\n }\n return result;\n }); };\n}\n//# sourceMappingURL=parseAndCheckHttpResponse.js.map","import { InvariantError } from 'ts-invariant';\nexport var serializeFetchParameter = function (p, label) {\n var serialized;\n try {\n serialized = JSON.stringify(p);\n }\n catch (e) {\n var parseError = process.env.NODE_ENV === \"production\" ? new InvariantError(23) : new InvariantError(\"Network request failed. \" + label + \" is not serializable: \" + e.message);\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n//# sourceMappingURL=serializeFetchParameter.js.map","import { visit } from \"./visitor.mjs\";\nimport { printBlockString } from \"./blockString.mjs\";\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n}\nvar MAX_LINE_LENGTH = 80; // TODO: provide better type coverage in future\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n // Document\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue,\n directives = _ref.directives;\n return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));\n },\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n var prefix = wrap('', alias, ': ') + name;\n var argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n // Fragments\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (// Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n \"fragment \".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), \" \") + \"on \".concat(typeCondition, \" \").concat(wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n // Value\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description' ? '' : ' ') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return value ? 'true' : 'false';\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n // Directive\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n // Type\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n // Type System Definitions\n SchemaDefinition: addDescription(function (_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n }),\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n ScalarTypeDefinition: addDescription(function (_ref22) {\n var name = _ref22.name,\n directives = _ref22.directives;\n return join(['scalar', name, join(directives, ' ')], ' ');\n }),\n ObjectTypeDefinition: addDescription(function (_ref23) {\n var name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n FieldDefinition: addDescription(function (_ref24) {\n var name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' '));\n }),\n InputValueDefinition: addDescription(function (_ref25) {\n var name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');\n }),\n InterfaceTypeDefinition: addDescription(function (_ref26) {\n var name = _ref26.name,\n interfaces = _ref26.interfaces,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n UnionTypeDefinition: addDescription(function (_ref27) {\n var name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n }),\n EnumTypeDefinition: addDescription(function (_ref28) {\n var name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join(['enum', name, join(directives, ' '), block(values)], ' ');\n }),\n EnumValueDefinition: addDescription(function (_ref29) {\n var name = _ref29.name,\n directives = _ref29.directives;\n return join([name, join(directives, ' ')], ' ');\n }),\n InputObjectTypeDefinition: addDescription(function (_ref30) {\n var name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join(['input', name, join(directives, ' '), block(fields)], ' ');\n }),\n DirectiveDefinition: addDescription(function (_ref31) {\n var name = _ref31.name,\n args = _ref31.arguments,\n repeatable = _ref31.repeatable,\n locations = _ref31.locations;\n return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ');\n }),\n SchemaExtension: function SchemaExtension(_ref32) {\n var directives = _ref32.directives,\n operationTypes = _ref32.operationTypes;\n return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n ScalarTypeExtension: function ScalarTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n ObjectTypeExtension: function ObjectTypeExtension(_ref34) {\n var name = _ref34.name,\n interfaces = _ref34.interfaces,\n directives = _ref34.directives,\n fields = _ref34.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {\n var name = _ref35.name,\n interfaces = _ref35.interfaces,\n directives = _ref35.directives,\n fields = _ref35.fields;\n return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n UnionTypeExtension: function UnionTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n types = _ref36.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n EnumTypeExtension: function EnumTypeExtension(_ref37) {\n var name = _ref37.name,\n directives = _ref37.directives,\n values = _ref37.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {\n var name = _ref38.name,\n directives = _ref38.directives,\n fields = _ref38.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n }\n};\n\nfunction addDescription(cb) {\n return function (node) {\n return join([node.description, cb(node)], '\\n');\n };\n}\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\n\nfunction join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\n\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\n\nfunction wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction isMultiline(str) {\n return str.indexOf('\\n') !== -1;\n}\n\nfunction hasMultilineItems(maybeArray) {\n return maybeArray != null && maybeArray.some(isMultiline);\n}\n","import { __assign } from \"tslib\";\nimport { print } from 'graphql';\nvar defaultHttpOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\nvar defaultHeaders = {\n accept: '*/*',\n 'content-type': 'application/json',\n};\nvar defaultOptions = {\n method: 'POST',\n};\nexport var fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\nexport var selectHttpOptionsAndBody = function (operation, fallbackConfig) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n var options = __assign(__assign({}, fallbackConfig.options), { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials });\n var http = fallbackConfig.http || {};\n configs.forEach(function (config) {\n options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), config.headers) });\n if (config.credentials)\n options.credentials = config.credentials;\n http = __assign(__assign({}, http), config.http);\n });\n var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;\n var body = { operationName: operationName, variables: variables };\n if (http.includeExtensions)\n body.extensions = extensions;\n if (http.includeQuery)\n body.query = print(query);\n return {\n options: options,\n body: body,\n };\n};\n//# sourceMappingURL=selectHttpOptionsAndBody.js.map","import { InvariantError } from 'ts-invariant';\nexport var checkFetcher = function (fetcher) {\n if (!fetcher && typeof fetch === 'undefined') {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(22) : new InvariantError(\"\\n\\\"fetch\\\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\\n\\nimport fetch from 'cross-fetch';\\nimport { ApolloClient, HttpLink } from '@apollo/client';\\nconst client = new ApolloClient({\\n link: new HttpLink({ uri: '/graphql', fetch })\\n});\\n \");\n }\n};\n//# sourceMappingURL=checkFetcher.js.map","export var createSignalIfSupported = function () {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n var controller = new AbortController();\n var signal = controller.signal;\n return { controller: controller, signal: signal };\n};\n//# sourceMappingURL=createSignalIfSupported.js.map","export var selectURI = function (operation, fallbackURI) {\n var context = operation.getContext();\n var contextURI = context.uri;\n if (contextURI) {\n return contextURI;\n }\n else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n }\n else {\n return fallbackURI || '/graphql';\n }\n};\n//# sourceMappingURL=selectURI.js.map","import { serializeFetchParameter } from \"./serializeFetchParameter.js\";\nexport function rewriteURIForGET(chosenURI, body) {\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}\n//# sourceMappingURL=rewriteURIForGET.js.map","import { __assign, __rest } from \"tslib\";\nimport { visit } from 'graphql';\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nimport { serializeFetchParameter } from \"./serializeFetchParameter.js\";\nimport { selectURI } from \"./selectURI.js\";\nimport { parseAndCheckHttpResponse } from \"./parseAndCheckHttpResponse.js\";\nimport { checkFetcher } from \"./checkFetcher.js\";\nimport { selectHttpOptionsAndBody, fallbackHttpConfig } from \"./selectHttpOptionsAndBody.js\";\nimport { createSignalIfSupported } from \"./createSignalIfSupported.js\";\nimport { rewriteURIForGET } from \"./rewriteURIForGET.js\";\nimport { fromError } from \"../utils/index.js\";\nexport var createHttpLink = function (linkOptions) {\n if (linkOptions === void 0) { linkOptions = {}; }\n var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, _b = linkOptions.includeUnusedVariables, includeUnusedVariables = _b === void 0 ? false : _b, requestOptions = __rest(linkOptions, [\"uri\", \"fetch\", \"includeExtensions\", \"useGETForQueries\", \"includeUnusedVariables\"]);\n checkFetcher(fetcher);\n if (!fetcher) {\n fetcher = fetch;\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n return new ApolloLink(function (operation) {\n var chosenURI = selectURI(operation, uri);\n var context = operation.getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextHeaders = __assign(__assign({}, clientAwarenessHeaders), context.headers);\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n var _b = selectHttpOptionsAndBody(operation, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;\n if (body.variables && !includeUnusedVariables) {\n var unusedNames_1 = new Set(Object.keys(body.variables));\n visit(operation.query, {\n Variable: function (node, _key, parent) {\n if (parent && parent.kind !== 'VariableDefinition') {\n unusedNames_1.delete(node.name.value);\n }\n },\n });\n if (unusedNames_1.size) {\n body.variables = __assign({}, body.variables);\n unusedNames_1.forEach(function (name) {\n delete body.variables[name];\n });\n }\n }\n var controller;\n if (!options.signal) {\n var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n var definitionIsMutation = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)) {\n options.method = 'GET';\n }\n if (options.method === 'GET') {\n var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError;\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n }\n else {\n try {\n options.body = serializeFetchParameter(body, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n }\n return new Observable(function (observer) {\n fetcher(chosenURI, options)\n .then(function (response) {\n operation.setContext({ response: response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n });\n};\n//# sourceMappingURL=createHttpLink.js.map","import { __extends } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { createHttpLink } from \"./createHttpLink.js\";\nvar HttpLink = (function (_super) {\n __extends(HttpLink, _super);\n function HttpLink(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, createHttpLink(options).request) || this;\n _this.options = options;\n return _this;\n }\n return HttpLink;\n}(ApolloLink));\nexport { HttpLink };\n//# sourceMappingURL=HttpLink.js.map","import { __assign, __rest } from \"tslib\";\nimport { KeyTrie } from 'optimism';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { getFragmentFromSelection, isField, getTypenameFromResult, storeKeyNameFromField, argumentsObjectFromField, isReference, getStoreKeyName, canUseWeakMap, compact, } from \"../../utilities/index.js\";\nimport { hasOwn, fieldNameFromStoreName, storeValueIsStoreObject, selectionSetMatchesResult, TypeOrFieldNameRegExp, } from \"./helpers.js\";\nimport { cacheSlot } from \"./reactiveVars.js\";\nfunction argsFromFieldSpecifier(spec) {\n return spec.args !== void 0 ? spec.args :\n spec.field ? argumentsObjectFromField(spec.field, spec.variables) : null;\n}\nexport var defaultDataIdFromObject = function (_a, context) {\n var __typename = _a.__typename, id = _a.id, _id = _a._id;\n if (typeof __typename === \"string\") {\n if (context) {\n context.keyObject =\n id !== void 0 ? { id: id } :\n _id !== void 0 ? { _id: _id } :\n void 0;\n }\n if (id === void 0)\n id = _id;\n if (id !== void 0) {\n return __typename + \":\" + ((typeof id === \"number\" ||\n typeof id === \"string\") ? id : JSON.stringify(id));\n }\n }\n};\nvar nullKeyFieldsFn = function () { return void 0; };\nvar simpleKeyArgsFn = function (_args, context) { return context.fieldName; };\nvar mergeTrueFn = function (existing, incoming, _a) {\n var mergeObjects = _a.mergeObjects;\n return mergeObjects(existing, incoming);\n};\nvar mergeFalseFn = function (_, incoming) { return incoming; };\nvar Policies = (function () {\n function Policies(config) {\n this.config = config;\n this.typePolicies = Object.create(null);\n this.toBeAdded = Object.create(null);\n this.supertypeMap = new Map();\n this.fuzzySubtypes = new Map();\n this.rootIdsByTypename = Object.create(null);\n this.rootTypenamesById = Object.create(null);\n this.usingPossibleTypes = false;\n this.config = __assign({ dataIdFromObject: defaultDataIdFromObject }, config);\n this.cache = this.config.cache;\n this.setRootTypename(\"Query\");\n this.setRootTypename(\"Mutation\");\n this.setRootTypename(\"Subscription\");\n if (config.possibleTypes) {\n this.addPossibleTypes(config.possibleTypes);\n }\n if (config.typePolicies) {\n this.addTypePolicies(config.typePolicies);\n }\n }\n Policies.prototype.identify = function (object, selectionSet, fragmentMap) {\n var typename = selectionSet && fragmentMap\n ? getTypenameFromResult(object, selectionSet, fragmentMap)\n : object.__typename;\n if (typename === this.rootTypenamesById.ROOT_QUERY) {\n return [\"ROOT_QUERY\"];\n }\n var context = {\n typename: typename,\n selectionSet: selectionSet,\n fragmentMap: fragmentMap,\n };\n var id;\n var policy = typename && this.getTypePolicy(typename);\n var keyFn = policy && policy.keyFn || this.config.dataIdFromObject;\n while (keyFn) {\n var specifierOrId = keyFn(object, context);\n if (Array.isArray(specifierOrId)) {\n keyFn = keyFieldsFnFromSpecifier(specifierOrId);\n }\n else {\n id = specifierOrId;\n break;\n }\n }\n id = id ? String(id) : void 0;\n return context.keyObject ? [id, context.keyObject] : [id];\n };\n Policies.prototype.addTypePolicies = function (typePolicies) {\n var _this = this;\n Object.keys(typePolicies).forEach(function (typename) {\n var _a = typePolicies[typename], queryType = _a.queryType, mutationType = _a.mutationType, subscriptionType = _a.subscriptionType, incoming = __rest(_a, [\"queryType\", \"mutationType\", \"subscriptionType\"]);\n if (queryType)\n _this.setRootTypename(\"Query\", typename);\n if (mutationType)\n _this.setRootTypename(\"Mutation\", typename);\n if (subscriptionType)\n _this.setRootTypename(\"Subscription\", typename);\n if (hasOwn.call(_this.toBeAdded, typename)) {\n _this.toBeAdded[typename].push(incoming);\n }\n else {\n _this.toBeAdded[typename] = [incoming];\n }\n });\n };\n Policies.prototype.updateTypePolicy = function (typename, incoming) {\n var _this = this;\n var existing = this.getTypePolicy(typename);\n var keyFields = incoming.keyFields, fields = incoming.fields;\n function setMerge(existing, merge) {\n existing.merge =\n typeof merge === \"function\" ? merge :\n merge === true ? mergeTrueFn :\n merge === false ? mergeFalseFn :\n existing.merge;\n }\n setMerge(existing, incoming.merge);\n existing.keyFn =\n keyFields === false ? nullKeyFieldsFn :\n Array.isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) :\n typeof keyFields === \"function\" ? keyFields :\n existing.keyFn;\n if (fields) {\n Object.keys(fields).forEach(function (fieldName) {\n var existing = _this.getFieldPolicy(typename, fieldName, true);\n var incoming = fields[fieldName];\n if (typeof incoming === \"function\") {\n existing.read = incoming;\n }\n else {\n var keyArgs = incoming.keyArgs, read = incoming.read, merge = incoming.merge;\n existing.keyFn =\n keyArgs === false ? simpleKeyArgsFn :\n Array.isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs) :\n typeof keyArgs === \"function\" ? keyArgs :\n existing.keyFn;\n if (typeof read === \"function\") {\n existing.read = read;\n }\n setMerge(existing, merge);\n }\n if (existing.read && existing.merge) {\n existing.keyFn = existing.keyFn || simpleKeyArgsFn;\n }\n });\n }\n };\n Policies.prototype.setRootTypename = function (which, typename) {\n if (typename === void 0) { typename = which; }\n var rootId = \"ROOT_\" + which.toUpperCase();\n var old = this.rootTypenamesById[rootId];\n if (typename !== old) {\n process.env.NODE_ENV === \"production\" ? invariant(!old || old === which, 1) : invariant(!old || old === which, \"Cannot change root \" + which + \" __typename more than once\");\n if (old)\n delete this.rootIdsByTypename[old];\n this.rootIdsByTypename[typename] = rootId;\n this.rootTypenamesById[rootId] = typename;\n }\n };\n Policies.prototype.addPossibleTypes = function (possibleTypes) {\n var _this = this;\n this.usingPossibleTypes = true;\n Object.keys(possibleTypes).forEach(function (supertype) {\n _this.getSupertypeSet(supertype, true);\n possibleTypes[supertype].forEach(function (subtype) {\n _this.getSupertypeSet(subtype, true).add(supertype);\n var match = subtype.match(TypeOrFieldNameRegExp);\n if (!match || match[0] !== subtype) {\n _this.fuzzySubtypes.set(subtype, new RegExp(subtype));\n }\n });\n });\n };\n Policies.prototype.getTypePolicy = function (typename) {\n var _this = this;\n if (!hasOwn.call(this.typePolicies, typename)) {\n var policy_1 = this.typePolicies[typename] = Object.create(null);\n policy_1.fields = Object.create(null);\n var supertypes = this.supertypeMap.get(typename);\n if (supertypes && supertypes.size) {\n supertypes.forEach(function (supertype) {\n var _a = _this.getTypePolicy(supertype), fields = _a.fields, rest = __rest(_a, [\"fields\"]);\n Object.assign(policy_1, rest);\n Object.assign(policy_1.fields, fields);\n });\n }\n }\n var inbox = this.toBeAdded[typename];\n if (inbox && inbox.length) {\n this.updateTypePolicy(typename, compact.apply(void 0, inbox.splice(0)));\n }\n return this.typePolicies[typename];\n };\n Policies.prototype.getFieldPolicy = function (typename, fieldName, createIfMissing) {\n if (typename) {\n var fieldPolicies = this.getTypePolicy(typename).fields;\n return fieldPolicies[fieldName] || (createIfMissing && (fieldPolicies[fieldName] = Object.create(null)));\n }\n };\n Policies.prototype.getSupertypeSet = function (subtype, createIfMissing) {\n var supertypeSet = this.supertypeMap.get(subtype);\n if (!supertypeSet && createIfMissing) {\n this.supertypeMap.set(subtype, supertypeSet = new Set());\n }\n return supertypeSet;\n };\n Policies.prototype.fragmentMatches = function (fragment, typename, result, variables) {\n var _this = this;\n if (!fragment.typeCondition)\n return true;\n if (!typename)\n return false;\n var supertype = fragment.typeCondition.name.value;\n if (typename === supertype)\n return true;\n if (this.usingPossibleTypes &&\n this.supertypeMap.has(supertype)) {\n var typenameSupertypeSet = this.getSupertypeSet(typename, true);\n var workQueue_1 = [typenameSupertypeSet];\n var maybeEnqueue_1 = function (subtype) {\n var supertypeSet = _this.getSupertypeSet(subtype, false);\n if (supertypeSet &&\n supertypeSet.size &&\n workQueue_1.indexOf(supertypeSet) < 0) {\n workQueue_1.push(supertypeSet);\n }\n };\n var needToCheckFuzzySubtypes = !!(result && this.fuzzySubtypes.size);\n var checkingFuzzySubtypes = false;\n for (var i = 0; i < workQueue_1.length; ++i) {\n var supertypeSet = workQueue_1[i];\n if (supertypeSet.has(supertype)) {\n if (!typenameSupertypeSet.has(supertype)) {\n if (checkingFuzzySubtypes) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Inferring subtype \" + typename + \" of supertype \" + supertype);\n }\n typenameSupertypeSet.add(supertype);\n }\n return true;\n }\n supertypeSet.forEach(maybeEnqueue_1);\n if (needToCheckFuzzySubtypes &&\n i === workQueue_1.length - 1 &&\n selectionSetMatchesResult(fragment.selectionSet, result, variables)) {\n needToCheckFuzzySubtypes = false;\n checkingFuzzySubtypes = true;\n this.fuzzySubtypes.forEach(function (regExp, fuzzyString) {\n var match = typename.match(regExp);\n if (match && match[0] === typename) {\n maybeEnqueue_1(fuzzyString);\n }\n });\n }\n }\n }\n return false;\n };\n Policies.prototype.hasKeyArgs = function (typename, fieldName) {\n var policy = this.getFieldPolicy(typename, fieldName, false);\n return !!(policy && policy.keyFn);\n };\n Policies.prototype.getStoreFieldName = function (fieldSpec) {\n var typename = fieldSpec.typename, fieldName = fieldSpec.fieldName;\n var policy = this.getFieldPolicy(typename, fieldName, false);\n var storeFieldName;\n var keyFn = policy && policy.keyFn;\n if (keyFn && typename) {\n var context = {\n typename: typename,\n fieldName: fieldName,\n field: fieldSpec.field || null,\n variables: fieldSpec.variables,\n };\n var args = argsFromFieldSpecifier(fieldSpec);\n while (keyFn) {\n var specifierOrString = keyFn(args, context);\n if (Array.isArray(specifierOrString)) {\n keyFn = keyArgsFnFromSpecifier(specifierOrString);\n }\n else {\n storeFieldName = specifierOrString || fieldName;\n break;\n }\n }\n }\n if (storeFieldName === void 0) {\n storeFieldName = fieldSpec.field\n ? storeKeyNameFromField(fieldSpec.field, fieldSpec.variables)\n : getStoreKeyName(fieldName, argsFromFieldSpecifier(fieldSpec));\n }\n if (storeFieldName === false) {\n return fieldName;\n }\n return fieldName === fieldNameFromStoreName(storeFieldName)\n ? storeFieldName\n : fieldName + \":\" + storeFieldName;\n };\n Policies.prototype.readField = function (options, context) {\n var objectOrReference = options.from;\n if (!objectOrReference)\n return;\n var nameOrField = options.field || options.fieldName;\n if (!nameOrField)\n return;\n if (options.typename === void 0) {\n var typename = context.store.getFieldValue(objectOrReference, \"__typename\");\n if (typename)\n options.typename = typename;\n }\n var storeFieldName = this.getStoreFieldName(options);\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var existing = context.store.getFieldValue(objectOrReference, storeFieldName);\n var policy = this.getFieldPolicy(options.typename, fieldName, false);\n var read = policy && policy.read;\n if (read) {\n var readOptions = makeFieldFunctionOptions(this, objectOrReference, options, context, context.store.getStorage(isReference(objectOrReference)\n ? objectOrReference.__ref\n : objectOrReference, storeFieldName));\n return cacheSlot.withValue(this.cache, read, [existing, readOptions]);\n }\n return existing;\n };\n Policies.prototype.getMergeFunction = function (parentTypename, fieldName, childTypename) {\n var policy = this.getFieldPolicy(parentTypename, fieldName, false);\n var merge = policy && policy.merge;\n if (!merge && childTypename) {\n policy = this.getTypePolicy(childTypename);\n merge = policy && policy.merge;\n }\n return merge;\n };\n Policies.prototype.runMergeFunction = function (existing, incoming, _a, context, storage) {\n var field = _a.field, typename = _a.typename, merge = _a.merge;\n if (merge === mergeTrueFn) {\n return makeMergeObjectsFunction(context.store.getFieldValue)(existing, incoming);\n }\n if (merge === mergeFalseFn) {\n return incoming;\n }\n return merge(existing, incoming, makeFieldFunctionOptions(this, void 0, { typename: typename, fieldName: field.name.value, field: field, variables: context.variables }, context, storage || Object.create(null)));\n };\n return Policies;\n}());\nexport { Policies };\nfunction makeFieldFunctionOptions(policies, objectOrReference, fieldSpec, context, storage) {\n var storeFieldName = policies.getStoreFieldName(fieldSpec);\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var variables = fieldSpec.variables || context.variables;\n var _a = context.store, getFieldValue = _a.getFieldValue, toReference = _a.toReference, canRead = _a.canRead;\n return {\n args: argsFromFieldSpecifier(fieldSpec),\n field: fieldSpec.field || null,\n fieldName: fieldName,\n storeFieldName: storeFieldName,\n variables: variables,\n isReference: isReference,\n toReference: toReference,\n storage: storage,\n cache: policies.cache,\n canRead: canRead,\n readField: function (fieldNameOrOptions, from) {\n var options = typeof fieldNameOrOptions === \"string\" ? {\n fieldName: fieldNameOrOptions,\n from: from,\n } : __assign({}, fieldNameOrOptions);\n if (void 0 === options.from) {\n options.from = objectOrReference;\n }\n if (void 0 === options.variables) {\n options.variables = variables;\n }\n return policies.readField(options, context);\n },\n mergeObjects: makeMergeObjectsFunction(getFieldValue),\n };\n}\nfunction makeMergeObjectsFunction(getFieldValue) {\n return function mergeObjects(existing, incoming) {\n if (Array.isArray(existing) || Array.isArray(incoming)) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(2) : new InvariantError(\"Cannot automatically merge arrays\");\n }\n if (existing && typeof existing === \"object\" &&\n incoming && typeof incoming === \"object\") {\n var eType = getFieldValue(existing, \"__typename\");\n var iType = getFieldValue(incoming, \"__typename\");\n var typesDiffer = eType && iType && eType !== iType;\n if (typesDiffer ||\n !storeValueIsStoreObject(existing) ||\n !storeValueIsStoreObject(incoming)) {\n return incoming;\n }\n return __assign(__assign({}, existing), incoming);\n }\n return incoming;\n };\n}\nfunction keyArgsFnFromSpecifier(specifier) {\n return function (args, context) {\n return args ? context.fieldName + \":\" + JSON.stringify(computeKeyObject(args, specifier, false)) : context.fieldName;\n };\n}\nfunction keyFieldsFnFromSpecifier(specifier) {\n var trie = new KeyTrie(canUseWeakMap);\n return function (object, context) {\n var aliasMap;\n if (context.selectionSet && context.fragmentMap) {\n var info = trie.lookupArray([\n context.selectionSet,\n context.fragmentMap,\n ]);\n aliasMap = info.aliasMap || (info.aliasMap = makeAliasMap(context.selectionSet, context.fragmentMap));\n }\n var keyObject = context.keyObject =\n computeKeyObject(object, specifier, true, aliasMap);\n return context.typename + \":\" + JSON.stringify(keyObject);\n };\n}\nfunction makeAliasMap(selectionSet, fragmentMap) {\n var map = Object.create(null);\n var workQueue = new Set([selectionSet]);\n workQueue.forEach(function (selectionSet) {\n selectionSet.selections.forEach(function (selection) {\n if (isField(selection)) {\n if (selection.alias) {\n var responseKey = selection.alias.value;\n var storeKey = selection.name.value;\n if (storeKey !== responseKey) {\n var aliases = map.aliases || (map.aliases = Object.create(null));\n aliases[storeKey] = responseKey;\n }\n }\n if (selection.selectionSet) {\n var subsets = map.subsets || (map.subsets = Object.create(null));\n subsets[selection.name.value] =\n makeAliasMap(selection.selectionSet, fragmentMap);\n }\n }\n else {\n var fragment = getFragmentFromSelection(selection, fragmentMap);\n if (fragment) {\n workQueue.add(fragment.selectionSet);\n }\n }\n });\n });\n return map;\n}\nfunction computeKeyObject(response, specifier, strict, aliasMap) {\n var keyObj = Object.create(null);\n var prevKey;\n specifier.forEach(function (s) {\n if (Array.isArray(s)) {\n if (typeof prevKey === \"string\") {\n var subsets = aliasMap && aliasMap.subsets;\n var subset = subsets && subsets[prevKey];\n keyObj[prevKey] = computeKeyObject(response[prevKey], s, strict, subset);\n }\n }\n else {\n var aliases = aliasMap && aliasMap.aliases;\n var responseName = aliases && aliases[s] || s;\n if (hasOwn.call(response, responseName)) {\n keyObj[prevKey = s] = response[responseName];\n }\n else {\n process.env.NODE_ENV === \"production\" ? invariant(!strict, 3) : invariant(!strict, \"Missing field '\" + responseName + \"' while computing key fields\");\n prevKey = void 0;\n }\n }\n });\n return keyObj;\n}\n//# sourceMappingURL=policies.js.map","// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nvar nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;\nexport default nodejsCustomInspectSymbol;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ASSET_COLLECTION_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"./tag\");\nexports.ASSET_COLLECTION_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment AssetCollectionProps on AssetCollection {\\n id\\n title\\n tags {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n fragment AssetCollectionProps on AssetCollection {\\n id\\n title\\n tags {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assetUpdatedEvent = exports.assetRemovedEvent = exports.assetCreatedEvent = exports.createEvent = void 0;\nvar asset_1 = require(\"./asset\");\nObject.defineProperty(exports, \"assetCreatedEvent\", { enumerable: true, get: function () { return asset_1.assetCreatedEvent; } });\nObject.defineProperty(exports, \"assetUpdatedEvent\", { enumerable: true, get: function () { return asset_1.assetUpdatedEvent; } });\nObject.defineProperty(exports, \"assetRemovedEvent\", { enumerable: true, get: function () { return asset_1.assetRemovedEvent; } });\nvar createEvent_1 = require(\"./createEvent\");\nObject.defineProperty(exports, \"createEvent\", { enumerable: true, get: function () { return createEvent_1.createEvent; } });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.humanFileSize = void 0;\nvar humanFileSize_1 = __importDefault(require(\"./humanFileSize\"));\nexports.humanFileSize = humanFileSize_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetPreview = exports.selectedAssetForPreviewState = void 0;\nvar AssetPreview_1 = __importDefault(require(\"./components/AssetPreview\"));\nexports.AssetPreview = AssetPreview_1.default;\nvar selectedAssetForPreviewState_1 = __importDefault(require(\"./state/selectedAssetForPreviewState\"));\nexports.selectedAssetForPreviewState = selectedAssetForPreviewState_1.default;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().ReactDOM;\n","import { wrap } from 'optimism';\nimport { getFragmentQueryDocument, } from \"../../utilities/index.js\";\nvar ApolloCache = (function () {\n function ApolloCache() {\n this.getFragmentDoc = wrap(getFragmentQueryDocument);\n }\n ApolloCache.prototype.recordOptimisticTransaction = function (transaction, optimisticId) {\n this.performTransaction(transaction, optimisticId);\n };\n ApolloCache.prototype.transformDocument = function (document) {\n return document;\n };\n ApolloCache.prototype.identify = function (object) {\n return;\n };\n ApolloCache.prototype.gc = function () {\n return [];\n };\n ApolloCache.prototype.modify = function (options) {\n return false;\n };\n ApolloCache.prototype.transformForLink = function (document) {\n return document;\n };\n ApolloCache.prototype.readQuery = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = !!options.optimistic; }\n return this.read({\n rootId: options.id || 'ROOT_QUERY',\n query: options.query,\n variables: options.variables,\n returnPartialData: options.returnPartialData,\n optimistic: optimistic,\n });\n };\n ApolloCache.prototype.readFragment = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = !!options.optimistic; }\n return this.read({\n query: this.getFragmentDoc(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n returnPartialData: options.returnPartialData,\n optimistic: optimistic,\n });\n };\n ApolloCache.prototype.writeQuery = function (options) {\n return this.write({\n dataId: options.id || 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n broadcast: options.broadcast,\n });\n };\n ApolloCache.prototype.writeFragment = function (options) {\n return this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: this.getFragmentDoc(options.fragment, options.fragmentName),\n broadcast: options.broadcast,\n });\n };\n return ApolloCache;\n}());\nexport { ApolloCache };\n//# sourceMappingURL=cache.js.map","import { NetworkStatus } from \"./networkStatus.js\";\nimport { compact } from \"../utilities/index.js\";\nimport { invariant } from 'ts-invariant';\nvar Reobserver = (function () {\n function Reobserver(observer, options, fetch, shouldFetch) {\n this.observer = observer;\n this.options = options;\n this.fetch = fetch;\n this.shouldFetch = shouldFetch;\n }\n Reobserver.prototype.reobserve = function (newOptions, newNetworkStatus) {\n if (newOptions) {\n this.updateOptions(newOptions);\n }\n else {\n this.updatePolling();\n }\n var concast = this.fetch(this.options, newNetworkStatus);\n if (this.concast) {\n this.concast.removeObserver(this.observer, true);\n }\n concast.addObserver(this.observer);\n return (this.concast = concast).promise;\n };\n Reobserver.prototype.updateOptions = function (newOptions) {\n Object.assign(this.options, compact(newOptions));\n this.updatePolling();\n return this;\n };\n Reobserver.prototype.stop = function () {\n if (this.concast) {\n this.concast.removeObserver(this.observer);\n delete this.concast;\n }\n if (this.pollingInfo) {\n clearTimeout(this.pollingInfo.timeout);\n this.options.pollInterval = 0;\n this.updatePolling();\n }\n };\n Reobserver.prototype.updatePolling = function () {\n var _this = this;\n var _a = this, pollingInfo = _a.pollingInfo, pollInterval = _a.options.pollInterval;\n if (!pollInterval) {\n if (pollingInfo) {\n clearTimeout(pollingInfo.timeout);\n delete this.pollingInfo;\n }\n return;\n }\n if (pollingInfo &&\n pollingInfo.interval === pollInterval) {\n return;\n }\n process.env.NODE_ENV === \"production\" ? invariant(pollInterval, 20) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.');\n if (this.shouldFetch === false) {\n return;\n }\n var info = pollingInfo || (this.pollingInfo = {});\n info.interval = pollInterval;\n var maybeFetch = function () {\n if (_this.pollingInfo) {\n if (_this.shouldFetch && _this.shouldFetch()) {\n _this.reobserve({\n fetchPolicy: \"network-only\",\n nextFetchPolicy: _this.options.fetchPolicy || \"cache-first\",\n }, NetworkStatus.poll).then(poll, poll);\n }\n else {\n poll();\n }\n }\n ;\n };\n var poll = function () {\n var info = _this.pollingInfo;\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n poll();\n };\n return Reobserver;\n}());\nexport { Reobserver };\n//# sourceMappingURL=Reobserver.js.map","import { __assign, __extends } from \"tslib\";\nimport { invariant } from 'ts-invariant';\nimport { equal } from '@wry/equality';\nimport { NetworkStatus, isNetworkRequestInFlight } from \"./networkStatus.js\";\nimport { cloneDeep, getOperationDefinition, Observable, iterateObserversSafely, isNonEmptyArray, fixObservableSubclass, } from \"../utilities/index.js\";\nimport { Reobserver } from \"./Reobserver.js\";\nvar warnedAboutUpdateQuery = false;\nvar ObservableQuery = (function (_super) {\n __extends(ObservableQuery, _super);\n function ObservableQuery(_a) {\n var queryManager = _a.queryManager, queryInfo = _a.queryInfo, options = _a.options;\n var _this = _super.call(this, function (observer) {\n return _this.onSubscribe(observer);\n }) || this;\n _this.observers = new Set();\n _this.subscriptions = new Set();\n _this.observer = {\n next: function (result) {\n if (_this.lastError || _this.isDifferentFromLastResult(result)) {\n _this.updateLastResult(result);\n iterateObserversSafely(_this.observers, 'next', result);\n }\n },\n error: function (error) {\n _this.updateLastResult(__assign(__assign({}, _this.lastResult), { error: error, errors: error.graphQLErrors, networkStatus: NetworkStatus.error, loading: false }));\n iterateObserversSafely(_this.observers, 'error', _this.lastError = error);\n },\n };\n _this.isTornDown = false;\n _this.options = options;\n _this.queryId = queryManager.generateQueryId();\n var opDef = getOperationDefinition(options.query);\n _this.queryName = opDef && opDef.name && opDef.name.value;\n _this.queryManager = queryManager;\n _this.queryInfo = queryInfo;\n return _this;\n }\n Object.defineProperty(ObservableQuery.prototype, \"variables\", {\n get: function () {\n return this.options.variables;\n },\n enumerable: false,\n configurable: true\n });\n ObservableQuery.prototype.result = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var observer = {\n next: function (result) {\n resolve(result);\n _this.observers.delete(observer);\n if (!_this.observers.size) {\n _this.queryManager.removeQuery(_this.queryId);\n }\n setTimeout(function () {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n var subscription = _this.subscribe(observer);\n });\n };\n ObservableQuery.prototype.getCurrentResult = function (saveAsLastResult) {\n if (saveAsLastResult === void 0) { saveAsLastResult = true; }\n var lastResult = this.lastResult;\n var networkStatus = this.queryInfo.networkStatus ||\n (lastResult && lastResult.networkStatus) ||\n NetworkStatus.ready;\n var result = __assign(__assign({}, lastResult), { loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus });\n if (this.isTornDown) {\n return result;\n }\n var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? 'cache-first' : _a;\n if (fetchPolicy === 'no-cache' ||\n fetchPolicy === 'network-only') {\n delete result.partial;\n }\n else if (!result.data ||\n !this.queryManager.transform(this.options.query).hasForcedResolvers) {\n var diff = this.queryInfo.getDiff();\n result.data = (diff.complete ||\n this.options.returnPartialData) ? diff.result : void 0;\n if (diff.complete) {\n if (result.networkStatus === NetworkStatus.loading &&\n (fetchPolicy === 'cache-first' ||\n fetchPolicy === 'cache-only')) {\n result.networkStatus = NetworkStatus.ready;\n result.loading = false;\n }\n delete result.partial;\n }\n else {\n result.partial = true;\n }\n }\n if (saveAsLastResult) {\n this.updateLastResult(result);\n }\n return result;\n };\n ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) {\n return !equal(this.lastResultSnapshot, newResult);\n };\n ObservableQuery.prototype.getLastResult = function () {\n return this.lastResult;\n };\n ObservableQuery.prototype.getLastError = function () {\n return this.lastError;\n };\n ObservableQuery.prototype.resetLastResults = function () {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n };\n ObservableQuery.prototype.resetQueryStoreErrors = function () {\n this.queryManager.resetErrors(this.queryId);\n };\n ObservableQuery.prototype.refetch = function (variables) {\n var reobserveOptions = {\n pollInterval: 0,\n };\n var fetchPolicy = this.options.fetchPolicy;\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n reobserveOptions.fetchPolicy = 'network-only';\n reobserveOptions.nextFetchPolicy = fetchPolicy || \"cache-first\";\n }\n if (variables && !equal(this.options.variables, variables)) {\n reobserveOptions.variables = this.options.variables = __assign(__assign({}, this.options.variables), variables);\n }\n return this.newReobserver(false).reobserve(reobserveOptions, NetworkStatus.refetch);\n };\n ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) {\n var _this = this;\n var combinedOptions = __assign(__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign(__assign(__assign({}, this.options), fetchMoreOptions), { variables: __assign(__assign({}, this.options.variables), fetchMoreOptions.variables) }))), { fetchPolicy: \"no-cache\" });\n var qid = this.queryManager.generateQueryId();\n if (combinedOptions.notifyOnNetworkStatusChange) {\n this.queryInfo.networkStatus = NetworkStatus.fetchMore;\n this.observe();\n }\n return this.queryManager.fetchQuery(qid, combinedOptions, NetworkStatus.fetchMore).then(function (fetchMoreResult) {\n var data = fetchMoreResult.data;\n var updateQuery = fetchMoreOptions.updateQuery;\n if (updateQuery) {\n if (process.env.NODE_ENV !== \"production\" &&\n !warnedAboutUpdateQuery) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"The updateQuery callback for fetchMore is deprecated, and will be removed\\nin the next major version of Apollo Client.\\n\\nPlease convert updateQuery functions to field policies with appropriate\\nread and merge functions, or use/adapt a helper function (such as\\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\\n@apollo/client/utilities.\\n\\nThe field policy system handles pagination more effectively than a\\nhand-written updateQuery function, and you only need to define the policy\\nonce, rather than every time you call fetchMore.\");\n warnedAboutUpdateQuery = true;\n }\n _this.updateQuery(function (previous) { return updateQuery(previous, {\n fetchMoreResult: data,\n variables: combinedOptions.variables,\n }); });\n }\n else {\n _this.queryManager.cache.writeQuery({\n query: combinedOptions.query,\n variables: combinedOptions.variables,\n data: data,\n });\n }\n return fetchMoreResult;\n }).finally(function () {\n _this.queryManager.stopQuery(qid);\n _this.reobserve();\n });\n };\n ObservableQuery.prototype.subscribeToMore = function (options) {\n var _this = this;\n var subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n context: options.context,\n })\n .subscribe({\n next: function (subscriptionData) {\n var updateQuery = options.updateQuery;\n if (updateQuery) {\n _this.updateQuery(function (previous, _a) {\n var variables = _a.variables;\n return updateQuery(previous, {\n subscriptionData: subscriptionData,\n variables: variables,\n });\n });\n }\n },\n error: function (err) {\n if (options.onError) {\n options.onError(err);\n return;\n }\n process.env.NODE_ENV === \"production\" || invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n this.subscriptions.add(subscription);\n return function () {\n if (_this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n };\n ObservableQuery.prototype.setOptions = function (newOptions) {\n return this.reobserve(newOptions);\n };\n ObservableQuery.prototype.setVariables = function (variables) {\n if (equal(this.variables, variables)) {\n return this.observers.size\n ? this.result()\n : Promise.resolve();\n }\n this.options.variables = variables;\n if (!this.observers.size) {\n return Promise.resolve();\n }\n var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? 'cache-first' : _a;\n var reobserveOptions = {\n fetchPolicy: fetchPolicy,\n variables: variables,\n };\n if (fetchPolicy !== 'cache-first' &&\n fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'network-only') {\n reobserveOptions.fetchPolicy = 'cache-and-network';\n reobserveOptions.nextFetchPolicy = fetchPolicy;\n }\n return this.reobserve(reobserveOptions, NetworkStatus.setVariables);\n };\n ObservableQuery.prototype.updateQuery = function (mapFn) {\n var _a;\n var queryManager = this.queryManager;\n var result = queryManager.cache.diff({\n query: this.options.query,\n variables: this.variables,\n previousResult: (_a = this.lastResult) === null || _a === void 0 ? void 0 : _a.data,\n returnPartialData: true,\n optimistic: false,\n }).result;\n var newResult = mapFn(result, {\n variables: this.variables,\n });\n if (newResult) {\n queryManager.cache.writeQuery({\n query: this.options.query,\n data: newResult,\n variables: this.variables,\n });\n queryManager.broadcastQueries();\n }\n };\n ObservableQuery.prototype.startPolling = function (pollInterval) {\n this.getReobserver().updateOptions({ pollInterval: pollInterval });\n };\n ObservableQuery.prototype.stopPolling = function () {\n if (this.reobserver) {\n this.reobserver.updateOptions({ pollInterval: 0 });\n }\n };\n ObservableQuery.prototype.updateLastResult = function (newResult) {\n var previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n if (!isNonEmptyArray(newResult.errors)) {\n delete this.lastError;\n }\n return previousResult;\n };\n ObservableQuery.prototype.onSubscribe = function (observer) {\n var _this = this;\n if (observer === this.observer) {\n return function () { };\n }\n try {\n var subObserver = observer._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n }\n catch (_a) { }\n var first = !this.observers.size;\n this.observers.add(observer);\n if (this.lastError) {\n observer.error && observer.error(this.lastError);\n }\n else if (this.lastResult) {\n observer.next && observer.next(this.lastResult);\n }\n if (first) {\n this.reobserve().catch(function (_) {\n });\n }\n return function () {\n if (_this.observers.delete(observer) && !_this.observers.size) {\n _this.tearDownQuery();\n }\n };\n };\n ObservableQuery.prototype.getReobserver = function () {\n return this.reobserver || (this.reobserver = this.newReobserver(true));\n };\n ObservableQuery.prototype.newReobserver = function (shareOptions) {\n var _this = this;\n var _a = this, queryManager = _a.queryManager, queryId = _a.queryId;\n queryManager.setObservableQuery(this);\n return new Reobserver(this.observer, shareOptions ? this.options : __assign({}, this.options), function (currentOptions, newNetworkStatus) {\n queryManager.setObservableQuery(_this);\n return queryManager.fetchQueryObservable(queryId, currentOptions, newNetworkStatus);\n }, !queryManager.ssrMode && (function () { return !isNetworkRequestInFlight(_this.queryInfo.networkStatus); }));\n };\n ObservableQuery.prototype.reobserve = function (newOptions, newNetworkStatus) {\n this.isTornDown = false;\n return this.getReobserver().reobserve(newOptions, newNetworkStatus);\n };\n ObservableQuery.prototype.observe = function () {\n this.observer.next(this.getCurrentResult(false));\n };\n ObservableQuery.prototype.hasObservers = function () {\n return this.observers.size > 0;\n };\n ObservableQuery.prototype.tearDownQuery = function () {\n if (this.isTornDown)\n return;\n if (this.reobserver) {\n this.reobserver.stop();\n delete this.reobserver;\n }\n this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });\n this.subscriptions.clear();\n this.queryManager.stopQuery(this.queryId);\n this.observers.clear();\n this.isTornDown = true;\n };\n return ObservableQuery;\n}(Observable));\nexport { ObservableQuery };\nfixObservableSubclass(ObservableQuery);\nfunction defaultSubscriptionObserverErrorCallback(error) {\n process.env.NODE_ENV === \"production\" || invariant.error('Unhandled error', error.message, error.stack);\n}\n//# sourceMappingURL=ObservableQuery.js.map","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable flowtype/no-weak-types */\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\nvar MAX_ARRAY_LENGTH = 10;\nvar MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport default function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (_typeof(value)) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? \"[function \".concat(value.name, \"]\") : '[function]';\n\n case 'object':\n if (value === null) {\n return 'null';\n }\n\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (previouslySeenValues.indexOf(value) !== -1) {\n return '[Circular]';\n }\n\n var seenValues = [].concat(previouslySeenValues, [value]);\n var customInspectFn = getCustomFn(value);\n\n if (customInspectFn !== undefined) {\n var customValue = customInspectFn.call(value); // check for infinite recursion\n\n if (customValue !== value) {\n return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction formatObject(object, seenValues) {\n var keys = Object.keys(object);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n var properties = keys.map(function (key) {\n var value = formatValue(object[key], seenValues);\n return key + ': ' + value;\n });\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n var len = Math.min(MAX_ARRAY_LENGTH, array.length);\n var remaining = array.length - len;\n var items = [];\n\n for (var i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(\"... \".concat(remaining, \" more items\"));\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getCustomFn(object) {\n var customInspectFn = object[String(nodejsCustomInspectSymbol)];\n\n if (typeof customInspectFn === 'function') {\n return customInspectFn;\n }\n\n if (typeof object.inspect === 'function') {\n return object.inspect;\n }\n}\n\nfunction getObjectTag(object) {\n var tag = Object.prototype.toString.call(object).replace(/^\\[object /, '').replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n var name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = getBlockStringIndentation(rawString);\n\n if (commonIndent !== 0) {\n for (var i = 1; i < lines.length; i++) {\n lines[i] = lines[i].slice(commonIndent);\n }\n } // Remove leading and trailing blank lines.\n\n\n var startLine = 0;\n\n while (startLine < lines.length && isBlank(lines[startLine])) {\n ++startLine;\n }\n\n var endLine = lines.length;\n\n while (endLine > startLine && isBlank(lines[endLine - 1])) {\n --endLine;\n } // Return a string of the lines joined with U+000A.\n\n\n return lines.slice(startLine, endLine).join('\\n');\n}\n\nfunction isBlank(str) {\n for (var i = 0; i < str.length; ++i) {\n if (str[i] !== ' ' && str[i] !== '\\t') {\n return false;\n }\n }\n\n return true;\n}\n/**\n * @internal\n */\n\n\nexport function getBlockStringIndentation(value) {\n var _commonIndent;\n\n var isFirstLine = true;\n var isEmptyLine = true;\n var indent = 0;\n var commonIndent = null;\n\n for (var i = 0; i < value.length; ++i) {\n switch (value.charCodeAt(i)) {\n case 13:\n // \\r\n if (value.charCodeAt(i + 1) === 10) {\n ++i; // skip \\r\\n as one symbol\n }\n\n // falls through\n\n case 10:\n // \\n\n isFirstLine = false;\n isEmptyLine = true;\n indent = 0;\n break;\n\n case 9: // \\t\n\n case 32:\n // \n ++indent;\n break;\n\n default:\n if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n }\n\n isEmptyLine = false;\n }\n }\n\n return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value) {\n var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isSingleLine = value.indexOf('\\n') === -1;\n var hasLeadingSpace = value[0] === ' ' || value[0] === '\\t';\n var hasTrailingQuote = value[value.length - 1] === '\"';\n var hasTrailingSlash = value[value.length - 1] === '\\\\';\n var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;\n var result = ''; // Format a multi-line block quote to account for leading space.\n\n if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {\n result += '\\n' + indentation;\n }\n\n result += indentation ? value.replace(/\\n/g, '\\n' + indentation) : value;\n\n if (printAsMultipleLines) {\n result += '\\n';\n }\n\n return '\"\"\"' + result.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"';\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useNotify = exports.useMediaUiTheme = exports.useMediaUi = exports.useIntl = exports.createUseMediaUiStyles = exports.NotifyProvider = exports.MediaUiThemeProvider = exports.MediaUiProvider = exports.IntlProvider = void 0;\nvar Notify_1 = require(\"./Notify\");\nObject.defineProperty(exports, \"NotifyProvider\", { enumerable: true, get: function () { return Notify_1.NotifyProvider; } });\nObject.defineProperty(exports, \"useNotify\", { enumerable: true, get: function () { return Notify_1.useNotify; } });\nvar MediaUiProvider_1 = require(\"./MediaUiProvider\");\nObject.defineProperty(exports, \"MediaUiProvider\", { enumerable: true, get: function () { return MediaUiProvider_1.MediaUiProvider; } });\nObject.defineProperty(exports, \"useMediaUi\", { enumerable: true, get: function () { return MediaUiProvider_1.useMediaUi; } });\nvar Intl_1 = require(\"./Intl\");\nObject.defineProperty(exports, \"IntlProvider\", { enumerable: true, get: function () { return Intl_1.IntlProvider; } });\nObject.defineProperty(exports, \"useIntl\", { enumerable: true, get: function () { return Intl_1.useIntl; } });\nvar MediaUiTheme_1 = require(\"./MediaUiTheme\");\nObject.defineProperty(exports, \"MediaUiThemeProvider\", { enumerable: true, get: function () { return MediaUiTheme_1.MediaUiThemeProvider; } });\nObject.defineProperty(exports, \"useMediaUiTheme\", { enumerable: true, get: function () { return MediaUiTheme_1.useMediaUiTheme; } });\nObject.defineProperty(exports, \"createUseMediaUiStyles\", { enumerable: true, get: function () { return MediaUiTheme_1.createUseMediaUiStyles; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NotifyProvider = exports.useNotify = exports.NotifyContext = void 0;\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nexports.NotifyContext = react_1.createContext(null);\nexports.useNotify = function () { return react_1.useContext(exports.NotifyContext); };\nfunction NotifyProvider(_a) {\n var children = _a.children, notificationApi = _a.notificationApi;\n var error = function (title, message) {\n if (message === void 0) { message = ''; }\n return notificationApi['error'](title, message);\n };\n var warning = function (title, message) {\n if (message === void 0) { message = ''; }\n return notificationApi['warning'](title, message);\n };\n var ok = function (title) { return notificationApi['ok'](title); };\n var info = function (title) { return notificationApi['info'](title); };\n var notice = function (title) { return notificationApi['notice'](title); };\n return React.createElement(exports.NotifyContext.Provider, { value: { notice: notice, error: error, ok: ok, info: info, warning: warning } }, children);\n}\nexports.NotifyProvider = NotifyProvider;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar useSelectedTag = function () {\n var selectedTagId = recoil_1.useRecoilValue(state_1.selectedTagIdState);\n var data = client_1.useQuery(queries_1.TAG, {\n variables: { id: selectedTagId },\n skip: !selectedTagId,\n }).data;\n return (data === null || data === void 0 ? void 0 : data.tag) || null;\n};\nexports.default = useSelectedTag;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedInspectorViewState = recoil_1.atom({\n key: 'selectedInspectorViewState',\n default: null,\n});\nexports.default = selectedInspectorViewState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar useSelectedAssetCollection = function () {\n var selectedAssetCollectionId = recoil_1.useRecoilValue(state_1.selectedAssetCollectionIdState);\n var data = client_1.useQuery(queries_1.ASSET_COLLECTION, {\n variables: { id: selectedAssetCollectionId },\n skip: !selectedAssetCollectionId,\n }).data;\n return (data === null || data === void 0 ? void 0 : data.assetCollection) || null;\n};\nexports.default = useSelectedAssetCollection;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PAGINATION_MAXIMUM_LINKS = exports.ASSETS_PER_PAGE = void 0;\n// TODO: Make configurable via Settings\nexports.ASSETS_PER_PAGE = 20;\nexports.PAGINATION_MAXIMUM_LINKS = 5;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar assetUsageDetailsModalState = recoil_1.atom({\n key: 'assetUsageDetailsModalState',\n default: false,\n});\nexports.default = assetUsageDetailsModalState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar clipboardVisibleState = recoil_1.atom({\n key: 'clipboardState',\n default: false,\n});\nexports.default = clipboardVisibleState;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TOGGLE_CLIPBOARD_STATE = exports.CLIPBOARD = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.CLIPBOARD = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query Clipboard {\\n clipboard @client(always: true)\\n }\\n\"], [\"\\n query Clipboard {\\n clipboard @client(always: true)\\n }\\n\"])));\nexports.TOGGLE_CLIPBOARD_STATE = client_1.gql(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n mutation ToggleClipboardState($assetId: AssetId, $assetSourceId: AssetSourceId, $force: Boolean) {\\n toggleClipboardState(assetId: $assetId, assetSourceId: $assetSourceId, force: $force) @client\\n }\\n\"], [\"\\n mutation ToggleClipboardState($assetId: AssetId, $assetSourceId: AssetSourceId, $force: Boolean) {\\n toggleClipboardState(assetId: $assetId, assetSourceId: $assetSourceId, force: $force) @client\\n }\\n\"])));\nvar templateObject_1, templateObject_2;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar ClipboardQuery_1 = require(\"../queries/ClipboardQuery\");\nfunction useClipboard() {\n var clipboard = client_1.useQuery(ClipboardQuery_1.CLIPBOARD).data.clipboard;\n var mutateClipboard = client_1.useMutation(ClipboardQuery_1.TOGGLE_CLIPBOARD_STATE)[0];\n var inClipboard = react_1.useCallback(function (_a) {\n var assetId = _a.assetId;\n return {}.hasOwnProperty.call(clipboard, assetId);\n }, [clipboard]);\n var toggleClipboardState = react_1.useCallback(function (assetIdentity, force) {\n return mutateClipboard({\n variables: __assign(__assign({}, assetIdentity), { force: force }),\n update: function (cache) {\n var cachedClipboard = cache.readQuery({\n query: ClipboardQuery_1.CLIPBOARD,\n }).clipboard;\n cache.writeFragment({\n id: cache.identify({ __typename: 'Asset', id: assetIdentity.assetId }),\n fragment: client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment UpdatedAsset on Asset {\\n isInClipboard\\n }\\n \"], [\"\\n fragment UpdatedAsset on Asset {\\n isInClipboard\\n }\\n \"]))),\n data: {\n isInClipboard: {}.hasOwnProperty.call(cachedClipboard, assetIdentity.assetId),\n },\n });\n },\n });\n }, [mutateClipboard]);\n var flushClipboard = react_1.useCallback(function () {\n Object.values(clipboard).map(function (assetIdentity) {\n toggleClipboardState(assetIdentity, false);\n });\n }, [clipboard, toggleClipboardState]);\n return { clipboard: clipboard !== null && clipboard !== void 0 ? clipboard : {}, inClipboard: inClipboard, toggleClipboardState: toggleClipboardState, flushClipboard: flushClipboard };\n}\nexports.default = useClipboard;\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar similarAssetsModalState = recoil_1.atom({\n key: 'similarAssetsModalState',\n default: false,\n});\nexports.default = similarAssetsModalState;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UploadSection = exports.UploadDialog = exports.UploadButton = exports.ReplaceAssetDialog = exports.PreviewSection = exports.NewAssetDialog = exports.FilePreview = exports.AssetReplacementButton = void 0;\nvar NewAssetDialog_1 = __importDefault(require(\"./Dialogs/NewAssetDialog\"));\nexports.NewAssetDialog = NewAssetDialog_1.default;\nvar ReplaceAssetDialog_1 = __importDefault(require(\"./Dialogs/ReplaceAssetDialog\"));\nexports.ReplaceAssetDialog = ReplaceAssetDialog_1.default;\nvar UploadDialog_1 = __importDefault(require(\"./Dialogs/UploadDialog\"));\nexports.UploadDialog = UploadDialog_1.default;\nvar FilePreview_1 = __importDefault(require(\"./FilePreview\"));\nexports.FilePreview = FilePreview_1.default;\nvar PreviewSection_1 = __importDefault(require(\"./PreviewSection\"));\nexports.PreviewSection = PreviewSection_1.default;\nvar UploadSection_1 = __importDefault(require(\"./UploadSection\"));\nexports.UploadSection = UploadSection_1.default;\nvar AssetReplacementButton_1 = __importDefault(require(\"./AssetReplacementButton\"));\nexports.AssetReplacementButton = AssetReplacementButton_1.default;\nvar UploadButton_1 = __importDefault(require(\"./UploadButton\"));\nexports.UploadButton = UploadButton_1.default;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_dropzone_1 = require(\"react-dropzone\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar helper_1 = require(\"@media-ui/core/src/helper\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n dropzone: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n padding: theme.spacing.goldenUnit,\n borderWidth: 2,\n borderRadius: 2,\n borderColor: function (_a) {\n var isDragAccept = _a.isDragAccept, isDragActive = _a.isDragActive, isDragReject = _a.isDragReject;\n if (isDragAccept)\n return theme.colors.success;\n if (isDragReject)\n return theme.colors.error;\n if (isDragActive)\n return theme.colors.primary;\n return theme.colors.disabled;\n },\n borderStyle: 'dashed',\n backgroundColor: theme.colors.alternatingBackground,\n color: theme.colors.text,\n outline: 'none',\n cursor: 'pointer',\n userSelect: 'none',\n transition: 'border .24s ease-in-out',\n },\n}); });\nvar UploadSection = function (_a) {\n var acceptedFileTypes = _a.acceptedFileTypes, files = _a.files, loading = _a.loading, maxFiles = _a.maxFiles, onSetFiles = _a.onSetFiles;\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var dummyImage = src_1.useMediaUi().dummyImage;\n var config = hooks_1.useConfigQuery().config;\n var maxFilesToUpload = maxFiles\n ? Math.min(maxFiles, config === null || config === void 0 ? void 0 : config.uploadMaxFileUploadLimit)\n : (config === null || config === void 0 ? void 0 : config.uploadMaxFileUploadLimit) || 1;\n var _b = react_dropzone_1.useDropzone({\n onDrop: function (acceptedFiles) {\n if (acceptedFiles.length === 0)\n return;\n var spotsLeft = maxFilesToUpload - files.length;\n if (acceptedFiles.length > spotsLeft) {\n Notify.error(translate('uploadDialog.warning.maxFiles', \"You can only upload a maximum of {limit} files. {rejected} File(s) rejected\", {\n limit: maxFilesToUpload,\n rejected: acceptedFiles.length - spotsLeft,\n }));\n }\n if (spotsLeft === 0) {\n return;\n }\n var newAcceptedFiles = acceptedFiles.length < spotsLeft ? acceptedFiles : acceptedFiles.slice(0, spotsLeft);\n var newFiles = newAcceptedFiles.map(function (file) {\n // Generate a unique id for the file to prevent errors with duplicate file names\n file.id = file.name + \"-\" + file.size + \"-\" + file.lastModified;\n if (file.type.indexOf('image') === 0) {\n file.preview = URL.createObjectURL(file);\n }\n else {\n // TODO: Find better preview visualisation\n file.preview = dummyImage;\n }\n return file;\n });\n onSetFiles(files.concat(newFiles));\n },\n disabled: loading,\n onDropRejected: function (rejections) {\n rejections.forEach(function (rejection) {\n Notify.warning(translate('uploadDialog.warning.fileRejected', \"The given file cannot be uploaded.\"), rejection.errors.reduce(function (acc, error) { return acc + \" \" + error.message; }, ''));\n });\n },\n maxSize: (config === null || config === void 0 ? void 0 : config.uploadMaxFileSize) || 0,\n maxFiles: maxFilesToUpload,\n multiple: maxFilesToUpload > 1,\n preventDropOnDocument: true,\n accept: acceptedFileTypes,\n }), getRootProps = _b.getRootProps, getInputProps = _b.getInputProps, isDragAccept = _b.isDragAccept, isDragActive = _b.isDragActive, isDragReject = _b.isDragReject;\n var classes = useStyles({ isDragAccept: isDragAccept, isDragActive: isDragActive, isDragReject: isDragReject });\n return (React.createElement(\"section\", null,\n React.createElement(\"div\", __assign({}, getRootProps({ className: classes.dropzone })),\n React.createElement(\"input\", __assign({}, getInputProps())),\n React.createElement(\"p\", null, translate('uploadDialog.dropzone.caption', \"Drag 'n' drop some files here, or click to select files\")),\n (config === null || config === void 0 ? void 0 : config.uploadMaxFileSize) > 0 && (React.createElement(\"p\", null, translate('uploadDialog.maxFileSize', 'Maximum file size is {size} and file limit is {limit}', {\n size: helper_1.humanFileSize(config.uploadMaxFileSize),\n limit: maxFilesToUpload,\n })))),\n loading && React.createElement(\"p\", null, translate('uploadDialog.label.uploading', 'Uploading…'))));\n};\nexports.default = React.memo(UploadSection);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar FilePreview_1 = __importDefault(require(\"./FilePreview\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n fileList: {\n marginTop: theme.spacing.full,\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n fileListHeader: {\n flex: '1 1 100%',\n marginBottom: theme.spacing.full,\n fontSize: theme.fontSize,\n },\n}); });\nvar PreviewSection = function (_a) {\n var files = _a.files, loading = _a.loading, uploadState = _a.uploadState;\n var translate = src_1.useIntl().translate;\n var classes = useStyles();\n // FIXME: Mapping the uploadState to the files name is not the best solution as the same filename might be used multiple times\n return (React.createElement(\"aside\", { className: classes.fileList },\n files.selected.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h4\", { className: classes.fileListHeader }, translate('uploadDialog.fileList.header', 'Selected files')),\n files.selected.map(function (file) { return (React.createElement(FilePreview_1.default, { file: file, loading: loading, fileState: uploadState.find(function (result) { return result.filename === file.name; }), key: file.id })); }))),\n files.rejected.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h4\", { className: classes.fileListHeader }, translate('uploadDialog.fileList.uploadedHeader', 'Failed uploads')),\n files.rejected.map(function (file) { return (React.createElement(FilePreview_1.default, { file: file, fileState: uploadState.find(function (result) { return result.filename === file.name; }), key: file.id })); }))),\n files.finished.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h4\", { className: classes.fileListHeader }, translate('uploadDialog.fileList.uploadedHeader', 'Successful uploads')),\n files.finished.map(function (file) { return (React.createElement(FilePreview_1.default, { file: file, fileState: uploadState.find(function (result) { return result.filename === file.name; }), key: file.id })); })))));\n};\nexports.default = React.memo(PreviewSection);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.REPLACE_ASSET = exports.UPLOAD_FILE = exports.UPLOAD_FILES = void 0;\nvar replaceAsset_1 = __importDefault(require(\"./replaceAsset\"));\nexports.REPLACE_ASSET = replaceAsset_1.default;\nvar uploadFiles_1 = __importDefault(require(\"./uploadFiles\"));\nexports.UPLOAD_FILES = uploadFiles_1.default;\nvar uploadFile_1 = __importDefault(require(\"./uploadFile\"));\nexports.UPLOAD_FILE = uploadFile_1.default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;\n\nvar _exenv = require(\"exenv\");\n\nvar _exenv2 = _interopRequireDefault(_exenv);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar EE = _exenv2.default;\n\nvar SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};\n\nvar SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};\n\nvar SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};\n\nvar canUseDOM = exports.canUseDOM = EE.canUseDOM;\n\nexports.default = SafeHTMLElement;","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles({\n propertyGroup: {},\n});\nvar Property = function (_a) {\n var children = _a.children, label = _a.label;\n var classes = useStyles();\n return (React.createElement(\"div\", { className: classes.propertyGroup },\n React.createElement(react_ui_components_1.Label, null, label),\n children));\n};\nexports.default = Property;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n actions: {\n display: 'flex',\n position: 'sticky',\n backgroundColor: theme.colors.mainBackground,\n bottom: 0,\n '& > *': {\n flex: 1,\n },\n },\n}); });\nvar Actions = function (_a) {\n var hasUnpublishedChanges = _a.hasUnpublishedChanges, handleApply = _a.handleApply, handleDiscard = _a.handleDiscard;\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n return (React.createElement(\"div\", { className: classes.actions },\n React.createElement(react_ui_components_1.Button, { disabled: !hasUnpublishedChanges, size: \"regular\", style: \"lighter\", hoverStyle: \"brand\", onClick: handleDiscard }, translate('inspector.actions.discard', 'Discard')),\n React.createElement(react_ui_components_1.Button, { disabled: !hasUnpublishedChanges, size: \"regular\", style: \"success\", hoverStyle: \"success\", onClick: handleApply }, translate('inspector.actions.apply', 'Apply'))));\n};\nexports.default = Actions;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n inspector: {\n display: 'grid',\n gridTemplateColumns: 'minmax(0, 1fr)',\n gridAutoRows: 'auto',\n gridGap: theme.spacing.full,\n '& input, & textarea': {\n width: '100%',\n },\n },\n}); });\nvar InspectorContainer = function (_a) {\n var children = _a.children;\n var classes = useStyles();\n return React.createElement(\"div\", { className: classes.inspector }, children);\n};\nexports.default = InspectorContainer;\n","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { visit, BREAK, } from 'graphql';\nimport { invariant } from 'ts-invariant';\nimport { argumentsObjectFromField, buildQueryFromSelectionSet, createFragmentMap, getFragmentDefinitions, getMainDefinition, hasDirectives, isField, isInlineFragment, mergeDeep, mergeDeepArray, removeClientSetsFromDocument, resultKeyNameFromField, shouldInclude, } from \"../utilities/index.js\";\nimport { cacheSlot } from \"../cache/index.js\";\nvar LocalState = (function () {\n function LocalState(_a) {\n var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher;\n this.cache = cache;\n if (client) {\n this.client = client;\n }\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n LocalState.prototype.addResolvers = function (resolvers) {\n var _this = this;\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(function (resolverGroup) {\n _this.resolvers = mergeDeep(_this.resolvers, resolverGroup);\n });\n }\n else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n };\n LocalState.prototype.setResolvers = function (resolvers) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n };\n LocalState.prototype.getResolvers = function () {\n return this.resolvers || {};\n };\n LocalState.prototype.runResolvers = function (_a) {\n var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b;\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_c) {\n if (document) {\n return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign(__assign({}, remoteResult), { data: localResult.result })); })];\n }\n return [2, remoteResult];\n });\n });\n };\n LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n };\n LocalState.prototype.getFragmentMatcher = function () {\n return this.fragmentMatcher;\n };\n LocalState.prototype.clientQuery = function (document) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n }\n return null;\n };\n LocalState.prototype.serverQuery = function (document) {\n return removeClientSetsFromDocument(document);\n };\n LocalState.prototype.prepareContext = function (context) {\n var cache = this.cache;\n return __assign(__assign({}, context), { cache: cache,\n getCacheKey: function (obj) {\n return cache.identify(obj);\n } });\n };\n LocalState.prototype.addExportedVariables = function (document, variables, context) {\n if (variables === void 0) { variables = {}; }\n if (context === void 0) { context = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (document) {\n return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (__assign(__assign({}, variables), data.exportedVariables)); })];\n }\n return [2, __assign({}, variables)];\n });\n });\n };\n LocalState.prototype.shouldForceResolvers = function (document) {\n var forceResolvers = false;\n visit(document, {\n Directive: {\n enter: function (node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(function (arg) {\n return arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true;\n });\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n };\n LocalState.prototype.buildRootValueFromCache = function (document, variables) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables: variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n };\n LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) {\n if (context === void 0) { context = {}; }\n if (variables === void 0) { variables = {}; }\n if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; }\n if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; }\n return __awaiter(this, void 0, void 0, function () {\n var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext;\n return __generator(this, function (_b) {\n mainDefinition = getMainDefinition(document);\n fragments = getFragmentDefinitions(document);\n fragmentMap = createFragmentMap(fragments);\n definitionOperation = mainDefinition\n .operation;\n defaultOperationType = definitionOperation\n ? definitionOperation.charAt(0).toUpperCase() +\n definitionOperation.slice(1)\n : 'Query';\n _a = this, cache = _a.cache, client = _a.client;\n execContext = {\n fragmentMap: fragmentMap,\n context: __assign(__assign({}, context), { cache: cache,\n client: client }),\n variables: variables,\n fragmentMatcher: fragmentMatcher,\n defaultOperationType: defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers: onlyRunForcedResolvers,\n };\n return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { return ({\n result: result,\n exportedVariables: execContext.exportedVariables,\n }); })];\n });\n });\n };\n LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) {\n return __awaiter(this, void 0, void 0, function () {\n var fragmentMap, context, variables, resultsToMerge, execute;\n var _this = this;\n return __generator(this, function (_a) {\n fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables;\n resultsToMerge = [rootValue];\n execute = function (selection) { return __awaiter(_this, void 0, void 0, function () {\n var fragment, typeCondition;\n return __generator(this, function (_a) {\n if (!shouldInclude(selection, variables)) {\n return [2];\n }\n if (isField(selection)) {\n return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) {\n var _a;\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push((_a = {},\n _a[resultKeyNameFromField(selection)] = fieldResult,\n _a));\n }\n })];\n }\n if (isInlineFragment(selection)) {\n fragment = selection;\n }\n else {\n fragment = fragmentMap[selection.name.value];\n process.env.NODE_ENV === \"production\" ? invariant(fragment, 11) : invariant(fragment, \"No fragment named \" + selection.name.value);\n }\n if (fragment && fragment.typeCondition) {\n typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) {\n resultsToMerge.push(fragmentResult);\n })];\n }\n }\n return [2];\n });\n }); };\n return [2, Promise.all(selectionSet.selections.map(execute)).then(function () {\n return mergeDeepArray(resultsToMerge);\n })];\n });\n });\n };\n LocalState.prototype.resolveField = function (field, rootValue, execContext) {\n return __awaiter(this, void 0, void 0, function () {\n var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve;\n var _this = this;\n return __generator(this, function (_a) {\n variables = execContext.variables;\n fieldName = field.name.value;\n aliasedFieldName = resultKeyNameFromField(field);\n aliasUsed = fieldName !== aliasedFieldName;\n defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n resultPromise = Promise.resolve(defaultResult);\n if (!execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)) {\n resolverType = rootValue.__typename || execContext.defaultOperationType;\n resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(cacheSlot.withValue(this.cache, resolve, [\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field: field, fragmentMap: execContext.fragmentMap },\n ]));\n }\n }\n }\n return [2, resultPromise.then(function (result) {\n if (result === void 0) { result = defaultResult; }\n if (field.directives) {\n field.directives.forEach(function (directive) {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(function (arg) {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n if (!field.selectionSet) {\n return result;\n }\n if (result == null) {\n return result;\n }\n if (Array.isArray(result)) {\n return _this.resolveSubSelectedArray(field, result, execContext);\n }\n if (field.selectionSet) {\n return _this.resolveSelectionSet(field.selectionSet, result, execContext);\n }\n })];\n });\n });\n };\n LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) {\n var _this = this;\n return Promise.all(result.map(function (item) {\n if (item === null) {\n return null;\n }\n if (Array.isArray(item)) {\n return _this.resolveSubSelectedArray(field, item, execContext);\n }\n if (field.selectionSet) {\n return _this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }));\n };\n return LocalState;\n}());\nexport { LocalState };\n//# sourceMappingURL=LocalState.js.map","import { equal } from \"@wry/equality\";\nimport { isNonEmptyArray, graphQLResultHasError, canUseWeakMap, } from \"../utilities/index.js\";\nimport { NetworkStatus, isNetworkRequestInFlight, } from \"./networkStatus.js\";\nvar destructiveMethodCounts = new (canUseWeakMap ? WeakMap : Map)();\nfunction wrapDestructiveCacheMethod(cache, methodName) {\n var original = cache[methodName];\n if (typeof original === \"function\") {\n cache[methodName] = function () {\n destructiveMethodCounts.set(cache, (destructiveMethodCounts.get(cache) + 1) % 1e15);\n return original.apply(this, arguments);\n };\n }\n}\nfunction cancelNotifyTimeout(info) {\n if (info[\"notifyTimeout\"]) {\n clearTimeout(info[\"notifyTimeout\"]);\n info[\"notifyTimeout\"] = void 0;\n }\n}\nvar QueryInfo = (function () {\n function QueryInfo(cache) {\n this.cache = cache;\n this.listeners = new Set();\n this.document = null;\n this.lastRequestId = 1;\n this.subscriptions = new Set();\n this.stopped = false;\n this.dirty = false;\n this.diff = null;\n this.observableQuery = null;\n if (!destructiveMethodCounts.has(cache)) {\n destructiveMethodCounts.set(cache, 0);\n wrapDestructiveCacheMethod(cache, \"evict\");\n wrapDestructiveCacheMethod(cache, \"modify\");\n wrapDestructiveCacheMethod(cache, \"reset\");\n }\n }\n QueryInfo.prototype.init = function (query) {\n var networkStatus = query.networkStatus || NetworkStatus.loading;\n if (this.variables &&\n this.networkStatus !== NetworkStatus.loading &&\n !equal(this.variables, query.variables)) {\n networkStatus = NetworkStatus.setVariables;\n }\n if (!equal(query.variables, this.variables)) {\n this.diff = null;\n }\n Object.assign(this, {\n document: query.document,\n variables: query.variables,\n networkError: null,\n graphQLErrors: this.graphQLErrors || [],\n networkStatus: networkStatus,\n });\n if (query.observableQuery) {\n this.setObservableQuery(query.observableQuery);\n }\n if (query.lastRequestId) {\n this.lastRequestId = query.lastRequestId;\n }\n return this;\n };\n QueryInfo.prototype.reset = function () {\n cancelNotifyTimeout(this);\n this.diff = null;\n this.dirty = false;\n };\n QueryInfo.prototype.getDiff = function (variables) {\n if (variables === void 0) { variables = this.variables; }\n if (this.diff && equal(variables, this.variables)) {\n return this.diff;\n }\n this.updateWatch(this.variables = variables);\n return this.diff = this.cache.diff({\n query: this.document,\n variables: variables,\n returnPartialData: true,\n optimistic: true,\n });\n };\n QueryInfo.prototype.setDiff = function (diff) {\n var _this = this;\n var oldDiff = this.diff;\n this.diff = diff;\n if (!this.dirty &&\n (diff && diff.result) !== (oldDiff && oldDiff.result)) {\n this.dirty = true;\n if (!this.notifyTimeout) {\n this.notifyTimeout = setTimeout(function () { return _this.notify(); }, 0);\n }\n }\n };\n QueryInfo.prototype.setObservableQuery = function (oq) {\n var _this = this;\n if (oq === this.observableQuery)\n return;\n if (this.oqListener) {\n this.listeners.delete(this.oqListener);\n }\n this.observableQuery = oq;\n if (oq) {\n oq[\"queryInfo\"] = this;\n this.listeners.add(this.oqListener = function () {\n if (_this.getDiff().fromOptimisticTransaction) {\n oq[\"observe\"]();\n }\n else {\n oq.reobserve();\n }\n });\n }\n else {\n delete this.oqListener;\n }\n };\n QueryInfo.prototype.notify = function () {\n var _this = this;\n cancelNotifyTimeout(this);\n if (this.shouldNotify()) {\n this.listeners.forEach(function (listener) { return listener(_this); });\n }\n this.dirty = false;\n };\n QueryInfo.prototype.shouldNotify = function () {\n if (!this.dirty || !this.listeners.size) {\n return false;\n }\n if (isNetworkRequestInFlight(this.networkStatus) &&\n this.observableQuery) {\n var fetchPolicy = this.observableQuery.options.fetchPolicy;\n if (fetchPolicy !== \"cache-only\" &&\n fetchPolicy !== \"cache-and-network\") {\n return false;\n }\n }\n return true;\n };\n QueryInfo.prototype.stop = function () {\n if (!this.stopped) {\n this.stopped = true;\n this.reset();\n this.cancel();\n delete this.cancel;\n this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });\n var oq = this.observableQuery;\n if (oq)\n oq.stopPolling();\n }\n };\n QueryInfo.prototype.cancel = function () { };\n QueryInfo.prototype.updateWatch = function (variables) {\n var _this = this;\n if (variables === void 0) { variables = this.variables; }\n var oq = this.observableQuery;\n if (oq && oq.options.fetchPolicy === \"no-cache\") {\n return;\n }\n if (!this.lastWatch ||\n this.lastWatch.query !== this.document ||\n !equal(variables, this.lastWatch.variables)) {\n this.cancel();\n this.cancel = this.cache.watch(this.lastWatch = {\n query: this.document,\n variables: variables,\n optimistic: true,\n callback: function (diff) { return _this.setDiff(diff); },\n });\n }\n };\n QueryInfo.prototype.shouldWrite = function (result, variables) {\n var lastWrite = this.lastWrite;\n return !(lastWrite &&\n lastWrite.dmCount === destructiveMethodCounts.get(this.cache) &&\n equal(variables, lastWrite.variables) &&\n equal(result.data, lastWrite.result.data));\n };\n QueryInfo.prototype.markResult = function (result, options, allowCacheWrite) {\n var _this = this;\n this.graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n this.reset();\n if (options.fetchPolicy === 'no-cache') {\n this.diff = { result: result.data, complete: true };\n }\n else if (!this.stopped && allowCacheWrite) {\n if (shouldWriteResult(result, options.errorPolicy)) {\n this.cache.performTransaction(function (cache) {\n if (_this.shouldWrite(result, options.variables)) {\n cache.writeQuery({\n query: _this.document,\n data: result.data,\n variables: options.variables,\n });\n _this.lastWrite = {\n result: result,\n variables: options.variables,\n dmCount: destructiveMethodCounts.get(_this.cache),\n };\n }\n else {\n if (_this.diff && _this.diff.complete) {\n result.data = _this.diff.result;\n return;\n }\n }\n var diff = cache.diff({\n query: _this.document,\n variables: options.variables,\n returnPartialData: true,\n optimistic: true,\n });\n if (!_this.stopped) {\n _this.updateWatch(options.variables);\n }\n _this.diff = diff;\n if (diff.complete) {\n result.data = diff.result;\n }\n });\n }\n else {\n this.lastWrite = void 0;\n }\n }\n };\n QueryInfo.prototype.markReady = function () {\n this.networkError = null;\n return this.networkStatus = NetworkStatus.ready;\n };\n QueryInfo.prototype.markError = function (error) {\n this.networkStatus = NetworkStatus.error;\n this.lastWrite = void 0;\n this.reset();\n if (error.graphQLErrors) {\n this.graphQLErrors = error.graphQLErrors;\n }\n if (error.networkError) {\n this.networkError = error.networkError;\n }\n return error;\n };\n return QueryInfo;\n}());\nexport { QueryInfo };\nexport function shouldWriteResult(result, errorPolicy) {\n if (errorPolicy === void 0) { errorPolicy = \"none\"; }\n var ignoreErrors = errorPolicy === \"ignore\" ||\n errorPolicy === \"all\";\n var writeWithErrors = !graphQLResultHasError(result);\n if (!writeWithErrors && ignoreErrors && result.data) {\n writeWithErrors = true;\n }\n return writeWithErrors;\n}\n//# sourceMappingURL=QueryInfo.js.map","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { equal } from '@wry/equality';\nimport { execute } from \"../link/core/index.js\";\nimport { getDefaultValues, getOperationDefinition, getOperationName, hasClientExports, graphQLResultHasError, removeConnectionDirectiveFromDocument, canUseWeakMap, Observable, asyncMap, isNonEmptyArray, Concast, } from \"../utilities/index.js\";\nimport { ApolloError, isApolloError } from \"../errors/index.js\";\nimport { ObservableQuery } from \"./ObservableQuery.js\";\nimport { NetworkStatus, isNetworkRequestInFlight } from \"./networkStatus.js\";\nimport { LocalState } from \"./LocalState.js\";\nimport { QueryInfo, shouldWriteResult } from \"./QueryInfo.js\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar QueryManager = (function () {\n function QueryManager(_a) {\n var cache = _a.cache, link = _a.link, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, onBroadcast = _a.onBroadcast, _c = _a.ssrMode, ssrMode = _c === void 0 ? false : _c, _d = _a.clientAwareness, clientAwareness = _d === void 0 ? {} : _d, localState = _a.localState, assumeImmutableResults = _a.assumeImmutableResults;\n this.clientAwareness = {};\n this.queries = new Map();\n this.fetchCancelFns = new Map();\n this.transformCache = new (canUseWeakMap ? WeakMap : Map)();\n this.queryIdCounter = 1;\n this.requestIdCounter = 1;\n this.mutationIdCounter = 1;\n this.inFlightLinkObservables = new Map();\n this.cache = cache;\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: cache });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n if ((this.onBroadcast = onBroadcast)) {\n this.mutationStore = Object.create(null);\n }\n }\n QueryManager.prototype.stop = function () {\n var _this = this;\n this.queries.forEach(function (_info, queryId) {\n _this.stopQueryNoBroadcast(queryId);\n });\n this.cancelPendingFetches(process.env.NODE_ENV === \"production\" ? new InvariantError(12) : new InvariantError('QueryManager stopped while query was in flight'));\n };\n QueryManager.prototype.cancelPendingFetches = function (error) {\n this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });\n this.fetchCancelFns.clear();\n };\n QueryManager.prototype.mutate = function (_a) {\n var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueries = _a.updateQueries, _b = _a.refetchQueries, refetchQueries = _b === void 0 ? [] : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, updateWithProxyFn = _a.update, _d = _a.errorPolicy, errorPolicy = _d === void 0 ? 'none' : _d, fetchPolicy = _a.fetchPolicy, _e = _a.context, context = _e === void 0 ? {} : _e;\n return __awaiter(this, void 0, void 0, function () {\n var mutationId, mutationStoreValue, self;\n return __generator(this, function (_f) {\n switch (_f.label) {\n case 0:\n process.env.NODE_ENV === \"production\" ? invariant(mutation, 13) : invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.');\n process.env.NODE_ENV === \"production\" ? invariant(!fetchPolicy || fetchPolicy === 'no-cache', 14) : invariant(!fetchPolicy || fetchPolicy === 'no-cache', \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\");\n mutationId = this.generateMutationId();\n mutation = this.transform(mutation).document;\n variables = this.getVariables(mutation, variables);\n if (!this.transform(mutation).hasClientExports) return [3, 2];\n return [4, this.localState.addExportedVariables(mutation, variables, context)];\n case 1:\n variables = _f.sent();\n _f.label = 2;\n case 2:\n mutationStoreValue = this.mutationStore &&\n (this.mutationStore[mutationId] = {\n mutation: mutation,\n variables: variables,\n loading: true,\n error: null,\n });\n if (optimisticResponse) {\n this.markMutationOptimistic(optimisticResponse, {\n mutationId: mutationId,\n document: mutation,\n variables: variables,\n errorPolicy: errorPolicy,\n updateQueries: updateQueries,\n update: updateWithProxyFn,\n });\n }\n this.broadcastQueries();\n self = this;\n return [2, new Promise(function (resolve, reject) {\n var storeResult;\n var error;\n self.getObservableFromLink(mutation, __assign(__assign({}, context), { optimisticResponse: optimisticResponse }), variables, false).subscribe({\n next: function (result) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n if (mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = null;\n }\n if (fetchPolicy !== 'no-cache') {\n try {\n self.markMutationResult({\n mutationId: mutationId,\n result: result,\n document: mutation,\n variables: variables,\n errorPolicy: errorPolicy,\n updateQueries: updateQueries,\n update: updateWithProxyFn,\n });\n }\n catch (e) {\n error = new ApolloError({\n networkError: e,\n });\n return;\n }\n }\n storeResult = result;\n },\n error: function (err) {\n if (mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = err;\n }\n if (optimisticResponse) {\n self.cache.removeOptimistic(mutationId);\n }\n self.broadcastQueries();\n reject(new ApolloError({\n networkError: err,\n }));\n },\n complete: function () {\n if (error && mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = error;\n }\n if (optimisticResponse) {\n self.cache.removeOptimistic(mutationId);\n }\n self.broadcastQueries();\n if (error) {\n reject(error);\n return;\n }\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult);\n }\n var refetchQueryPromises = [];\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(function (refetchQuery) {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(function (_a) {\n var observableQuery = _a.observableQuery;\n if (observableQuery &&\n observableQuery.hasObservers() &&\n observableQuery.queryName === refetchQuery) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n }\n else {\n var queryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () {\n if (errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)) {\n delete storeResult.errors;\n }\n resolve(storeResult);\n }, reject);\n },\n });\n })];\n }\n });\n });\n };\n QueryManager.prototype.markMutationResult = function (mutation, cache) {\n var _this = this;\n if (cache === void 0) { cache = this.cache; }\n if (shouldWriteResult(mutation.result, mutation.errorPolicy)) {\n var cacheWrites_1 = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n var updateQueries_1 = mutation.updateQueries;\n if (updateQueries_1) {\n this.queries.forEach(function (_a, queryId) {\n var observableQuery = _a.observableQuery;\n var queryName = observableQuery && observableQuery.queryName;\n if (!queryName || !hasOwnProperty.call(updateQueries_1, queryName)) {\n return;\n }\n var updater = updateQueries_1[queryName];\n var _b = _this.queries.get(queryId), document = _b.document, variables = _b.variables;\n var _c = cache.diff({\n query: document,\n variables: variables,\n returnPartialData: true,\n optimistic: false,\n }), currentQueryResult = _c.result, complete = _c.complete;\n if (complete && currentQueryResult) {\n var nextQueryResult = updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: document && getOperationName(document) || void 0,\n queryVariables: variables,\n });\n if (nextQueryResult) {\n cacheWrites_1.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n });\n }\n cache.performTransaction(function (c) {\n cacheWrites_1.forEach(function (write) { return c.write(write); });\n var update = mutation.update;\n if (update) {\n update(c, mutation.result);\n }\n }, null);\n }\n };\n QueryManager.prototype.markMutationOptimistic = function (optimisticResponse, mutation) {\n var _this = this;\n var data = typeof optimisticResponse === \"function\"\n ? optimisticResponse(mutation.variables)\n : optimisticResponse;\n return this.cache.recordOptimisticTransaction(function (cache) {\n try {\n _this.markMutationResult(__assign(__assign({}, mutation), { result: { data: data } }), cache);\n }\n catch (error) {\n process.env.NODE_ENV === \"production\" || invariant.error(error);\n }\n }, mutation.mutationId);\n };\n QueryManager.prototype.fetchQuery = function (queryId, options, networkStatus) {\n return this.fetchQueryObservable(queryId, options, networkStatus).promise;\n };\n QueryManager.prototype.getQueryStore = function () {\n var store = Object.create(null);\n this.queries.forEach(function (info, queryId) {\n store[queryId] = {\n variables: info.variables,\n networkStatus: info.networkStatus,\n networkError: info.networkError,\n graphQLErrors: info.graphQLErrors,\n };\n });\n return store;\n };\n QueryManager.prototype.resetErrors = function (queryId) {\n var queryInfo = this.queries.get(queryId);\n if (queryInfo) {\n queryInfo.networkError = undefined;\n queryInfo.graphQLErrors = [];\n }\n };\n QueryManager.prototype.transform = function (document) {\n var transformCache = this.transformCache;\n if (!transformCache.has(document)) {\n var transformed = this.cache.transformDocument(document);\n var forLink = removeConnectionDirectiveFromDocument(this.cache.transformForLink(transformed));\n var clientQuery = this.localState.clientQuery(transformed);\n var serverQuery = forLink && this.localState.serverQuery(forLink);\n var cacheEntry_1 = {\n document: transformed,\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery: clientQuery,\n serverQuery: serverQuery,\n defaultVars: getDefaultValues(getOperationDefinition(transformed)),\n };\n var add = function (doc) {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry_1);\n }\n };\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n return transformCache.get(document);\n };\n QueryManager.prototype.getVariables = function (document, variables) {\n return __assign(__assign({}, this.transform(document).defaultVars), variables);\n };\n QueryManager.prototype.watchQuery = function (options) {\n options = __assign(__assign({}, options), { variables: this.getVariables(options.query, options.variables) });\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n var queryInfo = new QueryInfo(this.cache);\n var observable = new ObservableQuery({\n queryManager: this,\n queryInfo: queryInfo,\n options: options,\n });\n this.queries.set(observable.queryId, queryInfo);\n queryInfo.init({\n document: options.query,\n observableQuery: observable,\n variables: options.variables,\n });\n return observable;\n };\n QueryManager.prototype.query = function (options) {\n var _this = this;\n process.env.NODE_ENV === \"production\" ? invariant(options.query, 15) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.');\n process.env.NODE_ENV === \"production\" ? invariant(options.query.kind === 'Document', 16) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a \"gql\" tag.');\n process.env.NODE_ENV === \"production\" ? invariant(!options.returnPartialData, 17) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.');\n process.env.NODE_ENV === \"production\" ? invariant(!options.pollInterval, 18) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.');\n var queryId = this.generateQueryId();\n return this.fetchQuery(queryId, options).finally(function () { return _this.stopQuery(queryId); });\n };\n QueryManager.prototype.generateQueryId = function () {\n return String(this.queryIdCounter++);\n };\n QueryManager.prototype.generateRequestId = function () {\n return this.requestIdCounter++;\n };\n QueryManager.prototype.generateMutationId = function () {\n return String(this.mutationIdCounter++);\n };\n QueryManager.prototype.stopQueryInStore = function (queryId) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n };\n QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) {\n var queryInfo = this.queries.get(queryId);\n if (queryInfo)\n queryInfo.stop();\n };\n QueryManager.prototype.clearStore = function () {\n this.cancelPendingFetches(process.env.NODE_ENV === \"production\" ? new InvariantError(19) : new InvariantError('Store reset while query was in flight (not completed in link chain)'));\n this.queries.forEach(function (queryInfo) {\n if (queryInfo.observableQuery) {\n queryInfo.networkStatus = NetworkStatus.loading;\n }\n else {\n queryInfo.stop();\n }\n });\n if (this.mutationStore) {\n this.mutationStore = Object.create(null);\n }\n return this.cache.reset();\n };\n QueryManager.prototype.resetStore = function () {\n var _this = this;\n return this.clearStore().then(function () {\n return _this.reFetchObservableQueries();\n });\n };\n QueryManager.prototype.reFetchObservableQueries = function (includeStandby) {\n var _this = this;\n if (includeStandby === void 0) { includeStandby = false; }\n var observableQueryPromises = [];\n this.queries.forEach(function (_a, queryId) {\n var observableQuery = _a.observableQuery;\n if (observableQuery && observableQuery.hasObservers()) {\n var fetchPolicy = observableQuery.options.fetchPolicy;\n observableQuery.resetLastResults();\n if (fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n _this.getQuery(queryId).setDiff(null);\n }\n });\n this.broadcastQueries();\n return Promise.all(observableQueryPromises);\n };\n QueryManager.prototype.setObservableQuery = function (observableQuery) {\n this.getQuery(observableQuery.queryId).setObservableQuery(observableQuery);\n };\n QueryManager.prototype.startGraphQLSubscription = function (_a) {\n var _this = this;\n var query = _a.query, fetchPolicy = _a.fetchPolicy, errorPolicy = _a.errorPolicy, variables = _a.variables, _b = _a.context, context = _b === void 0 ? {} : _b;\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n var makeObservable = function (variables) {\n return _this.getObservableFromLink(query, context, variables, false).map(function (result) {\n if (fetchPolicy !== 'no-cache') {\n if (shouldWriteResult(result, errorPolicy)) {\n _this.cache.write({\n query: query,\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n variables: variables,\n });\n }\n _this.broadcastQueries();\n }\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n return result;\n });\n };\n if (this.transform(query).hasClientExports) {\n var observablePromise_1 = this.localState.addExportedVariables(query, variables, context).then(makeObservable);\n return new Observable(function (observer) {\n var sub = null;\n observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error);\n return function () { return sub && sub.unsubscribe(); };\n });\n }\n return makeObservable(variables);\n };\n QueryManager.prototype.stopQuery = function (queryId) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n };\n QueryManager.prototype.stopQueryNoBroadcast = function (queryId) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n };\n QueryManager.prototype.removeQuery = function (queryId) {\n this.fetchCancelFns.delete(queryId);\n this.getQuery(queryId).stop();\n this.queries.delete(queryId);\n };\n QueryManager.prototype.broadcastQueries = function () {\n if (this.onBroadcast)\n this.onBroadcast();\n this.queries.forEach(function (info) { return info.notify(); });\n };\n QueryManager.prototype.getLocalState = function () {\n return this.localState;\n };\n QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) {\n var _this = this;\n var _a;\n if (deduplication === void 0) { deduplication = (_a = context === null || context === void 0 ? void 0 : context.queryDeduplication) !== null && _a !== void 0 ? _a : this.queryDeduplication; }\n var observable;\n var serverQuery = this.transform(query).serverQuery;\n if (serverQuery) {\n var _b = this, inFlightLinkObservables_1 = _b.inFlightLinkObservables, link = _b.link;\n var operation = {\n query: serverQuery,\n variables: variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext(__assign(__assign({}, context), { forceFetch: !deduplication })),\n };\n context = operation.context;\n if (deduplication) {\n var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map();\n inFlightLinkObservables_1.set(serverQuery, byVariables_1);\n var varJson_1 = JSON.stringify(variables);\n observable = byVariables_1.get(varJson_1);\n if (!observable) {\n var concast = new Concast([\n execute(link, operation)\n ]);\n byVariables_1.set(varJson_1, observable = concast);\n concast.cleanup(function () {\n if (byVariables_1.delete(varJson_1) &&\n byVariables_1.size < 1) {\n inFlightLinkObservables_1.delete(serverQuery);\n }\n });\n }\n }\n else {\n observable = new Concast([\n execute(link, operation)\n ]);\n }\n }\n else {\n observable = new Concast([\n Observable.of({ data: {} })\n ]);\n context = this.prepareContext(context);\n }\n var clientQuery = this.transform(query).clientQuery;\n if (clientQuery) {\n observable = asyncMap(observable, function (result) {\n return _this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context: context,\n variables: variables,\n });\n });\n }\n return observable;\n };\n QueryManager.prototype.getResultsFromLink = function (queryInfo, allowCacheWrite, options) {\n var requestId = queryInfo.lastRequestId = this.generateRequestId();\n return asyncMap(this.getObservableFromLink(queryInfo.document, options.context, options.variables), function (result) {\n var hasErrors = isNonEmptyArray(result.errors);\n if (requestId >= queryInfo.lastRequestId) {\n if (hasErrors && options.errorPolicy === \"none\") {\n throw queryInfo.markError(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n queryInfo.markResult(result, options, allowCacheWrite);\n queryInfo.markReady();\n }\n var aqr = {\n data: result.data,\n loading: false,\n networkStatus: queryInfo.networkStatus || NetworkStatus.ready,\n };\n if (hasErrors && options.errorPolicy !== \"ignore\") {\n aqr.errors = result.errors;\n }\n return aqr;\n }, function (networkError) {\n var error = isApolloError(networkError)\n ? networkError\n : new ApolloError({ networkError: networkError });\n if (requestId >= queryInfo.lastRequestId) {\n queryInfo.markError(error);\n }\n throw error;\n });\n };\n QueryManager.prototype.fetchQueryObservable = function (queryId, options, networkStatus) {\n var _this = this;\n if (networkStatus === void 0) { networkStatus = NetworkStatus.loading; }\n var query = this.transform(options.query).document;\n var variables = this.getVariables(query, options.variables);\n var queryInfo = this.getQuery(queryId);\n var oldNetworkStatus = queryInfo.networkStatus;\n var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? \"cache-first\" : _a, _b = options.errorPolicy, errorPolicy = _b === void 0 ? \"none\" : _b, _c = options.returnPartialData, returnPartialData = _c === void 0 ? false : _c, _d = options.notifyOnNetworkStatusChange, notifyOnNetworkStatusChange = _d === void 0 ? false : _d, _e = options.context, context = _e === void 0 ? {} : _e;\n var mightUseNetwork = fetchPolicy === \"cache-first\" ||\n fetchPolicy === \"cache-and-network\" ||\n fetchPolicy === \"network-only\" ||\n fetchPolicy === \"no-cache\";\n if (mightUseNetwork &&\n notifyOnNetworkStatusChange &&\n typeof oldNetworkStatus === \"number\" &&\n oldNetworkStatus !== networkStatus &&\n isNetworkRequestInFlight(networkStatus)) {\n if (fetchPolicy !== \"cache-first\") {\n fetchPolicy = \"cache-and-network\";\n }\n returnPartialData = true;\n }\n var normalized = Object.assign({}, options, {\n query: query,\n variables: variables,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n returnPartialData: returnPartialData,\n notifyOnNetworkStatusChange: notifyOnNetworkStatusChange,\n context: context,\n });\n var fromVariables = function (variables) {\n normalized.variables = variables;\n return _this.fetchQueryByPolicy(queryInfo, normalized, networkStatus);\n };\n this.fetchCancelFns.set(queryId, function (reason) {\n Promise.resolve().then(function () { return concast.cancel(reason); });\n });\n var concast = new Concast(this.transform(normalized.query).hasClientExports\n ? this.localState.addExportedVariables(normalized.query, normalized.variables, normalized.context).then(fromVariables)\n : fromVariables(normalized.variables));\n concast.cleanup(function () {\n _this.fetchCancelFns.delete(queryId);\n var nextFetchPolicy = options.nextFetchPolicy;\n if (nextFetchPolicy) {\n options.nextFetchPolicy = void 0;\n options.fetchPolicy = typeof nextFetchPolicy === \"function\"\n ? nextFetchPolicy.call(options, options.fetchPolicy || \"cache-first\")\n : nextFetchPolicy;\n }\n });\n return concast;\n };\n QueryManager.prototype.fetchQueryByPolicy = function (queryInfo, options, networkStatus) {\n var _this = this;\n var query = options.query, variables = options.variables, fetchPolicy = options.fetchPolicy, errorPolicy = options.errorPolicy, returnPartialData = options.returnPartialData, context = options.context;\n queryInfo.init({\n document: query,\n variables: variables,\n networkStatus: networkStatus,\n });\n var readCache = function () { return queryInfo.getDiff(variables); };\n var resultsFromCache = function (diff, networkStatus) {\n if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || NetworkStatus.loading; }\n var data = diff.result;\n if (process.env.NODE_ENV !== 'production' &&\n isNonEmptyArray(diff.missing) &&\n !equal(data, {}) &&\n !returnPartialData) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Missing cache result fields: \" + diff.missing.map(function (m) { return m.path.join('.'); }).join(', '), diff.missing);\n }\n var fromData = function (data) { return Observable.of(__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); };\n if (_this.transform(query).hasForcedResolvers) {\n return _this.localState.runResolvers({\n document: query,\n remoteResult: { data: data },\n context: context,\n variables: variables,\n onlyRunForcedResolvers: true,\n }).then(function (resolved) { return fromData(resolved.data); });\n }\n return fromData(data);\n };\n var resultsFromLink = function (allowCacheWrite) {\n return _this.getResultsFromLink(queryInfo, allowCacheWrite, {\n variables: variables,\n context: context,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n });\n };\n switch (fetchPolicy) {\n default:\n case \"cache-first\": {\n var diff = readCache();\n if (diff.complete) {\n return [\n resultsFromCache(diff, queryInfo.markReady()),\n ];\n }\n if (returnPartialData) {\n return [\n resultsFromCache(diff),\n resultsFromLink(true),\n ];\n }\n return [\n resultsFromLink(true),\n ];\n }\n case \"cache-and-network\": {\n var diff = readCache();\n if (diff.complete || returnPartialData) {\n return [\n resultsFromCache(diff),\n resultsFromLink(true),\n ];\n }\n return [\n resultsFromLink(true),\n ];\n }\n case \"cache-only\":\n return [\n resultsFromCache(readCache(), queryInfo.markReady()),\n ];\n case \"network-only\":\n return [resultsFromLink(true)];\n case \"no-cache\":\n return [resultsFromLink(false)];\n case \"standby\":\n return [];\n }\n };\n QueryManager.prototype.getQuery = function (queryId) {\n if (queryId && !this.queries.has(queryId)) {\n this.queries.set(queryId, new QueryInfo(this.cache));\n }\n return this.queries.get(queryId);\n };\n QueryManager.prototype.prepareContext = function (context) {\n if (context === void 0) { context = {}; }\n var newContext = this.localState.prepareContext(context);\n return __assign(__assign({}, newContext), { clientAwareness: this.clientAwareness });\n };\n return QueryManager;\n}());\nexport { QueryManager };\n//# sourceMappingURL=QueryManager.js.map","import { __assign } from \"tslib\";\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { ApolloLink, execute } from \"../link/core/index.js\";\nimport { compact } from \"../utilities/index.js\";\nimport { version } from \"../version.js\";\nimport { HttpLink } from \"../link/http/index.js\";\nimport { QueryManager } from \"./QueryManager.js\";\nimport { LocalState, } from \"./LocalState.js\";\nvar hasSuggestedDevtools = false;\nexport function mergeOptions(defaults, options) {\n return compact(defaults, options, options.variables && {\n variables: __assign(__assign({}, defaults.variables), options.variables),\n });\n}\nvar ApolloClient = (function () {\n function ApolloClient(options) {\n var _this = this;\n this.defaultOptions = {};\n this.resetStoreCallbacks = [];\n this.clearStoreCallbacks = [];\n var uri = options.uri, credentials = options.credentials, headers = options.headers, cache = options.cache, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, _c = options.connectToDevTools, connectToDevTools = _c === void 0 ? typeof window === 'object' &&\n !window.__APOLLO_CLIENT__ &&\n process.env.NODE_ENV !== 'production' : _c, _d = options.queryDeduplication, queryDeduplication = _d === void 0 ? true : _d, defaultOptions = options.defaultOptions, _e = options.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? false : _e, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version;\n var link = options.link;\n if (!link) {\n link = uri\n ? new HttpLink({ uri: uri, credentials: credentials, headers: headers })\n : ApolloLink.empty();\n }\n if (!cache) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(9) : new InvariantError(\"To initialize Apollo Client, you must specify a 'cache' property \" +\n \"in the options object. \\n\" +\n \"For more information, please visit: https://go.apollo.dev/c/docs\");\n }\n this.link = link;\n this.cache = cache;\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n if (ssrForceFetchDelay) {\n setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay);\n }\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n if (connectToDevTools && typeof window === 'object') {\n window.__APOLLO_CLIENT__ = this;\n }\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self &&\n !window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {\n var nav = window.navigator;\n var ua = nav && nav.userAgent;\n var url = void 0;\n if (typeof ua === \"string\") {\n if (ua.indexOf(\"Chrome/\") > -1) {\n url = \"https://chrome.google.com/webstore/detail/\" +\n \"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm\";\n }\n else if (ua.indexOf(\"Firefox/\") > -1) {\n url = \"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/\";\n }\n }\n if (url) {\n invariant.log(\"Download the Apollo DevTools for a better development \" +\n \"experience: \" + url);\n }\n }\n }\n this.version = version;\n this.localState = new LocalState({\n cache: cache,\n client: this,\n resolvers: resolvers,\n fragmentMatcher: fragmentMatcher,\n });\n this.queryManager = new QueryManager({\n cache: this.cache,\n link: this.link,\n queryDeduplication: queryDeduplication,\n ssrMode: ssrMode,\n clientAwareness: {\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n },\n localState: this.localState,\n assumeImmutableResults: assumeImmutableResults,\n onBroadcast: connectToDevTools ? function () {\n if (_this.devToolsHookCb) {\n _this.devToolsHookCb({\n action: {},\n state: {\n queries: _this.queryManager.getQueryStore(),\n mutations: _this.queryManager.mutationStore || {},\n },\n dataWithOptimisticResults: _this.cache.extract(true),\n });\n }\n } : void 0,\n });\n }\n ApolloClient.prototype.stop = function () {\n this.queryManager.stop();\n };\n ApolloClient.prototype.watchQuery = function (options) {\n if (this.defaultOptions.watchQuery) {\n options = mergeOptions(this.defaultOptions.watchQuery, options);\n }\n if (this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')) {\n options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' });\n }\n return this.queryManager.watchQuery(options);\n };\n ApolloClient.prototype.query = function (options) {\n if (this.defaultOptions.query) {\n options = mergeOptions(this.defaultOptions.query, options);\n }\n process.env.NODE_ENV === \"production\" ? invariant(options.fetchPolicy !== 'cache-and-network', 10) : invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.');\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' });\n }\n return this.queryManager.query(options);\n };\n ApolloClient.prototype.mutate = function (options) {\n if (this.defaultOptions.mutate) {\n options = mergeOptions(this.defaultOptions.mutate, options);\n }\n return this.queryManager.mutate(options);\n };\n ApolloClient.prototype.subscribe = function (options) {\n return this.queryManager.startGraphQLSubscription(options);\n };\n ApolloClient.prototype.readQuery = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return this.cache.readQuery(options, optimistic);\n };\n ApolloClient.prototype.readFragment = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return this.cache.readFragment(options, optimistic);\n };\n ApolloClient.prototype.writeQuery = function (options) {\n this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n };\n ApolloClient.prototype.writeFragment = function (options) {\n this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n };\n ApolloClient.prototype.__actionHookForDevTools = function (cb) {\n this.devToolsHookCb = cb;\n };\n ApolloClient.prototype.__requestRaw = function (payload) {\n return execute(this.link, payload);\n };\n ApolloClient.prototype.resetStore = function () {\n var _this = this;\n return Promise.resolve()\n .then(function () { return _this.queryManager.clearStore(); })\n .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); })\n .then(function () { return _this.reFetchObservableQueries(); });\n };\n ApolloClient.prototype.clearStore = function () {\n var _this = this;\n return Promise.resolve()\n .then(function () { return _this.queryManager.clearStore(); })\n .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); });\n };\n ApolloClient.prototype.onResetStore = function (cb) {\n var _this = this;\n this.resetStoreCallbacks.push(cb);\n return function () {\n _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; });\n };\n };\n ApolloClient.prototype.onClearStore = function (cb) {\n var _this = this;\n this.clearStoreCallbacks.push(cb);\n return function () {\n _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; });\n };\n };\n ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n };\n ApolloClient.prototype.extract = function (optimistic) {\n return this.cache.extract(optimistic);\n };\n ApolloClient.prototype.restore = function (serializedState) {\n return this.cache.restore(serializedState);\n };\n ApolloClient.prototype.addResolvers = function (resolvers) {\n this.localState.addResolvers(resolvers);\n };\n ApolloClient.prototype.setResolvers = function (resolvers) {\n this.localState.setResolvers(resolvers);\n };\n ApolloClient.prototype.getResolvers = function () {\n return this.localState.getResolvers();\n };\n ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n };\n ApolloClient.prototype.setLink = function (newLink) {\n this.link = this.queryManager.link = newLink;\n };\n return ApolloClient;\n}());\nexport { ApolloClient };\n//# sourceMappingURL=ApolloClient.js.map","export var version = '3.3.15';\n//# sourceMappingURL=version.js.map","module.exports = require('./lib/Observable.js').Observable;\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar AbstractRegistry_1 = tslib_1.__importDefault(require(\"./AbstractRegistry\"));\nvar positional_array_sorter_1 = tslib_1.__importDefault(require(\"@neos-project/positional-array-sorter\"));\nvar SynchronousRegistry = (function (_super) {\n tslib_1.__extends(SynchronousRegistry, _super);\n function SynchronousRegistry(description) {\n var _this = _super.call(this, description) || this;\n _this._registry = [];\n return _this;\n }\n SynchronousRegistry.prototype.set = function (key, value, position) {\n if (position === void 0) { position = 0; }\n if (typeof key !== 'string') {\n throw new Error('Key must be a string');\n }\n if (typeof position !== 'string' && typeof position !== 'number') {\n throw new Error('Position must be a string or a number');\n }\n var entry = { key: key, value: value };\n if (position) {\n entry.position = position;\n }\n var indexOfItemWithTheSameKey = this._registry.findIndex(function (item) { return item.key === key; });\n if (indexOfItemWithTheSameKey === -1) {\n this._registry.push(entry);\n }\n else {\n this._registry[indexOfItemWithTheSameKey] = entry;\n }\n return value;\n };\n SynchronousRegistry.prototype.get = function (key) {\n if (typeof key !== 'string') {\n console.error('Key must be a string');\n return null;\n }\n var result = this._registry.find(function (item) { return item.key === key; });\n return result ? result.value : null;\n };\n SynchronousRegistry.prototype._getChildrenWrapped = function (searchKey) {\n var unsortedChildren = this._registry.filter(function (item) { return item.key.indexOf(searchKey + '/') === 0; });\n return positional_array_sorter_1[\"default\"](unsortedChildren);\n };\n SynchronousRegistry.prototype.getChildrenAsObject = function (searchKey) {\n var result = {};\n this._getChildrenWrapped(searchKey).forEach(function (item) {\n result[item.key] = item.value;\n });\n return result;\n };\n SynchronousRegistry.prototype.getChildren = function (searchKey) {\n return this._getChildrenWrapped(searchKey).map(function (item) { return item.value; });\n };\n SynchronousRegistry.prototype.has = function (key) {\n if (typeof key !== 'string') {\n console.error('Key must be a string');\n return false;\n }\n return Boolean(this._registry.find(function (item) { return item.key === key; }));\n };\n SynchronousRegistry.prototype._getAllWrapped = function () {\n return positional_array_sorter_1[\"default\"](this._registry);\n };\n SynchronousRegistry.prototype.getAllAsObject = function () {\n var result = {};\n this._getAllWrapped().forEach(function (item) {\n result[item.key] = item.value;\n });\n return result;\n };\n SynchronousRegistry.prototype.getAllAsList = function () {\n return this._getAllWrapped().map(function (item) { return Object.assign({ id: item.key }, item.value); });\n };\n return SynchronousRegistry;\n}(AbstractRegistry_1[\"default\"]));\nexports[\"default\"] = SynchronousRegistry;\n//# sourceMappingURL=SynchronousRegistry.js.map","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","import { ApolloLink } from \"./ApolloLink.js\";\nexport var empty = ApolloLink.empty;\n//# sourceMappingURL=empty.js.map","module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","import { ApolloLink } from \"./ApolloLink.js\";\nexport var from = ApolloLink.from;\n//# sourceMappingURL=from.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var split = ApolloLink.split;\n//# sourceMappingURL=split.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var concat = ApolloLink.concat;\n//# sourceMappingURL=concat.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var execute = ApolloLink.execute;\n//# sourceMappingURL=execute.js.map","export var Cache;\n(function (Cache) {\n})(Cache || (Cache = {}));\n//# sourceMappingURL=Cache.js.map","export { ApolloProvider, ApolloConsumer, getApolloContext, resetApolloContext } from \"./context/index.js\";\nexport * from \"./hooks/index.js\";\nexport { DocumentType, operationName, parser } from \"./parser/index.js\";\nexport * from \"./types/types.js\";\n//# sourceMappingURL=index.js.map","'use strict';\n\nvar ReactNativeFile = require('./ReactNativeFile');\n\nmodule.exports = function isExtractableFile(value) {\n return (\n (typeof File !== 'undefined' && value instanceof File) ||\n (typeof Blob !== 'undefined' && value instanceof Blob) ||\n value instanceof ReactNativeFile\n );\n};\n","'use strict';\n\nmodule.exports = function ReactNativeFile(_ref) {\n var uri = _ref.uri,\n name = _ref.name,\n type = _ref.type;\n this.uri = uri;\n this.name = name;\n this.type = type;\n};\n","'use strict';\n\nmodule.exports = function formDataAppendFile(formData, fieldName, file) {\n formData.append(fieldName, file, file.name);\n};\n","'use strict';\n\nmodule.exports = require('extract-files/public/isExtractableFile');\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ASSET_SOURCE_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.ASSET_SOURCE_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment AssetSourceProps on AssetSource {\\n label\\n id\\n description\\n iconUri\\n readOnly\\n supportsTagging\\n supportsCollections\\n }\\n\"], [\"\\n fragment AssetSourceProps on AssetSource {\\n label\\n id\\n description\\n iconUri\\n readOnly\\n supportsTagging\\n supportsCollections\\n }\\n\"])));\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedAssetIdState = recoil_1.atom({\n key: 'selectedAssetIdState',\n default: null,\n});\nexports.default = selectedAssetIdState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SORT_DIRECTION = exports.SORT_BY = void 0;\nvar recoil_1 = require(\"recoil\");\nvar SORT_BY;\n(function (SORT_BY) {\n SORT_BY[\"Name\"] = \"name\";\n SORT_BY[\"LastModified\"] = \"lastModified\";\n})(SORT_BY = exports.SORT_BY || (exports.SORT_BY = {}));\nvar SORT_DIRECTION;\n(function (SORT_DIRECTION) {\n SORT_DIRECTION[\"Asc\"] = \"ASC\";\n SORT_DIRECTION[\"Desc\"] = \"DESC\";\n})(SORT_DIRECTION = exports.SORT_DIRECTION || (exports.SORT_DIRECTION = {}));\nvar selectedSortOrderState = recoil_1.atom({\n key: 'selectedSortOrderState',\n default: {\n sortBy: SORT_BY.LastModified,\n sortDirection: SORT_DIRECTION.Desc,\n },\n});\nexports.default = selectedSortOrderState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nfunction useAssetQuery(assetIdentity) {\n var _a = client_1.useQuery(queries_1.ASSET, {\n variables: { id: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetId, assetSourceId: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetSourceId },\n skip: !assetIdentity,\n }), data = _a.data, loading = _a.loading, refetch = _a.refetch;\n return { asset: (data === null || data === void 0 ? void 0 : data.asset) || null, loading: loading, refetch: refetch };\n}\nexports.default = useAssetQuery;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createEvent = void 0;\nvar pubsub_js_1 = __importDefault(require(\"pubsub-js\"));\n/**\n * Wraps the used pubsub library and exposes the methods we need\n */\nfunction createEvent(topic) {\n var event = function (payload) {\n event.publish(payload);\n };\n /**\n * Subscribe to the event\n * @returns a token which can be used to unsubscribe\n */\n event.subscribe = function (subscriber) {\n return pubsub_js_1.default.subscribe(topic, subscriber);\n };\n /**\n * Unsubscribe from the event\n * @param subscriber a function which was previously subscribed or a token which was returned by `subscribe`\n */\n event.unsubscribe = function (subscriber) {\n pubsub_js_1.default.unsubscribe(subscriber);\n };\n /**\n * Publish event and call all subscribers with payload\n * @returns true if the event has been published to at least one subscriber\n */\n event.publish = function (payload) {\n return pubsub_js_1.default.publish(topic, payload);\n };\n return event;\n}\nexports.createEvent = createEvent;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersistentStateManager = exports.IdFromObjectResolver = exports.CacheFactory = exports.ApolloErrorHandler = void 0;\nvar PersistentStateManager = __importStar(require(\"./PersistentStateManager\"));\nexports.PersistentStateManager = PersistentStateManager;\nvar IdFromObjectResolver_1 = __importDefault(require(\"./IdFromObjectResolver\"));\nexports.IdFromObjectResolver = IdFromObjectResolver_1.default;\nvar ApolloErrorHandler_1 = __importDefault(require(\"./ApolloErrorHandler\"));\nexports.ApolloErrorHandler = ApolloErrorHandler_1.default;\nvar Cache_1 = __importDefault(require(\"./Cache\"));\nexports.CacheFactory = Cache_1.default;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NEOS_ASSET_SOURCE = void 0;\nexports.NEOS_ASSET_SOURCE = 'neos';\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VIEW_MODE_SELECTION = exports.SET_VIEW_MODE_SELECTION = void 0;\nvar ViewModeSelectionQuery_1 = require(\"./ViewModeSelectionQuery\");\nObject.defineProperty(exports, \"SET_VIEW_MODE_SELECTION\", { enumerable: true, get: function () { return ViewModeSelectionQuery_1.SET_VIEW_MODE_SELECTION; } });\nObject.defineProperty(exports, \"VIEW_MODE_SELECTION\", { enumerable: true, get: function () { return ViewModeSelectionQuery_1.VIEW_MODE_SELECTION; } });\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar usageDetailsGroupFragment_1 = __importDefault(require(\"../fragments/usageDetailsGroupFragment\"));\nvar ASSET_USAGE_DETAILS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_USAGE_DETAILS($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n assetUsageDetails(id: $id, assetSourceId: $assetSourceId) {\\n ...UsageDetailsGroupProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_USAGE_DETAILS($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n assetUsageDetails(id: $id, assetSourceId: $assetSourceId) {\\n ...UsageDetailsGroupProps\\n }\\n }\\n \", \"\\n\"])), usageDetailsGroupFragment_1.default);\nexports.default = ASSET_USAGE_DETAILS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar USAGE_DETAILS_GROUP_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment UsageDetailsGroupProps on UsageDetailsGroup {\\n serviceId\\n label\\n metadataSchema {\\n name\\n label\\n type\\n }\\n usages {\\n label\\n url\\n metadata {\\n name\\n value\\n }\\n }\\n }\\n\"], [\"\\n fragment UsageDetailsGroupProps on UsageDetailsGroup {\\n serviceId\\n label\\n metadataSchema {\\n name\\n label\\n type\\n }\\n usages {\\n label\\n url\\n metadata {\\n name\\n value\\n }\\n }\\n }\\n\"])));\nexports.default = USAGE_DETAILS_GROUP_FRAGMENT;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"@media-ui/core/src/fragments/asset\");\nvar UNUSED_ASSETS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query UNUSED_ASSETS($limit: Int, $offset: Int, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n unusedAssets(limit: $limit, offset: $offset) {\\n ...AssetProps\\n isInUse @include(if: $includeUsage)\\n }\\n }\\n \", \"\\n\"], [\"\\n query UNUSED_ASSETS($limit: Int, $offset: Int, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n unusedAssets(limit: $limit, offset: $offset) {\\n ...AssetProps\\n isInUse @include(if: $includeUsage)\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = UNUSED_ASSETS;\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetUsages_1 = __importDefault(require(\"../queries/assetUsages\"));\nfunction useAssetUsagesQuery(assetIdentity) {\n var _a = client_1.useQuery(assetUsages_1.default, {\n variables: { id: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetId, assetSourceId: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetSourceId },\n skip: !assetIdentity,\n }), data = _a.data, loading = _a.loading;\n return { assetUsageDetails: (data === null || data === void 0 ? void 0 : data.assetUsageDetails) || null, loading: loading };\n}\nexports.default = useAssetUsagesQuery;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar showUnusedAssetsState = recoil_1.atom({\n key: 'showUnusedAssets',\n default: false,\n});\nexports.default = showUnusedAssetsState;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n clipboardItem: {\n cursor: 'pointer',\n minWidth: theme.spacing.goldenUnit,\n width: theme.spacing.goldenUnit,\n height: theme.spacing.goldenUnit,\n '& img': {\n display: 'block',\n width: '100%',\n height: '100%',\n objectFit: 'contain',\n },\n },\n}); });\nvar ClipboardItem = function (_a) {\n var assetIdentity = _a.assetIdentity;\n var asset = hooks_1.useAssetQuery(assetIdentity).asset;\n var dummyImage = src_1.useMediaUi().dummyImage;\n var Notify = src_1.useNotify();\n var classes = useStyles();\n var selectAsset = hooks_1.useSelectAsset();\n var translate = src_1.useIntl().translate;\n var onClick = react_1.useCallback(function () {\n if (assetIdentity) {\n selectAsset(assetIdentity);\n }\n else {\n Notify.warning(translate('clipboard.assetNotLoaded', \"Cannot select asset as it couldn't be loaded\"));\n }\n }, [assetIdentity, selectAsset, Notify, translate]);\n return (React.createElement(\"span\", { onClick: onClick, className: classes.clipboardItem, title: (asset === null || asset === void 0 ? void 0 : asset.isInClipboard) + '' },\n React.createElement(\"img\", { src: (asset === null || asset === void 0 ? void 0 : asset.thumbnailUrl) || dummyImage, alt: (asset === null || asset === void 0 ? void 0 : asset.label) || assetIdentity.assetId, width: 40, height: 36 })));\n};\nexports.default = React.memo(ClipboardItem);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ClipboardQuery_1 = require(\"../queries/ClipboardQuery\");\nvar buildResolvers = function (updateLocalState) {\n return {\n Mutation: {\n toggleClipboardState: function (_, _a, _b) {\n var _c;\n var assetId = _a.assetId, assetSourceId = _a.assetSourceId, force = _a.force;\n var cache = _b.cache;\n var clipboard = cache.readQuery({ query: ClipboardQuery_1.CLIPBOARD }).clipboard;\n if (force !== true && {}.hasOwnProperty.call(clipboard, assetId)) {\n clipboard = Object.values(clipboard).reduce(function (carry, item) {\n if (item.assetId !== assetId) {\n carry[item.assetId] = item;\n }\n return carry;\n }, {});\n }\n else if (force !== false) {\n clipboard = __assign(__assign({}, clipboard), (_c = {}, _c[assetId] = { assetId: assetId, assetSourceId: assetSourceId }, _c));\n }\n updateLocalState({ clipboard: clipboard }, cache);\n return clipboard;\n },\n },\n };\n};\nexports.default = buildResolvers;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetChangeType = void 0;\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar changedAssets_1 = __importDefault(require(\"../queries/changedAssets\"));\nvar AssetChangeType;\n(function (AssetChangeType) {\n AssetChangeType[\"ASSET_CREATED\"] = \"ASSET_CREATED\";\n AssetChangeType[\"ASSET_UPDATED\"] = \"ASSET_UPDATED\";\n AssetChangeType[\"ASSET_REPLACED\"] = \"ASSET_REPLACED\";\n AssetChangeType[\"ASSET_REMOVED\"] = \"ASSET_REMOVED\";\n})(AssetChangeType = exports.AssetChangeType || (exports.AssetChangeType = {}));\n// Check for updates every 5 seconds\nvar pollInterval = 5000;\nvar AssetLastModifiedFragment = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment AssetLastModified on Asset {\\n lastModified\\n }\\n\"], [\"\\n fragment AssetLastModified on Asset {\\n lastModified\\n }\\n\"])));\nfunction useChangedAssetsQuery() {\n var config = hooks_1.useConfigQuery().config;\n var _a = react_1.useState(null), lastUpdate = _a[0], setLastUpdate = _a[1];\n var _b = react_1.useState([]), changes = _b[0], setChanges = _b[1];\n // Query will continue to run on its own and poll the api\n var _c = client_1.useQuery(changedAssets_1.default, {\n variables: { since: lastUpdate !== null && lastUpdate !== void 0 ? lastUpdate : config === null || config === void 0 ? void 0 : config.currentServerTime },\n // TODO: slow down or skip requests when errors occur\n pollInterval: pollInterval,\n skip: !(config === null || config === void 0 ? void 0 : config.currentServerTime),\n }), data = _c.data, client = _c.client;\n // \"onComplete\" in the query options cannot be used, as it's only called once, due to the bug described in https://github.com/apollographql/apollo-client/issues/5531\n react_1.useEffect(function () {\n if (!(data === null || data === void 0 ? void 0 : data.changedAssets))\n return;\n var _a = data.changedAssets, lastModified = _a.lastModified, changes = _a.changes;\n // FIXME: Updating lastModified will immediately trigger another query for changes. Maybe we can't prevent this and rather wait for the next interval.\n if (lastModified)\n setLastUpdate(lastModified);\n var relevantChanges = changes.filter(function (change) {\n // New assets are always relevant and we surely have no previous version in the cache\n if (change.type === AssetChangeType.ASSET_CREATED) {\n return true;\n }\n // Check if we have a cached version of the changed asset\n var data = client.cache.readFragment({\n fragment: AssetLastModifiedFragment,\n id: client.cache.identify({ __typename: 'Asset', id: change.assetId }),\n });\n // Ignore changes to assets we never queried\n if (!data) {\n return false;\n }\n // Ignore changes that are older than our own version\n return data.lastModified < change.lastModified;\n });\n // Prevent triggering an update of the hook if we have zero changes since last time\n setChanges(function (prev) { return (relevantChanges.length === 0 ? prev : relevantChanges); });\n }, [data === null || data === void 0 ? void 0 : data.changedAssets, client]);\n return changes;\n}\nexports.default = useChangedAssetsQuery;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar CHANGED_ASSETS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query CHANGED_ASSETS($since: DateTime = null) {\\n changedAssets(since: $since) {\\n lastModified\\n changes {\\n assetId\\n lastModified\\n type\\n }\\n }\\n }\\n\"], [\"\\n query CHANGED_ASSETS($since: DateTime = null) {\\n changedAssets(since: $since) {\\n lastModified\\n changes {\\n assetId\\n lastModified\\n type\\n }\\n }\\n }\\n\"])));\nexports.default = CHANGED_ASSETS;\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SIMILAR_ASSETS = exports.useSimilarAssetsQuery = exports.SimilarAssetsModal = exports.similarAssetsModalState = exports.SimilarAssetsToggleButton = void 0;\nvar SimilarAssetsToggleButton_1 = __importDefault(require(\"./components/SimilarAssetsToggleButton\"));\nexports.SimilarAssetsToggleButton = SimilarAssetsToggleButton_1.default;\nvar SimilarAssetsModal_1 = __importDefault(require(\"./components/SimilarAssetsModal\"));\nexports.SimilarAssetsModal = SimilarAssetsModal_1.default;\nvar similarAssetsModalState_1 = __importDefault(require(\"./state/similarAssetsModalState\"));\nexports.similarAssetsModalState = similarAssetsModalState_1.default;\nvar useSimilarAssets_1 = __importDefault(require(\"./hooks/useSimilarAssets\"));\nexports.useSimilarAssetsQuery = useSimilarAssets_1.default;\nvar similarAssets_1 = __importDefault(require(\"./queries/similarAssets\"));\nexports.SIMILAR_ASSETS = similarAssets_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar similarAssets_1 = __importDefault(require(\"../queries/similarAssets\"));\nfunction useSimilarAssetsQuery(assetIdentity) {\n var _a = client_1.useQuery(similarAssets_1.default, {\n variables: { id: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetId, assetSourceId: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetSourceId },\n skip: !assetIdentity,\n }), data = _a.data, loading = _a.loading;\n return { similarAssets: (data === null || data === void 0 ? void 0 : data.similarAssets) || null, loading: loading };\n}\nexports.default = useSimilarAssetsQuery;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"@media-ui/core/src/fragments/asset\");\nvar SIMILAR_ASSETS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query SIMILAR_ASSETS($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n similarAssets(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query SIMILAR_ASSETS($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n similarAssets(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = SIMILAR_ASSETS;\nvar templateObject_1;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar components_1 = require(\"@media-ui/core/src/components\");\nvar UploadSection_1 = __importDefault(require(\"../UploadSection\"));\nvar PreviewSection_1 = __importDefault(require(\"../PreviewSection\"));\nvar hooks_1 = require(\"../../hooks\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n uploadArea: {\n padding: theme.spacing.full,\n },\n}); });\nvar NewAssetDialog = function () {\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var _a = hooks_1.useUploadFiles(), uploadFiles = _a.uploadFiles, uploadState = _a.uploadState, loading = _a.loading;\n var _b = hooks_1.useUploadDialogState(), dialogState = _b.state, closeDialog = _b.closeDialog, setFiles = _b.setFiles;\n var refetchAssets = src_1.useMediaUi().refetchAssets;\n var uploadPossible = !loading && dialogState.files.selected.length > 0;\n var classes = useStyles();\n var handleUpload = react_1.useCallback(function () {\n uploadFiles(dialogState.files.selected)\n .then(function (_a) {\n var uploadFiles = _a.data.uploadFiles;\n // FIXME: Mapping the uploadState to the files name is not the best solution as the same filename might be used multiple times\n // Move uploaded or failed files into separate lists\n setFiles(function (prev) {\n return {\n selected: [],\n finished: __spreadArrays(prev.finished, prev.selected.filter(function (file) {\n return uploadFiles.find(function (result) { return result.success && result.filename === file.name; });\n })),\n rejected: __spreadArrays(prev.rejected, prev.selected.filter(function (file) {\n return uploadFiles.find(function (result) { return !result.success && result.filename === file.name; });\n })),\n };\n });\n if (uploadFiles.some(function (result) { return !result.success; })) {\n Notify.warning(translate('uploadDialog.uploadFinishedWithErrors', 'Some files could not be uploaded'));\n }\n else {\n Notify.ok(translate('uploadDialog.uploadFinished', 'Upload finished'));\n }\n // Refresh list of files if any file was uploaded\n if (uploadFiles.some(function (result) { return result.success; })) {\n refetchAssets();\n }\n })\n .catch(function (error) {\n Notify.error(translate('fileUpload.error', 'Upload failed'), error);\n });\n }, [uploadFiles, dialogState.files.selected, setFiles, Notify, translate, refetchAssets]);\n var handleSetFiles = react_1.useCallback(function (files) {\n setFiles(function (prev) {\n return __assign(__assign({}, prev), { selected: files });\n });\n }, [setFiles]);\n return (React.createElement(components_1.Dialog, { isOpen: dialogState.visible, title: translate('uploadDialog.title', 'Upload assets'), onRequestClose: closeDialog, actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: closeDialog }, uploadState\n ? translate('uploadDialog.close', 'Close')\n : translate('uploadDialog.cancel', 'Cancel')),\n React.createElement(react_ui_components_1.Button, { key: \"upload\", style: \"success\", hoverStyle: \"success\", disabled: !uploadPossible, onClick: handleUpload }, translate('uploadDialog.upload', 'Upload')),\n ], style: \"wide\" },\n React.createElement(\"section\", { className: classes.uploadArea },\n React.createElement(UploadSection_1.default, { files: dialogState.files.selected, loading: loading, onSetFiles: handleSetFiles }),\n React.createElement(PreviewSection_1.default, { files: dialogState.files, loading: loading, uploadState: uploadState }))));\n};\nexports.default = React.memo(NewAssetDialog);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n fileList: {\n marginTop: theme.spacing.full,\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n fileListHeader: {\n flex: '1 1 100%',\n marginBottom: theme.spacing.full,\n fontSize: theme.fontSize,\n },\n thumb: {\n display: 'inline-flex',\n borderRadius: 2,\n border: '1px solid #eaeaea',\n marginBottom: theme.spacing.half,\n marginRight: theme.spacing.half,\n width: 100,\n height: 100,\n padding: theme.spacing.quarter,\n boxSizing: 'border-box',\n },\n thumbInner: {\n position: 'relative',\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '& span': {\n marginLeft: theme.spacing.half,\n userSelect: 'none',\n },\n },\n img: {\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n left: 0,\n top: 0,\n zIndex: -1,\n },\n stateOverlay: {\n position: 'absolute',\n content: '\"\"',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n backgroundColor: theme.colors.alternatingBackground,\n opacity: 0.3,\n zIndex: -1,\n },\n loading: {\n borderColor: theme.colors.border,\n '& $thumbInner:after': {\n extend: 'stateOverlay',\n },\n },\n success: {\n borderColor: theme.colors.success,\n '& $thumbInner:after': {\n extend: 'stateOverlay',\n backgroundColor: theme.colors.success,\n },\n },\n error: {\n borderColor: theme.colors.error,\n '& $thumbInner:after': {\n extend: 'stateOverlay',\n backgroundColor: theme.colors.error,\n },\n },\n warning: {\n color: theme.colors.warn,\n },\n}); });\nvar FilePreview = function (_a) {\n var file = _a.file, _b = _a.loading, loading = _b === void 0 ? false : _b, fileState = _a.fileState;\n var classes = useStyles();\n var success = fileState === null || fileState === void 0 ? void 0 : fileState.success;\n var error = fileState && !success;\n var stateClassName;\n if (error)\n stateClassName = classes.error;\n else if (success)\n stateClassName = classes.success;\n else if (loading)\n stateClassName = classes.loading;\n // TODO: Output helpful localised messages for results 'EXISTS', 'ADDED', 'ERROR'\n return (React.createElement(\"div\", { className: [classes.thumb, stateClassName].join(' '), title: file.name },\n React.createElement(\"div\", { className: classes.thumbInner },\n React.createElement(\"img\", { src: file.preview, alt: file.name, className: classes.img }),\n loading && React.createElement(react_ui_components_1.Icon, { icon: \"spinner\", spin: true }),\n success && React.createElement(react_ui_components_1.Icon, { icon: \"check\" }),\n error && React.createElement(react_ui_components_1.Icon, { icon: \"exclamation-circle\" }),\n (fileState === null || fileState === void 0 ? void 0 : fileState.result) && React.createElement(\"span\", null, fileState.result))));\n};\nexports.default = React.memo(FilePreview);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useUploadFile = exports.useUploadFiles = exports.useUploadDialogState = void 0;\nvar useUploadDialogState_1 = __importDefault(require(\"./useUploadDialogState\"));\nexports.useUploadDialogState = useUploadDialogState_1.default;\nvar useUploadFile_1 = __importDefault(require(\"./useUploadFile\"));\nexports.useUploadFile = useUploadFile_1.default;\nvar useUploadFiles_1 = __importDefault(require(\"./useUploadFiles\"));\nexports.useUploadFiles = useUploadFiles_1.default;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar components_1 = require(\"@media-ui/core/src/components\");\nvar UploadSection_1 = __importDefault(require(\"../UploadSection\"));\nvar PreviewSection_1 = __importDefault(require(\"../PreviewSection\"));\nvar hooks_2 = require(\"../../hooks\");\nvar useReplaceAsset_1 = __importDefault(require(\"../../hooks/useReplaceAsset\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n uploadArea: {\n padding: theme.spacing.full,\n },\n optionSection: {\n marginTop: theme.spacing.full,\n marginBottom: theme.spacing.full,\n },\n option: {\n marginTop: theme.spacing.half,\n marginBottom: theme.spacing.half,\n },\n}); });\nvar ReplaceAssetDialog = function () {\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var selectedAsset = hooks_1.useSelectedAsset();\n var _a = useReplaceAsset_1.default(), replaceAsset = _a.replaceAsset, uploadState = _a.uploadState, loading = _a.loading;\n var refetchAssets = src_1.useMediaUi().refetchAssets;\n var _b = hooks_2.useUploadDialogState(), dialogState = _b.state, closeDialog = _b.closeDialog, setFiles = _b.setFiles;\n var _c = React.useState({\n keepOriginalFilename: false,\n generateRedirects: false,\n }), replacementOptions = _c[0], setReplacementOptions = _c[1];\n var uploadPossible = !loading && dialogState.files.selected.length > 0;\n var classes = useStyles();\n var acceptedFileTypes = react_1.useMemo(function () {\n var _a, _b;\n // TODO: Extract this into a helper function\n var completeMediaType = selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.file.mediaType;\n var regex = /^(?(?:[.!#%&'`^~$*+\\-|\\w]+))\\//;\n var mainType = (_b = (_a = completeMediaType.match(regex)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.type;\n return mainType ? mainType + '/*' : '';\n }, [selectedAsset]);\n var handleUpload = react_1.useCallback(function () {\n if (dialogState.files.selected.length === 0) {\n return;\n }\n var file = dialogState.files.selected[0];\n replaceAsset({ asset: selectedAsset, file: file, options: replacementOptions })\n .then(function () {\n Notify.ok(translate('uploadDialog.replacementFinished', 'Replacement finished'));\n closeDialog();\n refetchAssets();\n })\n .catch(function (error) {\n Notify.error(translate('assetReplacement.error', 'Replacement failed'), error);\n });\n }, [replaceAsset, Notify, translate, dialogState, replacementOptions, refetchAssets, selectedAsset, closeDialog]);\n var handleSetFiles = react_1.useCallback(function (files) {\n setFiles(function (prev) {\n return __assign(__assign({}, prev), { selected: files });\n });\n }, [setFiles]);\n return (React.createElement(components_1.Dialog, { isOpen: dialogState.visible, title: translate('uploadDialog.replaceAsset', 'Replace Asset'), onRequestClose: closeDialog, actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: closeDialog }, uploadState\n ? translate('uploadDialog.close', 'Close')\n : translate('uploadDialog.cancel', 'Cancel')),\n React.createElement(react_ui_components_1.Button, { key: \"upload\", style: \"success\", hoverStyle: \"success\", disabled: !uploadPossible, onClick: handleUpload }, translate('uploadDialog.replace', 'Replace')),\n ], style: \"wide\" },\n React.createElement(\"section\", { className: classes.uploadArea },\n React.createElement(UploadSection_1.default, { files: dialogState.files.selected, loading: loading, onSetFiles: handleSetFiles, maxFiles: 1, acceptedFileTypes: acceptedFileTypes }),\n React.createElement(\"section\", { className: classes.optionSection },\n React.createElement(\"div\", { className: classes.option },\n React.createElement(react_ui_components_1.Label, null,\n React.createElement(react_ui_components_1.CheckBox, { isChecked: replacementOptions.generateRedirects, onChange: function (generateRedirects) {\n return setReplacementOptions(__assign(__assign({}, replacementOptions), { generateRedirects: generateRedirects }));\n } }),\n React.createElement(\"span\", null, translate('uploadDialog.generateRedirects', 'Generate redirects')))),\n React.createElement(\"div\", { className: classes.option },\n React.createElement(react_ui_components_1.Label, null,\n React.createElement(react_ui_components_1.CheckBox, { isChecked: replacementOptions.keepOriginalFilename, onChange: function (keepOriginalFilename) {\n return setReplacementOptions(__assign(__assign({}, replacementOptions), { keepOriginalFilename: keepOriginalFilename }));\n } }),\n React.createElement(\"span\", null, translate('uploadDialog.keepOriginalFilename', 'Keep original filename'))))),\n React.createElement(PreviewSection_1.default, { files: dialogState.files, loading: loading, uploadState: uploadState ? [uploadState] : [] }))));\n};\nexports.default = React.memo(ReplaceAssetDialog);\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = findTabbableDescendants;\n/*!\n * Adapted from jQuery UI core\n *\n * http://jqueryui.com\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/category/ui-core/\n */\n\nvar tabbableNode = /input|select|textarea|button|object/;\n\nfunction hidesContents(element) {\n var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;\n\n // If the node is empty, this is good enough\n if (zeroSize && !element.innerHTML) return true;\n\n // Otherwise we need to check some styles\n var style = window.getComputedStyle(element);\n return zeroSize ? style.getPropertyValue(\"overflow\") !== \"visible\" ||\n // if 'overflow: visible' set, check if there is actually any overflow\n element.scrollWidth <= 0 && element.scrollHeight <= 0 : style.getPropertyValue(\"display\") == \"none\";\n}\n\nfunction visible(element) {\n var parentElement = element;\n while (parentElement) {\n if (parentElement === document.body) break;\n if (hidesContents(parentElement)) return false;\n parentElement = parentElement.parentNode;\n }\n return true;\n}\n\nfunction focusable(element, isTabIndexNotNaN) {\n var nodeName = element.nodeName.toLowerCase();\n var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === \"a\" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);\n return res && visible(element);\n}\n\nfunction tabbable(element) {\n var tabIndex = element.getAttribute(\"tabindex\");\n if (tabIndex === null) tabIndex = undefined;\n var isTabIndexNaN = isNaN(tabIndex);\n return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);\n}\n\nfunction findTabbableDescendants(element) {\n return [].slice.call(element.querySelectorAll(\"*\"), 0).filter(tabbable);\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.assertNodeList = assertNodeList;\nexports.setElement = setElement;\nexports.validateElement = validateElement;\nexports.hide = hide;\nexports.show = show;\nexports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;\nexports.resetForTesting = resetForTesting;\n\nvar _warning = require(\"warning\");\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _safeHTMLElement = require(\"./safeHTMLElement\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar globalElement = null;\n\nfunction assertNodeList(nodeList, selector) {\n if (!nodeList || !nodeList.length) {\n throw new Error(\"react-modal: No elements were found for selector \" + selector + \".\");\n }\n}\n\nfunction setElement(element) {\n var useElement = element;\n if (typeof useElement === \"string\" && _safeHTMLElement.canUseDOM) {\n var el = document.querySelectorAll(useElement);\n assertNodeList(el, useElement);\n useElement = el;\n }\n globalElement = useElement || globalElement;\n return globalElement;\n}\n\nfunction validateElement(appElement) {\n var el = appElement || globalElement;\n if (el) {\n return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];\n } else {\n (0, _warning2.default)(false, [\"react-modal: App element is not defined.\", \"Please use `Modal.setAppElement(el)` or set `appElement={el}`.\", \"This is needed so screen readers don't see main content\", \"when modal is opened. It is not recommended, but you can opt-out\", \"by setting `ariaHideApp={false}`.\"].join(\" \"));\n\n return [];\n }\n}\n\nfunction hide(appElement) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var el = _step.value;\n\n el.setAttribute(\"aria-hidden\", \"true\");\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\n\nfunction show(appElement) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var el = _step2.value;\n\n el.removeAttribute(\"aria-hidden\");\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n}\n\nfunction documentNotReadyOrSSRTesting() {\n globalElement = null;\n}\n\nfunction resetForTesting() {\n globalElement = null;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// Tracks portals that are open and emits events to subscribers\n\nvar PortalOpenInstances = function PortalOpenInstances() {\n var _this = this;\n\n _classCallCheck(this, PortalOpenInstances);\n\n this.register = function (openInstance) {\n if (_this.openInstances.indexOf(openInstance) !== -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Cannot register modal instance that's already open\");\n }\n return;\n }\n _this.openInstances.push(openInstance);\n _this.emit(\"register\");\n };\n\n this.deregister = function (openInstance) {\n var index = _this.openInstances.indexOf(openInstance);\n if (index === -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Unable to deregister \" + openInstance + \" as \" + \"it was never registered\");\n }\n return;\n }\n _this.openInstances.splice(index, 1);\n _this.emit(\"deregister\");\n };\n\n this.subscribe = function (callback) {\n _this.subscribers.push(callback);\n };\n\n this.emit = function (eventType) {\n _this.subscribers.forEach(function (subscriber) {\n return subscriber(eventType,\n // shallow copy to avoid accidental mutation\n _this.openInstances.slice());\n });\n };\n\n this.openInstances = [];\n this.subscribers = [];\n};\n\nvar portalOpenInstances = new PortalOpenInstances();\n\nexports.default = portalOpenInstances;\nmodule.exports = exports[\"default\"];","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedAssetForPreviewState = recoil_1.atom({\n key: 'selectedAssetForPreviewState',\n default: null,\n});\nexports.default = selectedAssetForPreviewState;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetCollectionTree = exports.SideBarLeft = exports.AssetSourceDescription = exports.AssetSourceList = void 0;\nvar AssetSourceList_1 = __importDefault(require(\"./AssetSourceList\"));\nexports.AssetSourceList = AssetSourceList_1.default;\nvar AssetSourceDescription_1 = __importDefault(require(\"./AssetSourceDescription\"));\nexports.AssetSourceDescription = AssetSourceDescription_1.default;\nvar SideBarLeft_1 = __importDefault(require(\"./SideBarLeft\"));\nexports.SideBarLeft = SideBarLeft_1.default;\nvar Tree_1 = require(\"./Tree\");\nObject.defineProperty(exports, \"AssetCollectionTree\", { enumerable: true, get: function () { return Tree_1.AssetCollectionTree; } });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetCollectionTree = void 0;\nvar AssetCollectionTree_1 = __importDefault(require(\"./AssetCollectionTree\"));\nexports.AssetCollectionTree = AssetCollectionTree_1.default;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dndTypes = {\n TAG: 'neos-tree-tag',\n COLLECTION: 'neos-tree-collection',\n};\nexports.default = dndTypes;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar media_type_1 = require(\"media-type\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n currentSelection: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n overflow: 'hidden',\n },\n headline: {\n userSelect: 'none',\n flex: '1 1 100%',\n fontWeight: 'bold',\n lineHeight: theme.spacing.goldenUnit,\n },\n label: {\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n '& svg': {\n marginRight: theme.spacing.half,\n },\n },\n}); });\nvar CurrentSelection = function () {\n var classes = useStyles();\n var selectedAsset = hooks_1.useSelectedAsset();\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var selectedTag = hooks_1.useSelectedTag();\n var selectedInspectorView = recoil_1.useRecoilValue(state_1.selectedInspectorViewState);\n var translate = src_1.useIntl().translate;\n var selection = react_1.useMemo(function () {\n var icon = 'question';\n var label = null;\n if (selectedInspectorView === 'asset') {\n if (selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.file.mediaType) {\n var mainMediaType = media_type_1.fromString(selectedAsset.file.mediaType);\n if (mainMediaType.type === 'audio')\n icon = 'file-audio';\n if (mainMediaType.type === 'video')\n icon = 'file-video';\n if (mainMediaType.type === 'image')\n icon = 'file-image';\n }\n else {\n icon = 'file';\n }\n label = selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.label;\n }\n else if (selectedInspectorView === 'assetCollection') {\n icon = 'folder';\n label = selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.title;\n }\n else if (selectedInspectorView === 'tag') {\n icon = 'tag';\n label = selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.label;\n }\n return { icon: icon, label: label };\n }, [selectedAsset, selectedTag, selectedAssetCollection, selectedInspectorView]);\n if (!selection.label)\n return null;\n return (React.createElement(\"div\", { className: classes.currentSelection },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\", className: classes.headline }, translate('currentSelection.headline', 'Selected element')),\n React.createElement(\"div\", { className: classes.label, title: selection.label },\n React.createElement(react_ui_components_1.Icon, { icon: selection.icon }),\n selection.label)));\n};\nexports.default = React.memo(CurrentSelection);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"../../../hooks\");\nvar useStyles = src_1.createUseMediaUiStyles({\n assetCount: {\n height: '100%',\n alignSelf: 'flex-start',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n userSelect: 'none',\n },\n});\nvar AssetCount = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var assetCount = hooks_1.useAssetCount();\n return (React.createElement(\"div\", { className: classes.assetCount },\n assetCount,\n \" \",\n translate('pagination.assetCount', 'assets')));\n};\nexports.default = React.memo(AssetCount);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar pagination_1 = require(\"@media-ui/core/src/constants/pagination\");\nvar PaginationItem_1 = __importDefault(require(\"./PaginationItem\"));\nvar state_2 = require(\"../../../state\");\nvar hooks_1 = require(\"../../../hooks\");\nvar useStyles = src_1.createUseMediaUiStyles({\n pagination: {\n justifySelf: 'center',\n },\n list: {\n display: 'flex',\n justifySelf: 'center',\n listStyleType: 'none',\n textAlign: 'center',\n padding: 0,\n },\n ellipsis: {\n lineHeight: '2.4rem',\n },\n});\nvar Pagination = function () {\n var classes = useStyles();\n var _a = recoil_1.useRecoilState(state_1.currentPageState), currentPage = _a[0], setCurrentPage = _a[1];\n var assetCount = hooks_1.useAssetCount();\n var translate = src_1.useIntl().translate;\n var mainView = recoil_1.useRecoilValue(state_2.mainViewState);\n var disabled = ![state_2.MainViewState.DEFAULT, state_2.MainViewState.UNUSED_ASSETS].includes(mainView);\n var numberOfPages = Math.ceil(assetCount / pagination_1.ASSETS_PER_PAGE);\n var _b = react_1.useState({\n start: 0,\n end: 0,\n hasLessPages: false,\n hasMorePages: false,\n pages: [],\n }), displayRange = _b[0], setDisplayRange = _b[1];\n var handlePageClick = react_1.useCallback(function (page) { return setCurrentPage(page); }, [setCurrentPage]);\n var handlePreviousPageClick = react_1.useCallback(function () { return setCurrentPage(function (prev) { return prev - 1; }); }, [setCurrentPage]);\n var handleNextPageClick = react_1.useCallback(function () { return setCurrentPage(function (prev) { return prev + 1; }); }, [setCurrentPage]);\n // Calculates visible display range\n react_1.useMemo(function () {\n var maxLinks = Math.min(pagination_1.PAGINATION_MAXIMUM_LINKS, numberOfPages);\n var delta = Math.floor(maxLinks / 2);\n var start = currentPage - delta;\n var end = currentPage + delta + (maxLinks % 2 === 0 ? 1 : 0);\n if (start < 1) {\n end -= start - 1;\n }\n if (end > numberOfPages) {\n start -= end - numberOfPages;\n }\n start = Math.max(start, 1);\n end = Math.min(end, numberOfPages);\n var pages = __spreadArrays(Array(end - start + 1)).map(function (_, i) { return i + start; });\n setDisplayRange({\n start: start,\n end: end,\n hasLessPages: start > 2,\n hasMorePages: end + 1 < numberOfPages,\n pages: pages,\n });\n }, [numberOfPages, currentPage]);\n return (React.createElement(\"nav\", { className: classes.pagination }, numberOfPages > 0 && (React.createElement(\"ol\", { className: classes.list },\n React.createElement(PaginationItem_1.default, { icon: \"angle-left\", title: translate('pagination.previousPageTitle', \"Go to previous page\"), onClick: handlePreviousPageClick, disabled: disabled || currentPage <= 1 }),\n displayRange.start > 1 && (React.createElement(PaginationItem_1.default, { title: translate('pagination.firstPageTitle', \"Go to first page\"), onClick: handlePageClick, disabled: disabled, page: 1 })),\n displayRange.hasLessPages && React.createElement(\"li\", { className: classes.ellipsis }, \"\\u2026\"),\n displayRange.pages.map(function (page) { return (React.createElement(PaginationItem_1.default, { key: page, selected: currentPage === page, onClick: handlePageClick, disabled: disabled, title: translate('pagination.page', \"Go to page \" + page, [page]), page: page })); }),\n displayRange.hasMorePages && React.createElement(\"li\", { className: classes.ellipsis }, \"\\u2026\"),\n displayRange.end < numberOfPages && (React.createElement(PaginationItem_1.default, { title: translate('pagination.lastPageTitle', \"Go to last page\"), onClick: handlePageClick, disabled: disabled, page: numberOfPages })),\n React.createElement(PaginationItem_1.default, { icon: \"angle-right\", title: translate('pagination.nextPageTitle', \"Go to next page\"), onClick: handleNextPageClick, disabled: disabled || currentPage === numberOfPages })))));\n};\nexports.default = React.memo(Pagination);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ViewModeSelector = exports.TypeFilter = exports.TopBar = exports.SearchBox = void 0;\nvar SearchBox_1 = __importDefault(require(\"./SearchBox\"));\nexports.SearchBox = SearchBox_1.default;\nvar TopBar_1 = __importDefault(require(\"./TopBar\"));\nexports.TopBar = TopBar_1.default;\nvar TypeFilter_1 = __importDefault(require(\"./TypeFilter\"));\nexports.TypeFilter = TypeFilter_1.default;\nvar ViewModeSelector_1 = __importDefault(require(\"./ViewModeSelector\"));\nexports.ViewModeSelector = ViewModeSelector_1.default;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar MissingAssetActions = function (_a) {\n var assetIdentity = _a.assetIdentity;\n var translate = src_1.useIntl().translate;\n var _b = src_2.useClipboard(), inClipboard = _b.inClipboard, toggleClipboardState = _b.toggleClipboardState;\n // Skip rendering if it's not in the clipboard as we only have one possible action currently\n if (!inClipboard(assetIdentity))\n return null;\n return (React.createElement(react_ui_components_1.IconButton, { title: translate('itemActions.removeFromClipboard', 'Remove from clipboard'), icon: \"trash\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\", onClick: function () { return toggleClipboardState(assetIdentity, false); } }));\n};\nexports.default = React.memo(MissingAssetActions);\n","import React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from \"../context/index.js\";\nexport function useApolloClient() {\n var client = React.useContext(getApolloContext()).client;\n process.env.NODE_ENV === \"production\" ? invariant(client, 33) : invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +\n 'have called `ApolloProvider` higher up in your tree.');\n return client;\n}\n//# sourceMappingURL=useApolloClient.js.map","import { equal } from '@wry/equality';\nimport { invariant } from 'ts-invariant';\nimport { parser, operationName } from \"../parser/index.js\";\nvar OperationData = (function () {\n function OperationData(options, context) {\n this.isMounted = false;\n this.previousOptions = {};\n this.context = {};\n this.options = {};\n this.options = options || {};\n this.context = context || {};\n }\n OperationData.prototype.getOptions = function () {\n return this.options;\n };\n OperationData.prototype.setOptions = function (newOptions, storePrevious) {\n if (storePrevious === void 0) { storePrevious = false; }\n if (storePrevious && !equal(this.options, newOptions)) {\n this.previousOptions = this.options;\n }\n this.options = newOptions;\n };\n OperationData.prototype.unmount = function () {\n this.isMounted = false;\n };\n OperationData.prototype.refreshClient = function () {\n var client = (this.options && this.options.client) ||\n (this.context && this.context.client);\n process.env.NODE_ENV === \"production\" ? invariant(!!client, 29) : invariant(!!client, 'Could not find \"client\" in the context or passed in as an option. ' +\n 'Wrap the root component in an , or pass an ' +\n 'ApolloClient instance in via options.');\n var isNew = false;\n if (client !== this.client) {\n isNew = true;\n this.client = client;\n this.cleanup();\n }\n return {\n client: this.client,\n isNew: isNew\n };\n };\n OperationData.prototype.verifyDocumentType = function (document, type) {\n var operation = parser(document);\n var requiredOperationName = operationName(type);\n var usedOperationName = operationName(operation.type);\n process.env.NODE_ENV === \"production\" ? invariant(operation.type === type, 30) : invariant(operation.type === type, \"Running a \" + requiredOperationName + \" requires a graphql \" +\n (requiredOperationName + \", but a \" + usedOperationName + \" was used instead.\"));\n };\n return OperationData;\n}());\nexport { OperationData };\n//# sourceMappingURL=OperationData.js.map","import { __assign, __extends } from \"tslib\";\nimport { equal } from '@wry/equality';\nimport { OperationData } from \"./OperationData.js\";\nvar SubscriptionData = (function (_super) {\n __extends(SubscriptionData, _super);\n function SubscriptionData(_a) {\n var options = _a.options, context = _a.context, setResult = _a.setResult;\n var _this = _super.call(this, options, context) || this;\n _this.currentObservable = {};\n _this.setResult = setResult;\n _this.initialize(options);\n return _this;\n }\n SubscriptionData.prototype.execute = function (result) {\n if (this.getOptions().skip === true) {\n this.cleanup();\n return {\n loading: false,\n error: undefined,\n data: undefined,\n variables: this.getOptions().variables\n };\n }\n var currentResult = result;\n if (this.refreshClient().isNew) {\n currentResult = this.getLoadingResult();\n }\n var shouldResubscribe = this.getOptions().shouldResubscribe;\n if (typeof shouldResubscribe === 'function') {\n shouldResubscribe = !!shouldResubscribe(this.getOptions());\n }\n if (shouldResubscribe !== false &&\n this.previousOptions &&\n Object.keys(this.previousOptions).length > 0 &&\n (this.previousOptions.subscription !== this.getOptions().subscription ||\n !equal(this.previousOptions.variables, this.getOptions().variables) ||\n this.previousOptions.skip !== this.getOptions().skip)) {\n this.cleanup();\n currentResult = this.getLoadingResult();\n }\n this.initialize(this.getOptions());\n this.startSubscription();\n this.previousOptions = this.getOptions();\n return __assign(__assign({}, currentResult), { variables: this.getOptions().variables });\n };\n SubscriptionData.prototype.afterExecute = function () {\n this.isMounted = true;\n };\n SubscriptionData.prototype.cleanup = function () {\n this.endSubscription();\n delete this.currentObservable.query;\n };\n SubscriptionData.prototype.initialize = function (options) {\n if (this.currentObservable.query || this.getOptions().skip === true)\n return;\n this.currentObservable.query = this.refreshClient().client.subscribe({\n query: options.subscription,\n variables: options.variables,\n fetchPolicy: options.fetchPolicy,\n context: options.context,\n });\n };\n SubscriptionData.prototype.startSubscription = function () {\n if (this.currentObservable.subscription)\n return;\n this.currentObservable.subscription = this.currentObservable.query.subscribe({\n next: this.updateCurrentData.bind(this),\n error: this.updateError.bind(this),\n complete: this.completeSubscription.bind(this)\n });\n };\n SubscriptionData.prototype.getLoadingResult = function () {\n return {\n loading: true,\n error: undefined,\n data: undefined\n };\n };\n SubscriptionData.prototype.updateResult = function (result) {\n if (this.isMounted) {\n this.setResult(result);\n }\n };\n SubscriptionData.prototype.updateCurrentData = function (result) {\n var onSubscriptionData = this.getOptions().onSubscriptionData;\n this.updateResult({\n data: result.data,\n loading: false,\n error: undefined\n });\n if (onSubscriptionData) {\n onSubscriptionData({\n client: this.refreshClient().client,\n subscriptionData: result\n });\n }\n };\n SubscriptionData.prototype.updateError = function (error) {\n this.updateResult({\n error: error,\n loading: false\n });\n };\n SubscriptionData.prototype.completeSubscription = function () {\n var _this = this;\n Promise.resolve().then(function () {\n var onSubscriptionComplete = _this.getOptions().onSubscriptionComplete;\n if (onSubscriptionComplete)\n onSubscriptionComplete();\n _this.endSubscription();\n });\n };\n SubscriptionData.prototype.endSubscription = function () {\n if (this.currentObservable.subscription) {\n this.currentObservable.subscription.unsubscribe();\n delete this.currentObservable.subscription;\n }\n };\n return SubscriptionData;\n}(OperationData));\nexport { SubscriptionData };\n//# sourceMappingURL=SubscriptionData.js.map","import { __assign, __extends } from \"tslib\";\nimport { equal } from '@wry/equality';\nimport { DocumentType } from \"../parser/index.js\";\nimport { ApolloError } from \"../../errors/index.js\";\nimport { OperationData } from \"./OperationData.js\";\nimport { mergeOptions } from \"../../core/index.js\";\nvar MutationData = (function (_super) {\n __extends(MutationData, _super);\n function MutationData(_a) {\n var options = _a.options, context = _a.context, result = _a.result, setResult = _a.setResult;\n var _this = _super.call(this, options, context) || this;\n _this.runMutation = function (mutationFunctionOptions) {\n if (mutationFunctionOptions === void 0) { mutationFunctionOptions = {}; }\n _this.onMutationStart();\n var mutationId = _this.generateNewMutationId();\n return _this.mutate(mutationFunctionOptions)\n .then(function (response) {\n _this.onMutationCompleted(response, mutationId);\n return response;\n })\n .catch(function (error) {\n _this.onMutationError(error, mutationId);\n if (!_this.getOptions().onError)\n throw error;\n });\n };\n _this.verifyDocumentType(options.mutation, DocumentType.Mutation);\n _this.result = result;\n _this.setResult = setResult;\n _this.mostRecentMutationId = 0;\n return _this;\n }\n MutationData.prototype.execute = function (result) {\n this.isMounted = true;\n this.verifyDocumentType(this.getOptions().mutation, DocumentType.Mutation);\n return [\n this.runMutation,\n __assign(__assign({}, result), { client: this.refreshClient().client })\n ];\n };\n MutationData.prototype.afterExecute = function () {\n this.isMounted = true;\n return this.unmount.bind(this);\n };\n MutationData.prototype.cleanup = function () {\n };\n MutationData.prototype.mutate = function (options) {\n return this.refreshClient().client.mutate(mergeOptions(this.getOptions(), options));\n };\n MutationData.prototype.onMutationStart = function () {\n if (!this.result.loading && !this.getOptions().ignoreResults) {\n this.updateResult({\n loading: true,\n error: undefined,\n data: undefined,\n called: true\n });\n }\n };\n MutationData.prototype.onMutationCompleted = function (response, mutationId) {\n var _a = this.getOptions(), onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults;\n var data = response.data, errors = response.errors;\n var error = errors && errors.length > 0\n ? new ApolloError({ graphQLErrors: errors })\n : undefined;\n var callOncomplete = function () {\n return onCompleted ? onCompleted(data) : null;\n };\n if (this.isMostRecentMutation(mutationId) && !ignoreResults) {\n this.updateResult({\n called: true,\n loading: false,\n data: data,\n error: error\n });\n }\n callOncomplete();\n };\n MutationData.prototype.onMutationError = function (error, mutationId) {\n var onError = this.getOptions().onError;\n if (this.isMostRecentMutation(mutationId)) {\n this.updateResult({\n loading: false,\n error: error,\n data: undefined,\n called: true\n });\n }\n if (onError) {\n onError(error);\n }\n };\n MutationData.prototype.generateNewMutationId = function () {\n return ++this.mostRecentMutationId;\n };\n MutationData.prototype.isMostRecentMutation = function (mutationId) {\n return this.mostRecentMutationId === mutationId;\n };\n MutationData.prototype.updateResult = function (result) {\n if (this.isMounted &&\n (!this.previousResult || !equal(this.previousResult, result))) {\n this.setResult(result);\n this.previousResult = result;\n }\n };\n return MutationData;\n}(OperationData));\nexport { MutationData };\n//# sourceMappingURL=MutationData.js.map","import { __assign, __extends } from \"tslib\";\nimport { equal } from '@wry/equality';\nimport { ApolloError } from \"../../errors/index.js\";\nimport { NetworkStatus } from \"../../core/index.js\";\nimport { DocumentType } from \"../parser/index.js\";\nimport { OperationData } from \"./OperationData.js\";\nvar QueryData = (function (_super) {\n __extends(QueryData, _super);\n function QueryData(_a) {\n var options = _a.options, context = _a.context, onNewData = _a.onNewData;\n var _this = _super.call(this, options, context) || this;\n _this.runLazy = false;\n _this.previous = Object.create(null);\n _this.runLazyQuery = function (options) {\n _this.cleanup();\n _this.runLazy = true;\n _this.lazyOptions = options;\n _this.onNewData();\n };\n _this.getQueryResult = function () {\n var result = _this.observableQueryFields();\n var options = _this.getOptions();\n if (options.skip) {\n result = __assign(__assign({}, result), { data: undefined, error: undefined, loading: false, networkStatus: NetworkStatus.ready, called: true });\n }\n else if (_this.currentObservable) {\n var currentResult = _this.currentObservable.getCurrentResult();\n var data = currentResult.data, loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors;\n var error = currentResult.error;\n if (errors && errors.length > 0) {\n error = new ApolloError({ graphQLErrors: errors });\n }\n result = __assign(__assign({}, result), { data: data,\n loading: loading,\n networkStatus: networkStatus,\n error: error, called: true });\n if (loading) {\n }\n else if (error) {\n Object.assign(result, {\n data: (_this.currentObservable.getLastResult() || {})\n .data\n });\n }\n else {\n var fetchPolicy = _this.currentObservable.options.fetchPolicy;\n var partialRefetch = options.partialRefetch;\n if (partialRefetch &&\n partial &&\n (!data || Object.keys(data).length === 0) &&\n fetchPolicy !== 'cache-only') {\n Object.assign(result, {\n loading: true,\n networkStatus: NetworkStatus.loading\n });\n result.refetch();\n return result;\n }\n }\n }\n result.client = _this.client;\n _this.setOptions(options, true);\n var previousResult = _this.previous.result;\n _this.previous.loading =\n previousResult && previousResult.loading || false;\n result.previousData = previousResult &&\n (previousResult.data || previousResult.previousData);\n _this.previous.result = result;\n _this.currentObservable && _this.currentObservable.resetQueryStoreErrors();\n return result;\n };\n _this.obsRefetch = function (variables) { var _a; return (_a = _this.currentObservable) === null || _a === void 0 ? void 0 : _a.refetch(variables); };\n _this.obsFetchMore = function (fetchMoreOptions) { return _this.currentObservable.fetchMore(fetchMoreOptions); };\n _this.obsUpdateQuery = function (mapFn) { return _this.currentObservable.updateQuery(mapFn); };\n _this.obsStartPolling = function (pollInterval) {\n var _a;\n (_a = _this.currentObservable) === null || _a === void 0 ? void 0 : _a.startPolling(pollInterval);\n };\n _this.obsStopPolling = function () {\n var _a;\n (_a = _this.currentObservable) === null || _a === void 0 ? void 0 : _a.stopPolling();\n };\n _this.obsSubscribeToMore = function (options) { return _this.currentObservable.subscribeToMore(options); };\n _this.onNewData = onNewData;\n return _this;\n }\n QueryData.prototype.execute = function () {\n this.refreshClient();\n var _a = this.getOptions(), skip = _a.skip, query = _a.query;\n if (skip || query !== this.previous.query) {\n this.removeQuerySubscription();\n this.removeObservable(!skip);\n this.previous.query = query;\n }\n this.updateObservableQuery();\n if (this.isMounted)\n this.startQuerySubscription();\n return this.getExecuteSsrResult() || this.getExecuteResult();\n };\n QueryData.prototype.executeLazy = function () {\n return !this.runLazy\n ? [\n this.runLazyQuery,\n {\n loading: false,\n networkStatus: NetworkStatus.ready,\n called: false,\n data: undefined\n }\n ]\n : [this.runLazyQuery, this.execute()];\n };\n QueryData.prototype.fetchData = function () {\n var _this = this;\n var options = this.getOptions();\n if (options.skip || options.ssr === false)\n return false;\n return new Promise(function (resolve) { return _this.startQuerySubscription(resolve); });\n };\n QueryData.prototype.afterExecute = function (_a) {\n var _b = (_a === void 0 ? {} : _a).lazy, lazy = _b === void 0 ? false : _b;\n this.isMounted = true;\n if (!lazy || this.runLazy) {\n this.handleErrorOrCompleted();\n }\n this.previousOptions = this.getOptions();\n return this.unmount.bind(this);\n };\n QueryData.prototype.cleanup = function () {\n this.removeQuerySubscription();\n this.removeObservable(true);\n delete this.previous.result;\n };\n QueryData.prototype.getOptions = function () {\n var options = _super.prototype.getOptions.call(this);\n if (this.lazyOptions) {\n options.variables = __assign(__assign({}, options.variables), this.lazyOptions.variables);\n options.context = __assign(__assign({}, options.context), this.lazyOptions.context);\n }\n if (this.runLazy) {\n delete options.skip;\n }\n return options;\n };\n QueryData.prototype.ssrInitiated = function () {\n return this.context && this.context.renderPromises;\n };\n QueryData.prototype.getExecuteResult = function () {\n var result = this.getQueryResult();\n this.startQuerySubscription();\n return result;\n };\n ;\n QueryData.prototype.getExecuteSsrResult = function () {\n var _a = this.getOptions(), ssr = _a.ssr, skip = _a.skip;\n var ssrDisabled = ssr === false;\n var fetchDisabled = this.refreshClient().client.disableNetworkFetches;\n var ssrLoading = __assign({ loading: true, networkStatus: NetworkStatus.loading, called: true, data: undefined, stale: false, client: this.client }, this.observableQueryFields());\n if (ssrDisabled && (this.ssrInitiated() || fetchDisabled)) {\n this.previous.result = ssrLoading;\n return ssrLoading;\n }\n if (this.ssrInitiated()) {\n var result = this.getQueryResult() || ssrLoading;\n if (result.loading && !skip) {\n this.context.renderPromises.addQueryPromise(this, function () { return null; });\n }\n return result;\n }\n };\n QueryData.prototype.prepareObservableQueryOptions = function () {\n var options = this.getOptions();\n this.verifyDocumentType(options.query, DocumentType.Query);\n var displayName = options.displayName || 'Query';\n if (this.ssrInitiated() &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')) {\n options.fetchPolicy = 'cache-first';\n }\n return __assign(__assign({}, options), { displayName: displayName, context: options.context });\n };\n QueryData.prototype.initializeObservableQuery = function () {\n if (this.ssrInitiated()) {\n this.currentObservable = this.context.renderPromises.getSSRObservable(this.getOptions());\n }\n if (!this.currentObservable) {\n var observableQueryOptions = this.prepareObservableQueryOptions();\n this.previous.observableQueryOptions = __assign(__assign({}, observableQueryOptions), { children: null });\n this.currentObservable = this.refreshClient().client.watchQuery(__assign({}, observableQueryOptions));\n if (this.ssrInitiated()) {\n this.context.renderPromises.registerSSRObservable(this.currentObservable, observableQueryOptions);\n }\n }\n };\n QueryData.prototype.updateObservableQuery = function () {\n if (!this.currentObservable) {\n this.initializeObservableQuery();\n return;\n }\n if (this.getOptions().skip)\n return;\n var newObservableQueryOptions = __assign(__assign({}, this.prepareObservableQueryOptions()), { children: null });\n if (!equal(newObservableQueryOptions, this.previous.observableQueryOptions)) {\n this.previous.observableQueryOptions = newObservableQueryOptions;\n this.currentObservable\n .setOptions(newObservableQueryOptions)\n .catch(function () { });\n }\n };\n QueryData.prototype.startQuerySubscription = function (onNewData) {\n var _this = this;\n if (onNewData === void 0) { onNewData = this.onNewData; }\n if (this.currentSubscription || this.getOptions().skip)\n return;\n this.currentSubscription = this.currentObservable.subscribe({\n next: function (_a) {\n var loading = _a.loading, networkStatus = _a.networkStatus, data = _a.data;\n var previousResult = _this.previous.result;\n if (previousResult &&\n previousResult.loading === loading &&\n previousResult.networkStatus === networkStatus &&\n equal(previousResult.data, data)) {\n return;\n }\n onNewData();\n },\n error: function (error) {\n _this.resubscribeToQuery();\n if (!error.hasOwnProperty('graphQLErrors'))\n throw error;\n var previousResult = _this.previous.result;\n if ((previousResult && previousResult.loading) ||\n !equal(error, _this.previous.error)) {\n _this.previous.error = error;\n onNewData();\n }\n }\n });\n };\n QueryData.prototype.resubscribeToQuery = function () {\n this.removeQuerySubscription();\n var currentObservable = this.currentObservable;\n if (currentObservable) {\n var lastError = currentObservable.getLastError();\n var lastResult = currentObservable.getLastResult();\n currentObservable.resetLastResults();\n this.startQuerySubscription();\n Object.assign(currentObservable, {\n lastError: lastError,\n lastResult: lastResult\n });\n }\n };\n QueryData.prototype.handleErrorOrCompleted = function () {\n if (!this.currentObservable || !this.previous.result)\n return;\n var _a = this.previous.result, data = _a.data, loading = _a.loading, error = _a.error;\n if (!loading) {\n var _b = this.getOptions(), query = _b.query, variables = _b.variables, onCompleted = _b.onCompleted, onError = _b.onError, skip = _b.skip;\n if (this.previousOptions &&\n !this.previous.loading &&\n equal(this.previousOptions.query, query) &&\n equal(this.previousOptions.variables, variables)) {\n return;\n }\n if (onCompleted && !error && !skip) {\n onCompleted(data);\n }\n else if (onError && error) {\n onError(error);\n }\n }\n };\n QueryData.prototype.removeQuerySubscription = function () {\n if (this.currentSubscription) {\n this.currentSubscription.unsubscribe();\n delete this.currentSubscription;\n }\n };\n QueryData.prototype.removeObservable = function (andDelete) {\n if (this.currentObservable) {\n this.currentObservable[\"tearDownQuery\"]();\n if (andDelete) {\n delete this.currentObservable;\n }\n }\n };\n QueryData.prototype.observableQueryFields = function () {\n var _a;\n return {\n variables: (_a = this.currentObservable) === null || _a === void 0 ? void 0 : _a.variables,\n refetch: this.obsRefetch,\n fetchMore: this.obsFetchMore,\n updateQuery: this.obsUpdateQuery,\n startPolling: this.obsStartPolling,\n stopPolling: this.obsStopPolling,\n subscribeToMore: this.obsSubscribeToMore\n };\n };\n return QueryData;\n}(OperationData));\nexport { QueryData };\n//# sourceMappingURL=QueryData.js.map","import { __assign } from \"tslib\";\nimport { useContext, useEffect, useReducer, useRef } from 'react';\nimport { QueryData } from \"../../data/index.js\";\nimport { useDeepMemo } from \"./useDeepMemo.js\";\nimport { getApolloContext } from \"../../context/index.js\";\nexport function useBaseQuery(query, options, lazy) {\n if (lazy === void 0) { lazy = false; }\n var context = useContext(getApolloContext());\n var _a = useReducer(function (x) { return x + 1; }, 0), tick = _a[0], forceUpdate = _a[1];\n var updatedOptions = options ? __assign(__assign({}, options), { query: query }) : { query: query };\n var queryDataRef = useRef();\n var queryData = queryDataRef.current || (queryDataRef.current = new QueryData({\n options: updatedOptions,\n context: context,\n onNewData: function () {\n if (!queryData.ssrInitiated()) {\n Promise.resolve().then(function () { return queryDataRef.current && forceUpdate(); });\n }\n else {\n forceUpdate();\n }\n }\n }));\n queryData.setOptions(updatedOptions);\n queryData.context = context;\n var memo = {\n options: __assign(__assign({}, updatedOptions), { onError: undefined, onCompleted: undefined }),\n context: context,\n tick: tick\n };\n var result = useDeepMemo(function () { return (lazy ? queryData.executeLazy() : queryData.execute()); }, memo);\n var queryResult = lazy\n ? result[1]\n : result;\n useEffect(function () {\n return function () { return queryData.cleanup(); };\n }, []);\n useEffect(function () { return queryData.afterExecute({ lazy: lazy }); }, [\n queryResult.loading,\n queryResult.networkStatus,\n queryResult.error,\n queryResult.data,\n ]);\n return result;\n}\n//# sourceMappingURL=useBaseQuery.js.map","import { useRef } from 'react';\nimport { equal } from '@wry/equality';\nexport function useDeepMemo(memoFn, key) {\n var ref = useRef();\n if (!ref.current || !equal(key, ref.current.key)) {\n ref.current = { key: key, value: memoFn() };\n }\n return ref.current.value;\n}\n//# sourceMappingURL=useDeepMemo.js.map","import { useBaseQuery } from \"./utils/useBaseQuery.js\";\nexport function useLazyQuery(query, options) {\n return useBaseQuery(query, options, true);\n}\n//# sourceMappingURL=useLazyQuery.js.map","import { __assign } from \"tslib\";\nimport { useContext, useState, useRef, useEffect } from 'react';\nimport { MutationData } from \"../data/index.js\";\nimport { getApolloContext } from \"../context/index.js\";\nexport function useMutation(mutation, options) {\n var context = useContext(getApolloContext());\n var _a = useState({ called: false, loading: false }), result = _a[0], setResult = _a[1];\n var updatedOptions = options ? __assign(__assign({}, options), { mutation: mutation }) : { mutation: mutation };\n var mutationDataRef = useRef();\n function getMutationDataRef() {\n if (!mutationDataRef.current) {\n mutationDataRef.current = new MutationData({\n options: updatedOptions,\n context: context,\n result: result,\n setResult: setResult\n });\n }\n return mutationDataRef.current;\n }\n var mutationData = getMutationDataRef();\n mutationData.setOptions(updatedOptions);\n mutationData.context = context;\n useEffect(function () { return mutationData.afterExecute(); });\n return mutationData.execute(result);\n}\n//# sourceMappingURL=useMutation.js.map","import { useBaseQuery } from \"./utils/useBaseQuery.js\";\nexport function useQuery(query, options) {\n return useBaseQuery(query, options, false);\n}\n//# sourceMappingURL=useQuery.js.map","import { __assign } from \"tslib\";\nimport { useContext, useState, useRef, useEffect } from 'react';\nimport { SubscriptionData } from \"../data/index.js\";\nimport { getApolloContext } from \"../context/index.js\";\nexport function useSubscription(subscription, options) {\n var context = useContext(getApolloContext());\n var updatedOptions = options\n ? __assign(__assign({}, options), { subscription: subscription }) : { subscription: subscription };\n var _a = useState({\n loading: !updatedOptions.skip,\n error: undefined,\n data: undefined\n }), result = _a[0], setResult = _a[1];\n var subscriptionDataRef = useRef();\n function getSubscriptionDataRef() {\n if (!subscriptionDataRef.current) {\n subscriptionDataRef.current = new SubscriptionData({\n options: updatedOptions,\n context: context,\n setResult: setResult\n });\n }\n return subscriptionDataRef.current;\n }\n var subscriptionData = getSubscriptionDataRef();\n subscriptionData.setOptions(updatedOptions, true);\n subscriptionData.context = context;\n useEffect(function () { return subscriptionData.afterExecute(); });\n useEffect(function () { return subscriptionData.cleanup.bind(subscriptionData); }, []);\n return subscriptionData.execute(result);\n}\n//# sourceMappingURL=useSubscription.js.map","import { useState, useEffect } from 'react';\nexport function useReactiveVar(rv) {\n var value = rv();\n var _a = useState(value), setValue = _a[1];\n useEffect(function () { return rv.onNextChange(setValue); }, [value]);\n useEffect(function () {\n setValue(rv());\n }, []);\n return value;\n}\n//# sourceMappingURL=useReactiveVar.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport { dep, KeyTrie } from 'optimism';\nimport { equal } from '@wry/equality';\nimport { isReference, makeReference, DeepMerger, maybeDeepFreeze, canUseWeakMap, } from \"../../utilities/index.js\";\nimport { hasOwn, fieldNameFromStoreName } from \"./helpers.js\";\nvar DELETE = Object.create(null);\nvar delModifier = function () { return DELETE; };\nvar INVALIDATE = Object.create(null);\nvar EntityStore = (function () {\n function EntityStore(policies, group) {\n var _this = this;\n this.policies = policies;\n this.group = group;\n this.data = Object.create(null);\n this.rootIds = Object.create(null);\n this.refs = Object.create(null);\n this.getFieldValue = function (objectOrReference, storeFieldName) { return maybeDeepFreeze(isReference(objectOrReference)\n ? _this.get(objectOrReference.__ref, storeFieldName)\n : objectOrReference && objectOrReference[storeFieldName]); };\n this.canRead = function (objOrRef) {\n return isReference(objOrRef)\n ? _this.has(objOrRef.__ref)\n : typeof objOrRef === \"object\";\n };\n this.toReference = function (objOrIdOrRef, mergeIntoStore) {\n if (typeof objOrIdOrRef === \"string\") {\n return makeReference(objOrIdOrRef);\n }\n if (isReference(objOrIdOrRef)) {\n return objOrIdOrRef;\n }\n var id = _this.policies.identify(objOrIdOrRef)[0];\n if (id) {\n var ref = makeReference(id);\n if (mergeIntoStore) {\n _this.merge(id, objOrIdOrRef);\n }\n return ref;\n }\n };\n }\n EntityStore.prototype.toObject = function () {\n return __assign({}, this.data);\n };\n EntityStore.prototype.has = function (dataId) {\n return this.lookup(dataId, true) !== void 0;\n };\n EntityStore.prototype.get = function (dataId, fieldName) {\n this.group.depend(dataId, fieldName);\n if (hasOwn.call(this.data, dataId)) {\n var storeObject = this.data[dataId];\n if (storeObject && hasOwn.call(storeObject, fieldName)) {\n return storeObject[fieldName];\n }\n }\n if (fieldName === \"__typename\" &&\n hasOwn.call(this.policies.rootTypenamesById, dataId)) {\n return this.policies.rootTypenamesById[dataId];\n }\n if (this instanceof Layer) {\n return this.parent.get(dataId, fieldName);\n }\n };\n EntityStore.prototype.lookup = function (dataId, dependOnExistence) {\n if (dependOnExistence)\n this.group.depend(dataId, \"__exists\");\n if (hasOwn.call(this.data, dataId)) {\n return this.data[dataId];\n }\n if (this instanceof Layer) {\n return this.parent.lookup(dataId, dependOnExistence);\n }\n if (this.policies.rootTypenamesById[dataId]) {\n return Object.create(null);\n }\n };\n EntityStore.prototype.merge = function (dataId, incoming) {\n var _this = this;\n var existing = this.lookup(dataId);\n var merged = new DeepMerger(storeObjectReconciler).merge(existing, incoming);\n this.data[dataId] = merged;\n if (merged !== existing) {\n delete this.refs[dataId];\n if (this.group.caching) {\n var fieldsToDirty_1 = Object.create(null);\n if (!existing)\n fieldsToDirty_1.__exists = 1;\n Object.keys(incoming).forEach(function (storeFieldName) {\n if (!existing || existing[storeFieldName] !== merged[storeFieldName]) {\n fieldsToDirty_1[storeFieldName] = 1;\n var fieldName = fieldNameFromStoreName(storeFieldName);\n if (fieldName !== storeFieldName &&\n !_this.policies.hasKeyArgs(merged.__typename, fieldName)) {\n fieldsToDirty_1[fieldName] = 1;\n }\n if (merged[storeFieldName] === void 0 && !(_this instanceof Layer)) {\n delete merged[storeFieldName];\n }\n }\n });\n Object.keys(fieldsToDirty_1).forEach(function (fieldName) { return _this.group.dirty(dataId, fieldName); });\n }\n }\n };\n EntityStore.prototype.modify = function (dataId, fields) {\n var _this = this;\n var storeObject = this.lookup(dataId);\n if (storeObject) {\n var changedFields_1 = Object.create(null);\n var needToMerge_1 = false;\n var allDeleted_1 = true;\n var sharedDetails_1 = {\n DELETE: DELETE,\n INVALIDATE: INVALIDATE,\n isReference: isReference,\n toReference: this.toReference,\n canRead: this.canRead,\n readField: function (fieldNameOrOptions, from) { return _this.policies.readField(typeof fieldNameOrOptions === \"string\" ? {\n fieldName: fieldNameOrOptions,\n from: from || makeReference(dataId),\n } : fieldNameOrOptions, { store: _this }); },\n };\n Object.keys(storeObject).forEach(function (storeFieldName) {\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var fieldValue = storeObject[storeFieldName];\n if (fieldValue === void 0)\n return;\n var modify = typeof fields === \"function\"\n ? fields\n : fields[storeFieldName] || fields[fieldName];\n if (modify) {\n var newValue = modify === delModifier ? DELETE :\n modify(maybeDeepFreeze(fieldValue), __assign(__assign({}, sharedDetails_1), { fieldName: fieldName,\n storeFieldName: storeFieldName, storage: _this.getStorage(dataId, storeFieldName) }));\n if (newValue === INVALIDATE) {\n _this.group.dirty(dataId, storeFieldName);\n }\n else {\n if (newValue === DELETE)\n newValue = void 0;\n if (newValue !== fieldValue) {\n changedFields_1[storeFieldName] = newValue;\n needToMerge_1 = true;\n fieldValue = newValue;\n }\n }\n }\n if (fieldValue !== void 0) {\n allDeleted_1 = false;\n }\n });\n if (needToMerge_1) {\n this.merge(dataId, changedFields_1);\n if (allDeleted_1) {\n if (this instanceof Layer) {\n this.data[dataId] = void 0;\n }\n else {\n delete this.data[dataId];\n }\n this.group.dirty(dataId, \"__exists\");\n }\n return true;\n }\n }\n return false;\n };\n EntityStore.prototype.delete = function (dataId, fieldName, args) {\n var _a;\n var storeObject = this.lookup(dataId);\n if (storeObject) {\n var typename = this.getFieldValue(storeObject, \"__typename\");\n var storeFieldName = fieldName && args\n ? this.policies.getStoreFieldName({ typename: typename, fieldName: fieldName, args: args })\n : fieldName;\n return this.modify(dataId, storeFieldName ? (_a = {},\n _a[storeFieldName] = delModifier,\n _a) : delModifier);\n }\n return false;\n };\n EntityStore.prototype.evict = function (options) {\n var evicted = false;\n if (options.id) {\n if (hasOwn.call(this.data, options.id)) {\n evicted = this.delete(options.id, options.fieldName, options.args);\n }\n if (this instanceof Layer) {\n evicted = this.parent.evict(options) || evicted;\n }\n if (options.fieldName || evicted) {\n this.group.dirty(options.id, options.fieldName || \"__exists\");\n }\n }\n return evicted;\n };\n EntityStore.prototype.clear = function () {\n this.replace(null);\n };\n EntityStore.prototype.extract = function () {\n var _this = this;\n var obj = this.toObject();\n var extraRootIds = [];\n this.getRootIdSet().forEach(function (id) {\n if (!hasOwn.call(_this.policies.rootTypenamesById, id)) {\n extraRootIds.push(id);\n }\n });\n if (extraRootIds.length) {\n obj.__META = { extraRootIds: extraRootIds.sort() };\n }\n return obj;\n };\n EntityStore.prototype.replace = function (newData) {\n var _this = this;\n Object.keys(this.data).forEach(function (dataId) {\n if (!(newData && hasOwn.call(newData, dataId))) {\n _this.delete(dataId);\n }\n });\n if (newData) {\n var __META = newData.__META, rest_1 = __rest(newData, [\"__META\"]);\n Object.keys(rest_1).forEach(function (dataId) {\n _this.merge(dataId, rest_1[dataId]);\n });\n if (__META) {\n __META.extraRootIds.forEach(this.retain, this);\n }\n }\n };\n EntityStore.prototype.retain = function (rootId) {\n return this.rootIds[rootId] = (this.rootIds[rootId] || 0) + 1;\n };\n EntityStore.prototype.release = function (rootId) {\n if (this.rootIds[rootId] > 0) {\n var count = --this.rootIds[rootId];\n if (!count)\n delete this.rootIds[rootId];\n return count;\n }\n return 0;\n };\n EntityStore.prototype.getRootIdSet = function (ids) {\n if (ids === void 0) { ids = new Set(); }\n Object.keys(this.rootIds).forEach(ids.add, ids);\n if (this instanceof Layer) {\n this.parent.getRootIdSet(ids);\n }\n else {\n Object.keys(this.policies.rootTypenamesById).forEach(ids.add, ids);\n }\n return ids;\n };\n EntityStore.prototype.gc = function () {\n var _this = this;\n var ids = this.getRootIdSet();\n var snapshot = this.toObject();\n ids.forEach(function (id) {\n if (hasOwn.call(snapshot, id)) {\n Object.keys(_this.findChildRefIds(id)).forEach(ids.add, ids);\n delete snapshot[id];\n }\n });\n var idsToRemove = Object.keys(snapshot);\n if (idsToRemove.length) {\n var root_1 = this;\n while (root_1 instanceof Layer)\n root_1 = root_1.parent;\n idsToRemove.forEach(function (id) { return root_1.delete(id); });\n }\n return idsToRemove;\n };\n EntityStore.prototype.findChildRefIds = function (dataId) {\n if (!hasOwn.call(this.refs, dataId)) {\n var found_1 = this.refs[dataId] = Object.create(null);\n var workSet_1 = new Set([this.data[dataId]]);\n var canTraverse_1 = function (obj) { return obj !== null && typeof obj === 'object'; };\n workSet_1.forEach(function (obj) {\n if (isReference(obj)) {\n found_1[obj.__ref] = true;\n }\n else if (canTraverse_1(obj)) {\n Object.values(obj)\n .filter(canTraverse_1)\n .forEach(workSet_1.add, workSet_1);\n }\n });\n }\n return this.refs[dataId];\n };\n EntityStore.prototype.makeCacheKey = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return this.group.keyMaker.lookupArray(args);\n };\n return EntityStore;\n}());\nexport { EntityStore };\nvar CacheGroup = (function () {\n function CacheGroup(caching) {\n this.caching = caching;\n this.d = null;\n this.keyMaker = new KeyTrie(canUseWeakMap);\n this.d = caching ? dep() : null;\n }\n CacheGroup.prototype.depend = function (dataId, storeFieldName) {\n if (this.d) {\n this.d(makeDepKey(dataId, storeFieldName));\n var fieldName = fieldNameFromStoreName(storeFieldName);\n if (fieldName !== storeFieldName) {\n this.d(makeDepKey(dataId, fieldName));\n }\n }\n };\n CacheGroup.prototype.dirty = function (dataId, storeFieldName) {\n if (this.d) {\n this.d.dirty(makeDepKey(dataId, storeFieldName));\n }\n };\n return CacheGroup;\n}());\nfunction makeDepKey(dataId, storeFieldName) {\n return storeFieldName + '#' + dataId;\n}\n(function (EntityStore) {\n var Root = (function (_super) {\n __extends(Root, _super);\n function Root(_a) {\n var policies = _a.policies, _b = _a.resultCaching, resultCaching = _b === void 0 ? true : _b, seed = _a.seed;\n var _this = _super.call(this, policies, new CacheGroup(resultCaching)) || this;\n _this.storageTrie = new KeyTrie(canUseWeakMap);\n _this.sharedLayerGroup = new CacheGroup(resultCaching);\n if (seed)\n _this.replace(seed);\n return _this;\n }\n Root.prototype.addLayer = function (layerId, replay) {\n return new Layer(layerId, this, replay, this.sharedLayerGroup);\n };\n Root.prototype.removeLayer = function () {\n return this;\n };\n Root.prototype.getStorage = function () {\n return this.storageTrie.lookupArray(arguments);\n };\n return Root;\n }(EntityStore));\n EntityStore.Root = Root;\n})(EntityStore || (EntityStore = {}));\nvar Layer = (function (_super) {\n __extends(Layer, _super);\n function Layer(id, parent, replay, group) {\n var _this = _super.call(this, parent.policies, group) || this;\n _this.id = id;\n _this.parent = parent;\n _this.replay = replay;\n _this.group = group;\n replay(_this);\n return _this;\n }\n Layer.prototype.addLayer = function (layerId, replay) {\n return new Layer(layerId, this, replay, this.group);\n };\n Layer.prototype.removeLayer = function (layerId) {\n var _this = this;\n var parent = this.parent.removeLayer(layerId);\n if (layerId === this.id) {\n if (this.group.caching) {\n Object.keys(this.data).forEach(function (dataId) {\n if (_this.data[dataId] !== parent.lookup(dataId)) {\n _this.delete(dataId);\n }\n });\n }\n return parent;\n }\n if (parent === this.parent)\n return this;\n return parent.addLayer(this.id, this.replay);\n };\n Layer.prototype.toObject = function () {\n return __assign(__assign({}, this.parent.toObject()), this.data);\n };\n Layer.prototype.findChildRefIds = function (dataId) {\n var fromParent = this.parent.findChildRefIds(dataId);\n return hasOwn.call(this.data, dataId) ? __assign(__assign({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent;\n };\n Layer.prototype.getStorage = function () {\n var p = this.parent;\n while (p.parent)\n p = p.parent;\n return p.getStorage.apply(p, arguments);\n };\n return Layer;\n}(EntityStore));\nfunction storeObjectReconciler(existingObject, incomingObject, property) {\n var existingValue = existingObject[property];\n var incomingValue = incomingObject[property];\n return equal(existingValue, incomingValue) ? existingValue : incomingValue;\n}\nexport function supportsResultCaching(store) {\n return !!(store instanceof EntityStore && store.group.caching);\n}\n//# sourceMappingURL=entityStore.js.map","import { __assign } from \"tslib\";\nimport { wrap } from 'optimism';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { isField, resultKeyNameFromField, isReference, makeReference, createFragmentMap, shouldInclude, addTypenameToDocument, getDefaultValues, getFragmentDefinitions, getMainDefinition, getQueryDefinition, maybeDeepFreeze, mergeDeepArray, getFragmentFromSelection, } from \"../../utilities/index.js\";\nimport { supportsResultCaching } from \"./entityStore.js\";\nimport { getTypenameFromStoreObject } from \"./helpers.js\";\nimport { MissingFieldError } from \"../core/types/common.js\";\n;\nfunction missingFromInvariant(err, context) {\n return new MissingFieldError(err.message, context.path.slice(), context.query, context.clientOnly, context.variables);\n}\nvar StoreReader = (function () {\n function StoreReader(config) {\n var _this = this;\n this.config = config;\n this.executeSelectionSet = wrap(function (options) { return _this.execSelectionSetImpl(options); }, {\n keyArgs: function (options) {\n return [\n options.selectionSet,\n options.objectOrReference,\n options.context,\n ];\n },\n makeCacheKey: function (selectionSet, parent, context) {\n if (supportsResultCaching(context.store)) {\n return context.store.makeCacheKey(selectionSet, isReference(parent) ? parent.__ref : parent, context.varString);\n }\n }\n });\n this.knownResults = new WeakMap();\n this.executeSubSelectedArray = wrap(function (options) {\n return _this.execSubSelectedArrayImpl(options);\n }, {\n makeCacheKey: function (_a) {\n var field = _a.field, array = _a.array, context = _a.context;\n if (supportsResultCaching(context.store)) {\n return context.store.makeCacheKey(field, array, context.varString);\n }\n }\n });\n this.config = __assign({ addTypename: true }, config);\n }\n StoreReader.prototype.diffQueryAgainstStore = function (_a) {\n var store = _a.store, query = _a.query, _b = _a.rootId, rootId = _b === void 0 ? 'ROOT_QUERY' : _b, variables = _a.variables, _c = _a.returnPartialData, returnPartialData = _c === void 0 ? true : _c;\n var policies = this.config.cache.policies;\n variables = __assign(__assign({}, getDefaultValues(getQueryDefinition(query))), variables);\n var execResult = this.executeSelectionSet({\n selectionSet: getMainDefinition(query).selectionSet,\n objectOrReference: makeReference(rootId),\n context: {\n store: store,\n query: query,\n policies: policies,\n variables: variables,\n varString: JSON.stringify(variables),\n fragmentMap: createFragmentMap(getFragmentDefinitions(query)),\n path: [],\n clientOnly: false,\n },\n });\n var hasMissingFields = execResult.missing && execResult.missing.length > 0;\n if (hasMissingFields && !returnPartialData) {\n throw execResult.missing[0];\n }\n return {\n result: execResult.result,\n missing: execResult.missing,\n complete: !hasMissingFields,\n };\n };\n StoreReader.prototype.isFresh = function (result, parent, selectionSet, context) {\n if (supportsResultCaching(context.store) &&\n this.knownResults.get(result) === selectionSet) {\n var latest = this.executeSelectionSet.peek(selectionSet, parent, context);\n if (latest && result === latest.result) {\n return true;\n }\n }\n return false;\n };\n StoreReader.prototype.execSelectionSetImpl = function (_a) {\n var _this = this;\n var selectionSet = _a.selectionSet, objectOrReference = _a.objectOrReference, context = _a.context;\n if (isReference(objectOrReference) &&\n !context.policies.rootTypenamesById[objectOrReference.__ref] &&\n !context.store.has(objectOrReference.__ref)) {\n return {\n result: {},\n missing: [missingFromInvariant(process.env.NODE_ENV === \"production\" ? new InvariantError(4) : new InvariantError(\"Dangling reference to missing \" + objectOrReference.__ref + \" object\"), context)],\n };\n }\n var variables = context.variables, policies = context.policies, store = context.store;\n var objectsToMerge = [];\n var finalResult = { result: null };\n var typename = store.getFieldValue(objectOrReference, \"__typename\");\n if (this.config.addTypename &&\n typeof typename === \"string\" &&\n !policies.rootIdsByTypename[typename]) {\n objectsToMerge.push({ __typename: typename });\n }\n function getMissing() {\n return finalResult.missing || (finalResult.missing = []);\n }\n function handleMissing(result) {\n var _a;\n if (result.missing)\n (_a = getMissing()).push.apply(_a, result.missing);\n return result.result;\n }\n var workSet = new Set(selectionSet.selections);\n workSet.forEach(function (selection) {\n var _a;\n if (!shouldInclude(selection, variables))\n return;\n if (isField(selection)) {\n var fieldValue = policies.readField({\n fieldName: selection.name.value,\n field: selection,\n variables: context.variables,\n from: objectOrReference,\n }, context);\n var resultName = resultKeyNameFromField(selection);\n context.path.push(resultName);\n var wasClientOnly = context.clientOnly;\n context.clientOnly = wasClientOnly || !!(selection.directives &&\n selection.directives.some(function (d) { return d.name.value === \"client\"; }));\n if (fieldValue === void 0) {\n if (!addTypenameToDocument.added(selection)) {\n getMissing().push(missingFromInvariant(process.env.NODE_ENV === \"production\" ? new InvariantError(5) : new InvariantError(\"Can't find field '\" + selection.name.value + \"' on \" + (isReference(objectOrReference)\n ? objectOrReference.__ref + \" object\"\n : \"object \" + JSON.stringify(objectOrReference, null, 2))), context));\n }\n }\n else if (Array.isArray(fieldValue)) {\n fieldValue = handleMissing(_this.executeSubSelectedArray({\n field: selection,\n array: fieldValue,\n context: context,\n }));\n }\n else if (!selection.selectionSet) {\n if (process.env.NODE_ENV !== 'production') {\n assertSelectionSetForIdValue(context.store, selection, fieldValue);\n maybeDeepFreeze(fieldValue);\n }\n }\n else if (fieldValue != null) {\n fieldValue = handleMissing(_this.executeSelectionSet({\n selectionSet: selection.selectionSet,\n objectOrReference: fieldValue,\n context: context,\n }));\n }\n if (fieldValue !== void 0) {\n objectsToMerge.push((_a = {}, _a[resultName] = fieldValue, _a));\n }\n context.clientOnly = wasClientOnly;\n invariant(context.path.pop() === resultName);\n }\n else {\n var fragment = getFragmentFromSelection(selection, context.fragmentMap);\n if (fragment && policies.fragmentMatches(fragment, typename)) {\n fragment.selectionSet.selections.forEach(workSet.add, workSet);\n }\n }\n });\n finalResult.result = mergeDeepArray(objectsToMerge);\n if (process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n this.knownResults.set(finalResult.result, selectionSet);\n return finalResult;\n };\n StoreReader.prototype.execSubSelectedArrayImpl = function (_a) {\n var _this = this;\n var field = _a.field, array = _a.array, context = _a.context;\n var missing;\n function handleMissing(childResult, i) {\n if (childResult.missing) {\n missing = missing || [];\n missing.push.apply(missing, childResult.missing);\n }\n invariant(context.path.pop() === i);\n return childResult.result;\n }\n if (field.selectionSet) {\n array = array.filter(context.store.canRead);\n }\n array = array.map(function (item, i) {\n if (item === null) {\n return null;\n }\n context.path.push(i);\n if (Array.isArray(item)) {\n return handleMissing(_this.executeSubSelectedArray({\n field: field,\n array: item,\n context: context,\n }), i);\n }\n if (field.selectionSet) {\n return handleMissing(_this.executeSelectionSet({\n selectionSet: field.selectionSet,\n objectOrReference: item,\n context: context,\n }), i);\n }\n if (process.env.NODE_ENV !== 'production') {\n assertSelectionSetForIdValue(context.store, field, item);\n }\n invariant(context.path.pop() === i);\n return item;\n });\n if (process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n return { result: array, missing: missing };\n };\n return StoreReader;\n}());\nexport { StoreReader };\nfunction assertSelectionSetForIdValue(store, field, fieldValue) {\n if (!field.selectionSet) {\n var workSet_1 = new Set([fieldValue]);\n workSet_1.forEach(function (value) {\n if (value && typeof value === \"object\") {\n process.env.NODE_ENV === \"production\" ? invariant(!isReference(value), 6) : invariant(!isReference(value), \"Missing selection set for object of type \" + getTypenameFromStoreObject(store, value) + \" returned for query field \" + field.name.value);\n Object.values(value).forEach(workSet_1.add, workSet_1);\n }\n });\n }\n}\n//# sourceMappingURL=readFromStore.js.map","import { __assign } from \"tslib\";\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { equal } from '@wry/equality';\nimport { createFragmentMap, getFragmentFromSelection, getDefaultValues, getFragmentDefinitions, getOperationDefinition, getTypenameFromResult, makeReference, isField, resultKeyNameFromField, isReference, shouldInclude, hasDirectives, cloneDeep, } from \"../../utilities/index.js\";\nimport { makeProcessedFieldsMerger, fieldNameFromStoreName, storeValueIsStoreObject } from \"./helpers.js\";\n;\nvar StoreWriter = (function () {\n function StoreWriter(cache, reader) {\n this.cache = cache;\n this.reader = reader;\n }\n StoreWriter.prototype.writeToStore = function (_a) {\n var query = _a.query, result = _a.result, dataId = _a.dataId, store = _a.store, variables = _a.variables;\n var operationDefinition = getOperationDefinition(query);\n var merger = makeProcessedFieldsMerger();\n variables = __assign(__assign({}, getDefaultValues(operationDefinition)), variables);\n var ref = this.processSelectionSet({\n result: result || Object.create(null),\n dataId: dataId,\n selectionSet: operationDefinition.selectionSet,\n mergeTree: { map: new Map },\n context: {\n store: store,\n written: Object.create(null),\n merge: function (existing, incoming) {\n return merger.merge(existing, incoming);\n },\n variables: variables,\n varString: JSON.stringify(variables),\n fragmentMap: createFragmentMap(getFragmentDefinitions(query)),\n },\n });\n if (!isReference(ref)) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(7) : new InvariantError(\"Could not identify object \" + JSON.stringify(result));\n }\n store.retain(ref.__ref);\n return ref;\n };\n StoreWriter.prototype.processSelectionSet = function (_a) {\n var _this = this;\n var dataId = _a.dataId, result = _a.result, selectionSet = _a.selectionSet, context = _a.context, mergeTree = _a.mergeTree;\n var policies = this.cache.policies;\n var _b = policies.identify(result, selectionSet, context.fragmentMap), id = _b[0], keyObject = _b[1];\n dataId = dataId || id;\n if (\"string\" === typeof dataId) {\n var sets = context.written[dataId] || (context.written[dataId] = []);\n var ref = makeReference(dataId);\n if (sets.indexOf(selectionSet) >= 0)\n return ref;\n sets.push(selectionSet);\n if (this.reader && this.reader.isFresh(result, ref, selectionSet, context)) {\n return ref;\n }\n }\n var incomingFields = Object.create(null);\n if (keyObject) {\n incomingFields = context.merge(incomingFields, keyObject);\n }\n var typename = (dataId && policies.rootTypenamesById[dataId]) ||\n getTypenameFromResult(result, selectionSet, context.fragmentMap) ||\n (dataId && context.store.get(dataId, \"__typename\"));\n if (\"string\" === typeof typename) {\n incomingFields.__typename = typename;\n }\n var workSet = new Set(selectionSet.selections);\n workSet.forEach(function (selection) {\n var _a;\n if (!shouldInclude(selection, context.variables))\n return;\n if (isField(selection)) {\n var resultFieldKey = resultKeyNameFromField(selection);\n var value = result[resultFieldKey];\n if (typeof value !== 'undefined') {\n var storeFieldName = policies.getStoreFieldName({\n typename: typename,\n fieldName: selection.name.value,\n field: selection,\n variables: context.variables,\n });\n var childTree = getChildMergeTree(mergeTree, storeFieldName);\n var incomingValue = _this.processFieldValue(value, selection, context, childTree);\n var childTypename = selection.selectionSet\n && context.store.getFieldValue(incomingValue, \"__typename\")\n || void 0;\n var merge = policies.getMergeFunction(typename, selection.name.value, childTypename);\n if (merge) {\n childTree.info = {\n field: selection,\n typename: typename,\n merge: merge,\n };\n }\n else {\n maybeRecycleChildMergeTree(mergeTree, storeFieldName);\n }\n incomingFields = context.merge(incomingFields, (_a = {},\n _a[storeFieldName] = incomingValue,\n _a));\n }\n else if (policies.usingPossibleTypes &&\n !hasDirectives([\"defer\", \"client\"], selection)) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(8) : new InvariantError(\"Missing field '\" + resultFieldKey + \"' in \" + JSON.stringify(result, null, 2).substring(0, 100));\n }\n }\n else {\n var fragment = getFragmentFromSelection(selection, context.fragmentMap);\n if (fragment &&\n policies.fragmentMatches(fragment, typename, result, context.variables)) {\n fragment.selectionSet.selections.forEach(workSet.add, workSet);\n }\n }\n });\n if (\"string\" === typeof dataId) {\n var entityRef_1 = makeReference(dataId);\n if (mergeTree.map.size) {\n incomingFields = this.applyMerges(mergeTree, entityRef_1, incomingFields, context);\n }\n if (process.env.NODE_ENV !== \"production\") {\n var hasSelectionSet_1 = function (storeFieldName) {\n return fieldsWithSelectionSets_1.has(fieldNameFromStoreName(storeFieldName));\n };\n var fieldsWithSelectionSets_1 = new Set();\n workSet.forEach(function (selection) {\n if (isField(selection) && selection.selectionSet) {\n fieldsWithSelectionSets_1.add(selection.name.value);\n }\n });\n var hasMergeFunction_1 = function (storeFieldName) {\n var childTree = mergeTree.map.get(storeFieldName);\n return Boolean(childTree && childTree.info && childTree.info.merge);\n };\n Object.keys(incomingFields).forEach(function (storeFieldName) {\n if (hasSelectionSet_1(storeFieldName) &&\n !hasMergeFunction_1(storeFieldName)) {\n warnAboutDataLoss(entityRef_1, incomingFields, storeFieldName, context.store);\n }\n });\n }\n context.store.merge(dataId, incomingFields);\n return entityRef_1;\n }\n return incomingFields;\n };\n StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {\n var _this = this;\n if (!field.selectionSet || value === null) {\n return process.env.NODE_ENV === 'production' ? value : cloneDeep(value);\n }\n if (Array.isArray(value)) {\n return value.map(function (item, i) {\n var value = _this.processFieldValue(item, field, context, getChildMergeTree(mergeTree, i));\n maybeRecycleChildMergeTree(mergeTree, i);\n return value;\n });\n }\n return this.processSelectionSet({\n result: value,\n selectionSet: field.selectionSet,\n context: context,\n mergeTree: mergeTree,\n });\n };\n StoreWriter.prototype.applyMerges = function (mergeTree, existing, incoming, context, getStorageArgs) {\n var _a;\n var _this = this;\n if (mergeTree.map.size && !isReference(incoming)) {\n var e_1 = (!Array.isArray(incoming) &&\n (isReference(existing) || storeValueIsStoreObject(existing))) ? existing : void 0;\n var i_1 = incoming;\n if (e_1 && !getStorageArgs) {\n getStorageArgs = [isReference(e_1) ? e_1.__ref : e_1];\n }\n var changedFields_1;\n var getValue_1 = function (from, name) {\n return Array.isArray(from)\n ? (typeof name === \"number\" ? from[name] : void 0)\n : context.store.getFieldValue(from, String(name));\n };\n mergeTree.map.forEach(function (childTree, storeFieldName) {\n if (getStorageArgs) {\n getStorageArgs.push(storeFieldName);\n }\n var eVal = getValue_1(e_1, storeFieldName);\n var iVal = getValue_1(i_1, storeFieldName);\n var aVal = _this.applyMerges(childTree, eVal, iVal, context, getStorageArgs);\n if (aVal !== iVal) {\n changedFields_1 = changedFields_1 || new Map;\n changedFields_1.set(storeFieldName, aVal);\n }\n if (getStorageArgs) {\n invariant(getStorageArgs.pop() === storeFieldName);\n }\n });\n if (changedFields_1) {\n incoming = (Array.isArray(i_1) ? i_1.slice(0) : __assign({}, i_1));\n changedFields_1.forEach(function (value, name) {\n incoming[name] = value;\n });\n }\n }\n if (mergeTree.info) {\n return this.cache.policies.runMergeFunction(existing, incoming, mergeTree.info, context, getStorageArgs && (_a = context.store).getStorage.apply(_a, getStorageArgs));\n }\n return incoming;\n };\n return StoreWriter;\n}());\nexport { StoreWriter };\nvar emptyMergeTreePool = [];\nfunction getChildMergeTree(_a, name) {\n var map = _a.map;\n if (!map.has(name)) {\n map.set(name, emptyMergeTreePool.pop() || { map: new Map });\n }\n return map.get(name);\n}\nfunction maybeRecycleChildMergeTree(_a, name) {\n var map = _a.map;\n var childTree = map.get(name);\n if (childTree &&\n !childTree.info &&\n !childTree.map.size) {\n emptyMergeTreePool.push(childTree);\n map.delete(name);\n }\n}\nvar warnings = new Set();\nfunction warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {\n var getChild = function (objOrRef) {\n var child = store.getFieldValue(objOrRef, storeFieldName);\n return typeof child === \"object\" && child;\n };\n var existing = getChild(existingRef);\n if (!existing)\n return;\n var incoming = getChild(incomingObj);\n if (!incoming)\n return;\n if (isReference(existing))\n return;\n if (equal(existing, incoming))\n return;\n if (Object.keys(existing).every(function (key) { return store.getFieldValue(incoming, key) !== void 0; })) {\n return;\n }\n var parentType = store.getFieldValue(existingRef, \"__typename\") ||\n store.getFieldValue(incomingObj, \"__typename\");\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var typeDotName = parentType + \".\" + fieldName;\n if (warnings.has(typeDotName))\n return;\n warnings.add(typeDotName);\n var childTypenames = [];\n if (!Array.isArray(existing) &&\n !Array.isArray(incoming)) {\n [existing, incoming].forEach(function (child) {\n var typename = store.getFieldValue(child, \"__typename\");\n if (typeof typename === \"string\" &&\n !childTypenames.includes(typename)) {\n childTypenames.push(typename);\n }\n });\n }\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Cache data may be lost when replacing the \" + fieldName + \" field of a \" + parentType + \" object.\\n\\nTo address this problem (which is not a bug in Apollo Client), \" + (childTypenames.length\n ? \"either ensure all objects of type \" +\n childTypenames.join(\" and \") + \" have an ID or a custom merge function, or \"\n : \"\") + \"define a custom merge function for the \" + typeDotName + \" field, so InMemoryCache can safely merge these objects:\\n\\n existing: \" + JSON.stringify(existing).slice(0, 1000) + \"\\n incoming: \" + JSON.stringify(incoming).slice(0, 1000) + \"\\n\\nFor more information about these options, please refer to the documentation:\\n\\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\\n\");\n}\n//# sourceMappingURL=writeToStore.js.map","import { __assign, __extends } from \"tslib\";\nimport \"./fixPolyfills.js\";\nimport { dep, wrap } from 'optimism';\nimport { ApolloCache } from \"../core/cache.js\";\nimport { MissingFieldError } from \"../core/types/common.js\";\nimport { addTypenameToDocument, isReference, } from \"../../utilities/index.js\";\nimport { StoreReader } from \"./readFromStore.js\";\nimport { StoreWriter } from \"./writeToStore.js\";\nimport { EntityStore, supportsResultCaching } from \"./entityStore.js\";\nimport { makeVar, forgetCache, recallCache } from \"./reactiveVars.js\";\nimport { defaultDataIdFromObject, Policies, } from \"./policies.js\";\nimport { hasOwn } from \"./helpers.js\";\nvar defaultConfig = {\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n typePolicies: {},\n};\nvar InMemoryCache = (function (_super) {\n __extends(InMemoryCache, _super);\n function InMemoryCache(config) {\n if (config === void 0) { config = {}; }\n var _this = _super.call(this) || this;\n _this.watches = new Set();\n _this.typenameDocumentCache = new Map();\n _this.makeVar = makeVar;\n _this.txCount = 0;\n _this.maybeBroadcastWatch = wrap(function (c, fromOptimisticTransaction) {\n return _this.broadcastWatch.call(_this, c, !!fromOptimisticTransaction);\n }, {\n makeCacheKey: function (c) {\n var store = c.optimistic ? _this.optimisticData : _this.data;\n if (supportsResultCaching(store)) {\n var optimistic = c.optimistic, rootId = c.rootId, variables = c.variables;\n return store.makeCacheKey(c.query, c.callback, JSON.stringify({ optimistic: optimistic, rootId: rootId, variables: variables }));\n }\n }\n });\n _this.watchDep = dep();\n _this.config = __assign(__assign({}, defaultConfig), config);\n _this.addTypename = !!_this.config.addTypename;\n _this.policies = new Policies({\n cache: _this,\n dataIdFromObject: _this.config.dataIdFromObject,\n possibleTypes: _this.config.possibleTypes,\n typePolicies: _this.config.typePolicies,\n });\n _this.data = new EntityStore.Root({\n policies: _this.policies,\n resultCaching: _this.config.resultCaching,\n });\n _this.optimisticData = _this.data;\n _this.storeWriter = new StoreWriter(_this, _this.storeReader = new StoreReader({\n cache: _this,\n addTypename: _this.addTypename,\n }));\n return _this;\n }\n InMemoryCache.prototype.restore = function (data) {\n if (data)\n this.data.replace(data);\n return this;\n };\n InMemoryCache.prototype.extract = function (optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return (optimistic ? this.optimisticData : this.data).extract();\n };\n InMemoryCache.prototype.read = function (options) {\n var _a = options.returnPartialData, returnPartialData = _a === void 0 ? false : _a;\n try {\n return this.storeReader.diffQueryAgainstStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: options.query,\n variables: options.variables,\n rootId: options.rootId,\n config: this.config,\n returnPartialData: returnPartialData,\n }).result || null;\n }\n catch (e) {\n if (e instanceof MissingFieldError) {\n return null;\n }\n throw e;\n }\n };\n InMemoryCache.prototype.write = function (options) {\n try {\n ++this.txCount;\n return this.storeWriter.writeToStore({\n store: this.data,\n query: options.query,\n result: options.result,\n dataId: options.dataId,\n variables: options.variables,\n });\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.modify = function (options) {\n if (hasOwn.call(options, \"id\") && !options.id) {\n return false;\n }\n var store = options.optimistic\n ? this.optimisticData\n : this.data;\n try {\n ++this.txCount;\n return store.modify(options.id || \"ROOT_QUERY\", options.fields);\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.diff = function (options) {\n return this.storeReader.diffQueryAgainstStore({\n store: options.optimistic ? this.optimisticData : this.data,\n rootId: options.id || \"ROOT_QUERY\",\n query: options.query,\n variables: options.variables,\n returnPartialData: options.returnPartialData,\n config: this.config,\n });\n };\n InMemoryCache.prototype.watch = function (watch) {\n var _this = this;\n if (!this.watches.size) {\n recallCache(this);\n }\n this.watches.add(watch);\n if (watch.immediate) {\n this.maybeBroadcastWatch(watch);\n }\n return function () {\n if (_this.watches.delete(watch) && !_this.watches.size) {\n forgetCache(_this);\n }\n _this.watchDep.dirty(watch);\n _this.maybeBroadcastWatch.forget(watch);\n };\n };\n InMemoryCache.prototype.gc = function () {\n return this.optimisticData.gc();\n };\n InMemoryCache.prototype.retain = function (rootId, optimistic) {\n return (optimistic ? this.optimisticData : this.data).retain(rootId);\n };\n InMemoryCache.prototype.release = function (rootId, optimistic) {\n return (optimistic ? this.optimisticData : this.data).release(rootId);\n };\n InMemoryCache.prototype.identify = function (object) {\n return isReference(object) ? object.__ref :\n this.policies.identify(object)[0];\n };\n InMemoryCache.prototype.evict = function (options) {\n if (!options.id) {\n if (hasOwn.call(options, \"id\")) {\n return false;\n }\n options = __assign(__assign({}, options), { id: \"ROOT_QUERY\" });\n }\n try {\n ++this.txCount;\n return this.optimisticData.evict(options);\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.reset = function () {\n this.data.clear();\n this.optimisticData = this.data;\n this.broadcastWatches();\n return Promise.resolve();\n };\n InMemoryCache.prototype.removeOptimistic = function (idToRemove) {\n var newOptimisticData = this.optimisticData.removeLayer(idToRemove);\n if (newOptimisticData !== this.optimisticData) {\n this.optimisticData = newOptimisticData;\n this.broadcastWatches();\n }\n };\n InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) {\n var _this = this;\n var perform = function (layer) {\n var _a = _this, data = _a.data, optimisticData = _a.optimisticData;\n ++_this.txCount;\n if (layer) {\n _this.data = _this.optimisticData = layer;\n }\n try {\n transaction(_this);\n }\n finally {\n --_this.txCount;\n _this.data = data;\n _this.optimisticData = optimisticData;\n }\n };\n var fromOptimisticTransaction = false;\n if (typeof optimisticId === 'string') {\n this.optimisticData = this.optimisticData.addLayer(optimisticId, perform);\n fromOptimisticTransaction = true;\n }\n else if (optimisticId === null) {\n perform(this.data);\n }\n else {\n perform();\n }\n this.broadcastWatches(fromOptimisticTransaction);\n };\n InMemoryCache.prototype.transformDocument = function (document) {\n if (this.addTypename) {\n var result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n };\n InMemoryCache.prototype.broadcastWatches = function (fromOptimisticTransaction) {\n var _this = this;\n if (!this.txCount) {\n this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c, fromOptimisticTransaction); });\n }\n };\n InMemoryCache.prototype.broadcastWatch = function (c, fromOptimisticTransaction) {\n this.watchDep.dirty(c);\n this.watchDep(c);\n var diff = this.diff({\n query: c.query,\n variables: c.variables,\n optimistic: c.optimistic,\n });\n if (c.optimistic && fromOptimisticTransaction) {\n diff.fromOptimisticTransaction = true;\n }\n c.callback(diff);\n };\n return InMemoryCache;\n}(ApolloCache));\nexport { InMemoryCache };\n//# sourceMappingURL=inMemoryCache.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import inspect from \"../jsutils/inspect.mjs\";\nimport { isNode } from \"./ast.mjs\";\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport var QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields']\n};\nexport var BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\n\nexport function visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n\n for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) {\n var k = _Object$keys2[_i2];\n clone[k] = node[k];\n }\n\n node = clone;\n }\n\n var editOffset = 0;\n\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n\n if (inArray) {\n editKey -= editOffset;\n }\n\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n\n if (node === null || node === undefined) {\n continue;\n }\n\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error(\"Invalid AST Node: \".concat(inspect(node), \".\"));\n }\n\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _visitorKeys$node$kin;\n\n stack = {\n inArray: inArray,\n index: index,\n keys: keys,\n edits: edits,\n prev: stack\n };\n inArray = Array.isArray(node);\n keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n\n var specificKindVisitor = specificVisitor[kind];\n\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\n\t\t\t// This just needs to be something that won't trample other user's Symbol.for use\n\t\t\t// It also will guide people to the source of their issues, if this is problematic.\n\t\t\t// META: It's a resource locator!\n\t\t\tresult = Symbol.for('https://github.com/benlesh/symbol-observable');\n\t\t\ttry {\n\t\t\t\tSymbol.observable = result;\n\t\t\t} catch (err) {\n\t\t\t\t// Do nothing. In some environments, users have frozen `Symbol` for security reasons,\n\t\t\t\t// if it is frozen assigning to it will throw. In this case, we don't care, because\n\t\t\t\t// they will need to use the returned value from the ponyfill.\n\t\t\t}\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n var fileName = file.name || '';\n var mimeType = (file.type || '').toLowerCase();\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim().toLowerCase();\n\n if (validType.charAt(0) === '.') {\n return fileName.toLowerCase().endsWith(validType);\n } else if (validType.endsWith('/*')) {\n // This is something like a image/* mime type\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n return mimeType === validType;\n });\n }\n\n return true;\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Modal = require(\"./components/Modal\");\n\nvar _Modal2 = _interopRequireDefault(_Modal);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _Modal2.default;\nmodule.exports = exports[\"default\"];","require('./manifest');\n","import manifest from '@neos-project/neos-ui-extensibility';\n\nimport MediaSelectionScreen from './MediaSelectionScreen';\n\nmanifest('Flowpack.Media.Ui:MediaSelectionScreen', {}, (globalRegistry, { frontendConfiguration }) => {\n const secondaryEditorsRegistry = globalRegistry.get('inspector').get('secondaryEditors');\n\n const { useNewMediaSelection } = frontendConfiguration['Flowpack.Media.Ui'];\n\n if (useNewMediaSelection) {\n secondaryEditorsRegistry.set('Neos.Neos/Inspector/Secondary/Editors/MediaSelectionScreen', {\n component: MediaSelectionScreen,\n });\n }\n});\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar createConsumerApi_1 = tslib_1.__importDefault(require(\"./createConsumerApi\"));\nexports.createConsumerApi = createConsumerApi_1[\"default\"];\nvar readFromConsumerApi_1 = tslib_1.__importDefault(require(\"./readFromConsumerApi\"));\nexports.readFromConsumerApi = readFromConsumerApi_1[\"default\"];\nvar index_1 = require(\"./registry/index\");\nexports.SynchronousRegistry = index_1.SynchronousRegistry;\nexports.SynchronousMetaRegistry = index_1.SynchronousMetaRegistry;\nexports[\"default\"] = readFromConsumerApi_1[\"default\"]('manifest');\n//# sourceMappingURL=index.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar manifest_1 = tslib_1.__importDefault(require(\"./manifest\"));\nvar createReadOnlyValue = function (value) { return ({\n value: value,\n writable: false,\n enumerable: false,\n configurable: true\n}); };\nfunction createConsumerApi(manifests, exposureMap) {\n var api = {};\n Object.keys(exposureMap).forEach(function (key) {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n Object.defineProperty(api, '@manifest', createReadOnlyValue(manifest_1[\"default\"](manifests)));\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n}\nexports[\"default\"] = createConsumerApi;\n//# sourceMappingURL=createConsumerApi.js.map","\"use strict\";\nexports.__esModule = true;\nexports[\"default\"] = (function (manifests) {\n return function (identifier, options, bootstrap) {\n var _a;\n manifests.push((_a = {},\n _a[identifier] = {\n options: options,\n bootstrap: bootstrap\n },\n _a));\n };\n});\n//# sourceMappingURL=manifest.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar SynchronousRegistry_1 = tslib_1.__importDefault(require(\"./SynchronousRegistry\"));\nexports.SynchronousRegistry = SynchronousRegistry_1[\"default\"];\nvar SynchronousMetaRegistry_1 = tslib_1.__importDefault(require(\"./SynchronousMetaRegistry\"));\nexports.SynchronousMetaRegistry = SynchronousMetaRegistry_1[\"default\"];\n//# sourceMappingURL=index.js.map","\"use strict\";\nexports.__esModule = true;\nvar AbstractRegistry = (function () {\n function AbstractRegistry(description) {\n this.SERIAL_VERSION_UID = 'd8a5aa78-978e-11e6-ae22-56b6b6499611';\n this.description = description;\n }\n return AbstractRegistry;\n}());\nexports[\"default\"] = AbstractRegistry;\n//# sourceMappingURL=AbstractRegistry.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar positionalArraySorter = function (subject, position, idKey) {\n var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f, e_7, _g;\n if (position === void 0) { position = 'position'; }\n if (idKey === void 0) { idKey = 'key'; }\n var positionAccessor = typeof position === 'string' ? function (value) { return value[position]; } : position;\n var indexMapping = {};\n var middleKeys = {};\n var startKeys = {};\n var endKeys = {};\n var beforeKeys = {};\n var afterKeys = {};\n subject.forEach(function (item, index) {\n var key = item[idKey] ? item[idKey] : String(index);\n indexMapping[key] = index;\n var positionValue = positionAccessor(item);\n var position = String(positionValue ? positionValue : index);\n var invalid = false;\n if (position.startsWith('start')) {\n var weightMatch = position.match(/start\\s+(\\d+)/);\n var weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0;\n if (!startKeys[weight]) {\n startKeys[weight] = [];\n }\n startKeys[weight].push(key);\n }\n else if (position.startsWith('end')) {\n var weightMatch = position.match(/end\\s+(\\d+)/);\n var weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0;\n if (!endKeys[weight]) {\n endKeys[weight] = [];\n }\n endKeys[weight].push(key);\n }\n else if (position.startsWith('before')) {\n var match = position.match(/before\\s+(\\S+)(\\s+(\\d+))?/);\n if (!match) {\n invalid = true;\n }\n else {\n var reference = match[1];\n var weight = match[3] ? Number(match[3]) : 0;\n if (!beforeKeys[reference]) {\n beforeKeys[reference] = {};\n }\n if (!beforeKeys[reference][weight]) {\n beforeKeys[reference][weight] = [];\n }\n beforeKeys[reference][weight].push(key);\n }\n }\n else if (position.startsWith('after')) {\n var match = position.match(/after\\s+(\\S+)(\\s+(\\d+))?/);\n if (!match) {\n invalid = true;\n }\n else {\n var reference = match[1];\n var weight = match[3] ? Number(match[3]) : 0;\n if (!afterKeys[reference]) {\n afterKeys[reference] = {};\n }\n if (!afterKeys[reference][weight]) {\n afterKeys[reference][weight] = [];\n }\n afterKeys[reference][weight].push(key);\n }\n }\n else {\n invalid = true;\n }\n if (invalid) {\n var numberPosition = parseFloat(position);\n if (isNaN(numberPosition) || !isFinite(numberPosition)) {\n numberPosition = index;\n }\n if (!middleKeys[numberPosition]) {\n middleKeys[numberPosition] = [];\n }\n middleKeys[numberPosition].push(key);\n }\n });\n var resultStart = [];\n var resultMiddle = [];\n var resultEnd = [];\n var processedKeys = [];\n var sortedWeights = function (dict, asc) {\n var weights = Object.keys(dict).map(function (x) { return Number(x); }).sort(function (a, b) { return a - b; });\n return asc ? weights : weights.reverse();\n };\n var addToResults = function (keys, result) {\n keys.forEach(function (key) {\n var e_8, _a, e_9, _b;\n if (processedKeys.indexOf(key) >= 0) {\n return;\n }\n processedKeys.push(key);\n if (beforeKeys[key]) {\n var beforeWeights = sortedWeights(beforeKeys[key], true);\n try {\n for (var beforeWeights_1 = tslib_1.__values(beforeWeights), beforeWeights_1_1 = beforeWeights_1.next(); !beforeWeights_1_1.done; beforeWeights_1_1 = beforeWeights_1.next()) {\n var i = beforeWeights_1_1.value;\n addToResults(beforeKeys[key][i], result);\n }\n }\n catch (e_8_1) { e_8 = { error: e_8_1 }; }\n finally {\n try {\n if (beforeWeights_1_1 && !beforeWeights_1_1.done && (_a = beforeWeights_1[\"return\"])) _a.call(beforeWeights_1);\n }\n finally { if (e_8) throw e_8.error; }\n }\n }\n result.push(key);\n if (afterKeys[key]) {\n var afterWeights = sortedWeights(afterKeys[key], false);\n try {\n for (var afterWeights_1 = tslib_1.__values(afterWeights), afterWeights_1_1 = afterWeights_1.next(); !afterWeights_1_1.done; afterWeights_1_1 = afterWeights_1.next()) {\n var i = afterWeights_1_1.value;\n addToResults(afterKeys[key][i], result);\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (afterWeights_1_1 && !afterWeights_1_1.done && (_b = afterWeights_1[\"return\"])) _b.call(afterWeights_1);\n }\n finally { if (e_9) throw e_9.error; }\n }\n }\n });\n };\n try {\n for (var _h = tslib_1.__values(sortedWeights(startKeys, false)), _j = _h.next(); !_j.done; _j = _h.next()) {\n var i = _j.value;\n addToResults(startKeys[i], resultStart);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_j && !_j.done && (_a = _h[\"return\"])) _a.call(_h);\n }\n finally { if (e_1) throw e_1.error; }\n }\n try {\n for (var _k = tslib_1.__values(sortedWeights(middleKeys, true)), _l = _k.next(); !_l.done; _l = _k.next()) {\n var i = _l.value;\n addToResults(middleKeys[i], resultMiddle);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_l && !_l.done && (_b = _k[\"return\"])) _b.call(_k);\n }\n finally { if (e_2) throw e_2.error; }\n }\n try {\n for (var _m = tslib_1.__values(sortedWeights(endKeys, true)), _o = _m.next(); !_o.done; _o = _m.next()) {\n var i = _o.value;\n addToResults(endKeys[i], resultEnd);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_o && !_o.done && (_c = _m[\"return\"])) _c.call(_m);\n }\n finally { if (e_3) throw e_3.error; }\n }\n try {\n for (var _p = tslib_1.__values(Object.keys(beforeKeys)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var key = _q.value;\n if (processedKeys.indexOf(key) >= 0) {\n continue;\n }\n try {\n for (var _r = (e_5 = void 0, tslib_1.__values(sortedWeights(beforeKeys[key], false))), _s = _r.next(); !_s.done; _s = _r.next()) {\n var i = _s.value;\n addToResults(beforeKeys[key][i], resultStart);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_s && !_s.done && (_e = _r[\"return\"])) _e.call(_r);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_q && !_q.done && (_d = _p[\"return\"])) _d.call(_p);\n }\n finally { if (e_4) throw e_4.error; }\n }\n try {\n for (var _t = tslib_1.__values(Object.keys(afterKeys)), _u = _t.next(); !_u.done; _u = _t.next()) {\n var key = _u.value;\n if (processedKeys.indexOf(key) >= 0) {\n continue;\n }\n try {\n for (var _v = (e_7 = void 0, tslib_1.__values(sortedWeights(afterKeys[key], false))), _w = _v.next(); !_w.done; _w = _v.next()) {\n var i = _w.value;\n addToResults(afterKeys[key][i], resultMiddle);\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (_w && !_w.done && (_g = _v[\"return\"])) _g.call(_v);\n }\n finally { if (e_7) throw e_7.error; }\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_u && !_u.done && (_f = _t[\"return\"])) _f.call(_t);\n }\n finally { if (e_6) throw e_6.error; }\n }\n var sortedKeys = tslib_1.__spread(resultStart, resultMiddle, resultEnd);\n return sortedKeys.map(function (key) { return indexMapping[key]; }).map(function (i) { return subject[i]; });\n};\nexports[\"default\"] = positionalArraySorter;\n//# sourceMappingURL=positionalArraySorter.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar SynchronousRegistry_1 = tslib_1.__importDefault(require(\"./SynchronousRegistry\"));\nvar SynchronousMetaRegistry = (function (_super) {\n tslib_1.__extends(SynchronousMetaRegistry, _super);\n function SynchronousMetaRegistry() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SynchronousMetaRegistry.prototype.set = function (key, value) {\n if (value.SERIAL_VERSION_UID !== 'd8a5aa78-978e-11e6-ae22-56b6b6499611') {\n throw new Error('You can only add registries to a meta registry');\n }\n return _super.prototype.set.call(this, key, value);\n };\n return SynchronousMetaRegistry;\n}(SynchronousRegistry_1[\"default\"]));\nexports[\"default\"] = SynchronousMetaRegistry;\n//# sourceMappingURL=SynchronousMetaRegistry.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_redux_1 = require(\"react-redux\");\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar apollo_upload_client_1 = require(\"apollo-upload-client\");\nvar plow_js_1 = require(\"plow-js\");\n// Neos dependencies are provided by the UI\n// @ts-ignore\nvar neos_ui_decorators_1 = require(\"@neos-project/neos-ui-decorators\");\n// @ts-ignore\nvar neos_ui_redux_store_1 = require(\"@neos-project/neos-ui-redux-store\");\n// Media UI dependencies\nvar src_1 = require(\"@media-ui/core/src\");\nvar core_1 = require(\"@media-ui/media-module/src/core\");\nvar App_1 = __importDefault(require(\"@media-ui/media-module/src/components/App\"));\n// GraphQL type definitions\nvar schema_graphql_1 = __importDefault(require(\"@media-ui/core/schema.graphql\"));\nvar schema_graphql_2 = __importDefault(require(\"@media-ui/feature-clipboard/schema.graphql\"));\nvar schema_graphql_3 = __importDefault(require(\"@media-ui/feature-asset-usage/schema.graphql\"));\n// GraphQL local resolvers\nvar mutation_1 = __importDefault(require(\"@media-ui/feature-clipboard/src/resolvers/mutation\"));\nvar mutation_2 = __importDefault(require(\"@media-ui/media-module/src/resolvers/mutation\"));\nvar apolloClient = null;\nvar MediaSelectionScreen = /** @class */ (function (_super) {\n __extends(MediaSelectionScreen, _super);\n function MediaSelectionScreen(props) {\n var _this = _super.call(this, props) || this;\n _this.translate = function (id, fallback, params, packageKey, sourceName) {\n if (packageKey === void 0) { packageKey = 'Flowpack.Media.Ui'; }\n if (sourceName === void 0) { sourceName = 'Main'; }\n return _this.props.i18nRegistry.translate(id, fallback, params, packageKey, sourceName);\n };\n _this.state = {\n initialLeftSideBarHiddenState: false,\n initialNodeCreationDialogOpenState: false,\n };\n return _this;\n }\n MediaSelectionScreen.prototype.componentDidMount = function () {\n var _a = this.props, isLeftSideBarHidden = _a.isLeftSideBarHidden, isNodeCreationDialogOpen = _a.isNodeCreationDialogOpen, toggleSidebar = _a.toggleSidebar;\n this.setState({\n initialLeftSideBarHiddenState: isLeftSideBarHidden,\n initialNodeCreationDialogOpenState: isNodeCreationDialogOpen,\n });\n if (!isLeftSideBarHidden && !isNodeCreationDialogOpen) {\n toggleSidebar();\n }\n };\n MediaSelectionScreen.prototype.componentWillUnmount = function () {\n var _a = this.props, isLeftSideBarHidden = _a.isLeftSideBarHidden, toggleSidebar = _a.toggleSidebar;\n var _b = this.state, initialLeftSideBarHiddenState = _b.initialLeftSideBarHiddenState, initialNodeCreationDialogOpenState = _b.initialNodeCreationDialogOpenState;\n if (initialLeftSideBarHiddenState !== isLeftSideBarHidden && !initialNodeCreationDialogOpenState) {\n toggleSidebar();\n }\n };\n MediaSelectionScreen.prototype.getConfig = function () {\n return {\n endpoints: {\n // TODO: Generate uri from Neos maybe like $get('routes.core.modules.mediaBrowser', neos);\n graphql: '/neos/graphql/media-assets',\n upload: '/neos/media-ui/upload',\n },\n // TODO: Generate image uri from Neos\n dummyImage: '/_Resources/Static/Packages/Neos.Neos/Images/dummy-image.svg',\n };\n };\n MediaSelectionScreen.prototype.getApolloClient = function () {\n if (!apolloClient) {\n var endpoints = this.getConfig().endpoints;\n var cache = core_1.CacheFactory.createCache(this.props.frontendConfiguration);\n core_1.PersistentStateManager.restoreLocalState(cache, this.props.constraints);\n apolloClient = new client_1.ApolloClient({\n cache: cache,\n link: client_1.ApolloLink.from([\n core_1.ApolloErrorHandler,\n apollo_upload_client_1.createUploadLink({\n uri: endpoints.graphql,\n credentials: 'same-origin',\n }),\n ]),\n typeDefs: [schema_graphql_1.default, schema_graphql_2.default, schema_graphql_3.default],\n resolvers: [\n mutation_2.default(core_1.PersistentStateManager.updateLocalState),\n mutation_1.default(core_1.PersistentStateManager.updateLocalState),\n ],\n });\n }\n return apolloClient;\n };\n MediaSelectionScreen.prototype.render = function () {\n var _a = this.props, addFlashMessage = _a.addFlashMessage, onComplete = _a.onComplete, constraints = _a.constraints, type = _a.type;\n var client = this.getApolloClient();\n var dummyImage = this.getConfig().dummyImage;\n var containerRef = react_1.createRef();\n var featureFlags = this.props.frontendConfiguration;\n // The Neos.UI Flashmessages only support the levels 'success', 'error' and 'info'\n var Notification = {\n info: function (message) { return addFlashMessage(message, message, 'info'); },\n ok: function (message) { return addFlashMessage(message, message, 'success'); },\n notice: function (message) { return addFlashMessage(message, message, 'info'); },\n warning: function (title, message) {\n if (message === void 0) { message = ''; }\n return addFlashMessage(title, message, 'error');\n },\n error: function (title, message) {\n if (message === void 0) { message = ''; }\n return addFlashMessage(title, message, 'error');\n },\n };\n var isInNodeCreationDialog = this.state.initialNodeCreationDialogOpenState;\n return (React.createElement(\"div\", { style: { transform: 'translateZ(0)', height: '100%', padding: isInNodeCreationDialog ? 0 : '1rem' } },\n React.createElement(src_1.IntlProvider, { translate: this.translate },\n React.createElement(src_1.NotifyProvider, { notificationApi: Notification },\n React.createElement(client_1.ApolloProvider, { client: client },\n React.createElement(recoil_1.RecoilRoot, null,\n React.createElement(src_1.MediaUiProvider, { dummyImage: dummyImage, onAssetSelection: onComplete, selectionMode: true, isInNodeCreationDialog: isInNodeCreationDialog, containerRef: containerRef, featureFlags: featureFlags, constraints: constraints || {}, assetType: type === 'images' ? 'image' : type },\n React.createElement(src_1.MediaUiThemeProvider, null,\n React.createElement(App_1.default, null)))))))));\n };\n MediaSelectionScreen = __decorate([\n react_redux_1.connect(plow_js_1.$transform({\n isLeftSideBarHidden: plow_js_1.$get('ui.leftSideBar.isHidden'),\n isNodeCreationDialogOpen: plow_js_1.$get('ui.nodeCreationDialog.isOpen'),\n }), {\n addFlashMessage: neos_ui_redux_store_1.actions.UI.FlashMessages.add,\n toggleSidebar: neos_ui_redux_store_1.actions.UI.LeftSideBar.toggle,\n }),\n neos_ui_decorators_1.neos(function (globalRegistry) { return ({\n i18nRegistry: globalRegistry.get('i18n'),\n frontendConfiguration: globalRegistry.get('frontendConfiguration').get('Flowpack.Media.Ui'),\n }); })\n // eslint-disable-next-line prettier/prettier\n ], MediaSelectionScreen);\n return MediaSelectionScreen;\n}(React.PureComponent));\nexports.default = MediaSelectionScreen;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Observable = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// === Symbol Support ===\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\n\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\n\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species'); // === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n if (value == null) return undefined;\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n\n if (ctor === null) {\n ctor = undefined;\n }\n }\n\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n\n if (!queue) {\n return;\n }\n\n subscription._queue = undefined;\n subscription._state = 'ready';\n\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({\n type: type,\n value: value\n });\n\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{\n type: type,\n value: value\n }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription =\n/*#__PURE__*/\nfunction () {\n function Subscription(observer, subscriber) {\n _classCallCheck(this, Subscription);\n\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n _createClass(Subscription, [{\n key: \"unsubscribe\",\n value: function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n }\n }, {\n key: \"closed\",\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver =\n/*#__PURE__*/\nfunction () {\n function SubscriptionObserver(subscription) {\n _classCallCheck(this, SubscriptionObserver);\n\n this._subscription = subscription;\n }\n\n _createClass(SubscriptionObserver, [{\n key: \"next\",\n value: function next(value) {\n onNotify(this._subscription, 'next', value);\n }\n }, {\n key: \"error\",\n value: function error(value) {\n onNotify(this._subscription, 'error', value);\n }\n }, {\n key: \"complete\",\n value: function complete() {\n onNotify(this._subscription, 'complete');\n }\n }, {\n key: \"closed\",\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable =\n/*#__PURE__*/\nfunction () {\n function Observable(subscriber) {\n _classCallCheck(this, Observable);\n\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n this._subscriber = subscriber;\n }\n\n _createClass(Observable, [{\n key: \"subscribe\",\n value: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n\n return new Subscription(observer, this._subscriber);\n }\n }, {\n key: \"forEach\",\n value: function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n }, {\n key: \"map\",\n value: function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"filter\",\n value: function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"reduce\",\n value: function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n observer.next(acc);\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"concat\",\n value: function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscription;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n }\n }, {\n key: \"flatMap\",\n value: function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n }\n }, {\n key: SymbolObservable,\n value: function () {\n return this;\n }\n }], [{\n key: \"from\",\n value: function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n if (x == null) throw new TypeError(x + ' is not an object');\n var method = getMethod(x, SymbolObservable);\n\n if (method) {\n var observable = method.call(x);\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n if (isObservable(observable) && observable.constructor === C) return observable;\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _item = _step.value;\n observer.next(_item);\n if (observer.closed) return;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n }\n }, {\n key: \"of\",\n value: function of() {\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n }, {\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nexports.Observable = Observable;\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export function getEnv() {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n return 'development';\n}\nexport function isEnv(env) {\n return getEnv() === env;\n}\nexport function isDevelopment() {\n return isEnv('development') === true;\n}\nexport function isTest() {\n return isEnv('test') === true;\n}\n//# sourceMappingURL=environment.js.map","'use strict';\n\nexports.createUploadLink = require('./createUploadLink');\nexports.formDataAppendFile = require('./formDataAppendFile');\nexports.isExtractableFile = require('./isExtractableFile');\nexports.ReactNativeFile = require('./ReactNativeFile');\n","'use strict';\n\nvar _extends = require('@babel/runtime/helpers/extends');\n\nvar _require = require('@apollo/client/core'),\n ApolloLink = _require.ApolloLink,\n Observable = _require.Observable;\n\nvar _require2 = require('@apollo/client/link/http'),\n createSignalIfSupported = _require2.createSignalIfSupported,\n fallbackHttpConfig = _require2.fallbackHttpConfig,\n parseAndCheckHttpResponse = _require2.parseAndCheckHttpResponse,\n rewriteURIForGET = _require2.rewriteURIForGET,\n selectHttpOptionsAndBody = _require2.selectHttpOptionsAndBody,\n selectURI = _require2.selectURI,\n serializeFetchParameter = _require2.serializeFetchParameter;\n\nvar extractFiles = require('extract-files/public/extractFiles');\n\nvar formDataAppendFile = require('./formDataAppendFile');\n\nvar isExtractableFile = require('./isExtractableFile');\n\nmodule.exports = function createUploadLink(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$uri = _ref.uri,\n fetchUri = _ref$uri === void 0 ? '/graphql' : _ref$uri,\n useGETForQueries = _ref.useGETForQueries,\n _ref$isExtractableFil = _ref.isExtractableFile,\n customIsExtractableFile =\n _ref$isExtractableFil === void 0\n ? isExtractableFile\n : _ref$isExtractableFil,\n CustomFormData = _ref.FormData,\n _ref$formDataAppendFi = _ref.formDataAppendFile,\n customFormDataAppendFile =\n _ref$formDataAppendFi === void 0\n ? formDataAppendFile\n : _ref$formDataAppendFi,\n customFetch = _ref.fetch,\n fetchOptions = _ref.fetchOptions,\n credentials = _ref.credentials,\n headers = _ref.headers,\n includeExtensions = _ref.includeExtensions;\n\n var linkConfig = {\n http: {\n includeExtensions: includeExtensions,\n },\n options: fetchOptions,\n credentials: credentials,\n headers: headers,\n };\n return new ApolloLink(function (operation) {\n var context = operation.getContext();\n var _context$clientAwaren = context.clientAwareness;\n _context$clientAwaren =\n _context$clientAwaren === void 0 ? {} : _context$clientAwaren;\n var name = _context$clientAwaren.name,\n version = _context$clientAwaren.version,\n headers = context.headers;\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: _extends(\n {},\n name && {\n 'apollographql-client-name': name,\n },\n version && {\n 'apollographql-client-version': version,\n },\n headers\n ),\n };\n\n var _selectHttpOptionsAnd = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig\n ),\n options = _selectHttpOptionsAnd.options,\n body = _selectHttpOptionsAnd.body;\n\n var _extractFiles = extractFiles(body, '', customIsExtractableFile),\n clone = _extractFiles.clone,\n files = _extractFiles.files;\n\n var uri = selectURI(operation, fetchUri);\n\n if (files.size) {\n delete options.headers['content-type'];\n var RuntimeFormData = CustomFormData || FormData;\n var form = new RuntimeFormData();\n form.append('operations', serializeFetchParameter(clone, 'Payload'));\n var map = {};\n var i = 0;\n files.forEach(function (paths) {\n map[++i] = paths;\n });\n form.append('map', JSON.stringify(map));\n i = 0;\n files.forEach(function (paths, file) {\n customFormDataAppendFile(form, ++i, file);\n });\n options.body = form;\n } else {\n if (\n useGETForQueries &&\n !operation.query.definitions.some(function (definition) {\n return (\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation'\n );\n })\n )\n options.method = 'GET';\n\n if (options.method === 'GET') {\n var _rewriteURIForGET = rewriteURIForGET(uri, body),\n newURI = _rewriteURIForGET.newURI,\n parseError = _rewriteURIForGET.parseError;\n\n if (parseError)\n return new Observable(function (observer) {\n observer.error(parseError);\n });\n uri = newURI;\n } else options.body = serializeFetchParameter(clone, 'Payload');\n }\n\n var _createSignalIfSuppor = createSignalIfSupported(),\n controller = _createSignalIfSuppor.controller;\n\n if (controller) {\n if (options.signal)\n options.signal.addEventListener('abort', function () {\n controller.abort();\n });\n options.signal = controller.signal;\n }\n\n var runtimeFetch = customFetch || fetch;\n return new Observable(function (observer) {\n var cleaningUp;\n runtimeFetch(uri, options)\n .then(function (response) {\n operation.setContext({\n response: response,\n });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n })\n .catch(function (error) {\n if (!cleaningUp) {\n if (error.result && error.result.errors && error.result.data)\n observer.next(error.result);\n observer.error(error);\n }\n });\n return function () {\n cleaningUp = true;\n if (controller) controller.abort();\n };\n });\n });\n};\n","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","'use strict';\n\nvar defaultIsExtractableFile = require('./isExtractableFile');\n\nmodule.exports = function extractFiles(value, path, isExtractableFile) {\n if (path === void 0) {\n path = '';\n }\n\n if (isExtractableFile === void 0) {\n isExtractableFile = defaultIsExtractableFile;\n }\n\n var clone;\n var files = new Map();\n\n function addFile(paths, file) {\n var storedPaths = files.get(file);\n if (storedPaths) storedPaths.push.apply(storedPaths, paths);\n else files.set(file, paths);\n }\n\n if (isExtractableFile(value)) {\n clone = null;\n addFile([path], value);\n } else {\n var prefix = path ? path + '.' : '';\n if (typeof FileList !== 'undefined' && value instanceof FileList)\n clone = Array.prototype.map.call(value, function (file, i) {\n addFile(['' + prefix + i], file);\n return null;\n });\n else if (Array.isArray(value))\n clone = value.map(function (child, i) {\n var result = extractFiles(child, '' + prefix + i, isExtractableFile);\n result.files.forEach(addFile);\n return result.clone;\n });\n else if (value && value.constructor === Object) {\n clone = {};\n\n for (var i in value) {\n var result = extractFiles(value[i], '' + prefix + i, isExtractableFile);\n result.files.forEach(addFile);\n clone[i] = result.clone;\n }\n } else clone = value;\n }\n\n return {\n clone: clone,\n files: files,\n };\n};\n","'use strict';\n\nmodule.exports = require('extract-files/public/ReactNativeFile');\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().plow;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiDecorators;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MediaUiProvider = exports.useMediaUi = exports.MediaUiContext = void 0;\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar matcher_1 = require(\"matcher\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"../hooks\");\nvar Notify_1 = require(\"./Notify\");\nvar state_1 = require(\"../state\");\nvar asset_1 = require(\"../fragments/asset\");\nexports.MediaUiContext = react_1.createContext({});\nexports.useMediaUi = function () { return react_1.useContext(exports.MediaUiContext); };\nfunction MediaUiProvider(_a) {\n var children = _a.children, dummyImage = _a.dummyImage, _b = _a.selectionMode, selectionMode = _b === void 0 ? false : _b, _c = _a.isInNodeCreationDialog, isInNodeCreationDialog = _c === void 0 ? false : _c, _d = _a.onAssetSelection, onAssetSelection = _d === void 0 ? null : _d, containerRef = _a.containerRef, featureFlags = _a.featureFlags, _e = _a.constraints, constraints = _e === void 0 ? {} : _e, _f = _a.assetType, assetType = _f === void 0 ? 'all' : _f;\n var translate = src_1.useIntl().translate;\n var Notify = Notify_1.useNotify();\n var client = client_1.useApolloClient();\n var deleteAsset = hooks_1.useDeleteAsset().deleteAsset;\n var importAsset = hooks_1.useImportAsset().importAsset;\n var _g = hooks_1.useAssetsQuery(), assets = _g.assets, refetchAssets = _g.refetch;\n var _h = recoil_1.useRecoilState(state_1.selectedMediaTypeState), selectedMediaType = _h[0], setSelectedMediaType = _h[1];\n // Set initial media type state\n react_1.useEffect(function () {\n if (assetType) {\n setSelectedMediaType(assetType);\n }\n }, [assetType, setSelectedMediaType]);\n var handleDeleteAsset = react_1.useCallback(function (asset) {\n // TODO: Use custom modal\n var confirm = window.confirm(translate('action.deleteAsset.confirm', 'Do you really want to delete the asset ' + asset.label, [\n asset.label,\n ]));\n if (!confirm)\n return new Promise(function () { return false; });\n return deleteAsset({ assetId: asset.id, assetSourceId: asset.assetSource.id })\n .then(function () {\n Notify.ok(translate('action.deleteAsset.success', 'The asset has been deleted'));\n return true;\n })\n .catch(function (_a) {\n var message = _a.message;\n // TODO: translate possible error message or generate one on server\n Notify.error(translate('action.deleteAsset.error', 'Error while trying to delete the asset'), message);\n return false;\n });\n }, [Notify, translate, deleteAsset]);\n var isAssetSelectable = react_1.useCallback(function (asset) {\n var _a, _b;\n if (((_a = constraints.mediaTypes) === null || _a === void 0 ? void 0 : _a.length) > 0) {\n if (!matcher_1.isMatch(asset.file.mediaType, constraints.mediaTypes)) {\n return false;\n }\n }\n if (((_b = constraints.assetSources) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n if (!matcher_1.isMatch(asset.assetSource.id, constraints.assetSources)) {\n return false;\n }\n }\n return true;\n }, [constraints]);\n // Handle selection mode for the secondary Neos UI inspector\n var handleSelectAsset = react_1.useCallback(function (assetIdentity) {\n if (!onAssetSelection || !assetIdentity) {\n return;\n }\n // Read local asset data from cache as the asset editor and the constraint check require it\n var asset = client.readFragment({\n fragment: client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment LocalAssetData on Asset {\\n ...AssetProps\\n }\\n \", \"\\n \"], [\"\\n fragment LocalAssetData on Asset {\\n ...AssetProps\\n }\\n \", \"\\n \"])), asset_1.ASSET_FRAGMENT),\n fragmentName: 'LocalAssetData',\n variables: {\n includeUsage: false,\n },\n id: client.cache.identify({ __typename: 'Asset', id: assetIdentity.assetId }),\n });\n if (!isAssetSelectable(asset)) {\n Notify.notice(translate('action.selectAsset.invalidType.message', 'You can only select any of the following types: {types}', {\n types: constraints.mediaTypes.join(', '),\n }));\n return;\n }\n if (asset.localId) {\n onAssetSelection(asset.localId);\n }\n else {\n // If no local id is present, we first need to import the asset from its remote source\n importAsset(assetIdentity).then(function (_a) {\n var data = _a.data;\n onAssetSelection(data.importAsset.localId);\n });\n }\n }, [client, importAsset, onAssetSelection, isAssetSelectable, translate, Notify, constraints.mediaTypes]);\n return (React.createElement(exports.MediaUiContext.Provider, { value: {\n containerRef: containerRef,\n dummyImage: dummyImage,\n handleDeleteAsset: handleDeleteAsset,\n handleSelectAsset: handleSelectAsset,\n selectionMode: selectionMode,\n isInNodeCreationDialog: isInNodeCreationDialog,\n assets: assets,\n refetchAssets: refetchAssets,\n featureFlags: featureFlags,\n constraints: constraints,\n assetType: assetType,\n isAssetSelectable: isAssetSelectable,\n } }, children));\n}\nexports.MediaUiProvider = MediaUiProvider;\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nfunction useAssetCollectionsQuery() {\n var _a = client_1.useQuery(queries_1.ASSET_COLLECTIONS), data = _a.data, loading = _a.loading;\n return { assetCollections: (data === null || data === void 0 ? void 0 : data.assetCollections) || [], loading: loading };\n}\nexports.default = useAssetCollectionsQuery;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n asset(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n asset(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IPTC_PROPERTY_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.IPTC_PROPERTY_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment IptcPropertyProps on IptcProperty {\\n propertyName\\n value\\n }\\n\"], [\"\\n fragment IptcPropertyProps on IptcProperty {\\n propertyName\\n value\\n }\\n\"])));\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FILE_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.FILE_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment FileProps on File {\\n extension\\n mediaType\\n typeIcon {\\n url\\n alt\\n }\\n size\\n url\\n }\\n\"], [\"\\n fragment FileProps on File {\\n extension\\n mediaType\\n typeIcon {\\n url\\n alt\\n }\\n size\\n url\\n }\\n\"])));\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar ASSETS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSETS(\\n $searchTerm: String\\n $assetSourceId: AssetSourceId\\n $assetCollectionId: AssetCollectionId\\n $mediaType: MediaType\\n $tagId: TagId\\n $limit: Int\\n $offset: Int\\n $sortBy: SortBy\\n $sortDirection: SortDirection\\n $includeUsage: Boolean = false\\n ) {\\n selectedAssetSourceId @client(always: true) @export(as: \\\"assetSourceId\\\")\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n assets(\\n searchTerm: $searchTerm\\n assetSourceId: $assetSourceId\\n assetCollectionId: $assetCollectionId\\n mediaType: $mediaType\\n tagId: $tagId\\n limit: $limit\\n offset: $offset\\n sortBy: $sortBy\\n sortDirection: $sortDirection\\n ) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSETS(\\n $searchTerm: String\\n $assetSourceId: AssetSourceId\\n $assetCollectionId: AssetCollectionId\\n $mediaType: MediaType\\n $tagId: TagId\\n $limit: Int\\n $offset: Int\\n $sortBy: SortBy\\n $sortDirection: SortDirection\\n $includeUsage: Boolean = false\\n ) {\\n selectedAssetSourceId @client(always: true) @export(as: \\\"assetSourceId\\\")\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n assets(\\n searchTerm: $searchTerm\\n assetSourceId: $assetSourceId\\n assetCollectionId: $assetCollectionId\\n mediaType: $mediaType\\n tagId: $tagId\\n limit: $limit\\n offset: $offset\\n sortBy: $sortBy\\n sortDirection: $sortDirection\\n ) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = ASSETS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetCollection_1 = require(\"../fragments/assetCollection\");\nvar ASSET_COLLECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_COLLECTION($id: AssetCollectionId!) {\\n assetCollection(id: $id) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_COLLECTION($id: AssetCollectionId!) {\\n assetCollection(id: $id) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"])), assetCollection_1.ASSET_COLLECTION_FRAGMENT);\nexports.default = ASSET_COLLECTION;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetCollection_1 = require(\"../fragments/assetCollection\");\nvar ASSET_COLLECTIONS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_COLLECTIONS {\\n assetCollections {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_COLLECTIONS {\\n assetCollections {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"])), assetCollection_1.ASSET_COLLECTION_FRAGMENT);\nexports.default = ASSET_COLLECTIONS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar ASSET_COUNT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_COUNT(\\n $searchTerm: String\\n $assetSourceId: AssetSourceId\\n $assetCollectionId: AssetCollectionId\\n $mediaType: MediaType\\n $tagId: TagId\\n ) {\\n selectedAssetSourceId @client(always: true) @export(as: \\\"assetSourceId\\\")\\n assetCount(\\n searchTerm: $searchTerm\\n assetSourceId: $assetSourceId\\n assetCollectionId: $assetCollectionId\\n mediaType: $mediaType\\n tagId: $tagId\\n )\\n }\\n\"], [\"\\n query ASSET_COUNT(\\n $searchTerm: String\\n $assetSourceId: AssetSourceId\\n $assetCollectionId: AssetCollectionId\\n $mediaType: MediaType\\n $tagId: TagId\\n ) {\\n selectedAssetSourceId @client(always: true) @export(as: \\\"assetSourceId\\\")\\n assetCount(\\n searchTerm: $searchTerm\\n assetSourceId: $assetSourceId\\n assetCollectionId: $assetCollectionId\\n mediaType: $mediaType\\n tagId: $tagId\\n )\\n }\\n\"])));\nexports.default = ASSET_COUNT;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetSource_1 = require(\"../fragments/assetSource\");\nvar ASSET_SOURCES = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_SOURCES {\\n assetSources {\\n ...AssetSourceProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_SOURCES {\\n assetSources {\\n ...AssetSourceProps\\n }\\n }\\n \", \"\\n\"])), assetSource_1.ASSET_SOURCE_FRAGMENT);\nexports.default = ASSET_SOURCES;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar CONFIG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query CONFIG {\\n config {\\n uploadMaxFileSize\\n uploadMaxFileUploadLimit\\n currentServerTime\\n }\\n }\\n\"], [\"\\n query CONFIG {\\n config {\\n uploadMaxFileSize\\n uploadMaxFileUploadLimit\\n currentServerTime\\n }\\n }\\n\"])));\nexports.default = CONFIG;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"../fragments/tag\");\nvar TAG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query TAG($id: TagId!) {\\n tag(id: $id) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query TAG($id: TagId!) {\\n tag(id: $id) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nexports.default = TAG;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"../fragments/tag\");\nvar TAGS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query TAGS {\\n tags {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query TAGS {\\n tags {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nexports.default = TAGS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SET_SELECTED_ASSET_SOURCE_ID = exports.SELECTED_ASSET_SOURCE_ID = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.SELECTED_ASSET_SOURCE_ID = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query SelectedAssetSourceId {\\n selectedAssetSourceId @client(always: true)\\n }\\n\"], [\"\\n query SelectedAssetSourceId {\\n selectedAssetSourceId @client(always: true)\\n }\\n\"])));\nexports.SET_SELECTED_ASSET_SOURCE_ID = client_1.gql(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\\n }\\n\"], [\"\\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\\n }\\n\"])));\nvar templateObject_1, templateObject_2;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar queries_1 = require(\"../queries\");\nvar useSelectedTag_1 = __importDefault(require(\"./useSelectedTag\"));\nvar useSelectedAssetCollection_1 = __importDefault(require(\"./useSelectedAssetCollection\"));\nvar state_1 = require(\"../state\");\nfunction useAssetCountQuery() {\n var searchTerm = recoil_1.useRecoilValue(state_1.searchTermState);\n var selectedTag = useSelectedTag_1.default();\n var selectedAssetCollection = useSelectedAssetCollection_1.default();\n var _a = client_1.useQuery(queries_1.ASSET_COUNT, {\n variables: {\n assetCollectionId: selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id,\n tagId: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id,\n searchTerm: searchTerm,\n },\n }), data = _a.data, loading = _a.loading;\n return { assetCount: (data === null || data === void 0 ? void 0 : data.assetCount) || 0, loading: loading };\n}\nexports.default = useAssetCountQuery;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar currentPageState = recoil_1.atom({\n key: 'currentPageState',\n default: 1,\n});\nexports.default = currentPageState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar initialLoadCompleteState = recoil_1.atom({\n key: 'initialLoadComplete',\n default: false,\n});\nexports.default = initialLoadCompleteState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar loadingState = recoil_1.atom({\n key: 'loadingState',\n default: false,\n});\nexports.default = loadingState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar searchTermState = recoil_1.atom({\n key: 'searchTermState',\n default: '',\n});\nexports.default = searchTermState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedAssetCollectionIdState = recoil_1.atom({\n key: 'selectedAssetCollectionIdState',\n default: null,\n});\nexports.default = selectedAssetCollectionIdState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedMediaTypeState = recoil_1.atom({\n key: 'selectedMediaTypeState',\n default: 'all',\n});\nexports.default = selectedMediaTypeState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedTagIdState = recoil_1.atom({\n key: 'selectedTagIdState',\n default: null,\n});\nexports.default = selectedTagIdState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar provider_1 = require(\"../provider\");\nfunction useAssetSourcesQuery() {\n var constraints = provider_1.useMediaUi().constraints;\n var _a = client_1.useQuery(queries_1.ASSET_SOURCES), data = _a.data, loading = _a.loading;\n // Filter out sources that don't match the constraints\n var assetSources = react_1.useMemo(function () {\n var assetSources = (data === null || data === void 0 ? void 0 : data.assetSources) || [];\n return constraints.assetSources\n ? assetSources.filter(function (source) {\n return constraints.assetSources.includes(source.id);\n })\n : assetSources;\n }, [data === null || data === void 0 ? void 0 : data.assetSources, constraints.assetSources]);\n // TODO: Handle error if no asset sources are available\n return { assetSources: assetSources, loading: loading };\n}\nexports.default = useAssetSourcesQuery;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar useSelectedAssetCollection_1 = __importDefault(require(\"./useSelectedAssetCollection\"));\nvar useSelectedTag_1 = __importDefault(require(\"./useSelectedTag\"));\nvar pagination_1 = require(\"../constants/pagination\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar useAssetsQuery = function () {\n var searchTerm = recoil_1.useRecoilValue(state_1.searchTermState);\n var selectedAssetCollection = useSelectedAssetCollection_1.default();\n var selectedTag = useSelectedTag_1.default();\n var mediaTypeFilter = recoil_1.useRecoilValue(state_1.selectedMediaTypeState);\n var sortOrderState = recoil_1.useRecoilValue(state_1.selectedSortOrderState);\n var currentPage = recoil_1.useRecoilValue(state_1.currentPageState);\n var _a = recoil_1.useRecoilState(state_1.loadingState), isLoading = _a[0], setIsLoading = _a[1];\n var setInitialLoadComplete = recoil_1.useSetRecoilState(state_1.initialLoadCompleteState);\n var _b = react_1.useState([]), assets = _b[0], setAssets = _b[1];\n var limit = pagination_1.ASSETS_PER_PAGE;\n var offset = (currentPage - 1) * pagination_1.ASSETS_PER_PAGE;\n var _c = client_1.useLazyQuery(queries_1.ASSETS, {\n notifyOnNetworkStatusChange: false,\n variables: {\n searchTerm: searchTerm,\n assetCollectionId: selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id,\n mediaType: mediaTypeFilter,\n tagId: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id,\n limit: limit,\n offset: offset,\n sortBy: sortOrderState.sortBy,\n sortDirection: sortOrderState.sortDirection,\n },\n }), query = _c[0], _d = _c[1], loading = _d.loading, error = _d.error, data = _d.data, refetch = _d.refetch;\n react_1.useEffect(function () {\n if (!loading && !isLoading) {\n query({\n variables: {\n searchTerm: searchTerm,\n assetCollectionId: selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id,\n mediaType: mediaTypeFilter,\n tagId: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id,\n limit: limit,\n offset: offset,\n sortBy: sortOrderState.sortBy,\n sortDirection: sortOrderState.sortDirection,\n },\n });\n setIsLoading(true);\n }\n else if (data && !loading && isLoading) {\n setIsLoading(false);\n setInitialLoadComplete(true);\n setAssets(data.assets);\n // TODO: Update currentPage if asset count changes and current page exceeds limit\n }\n // Don't include `isLoading` to prevent constant reloads\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n query,\n data,\n loading,\n offset,\n limit,\n searchTerm,\n selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.title,\n mediaTypeFilter,\n selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id,\n sortOrderState,\n ]);\n return { error: error, assets: assets, refetch: refetch };\n};\nexports.default = useAssetsQuery;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar useConfigQuery = function () {\n var _a = client_1.useQuery(queries_1.CONFIG), data = _a.data, loading = _a.loading;\n return { config: data === null || data === void 0 ? void 0 : data.config, loading: loading };\n};\nexports.default = useConfigQuery;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar mutations_1 = require(\"../mutations\");\nfunction useCreateAssetCollection() {\n var _a = client_1.useMutation(mutations_1.CREATE_ASSET_COLLECTION), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var createAssetCollection = function (title) {\n return action({\n variables: {\n title: title,\n },\n update: function (cache, _a) {\n var data = _a.data;\n var assetCollections = cache.readQuery({ query: queries_1.ASSET_COLLECTIONS }).assetCollections;\n cache.writeQuery({\n query: queries_1.ASSET_COLLECTIONS,\n data: { assetCollections: assetCollections.concat([data === null || data === void 0 ? void 0 : data.createAssetCollection]) },\n });\n },\n });\n };\n return { createAssetCollection: createAssetCollection, data: data, error: error, loading: loading };\n}\nexports.default = useCreateAssetCollection;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetCollection_1 = require(\"../fragments/assetCollection\");\nvar CREATE_ASSET_COLLECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation CreateAssetCollection($title: String!) {\\n createAssetCollection(title: $title) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation CreateAssetCollection($title: String!) {\\n createAssetCollection(title: $title) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"])), assetCollection_1.ASSET_COLLECTION_FRAGMENT);\nexports.default = CREATE_ASSET_COLLECTION;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"../fragments/tag\");\nvar CREATE_TAG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nexports.default = CREATE_TAG;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar DELETE_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\\n }\\n\"], [\"\\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\\n }\\n\"])));\nexports.default = DELETE_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar DELETE_ASSET_COLLECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\\n deleteAssetCollection(id: $id) {\\n success\\n }\\n }\\n\"], [\"\\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\\n deleteAssetCollection(id: $id) {\\n success\\n }\\n }\\n\"])));\nexports.default = DELETE_ASSET_COLLECTION;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar DELETE_TAG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation DeleteTag($id: TagId!) {\\n deleteTag(id: $id)\\n }\\n\"], [\"\\n mutation DeleteTag($id: TagId!) {\\n deleteTag(id: $id)\\n }\\n\"])));\nexports.default = DELETE_TAG;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar IMPORT_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n importAsset(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n importAsset(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = IMPORT_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar SET_ASSET_COLLECTIONS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation SetAssetCollections(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $assetCollectionIds: [AssetCollectionId!]!\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation SetAssetCollections(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $assetCollectionIds: [AssetCollectionId!]!\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = SET_ASSET_COLLECTIONS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar SET_ASSET_TAGS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation SetAssetTags(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $tagIds: [TagId!]!\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation SetAssetTags(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $tagIds: [TagId!]!\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = SET_ASSET_TAGS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar TAG_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = TAG_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar UNTAG_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = UNTAG_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar UPDATE_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UpdateAsset(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $label: String\\n $caption: String\\n $copyrightNotice: String\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n updateAsset(\\n id: $id\\n assetSourceId: $assetSourceId\\n label: $label\\n caption: $caption\\n copyrightNotice: $copyrightNotice\\n ) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation UpdateAsset(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $label: String\\n $caption: String\\n $copyrightNotice: String\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n updateAsset(\\n id: $id\\n assetSourceId: $assetSourceId\\n label: $label\\n caption: $caption\\n copyrightNotice: $copyrightNotice\\n ) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = UPDATE_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetCollection_1 = require(\"../fragments/assetCollection\");\nvar UPDATE_ASSET_COLLECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"])), assetCollection_1.ASSET_COLLECTION_FRAGMENT);\nexports.default = UPDATE_ASSET_COLLECTION;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"../fragments/tag\");\nvar UPDATE_TAG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UpdateTag($id: TagId!, $label: String) {\\n updateTag(id: $id, label: $label) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation UpdateTag($id: TagId!, $label: String) {\\n updateTag(id: $id, label: $label) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nexports.default = UPDATE_TAG;\nvar templateObject_1;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar mutations_1 = require(\"../mutations\");\nfunction useCreateTag() {\n var _a = client_1.useMutation(mutations_1.CREATE_TAG), action = _a[0], _b = _a[1], error = _b.error, data = _b.data;\n var createTag = function (label, assetCollectionId) {\n return action({\n variables: { label: label, assetCollectionId: assetCollectionId },\n // FIXME: Optimistic response has to be adjusted as we don't know the id of the created tag\n // optimisticResponse: {\n // __typename: 'Mutation',\n // createTag: {\n // __typename: 'Tag',\n // label: label,\n // }\n // },\n update: function (proxy, _a) {\n var newTag = _a.data.createTag;\n var assetCollections = proxy.readQuery({ query: queries_1.ASSET_COLLECTIONS }).assetCollections;\n var updatedAssetCollections = assetCollections.map(function (assetCollection) {\n if (assetCollection.id === assetCollectionId) {\n return __assign(__assign({}, assetCollection), { tags: __spreadArrays(assetCollection.tags, [newTag]) });\n }\n return assetCollection;\n });\n proxy.writeQuery({\n query: queries_1.ASSET_COLLECTIONS,\n data: { assetCollections: updatedAssetCollections },\n });\n var tags = proxy.readQuery({ query: queries_1.TAGS }).tags;\n if (!tags.find(function (tag) { return (tag === null || tag === void 0 ? void 0 : tag.label) === (newTag === null || newTag === void 0 ? void 0 : newTag.label); })) {\n proxy.writeQuery({\n query: queries_1.TAGS,\n data: {\n tags: __spreadArrays(tags, [newTag]),\n },\n });\n }\n },\n });\n };\n return { createTag: createTag, data: data, error: error };\n}\nexports.default = useCreateTag;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar mutations_1 = require(\"../mutations\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar index_1 = require(\"./index\");\nvar events_1 = require(\"../events\");\nfunction useDeleteAsset() {\n var _a = client_1.useMutation(mutations_1.DELETE_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data;\n var _c = recoil_1.useRecoilState(state_1.selectedAssetIdState), selectedAssetId = _c[0], setSelectedAsset = _c[1];\n var assetRemoved = index_1.useEvent(events_1.assetRemovedEvent);\n // TODO: Check whether an optimisticResponse can be used here\n // Without a fast asset usage count retrieval a lot of negative responses are possible\n var deleteAsset = function (_a) {\n var assetId = _a.assetId, assetSourceId = _a.assetSourceId;\n return action({\n variables: { id: assetId, assetSourceId: assetSourceId },\n refetchQueries: [\n {\n query: queries_1.ASSET,\n variables: { id: assetId, assetSourceId: assetSourceId },\n },\n ],\n update: function (cache, _a) {\n var success = _a.data.deleteAsset;\n if (!success)\n return;\n // Remove deleted asset from cache\n cache.evict({ id: cache.identify({ __typename: 'Asset', id: assetId }) });\n cache.gc();\n },\n }).then(function (_a) {\n var success = _a.data.deleteAsset;\n if (!success) {\n throw new Error('Could not delete asset');\n }\n assetRemoved({ assetId: assetId, assetSourceId: assetSourceId });\n // Unselect currently selected asset if it was just deleted\n if (assetId === (selectedAssetId === null || selectedAssetId === void 0 ? void 0 : selectedAssetId.assetId)) {\n setSelectedAsset(null);\n }\n });\n };\n return { deleteAsset: deleteAsset, data: data, error: error };\n}\nexports.default = useDeleteAsset;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assetUpdatedEvent = exports.assetRemovedEvent = exports.assetCreatedEvent = void 0;\nvar createEvent_1 = require(\"./createEvent\");\nvar assetCreatedEvent = createEvent_1.createEvent('ASSET_CREATED');\nexports.assetCreatedEvent = assetCreatedEvent;\nvar assetRemovedEvent = createEvent_1.createEvent('ASSET_REMOVED');\nexports.assetRemovedEvent = assetRemovedEvent;\nvar assetUpdatedEvent = createEvent_1.createEvent('ASSET_UPDATED');\nexports.assetUpdatedEvent = assetUpdatedEvent;\n","/**\n * Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk\n * License: MIT - http://mrgnrdrck.mit-license.org\n *\n * https://github.com/mroderick/PubSubJS\n */\n\n(function (root, factory){\n 'use strict';\n\n var PubSub = {};\n root.PubSub = PubSub;\n factory(PubSub);\n // CommonJS and Node.js module support\n if (typeof exports === 'object'){\n if (module !== undefined && module.exports) {\n exports = module.exports = PubSub; // Node.js specific `module.exports`\n }\n exports.PubSub = PubSub; // CommonJS module 1.1.1 spec\n module.exports = exports = PubSub; // CommonJS\n }\n // AMD support\n /* eslint-disable no-undef */\n else if (typeof define === 'function' && define.amd){\n define(function() { return PubSub; });\n /* eslint-enable no-undef */\n }\n\n}(( typeof window === 'object' && window ) || this, function (PubSub){\n 'use strict';\n\n var messages = {},\n lastUid = -1,\n ALL_SUBSCRIBING_MSG = '*';\n\n function hasKeys(obj){\n var key;\n\n for (key in obj){\n if ( Object.prototype.hasOwnProperty.call(obj, key) ){\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns a function that throws the passed exception, for use as argument for setTimeout\n * @alias throwException\n * @function\n * @param { Object } ex An Error object\n */\n function throwException( ex ){\n return function reThrowException(){\n throw ex;\n };\n }\n\n function callSubscriberWithDelayedExceptions( subscriber, message, data ){\n try {\n subscriber( message, data );\n } catch( ex ){\n setTimeout( throwException( ex ), 0);\n }\n }\n\n function callSubscriberWithImmediateExceptions( subscriber, message, data ){\n subscriber( message, data );\n }\n\n function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){\n var subscribers = messages[matchedMessage],\n callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions,\n s;\n\n if ( !Object.prototype.hasOwnProperty.call( messages, matchedMessage ) ) {\n return;\n }\n\n for (s in subscribers){\n if ( Object.prototype.hasOwnProperty.call(subscribers, s)){\n callSubscriber( subscribers[s], originalMessage, data );\n }\n }\n }\n\n function createDeliveryFunction( message, data, immediateExceptions ){\n return function deliverNamespaced(){\n var topic = String( message ),\n position = topic.lastIndexOf( '.' );\n\n // deliver the message as it is now\n deliverMessage(message, message, data, immediateExceptions);\n\n // trim the hierarchy and deliver message to each level\n while( position !== -1 ){\n topic = topic.substr( 0, position );\n position = topic.lastIndexOf('.');\n deliverMessage( message, topic, data, immediateExceptions );\n }\n\n deliverMessage(message, ALL_SUBSCRIBING_MSG, data, immediateExceptions);\n };\n }\n\n function hasDirectSubscribersFor( message ) {\n var topic = String( message ),\n found = Boolean(Object.prototype.hasOwnProperty.call( messages, topic ) && hasKeys(messages[topic]));\n\n return found;\n }\n\n function messageHasSubscribers( message ){\n var topic = String( message ),\n found = hasDirectSubscribersFor(topic) || hasDirectSubscribersFor(ALL_SUBSCRIBING_MSG),\n position = topic.lastIndexOf( '.' );\n\n while ( !found && position !== -1 ){\n topic = topic.substr( 0, position );\n position = topic.lastIndexOf( '.' );\n found = hasDirectSubscribersFor(topic);\n }\n\n return found;\n }\n\n function publish( message, data, sync, immediateExceptions ){\n message = (typeof message === 'symbol') ? message.toString() : message;\n\n var deliver = createDeliveryFunction( message, data, immediateExceptions ),\n hasSubscribers = messageHasSubscribers( message );\n\n if ( !hasSubscribers ){\n return false;\n }\n\n if ( sync === true ){\n deliver();\n } else {\n setTimeout( deliver, 0 );\n }\n return true;\n }\n\n /**\n * Publishes the message, passing the data to it's subscribers\n * @function\n * @alias publish\n * @param { String } message The message to publish\n * @param {} data The data to pass to subscribers\n * @return { Boolean }\n */\n PubSub.publish = function( message, data ){\n return publish( message, data, false, PubSub.immediateExceptions );\n };\n\n /**\n * Publishes the message synchronously, passing the data to it's subscribers\n * @function\n * @alias publishSync\n * @param { String } message The message to publish\n * @param {} data The data to pass to subscribers\n * @return { Boolean }\n */\n PubSub.publishSync = function( message, data ){\n return publish( message, data, true, PubSub.immediateExceptions );\n };\n\n /**\n * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if you need to unsubscribe\n * @function\n * @alias subscribe\n * @param { String } message The message to subscribe to\n * @param { Function } func The function to call when a new message is published\n * @return { String }\n */\n PubSub.subscribe = function( message, func ){\n if ( typeof func !== 'function'){\n return false;\n }\n\n message = (typeof message === 'symbol') ? message.toString() : message;\n\n // message is not registered yet\n if ( !Object.prototype.hasOwnProperty.call( messages, message ) ){\n messages[message] = {};\n }\n\n // forcing token as String, to allow for future expansions without breaking usage\n // and allow for easy use as key names for the 'messages' object\n var token = 'uid_' + String(++lastUid);\n messages[message][token] = func;\n\n // return token for unsubscribing\n return token;\n };\n\n PubSub.subscribeAll = function( func ){\n return PubSub.subscribe(ALL_SUBSCRIBING_MSG, func);\n };\n\n /**\n * Subscribes the passed function to the passed message once\n * @function\n * @alias subscribeOnce\n * @param { String } message The message to subscribe to\n * @param { Function } func The function to call when a new message is published\n * @return { PubSub }\n */\n PubSub.subscribeOnce = function( message, func ){\n var token = PubSub.subscribe( message, function(){\n // before func apply, unsubscribe message\n PubSub.unsubscribe( token );\n func.apply( this, arguments );\n });\n return PubSub;\n };\n\n /**\n * Clears all subscriptions\n * @function\n * @public\n * @alias clearAllSubscriptions\n */\n PubSub.clearAllSubscriptions = function clearAllSubscriptions(){\n messages = {};\n };\n\n /**\n * Clear subscriptions by the topic\n * @function\n * @public\n * @alias clearAllSubscriptions\n * @return { int }\n */\n PubSub.clearSubscriptions = function clearSubscriptions(topic){\n var m;\n for (m in messages){\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){\n delete messages[m];\n }\n }\n };\n\n /**\n Count subscriptions by the topic\n * @function\n * @public\n * @alias countSubscriptions\n * @return { Array }\n */\n PubSub.countSubscriptions = function countSubscriptions(topic){\n var m;\n // eslint-disable-next-line no-unused-vars\n var token;\n var count = 0;\n for (m in messages) {\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0) {\n for (token in messages[m]) {\n count++;\n }\n break;\n }\n }\n return count;\n };\n\n\n /**\n Gets subscriptions by the topic\n * @function\n * @public\n * @alias getSubscriptions\n */\n PubSub.getSubscriptions = function getSubscriptions(topic){\n var m;\n var list = [];\n for (m in messages){\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){\n list.push(m);\n }\n }\n return list;\n };\n\n /**\n * Removes subscriptions\n *\n * - When passed a token, removes a specific subscription.\n *\n\t * - When passed a function, removes all subscriptions for that function\n *\n\t * - When passed a topic, removes all subscriptions for that topic (hierarchy)\n * @function\n * @public\n * @alias subscribeOnce\n * @param { String | Function } value A token, function or topic to unsubscribe from\n * @example // Unsubscribing with a token\n * var token = PubSub.subscribe('mytopic', myFunc);\n * PubSub.unsubscribe(token);\n * @example // Unsubscribing with a function\n * PubSub.unsubscribe(myFunc);\n * @example // Unsubscribing from a topic\n * PubSub.unsubscribe('mytopic');\n */\n PubSub.unsubscribe = function(value){\n var descendantTopicExists = function(topic) {\n var m;\n for ( m in messages ){\n if ( Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0 ){\n // a descendant of the topic exists:\n return true;\n }\n }\n\n return false;\n },\n isTopic = typeof value === 'string' && ( Object.prototype.hasOwnProperty.call(messages, value) || descendantTopicExists(value) ),\n isToken = !isTopic && typeof value === 'string',\n isFunction = typeof value === 'function',\n result = false,\n m, message, t;\n\n if (isTopic){\n PubSub.clearSubscriptions(value);\n return;\n }\n\n for ( m in messages ){\n if ( Object.prototype.hasOwnProperty.call( messages, m ) ){\n message = messages[m];\n\n if ( isToken && message[value] ){\n delete message[value];\n result = value;\n // tokens are unique, so we can just stop here\n break;\n }\n\n if (isFunction) {\n for ( t in message ){\n if (Object.prototype.hasOwnProperty.call(message, t) && message[t] === value){\n delete message[t];\n result = true;\n }\n }\n }\n }\n }\n\n return result;\n };\n}));\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar mutations_1 = require(\"../mutations\");\nfunction useDeleteAssetCollection() {\n var _a = client_1.useMutation(mutations_1.DELETE_ASSET_COLLECTION), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var deleteAssetCollection = function (id) {\n return action({\n variables: {\n id: id,\n },\n optimisticResponse: {\n deleteAssetCollection: {\n success: true,\n __typename: 'DeleteAssetCollectionResult',\n },\n },\n update: function (cache) {\n var assetCollections = cache.readQuery({ query: queries_1.ASSET_COLLECTIONS }).assetCollections;\n cache.writeQuery({\n query: queries_1.ASSET_COLLECTIONS,\n data: { assetCollections: assetCollections.filter(function (c) { return c.id !== id; }) },\n });\n },\n });\n };\n return { deleteAssetCollection: deleteAssetCollection, data: data, error: error, loading: loading };\n}\nexports.default = useDeleteAssetCollection;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar mutations_1 = require(\"../mutations\");\nfunction useDeleteTag() {\n var _a = client_1.useMutation(mutations_1.DELETE_TAG), action = _a[0], _b = _a[1], error = _b.error, data = _b.data;\n var _c = recoil_1.useRecoilState(state_1.selectedTagIdState), selectedTagId = _c[0], setSelectedTagId = _c[1];\n var deleteTag = function (id) {\n return action({\n variables: { id: id },\n optimisticResponse: {\n __typename: 'Mutation',\n deleteTag: true,\n },\n update: function (proxy, _a) {\n var success = _a.data.deleteTag;\n if (!success)\n return;\n var assetCollections = proxy.readQuery({ query: queries_1.ASSET_COLLECTIONS }).assetCollections;\n var updatedAssetCollections = assetCollections.map(function (assetCollection) {\n return __assign(__assign({}, assetCollection), { tags: assetCollection.tags.filter(function (tag) { return (tag === null || tag === void 0 ? void 0 : tag.id) !== id; }) });\n });\n proxy.writeQuery({\n query: queries_1.ASSET_COLLECTIONS,\n data: { assetCollections: updatedAssetCollections },\n });\n var tags = proxy.readQuery({ query: queries_1.TAGS }).tags;\n proxy.writeQuery({\n query: queries_1.TAGS,\n data: {\n tags: tags.filter(function (tag) { return tag.id !== id; }),\n },\n });\n },\n }).then(function (success) {\n // Unselect currently selected tag if it was just deleted\n if (success && id === selectedTagId) {\n setSelectedTagId(null);\n }\n });\n };\n return { deleteTag: deleteTag, data: data, error: error };\n}\nexports.default = useDeleteTag;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction useEvent(event) {\n return event;\n}\nexports.default = useEvent;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useImportAsset() {\n var _a = client_1.useMutation(mutations_1.IMPORT_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var importAsset = function (assetIdentity) {\n return action({\n variables: {\n id: assetIdentity.assetId,\n assetSourceId: assetIdentity.assetSourceId,\n },\n });\n };\n return { importAsset: importAsset, data: data, error: error, loading: loading };\n}\nexports.default = useImportAsset;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar provider_1 = require(\"../provider\");\nvar state_1 = require(\"../state\");\nvar selectedInspectorViewState_1 = __importDefault(require(\"../state/selectedInspectorViewState\"));\nvar useSelectAsset = function () {\n var setSelectedAssetId = recoil_1.useSetRecoilState(state_1.selectedAssetIdState);\n var setSelectedInspectorView = recoil_1.useSetRecoilState(selectedInspectorViewState_1.default);\n var handleSelectAsset = provider_1.useMediaUi().handleSelectAsset;\n return react_1.useCallback(function (assetIdentity) {\n if (!assetIdentity)\n return;\n setSelectedAssetId(assetIdentity);\n handleSelectAsset(assetIdentity);\n setSelectedInspectorView('asset');\n }, [setSelectedAssetId, handleSelectAsset, setSelectedInspectorView]);\n};\nexports.default = useSelectAsset;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../state\");\nvar useSelectAssetCollection = function () {\n var setSelectedAssetCollectionId = recoil_1.useSetRecoilState(state_1.selectedAssetCollectionIdState);\n var setSelectedTagId = recoil_1.useSetRecoilState(state_1.selectedTagIdState);\n var setSelectedAssetId = recoil_1.useSetRecoilState(state_1.selectedAssetIdState);\n var setSelectedInspectorView = recoil_1.useSetRecoilState(state_1.selectedInspectorViewState);\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n return react_1.useCallback(function (assetCollection) {\n setSelectedInspectorView('assetCollection');\n setSelectedTagId(null);\n setSelectedAssetId(null);\n setCurrentPage(1);\n setSelectedAssetCollectionId(assetCollection === null || assetCollection === void 0 ? void 0 : assetCollection.id);\n }, [setSelectedInspectorView, setSelectedTagId, setSelectedAssetId, setCurrentPage, setSelectedAssetCollectionId]);\n};\nexports.default = useSelectAssetCollection;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar queries_1 = require(\"../queries\");\nvar index_1 = require(\"./index\");\nvar state_1 = require(\"../state\");\nvar useSelectAssetSource = function () {\n var selectedAssetSourceQuery = client_1.useQuery(queries_1.SELECTED_ASSET_SOURCE_ID);\n var selectedAssetSourceId = selectedAssetSourceQuery.data.selectedAssetSourceId;\n var assetSources = index_1.useAssetSourcesQuery().assetSources;\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n var selectedAssetSource = react_1.useMemo(function () { return assetSources.find(function (assetSource) { return assetSource.id === selectedAssetSourceId; }); }, [assetSources, selectedAssetSourceId]);\n var mutateSelectedAssetSourceId = client_1.useMutation(queries_1.SET_SELECTED_ASSET_SOURCE_ID)[0];\n var setSelectedAssetSource = react_1.useCallback(function (assetSource) {\n setCurrentPage(1);\n return mutateSelectedAssetSourceId({\n variables: { selectedAssetSourceId: assetSource.id },\n });\n }, [mutateSelectedAssetSourceId, setCurrentPage]);\n return [selectedAssetSource, setSelectedAssetSource];\n};\nexports.default = useSelectAssetSource;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../state\");\nvar selectedInspectorViewState_1 = __importDefault(require(\"../state/selectedInspectorViewState\"));\nvar useSelectTag = function () {\n var setSelectedAssetCollectionId = recoil_1.useSetRecoilState(state_1.selectedAssetCollectionIdState);\n var setSelectedTagId = recoil_1.useSetRecoilState(state_1.selectedTagIdState);\n var setSelectedAssetId = recoil_1.useSetRecoilState(state_1.selectedAssetIdState);\n var setSelectedInspectorView = recoil_1.useSetRecoilState(selectedInspectorViewState_1.default);\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n return react_1.useCallback(function (tag, assetCollection) {\n if (assetCollection === void 0) { assetCollection = null; }\n setSelectedInspectorView('tag');\n setSelectedAssetCollectionId(assetCollection === null || assetCollection === void 0 ? void 0 : assetCollection.id);\n setSelectedTagId(tag === null || tag === void 0 ? void 0 : tag.id);\n setCurrentPage(1);\n setSelectedAssetId(null);\n }, [setCurrentPage, setSelectedAssetCollectionId, setSelectedAssetId, setSelectedInspectorView, setSelectedTagId]);\n};\nexports.default = useSelectTag;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedAssetIdState_1 = __importDefault(require(\"../state/selectedAssetIdState\"));\nvar useAssetQuery_1 = __importDefault(require(\"./useAssetQuery\"));\nvar useSelectedAsset = function () {\n var selectedAssetId = recoil_1.useRecoilValue(selectedAssetIdState_1.default);\n var asset = useAssetQuery_1.default(selectedAssetId).asset;\n return asset;\n};\nexports.default = useSelectedAsset;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useSetAssetCollections() {\n var _a = client_1.useMutation(mutations_1.SET_ASSET_COLLECTIONS), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var setAssetCollections = function (_a) {\n var asset = _a.asset, assetCollections = _a.assetCollections;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n assetCollectionIds: assetCollections.map(function (c) { return c.id; }),\n },\n optimisticResponse: {\n __typename: 'Mutation',\n setAssetCollections: __assign(__assign({}, asset), { collections: assetCollections }),\n },\n });\n };\n return { setAssetCollections: setAssetCollections, data: data, error: error, loading: loading };\n}\nexports.default = useSetAssetCollections;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useSetAssetTags() {\n var _a = client_1.useMutation(mutations_1.SET_ASSET_TAGS), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var setAssetTags = function (_a) {\n var asset = _a.asset, tags = _a.tags;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n tagIds: tags.map(function (tag) { return tag.id; }),\n },\n optimisticResponse: {\n __typename: 'Mutation',\n setAssetTags: __assign(__assign({}, asset), { tags: tags }),\n },\n });\n };\n return { setAssetTags: setAssetTags, data: data, error: error, loading: loading };\n}\nexports.default = useSetAssetTags;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nfunction useAssetTagsQuery() {\n var _a = client_1.useQuery(queries_1.TAGS), data = _a.data, loading = _a.loading;\n return { tags: (data === null || data === void 0 ? void 0 : data.tags) || [], loading: loading };\n}\nexports.default = useAssetTagsQuery;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUntagAsset() {\n var _a = client_1.useMutation(mutations_1.UNTAG_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var untagAsset = function (_a) {\n var asset = _a.asset, tagName = _a.tagName;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n tag: tagName,\n },\n optimisticResponse: {\n __typename: 'Mutation',\n untagAsset: __assign(__assign({}, asset), { tags: __spreadArrays(asset.tags.filter(function (tag) { return tag.label !== tagName; })) }),\n },\n });\n };\n return { untagAsset: untagAsset, data: data, error: error, loading: loading };\n}\nexports.default = useUntagAsset;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUpdateAsset() {\n var _a = client_1.useMutation(mutations_1.UPDATE_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var updateAsset = function (_a) {\n var asset = _a.asset, label = _a.label, caption = _a.caption, copyrightNotice = _a.copyrightNotice;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n label: label,\n caption: caption,\n copyrightNotice: copyrightNotice,\n },\n optimisticResponse: {\n __typename: 'Mutation',\n updateAsset: __assign(__assign({}, asset), { label: label,\n caption: caption,\n copyrightNotice: copyrightNotice }),\n },\n });\n };\n return { updateAsset: updateAsset, data: data, error: error, loading: loading };\n}\nexports.default = useUpdateAsset;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUpdateAssetCollection() {\n var _a = client_1.useMutation(mutations_1.UPDATE_ASSET_COLLECTION), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var updateAssetCollection = function (_a) {\n var assetCollection = _a.assetCollection, title = _a.title, tags = _a.tags;\n return action({\n variables: {\n id: assetCollection.id,\n title: title,\n tagIds: tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return tag.id; }),\n },\n optimisticResponse: {\n updateAssetCollection: __assign(__assign(__assign(__assign({}, assetCollection), { title: title }), (title\n ? {\n title: title,\n }\n : {})), (tags\n ? {\n tags: tags,\n }\n : {})),\n },\n });\n };\n return { updateAssetCollection: updateAssetCollection, data: data, error: error, loading: loading };\n}\nexports.default = useUpdateAssetCollection;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUpdateTag() {\n var _a = client_1.useMutation(mutations_1.UPDATE_TAG), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var updateTag = function (_a) {\n var tag = _a.tag, label = _a.label;\n return action({\n variables: {\n id: tag.id,\n label: label,\n },\n optimisticResponse: {\n updateTag: __assign(__assign(__assign({}, tag), { label: label }), (label\n ? {\n label: label,\n }\n : {})),\n },\n });\n };\n return { updateTag: updateTag, data: data, error: error, loading: loading };\n}\nexports.default = useUpdateTag;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IntlProvider = exports.useIntl = exports.IntlContext = void 0;\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nexports.IntlContext = react_1.createContext(null);\nexports.useIntl = function () { return react_1.useContext(exports.IntlContext); };\nfunction IntlProvider(_a) {\n var children = _a.children, translate = _a.translate;\n return React.createElement(exports.IntlContext.Provider, { value: { translate: translate } }, children);\n}\nexports.IntlProvider = IntlProvider;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MediaUiThemeProvider = exports.createUseMediaUiStyles = exports.useMediaUiTheme = void 0;\nvar React = __importStar(require(\"react\"));\nvar react_jss_1 = require(\"react-jss\");\nvar jss_1 = __importDefault(require(\"jss\"));\nvar jss_plugin_cache_1 = __importDefault(require(\"jss-plugin-cache\"));\nvar styleConstants_1 = require(\"@neos-project/build-essentials/src/styles/styleConstants\");\nvar ThemeContext = React.createContext({});\nvar theming = react_jss_1.createTheming(ThemeContext);\nvar ThemeProvider = theming.ThemeProvider, useTheme = theming.useTheme;\njss_1.default.use(jss_plugin_cache_1.default());\n// Extend theme config from Neos.Ui package\nvar mediaUiTheme = {\n spacing: styleConstants_1.config.spacing,\n fontSize: __assign(__assign({}, styleConstants_1.config.fontSize), { large: '18px' }),\n size: __assign(__assign({}, styleConstants_1.config.size), { sidebarWidth: '250px', scrollbarSize: '4px' }),\n colors: {\n primary: styleConstants_1.config.colors.primaryBlue,\n text: styleConstants_1.config.colors.contrastBright,\n mainBackground: styleConstants_1.config.colors.contrastNeutral,\n alternatingBackground: styleConstants_1.config.colors.contrastDark,\n border: styleConstants_1.config.colors.contrastDark,\n inactive: styleConstants_1.config.colors.contrastBright,\n success: styleConstants_1.config.colors.success,\n warn: styleConstants_1.config.colors.warn,\n error: styleConstants_1.config.colors.error,\n generated: styleConstants_1.config.colors.success,\n warning: styleConstants_1.config.colors.warn,\n deleted: styleConstants_1.config.colors.error,\n disabled: styleConstants_1.config.colors.contrastDark,\n assetBackground: styleConstants_1.config.colors.contrastDarkest,\n captionBackground: styleConstants_1.config.colors.contrastNeutral,\n moduleBackground: styleConstants_1.config.colors.contrastDarker,\n scrollbarBackground: 'transparent',\n scrollbarForeground: styleConstants_1.config.colors.contrastBright,\n },\n transition: styleConstants_1.config.transition,\n loadingIndicatorZIndex: 10024,\n paginationZIndex: 10022,\n lightboxZIndex: 10023,\n};\nexports.useMediaUiTheme = useTheme;\nexports.createUseMediaUiStyles = function (styles) {\n return react_jss_1.createUseStyles(styles, { theming: theming });\n};\nfunction MediaUiThemeProvider(_a) {\n var children = _a.children;\n return React.createElement(ThemeProvider, { theme: mediaUiTheme }, children);\n}\nexports.MediaUiThemeProvider = MediaUiThemeProvider;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getDisplayName;\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');\n}","function cachePlugin() {\n var cache = new WeakMap();\n\n function onCreateRule(name, decl, _ref) {\n var parent = _ref.parent;\n return parent && name ? cache.get(parent.rules.raw[name]) || null : null;\n }\n\n function onProcessRule(rule) {\n var _rule$options = rule.options,\n sheet = _rule$options.sheet,\n parent = _rule$options.parent;\n\n if (!parent || sheet && sheet.options.link) {\n return;\n }\n\n var originalStyle = parent.rules.raw[rule.key];\n if (!cache.get(originalStyle)) cache.set(originalStyle, rule);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}\n\nexport default cachePlugin;\n","const upperFirst = require('lodash.upperfirst');\n\n// Global CSS variables for Neos.Ui\nconst config = {\n spacing: {\n goldenUnit: '40px',\n full: '16px',\n half: '8px',\n quarter: '4px'\n },\n size: {\n sidebarWidth: '320px'\n },\n transition: {\n fast: '.1s',\n default: '.25s',\n slow: '.5s'\n },\n zIndex: {\n secondaryToolbar: ['linkIconButtonFlyout'],\n flashMessageContainer: '6',\n loadingIndicatorContainer: '5',\n secondaryInspector: ['context', 'iframe', 'close'],\n secondaryInspectorElevated: ['context', 'dropdownContents'],\n dialog: ['context'],\n fullScreenClose: ['context'],\n drawer: ['context'],\n bar: ['context'],\n primaryToolbar: '4',\n checkboxInput: ['context'],\n dropdownContents: ['context'],\n selectBoxContents: '3',\n notInlineEditableOverlay: ['context'],\n calendarFakeInputMirror: ['context'],\n rdtPicker: ['context'],\n sideBar: ['dropTargetBefore', 'dropTargetAfter'],\n wrapperDropdown: ['context'],\n unappliedChangesOverlay: ['context'],\n nodeToolBar: '2147483646'\n },\n fontSize: {\n base: '14px',\n small: '12px'\n },\n fonts: {\n headings: {\n family: 'Noto Sans',\n style: 'Regular',\n cssWeight: '400'\n },\n copy: {\n family: 'Noto Sans',\n style: 'Regular',\n cssWeight: '400'\n }\n },\n colors: {\n primaryViolet: '#26224C',\n primaryVioletHover: '#342f5f',\n primaryBlue: '#00ADEE',\n primaryBlueHover: '#35c3f8',\n contrastDarkest: '#141414',\n contrastDarker: '#222',\n contrastDark: '#3f3f3f',\n contrastNeutral: '#323232',\n contrastBright: '#999',\n contrastBrighter: '#adadad',\n contrastBrightest: '#FFF',\n success: '#00a338',\n successHover: '#0bb344',\n warn: '#ff8700',\n warnHover: '#fda23d',\n error: '#ff460d',\n errorHover: '#ff6a3c',\n uncheckedCheckboxTick: '#5B5B5B'\n }\n};\n\nconst generateCssVarsObject = (subject = config, predicate = '') => {\n const hasPredicate = predicate && predicate.length;\n let target = {};\n\n Object.keys(subject).forEach(key => {\n const val = subject[key];\n const camelKey = upperFirst(key);\n const nestedPredicate = hasPredicate ? predicate + camelKey : key;\n\n if (Array.isArray(val)) {\n val.forEach((item, index) => {\n target[`--${predicate}-${camelKey}-${upperFirst(item)}`] = `${index + 1}`;\n });\n } else if (typeof val === 'object') {\n target = Object.assign({}, target, generateCssVarsObject(val, nestedPredicate));\n } else {\n target[`--${predicate}-${camelKey}`] = val;\n }\n });\n\n return target;\n};\n\nmodule.exports = {\n config,\n generateCssVarsObject\n};\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe23',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20f0',\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nmodule.exports = upperFirst;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Dialog = void 0;\nvar React = __importStar(require(\"react\"));\nvar ReactDOM = __importStar(require(\"react-dom\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\n//\n// @TODO: Remove this once https://github.com/neos/neos-ui/issues/2925 is solved.\n//\nexports.Dialog = function (props) {\n var dialogRef = React.useRef();\n React.useEffect(function () {\n var _a;\n if (dialogRef.current) {\n var section = ReactDOM.findDOMNode(dialogRef.current); // eslint-disable-line react/no-find-dom-node\n (_a = section === null || section === void 0 ? void 0 : section.firstElementChild) === null || _a === void 0 ? void 0 : _a.setAttribute('data-ignore_click_outside', 'true');\n }\n }, [dialogRef]);\n return React.createElement(react_ui_components_1.Dialog, __assign({}, props, { ref: dialogRef }));\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction humanFileSize(bytes, si) {\n if (si === void 0) { si = false; }\n var thresh = si ? 1000 : 1024;\n if (Math.abs(bytes) < thresh) {\n return bytes + ' B';\n }\n var units = si\n ? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n : ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];\n var u = -1;\n do {\n bytes /= thresh;\n ++u;\n } while (Math.abs(bytes) >= thresh && u < units.length - 1);\n return bytes.toFixed(1) + ' ' + units[u];\n}\nexports.default = humanFileSize;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateLocalState = exports.resetLocalState = exports.restoreLocalState = exports.getItem = void 0;\nvar queries_1 = require(\"@media-ui/core/src/queries\");\nvar neos_1 = require(\"@media-ui/core/src/constants/neos\");\nvar hooks_1 = require(\"../hooks\");\nvar queries_2 = require(\"../queries\");\nvar src_1 = require(\"@media-ui/feature-clipboard/src\");\nvar STORAGE_PREFIX = 'flowpack.mediaui';\nfunction writeToCache(cache, _a) {\n var _b = _a.selectedAssetSourceId, selectedAssetSourceId = _b === void 0 ? undefined : _b, _c = _a.viewModeSelection, viewModeSelection = _c === void 0 ? undefined : _c, _d = _a.clipboard, clipboard = _d === void 0 ? undefined : _d;\n if (selectedAssetSourceId !== undefined) {\n cache.writeQuery({\n query: queries_1.SELECTED_ASSET_SOURCE_ID,\n data: { selectedAssetSourceId: selectedAssetSourceId },\n });\n }\n if (viewModeSelection !== undefined) {\n cache.writeQuery({\n query: queries_2.VIEW_MODE_SELECTION,\n data: { viewModeSelection: viewModeSelection },\n });\n }\n if (clipboard !== undefined) {\n cache.writeQuery({\n query: src_1.CLIPBOARD,\n data: { clipboard: clipboard },\n });\n }\n}\nfunction getItem(key) {\n try {\n return JSON.parse(localStorage.getItem(STORAGE_PREFIX + \".\" + key));\n }\n catch (e) {\n console.error(\"Could not parse item \\\"\" + key + \"\\\" from storage\", e);\n }\n return undefined;\n}\nexports.getItem = getItem;\nfunction restoreLocalState(cache, constraints) {\n var _a;\n if (constraints === void 0) { constraints = {}; }\n var selectedAssetSourceId = getItem('selectedAssetSourceId') || neos_1.NEOS_ASSET_SOURCE;\n if (((_a = constraints.assetSources) === null || _a === void 0 ? void 0 : _a.length) > 0 && !constraints.assetSources.includes(selectedAssetSourceId)) {\n selectedAssetSourceId = constraints.assetSources[0];\n }\n var viewModeSelection = getItem('viewModeSelection') || hooks_1.VIEW_MODES.Thumbnails;\n var clipboard = getItem('clipboard') || {};\n writeToCache(cache, { selectedAssetSourceId: selectedAssetSourceId, viewModeSelection: viewModeSelection, clipboard: clipboard });\n}\nexports.restoreLocalState = restoreLocalState;\nfunction resetLocalState(cache) {\n writeToCache(cache, {\n selectedAssetSourceId: neos_1.NEOS_ASSET_SOURCE,\n viewModeSelection: hooks_1.VIEW_MODES.Thumbnails,\n clipboard: {},\n });\n}\nexports.resetLocalState = resetLocalState;\nfunction updateLocalState(data, cache) {\n Object.keys(data).forEach(function (key) {\n localStorage.setItem(STORAGE_PREFIX + \".\" + key, JSON.stringify(data[key]));\n });\n writeToCache(cache, __assign({}, data));\n}\nexports.updateLocalState = updateLocalState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VIEW_MODES = void 0;\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar VIEW_MODES;\n(function (VIEW_MODES) {\n VIEW_MODES[\"Thumbnails\"] = \"thumbnails\";\n VIEW_MODES[\"List\"] = \"list\";\n})(VIEW_MODES = exports.VIEW_MODES || (exports.VIEW_MODES = {}));\nfunction useViewModeSelection() {\n var viewModeSelectionQuery = client_1.useQuery(queries_1.VIEW_MODE_SELECTION);\n var viewModeSelection = viewModeSelectionQuery.data.viewModeSelection;\n var mutateViewModeSelection = client_1.useMutation(queries_1.SET_VIEW_MODE_SELECTION)[0];\n var setViewModeSelection = function (viewMode) {\n return mutateViewModeSelection({\n variables: { viewModeSelection: viewMode },\n });\n };\n return [viewModeSelection, setViewModeSelection];\n}\nexports.default = useViewModeSelection;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SET_VIEW_MODE_SELECTION = exports.VIEW_MODE_SELECTION = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.VIEW_MODE_SELECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ViewModeSelection {\\n viewModeSelection @client(always: true)\\n }\\n\"], [\"\\n query ViewModeSelection {\\n viewModeSelection @client(always: true)\\n }\\n\"])));\nexports.SET_VIEW_MODE_SELECTION = client_1.gql(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n mutation SetViewModeSelection($viewModeSelection: String) {\\n setViewModeSelection(viewModeSelection: $viewModeSelection) @client\\n }\\n\"], [\"\\n mutation SetViewModeSelection($viewModeSelection: String) {\\n setViewModeSelection(viewModeSelection: $viewModeSelection) @client\\n }\\n\"])));\nvar templateObject_1, templateObject_2;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_1 = require(\"@media-ui/feature-asset-usage/src\");\nvar state_1 = require(\"../state\");\nvar useAssetCount = function () {\n var assetCount = hooks_1.useAssetCountQuery().assetCount;\n var mainView = recoil_1.useRecoilValue(state_1.mainViewState);\n var _a = src_1.useUnusedAssetCountQuery(), unusedAssetCountLoaded = _a.called, loadUnusedAssetCount = _a.load, unusedAssetCount = _a.unusedAssetCount;\n var count = mainView === state_1.MainViewState.UNUSED_ASSETS ? unusedAssetCount : assetCount;\n react_1.useEffect(function () {\n if (mainView === state_1.MainViewState.UNUSED_ASSETS && !unusedAssetCountLoaded)\n loadUnusedAssetCount();\n }, [mainView, unusedAssetCountLoaded, loadUnusedAssetCount]);\n return count;\n};\nexports.default = useAssetCount;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UsageDetailsMetadataType = void 0;\nvar UsageDetailsMetadataType;\n(function (UsageDetailsMetadataType) {\n UsageDetailsMetadataType[\"TEXT\"] = \"TEXT\";\n UsageDetailsMetadataType[\"DATE\"] = \"DATE\";\n UsageDetailsMetadataType[\"DATETIME\"] = \"DATETIME\";\n UsageDetailsMetadataType[\"URL\"] = \"URL\";\n})(UsageDetailsMetadataType = exports.UsageDetailsMetadataType || (exports.UsageDetailsMetadataType = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar assetUsageDetailsModalState_1 = __importDefault(require(\"../state/assetUsageDetailsModalState\"));\nvar useAssetUsages_1 = __importDefault(require(\"../hooks/useAssetUsages\"));\nvar AssetUsageSection_1 = __importDefault(require(\"./AssetUsageSection\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetUsage: {\n padding: theme.spacing.full,\n '& section + section': {\n marginTop: theme.spacing.full,\n },\n },\n usageTable: {\n width: '100%',\n '& th': {\n fontWeight: 'bold',\n },\n '& td, & th': {\n padding: theme.spacing.quarter,\n '&:first-child': {\n paddingLeft: 0,\n },\n '&:last-child': {\n paddingRight: 0,\n },\n },\n '.neos & a': {\n color: theme.colors.primary,\n '&:hover': {\n color: theme.colors.primary,\n textDecoration: 'underline',\n },\n },\n },\n}); });\nvar AssetUsagesModal = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var _a = recoil_1.useRecoilState(assetUsageDetailsModalState_1.default), isOpen = _a[0], setIsOpen = _a[1];\n var asset = hooks_1.useSelectedAsset();\n var _b = useAssetUsages_1.default(asset ? { assetId: asset.id, assetSourceId: asset.assetSource.id } : null), assetUsageDetails = _b.assetUsageDetails, loading = _b.loading;\n var handleRequestClose = react_1.useCallback(function () { return setIsOpen(false); }, [setIsOpen]);\n return (React.createElement(react_ui_components_1.Dialog, { isOpen: isOpen, title: translate('assetUsage.title', \"Usage details for \" + asset.label, { asset: asset.label }), onRequestClose: handleRequestClose, style: \"wide\", actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: handleRequestClose }, translate('assetUsage.cancel', 'Cancel')),\n ] },\n React.createElement(\"div\", { className: classes.assetUsage }, (assetUsageDetails === null || assetUsageDetails === void 0 ? void 0 : assetUsageDetails.length) > 0 ? (assetUsageDetails.map(function (usageDetailsGroup, index) { return (React.createElement(AssetUsageSection_1.default, { key: index, usageDetailsGroup: usageDetailsGroup })); })) : (React.createElement(\"span\", null, loading\n ? translate('assetUsagesModal.loading', 'Loading...')\n : translate('assetUsagesModal.noResults', 'No results'))))));\n};\nexports.default = React.memo(AssetUsagesModal);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n usageSection: {\n '& h2': {\n fontWeight: 'bold',\n },\n },\n usageTable: {\n width: '100%',\n marginTop: theme.spacing.full,\n '& th': {\n fontWeight: 'bold',\n },\n '& td, & th': {\n padding: theme.spacing.quarter,\n '&:first-child': {\n paddingLeft: 0,\n },\n '&:last-child': {\n paddingRight: 0,\n },\n },\n '.neos & a': {\n color: theme.colors.primary,\n '&:hover': {\n color: theme.colors.primary,\n textDecoration: 'underline',\n },\n },\n },\n}); });\nvar AssetUsageSection = function (_a) {\n var usageDetailsGroup = _a.usageDetailsGroup;\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var label = usageDetailsGroup.label, usages = usageDetailsGroup.usages, metadataSchema = usageDetailsGroup.metadataSchema;\n return (React.createElement(\"section\", { className: classes.usageSection },\n React.createElement(\"h2\", null, label),\n usages.length > 0 && (React.createElement(\"table\", { className: classes.usageTable },\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"th\", null, translate('assetUsageSection.label', 'Label')),\n metadataSchema.map(function (schema, index) { return (React.createElement(\"th\", { key: index }, schema.label)); }))),\n React.createElement(\"tbody\", null, usages.map(function (assetUsage, index) { return (React.createElement(\"tr\", { key: index },\n React.createElement(\"td\", null,\n React.createElement(\"a\", { href: assetUsage.url, target: \"_blank\", rel: \"noreferrer\" }, assetUsage.label)),\n metadataSchema.map(function (_a, index) {\n var name = _a.name, type = _a.type;\n var usage = assetUsage.metadata.find(function (usage) { return usage.name == name; });\n return usage ? (React.createElement(\"td\", { key: index }, type == 'DATETIME' || type == 'DATE' ? (new Date(usage.value).toLocaleString()) : type == 'URL' ? (React.createElement(\"a\", { href: usage.value, target: \"_blank\", rel: \"noreferrer\" }, name)) : (usage.value))) : null;\n }))); }))))));\n};\nexports.default = React.memo(AssetUsageSection);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar assetUsageDetailsModalState_1 = __importDefault(require(\"../state/assetUsageDetailsModalState\"));\nvar AssetUsagesToggleButton = function () {\n var _a = recoil_1.useRecoilState(assetUsageDetailsModalState_1.default), assetUsagesModalOpen = _a[0], setAssetUsagesModalOpen = _a[1];\n var translate = src_1.useIntl().translate;\n // TODO: Resolve actual usage when calculation is fast enough or data has been preloaded\n var usage = 1;\n return (React.createElement(react_ui_components_1.Button, { disabled: !usage, size: \"regular\", style: assetUsagesModalOpen ? 'brand' : 'lighter', hoverStyle: \"brand\", onClick: function () { return setAssetUsagesModalOpen(true); } }, translate('assetUsageList.toggle', 'Show usages')));\n};\nexports.default = React.memo(AssetUsagesToggleButton);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar pagination_1 = require(\"@media-ui/core/src/constants/pagination\");\nvar unusedAssets_1 = __importDefault(require(\"../queries/unusedAssets\"));\nvar showUnusedAssetsState_1 = __importDefault(require(\"../state/showUnusedAssetsState\"));\nvar useUnusedAssetsQuery = function () {\n var currentPage = recoil_1.useRecoilValue(state_1.currentPageState);\n var _a = recoil_1.useRecoilState(state_1.loadingState), isLoading = _a[0], setIsLoading = _a[1];\n var showUnusedAssets = recoil_1.useRecoilValue(showUnusedAssetsState_1.default);\n var _b = react_1.useState([]), assets = _b[0], setAssets = _b[1];\n var limit = pagination_1.ASSETS_PER_PAGE;\n var offset = (currentPage - 1) * pagination_1.ASSETS_PER_PAGE;\n var _c = client_1.useLazyQuery(unusedAssets_1.default, {\n notifyOnNetworkStatusChange: false,\n variables: {\n limit: limit,\n offset: offset,\n },\n }), query = _c[0], _d = _c[1], loading = _d.loading, error = _d.error, data = _d.data, refetch = _d.refetch;\n react_1.useEffect(function () {\n if (showUnusedAssets && !loading && !isLoading) {\n query({\n variables: {\n limit: limit,\n offset: offset,\n },\n });\n setIsLoading(true);\n }\n else if (data && !loading && isLoading) {\n setIsLoading(false);\n setAssets(data.unusedAssets);\n // TODO: Update currentPage if asset count changes and current page exceeds limit\n }\n // Don't include `isLoading` to prevent constant reloads\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [query, data, loading, offset, limit, showUnusedAssets]);\n return { error: error, assets: assets, refetch: refetch };\n};\nexports.default = useUnusedAssetsQuery;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar unusedAssetCount_1 = __importDefault(require(\"./unusedAssetCount\"));\nfunction useUnusedAssetCountQuery() {\n var _a = client_1.useLazyQuery(unusedAssetCount_1.default), load = _a[0], _b = _a[1], called = _b.called, loading = _b.loading, data = _b.data;\n return { called: called, load: load, unusedAssetCount: (data === null || data === void 0 ? void 0 : data.unusedAssetCount) || 0, loading: loading };\n}\nexports.default = useUnusedAssetCountQuery;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar UNUSED_ASSET_COUNT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query UNUSED_ASSET_COUNT {\\n unusedAssetCount\\n }\\n\"], [\"\\n query UNUSED_ASSET_COUNT {\\n unusedAssetCount\\n }\\n\"])));\nexports.default = UNUSED_ASSET_COUNT;\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar createAssetCollectionDialogState = recoil_1.atom({\n key: 'createAssetCollectionDialogState',\n default: {\n visible: false,\n title: '',\n },\n});\nexports.default = createAssetCollectionDialogState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar createTagDialogState = recoil_1.atom({\n key: 'createTagDialogState',\n default: {\n visible: false,\n label: '',\n },\n});\nexports.default = createTagDialogState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MainViewState = exports.mainViewState = void 0;\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/feature-clipboard/src\");\nvar src_2 = require(\"@media-ui/feature-asset-usage/src\");\nvar MainViewState;\n(function (MainViewState) {\n MainViewState[MainViewState[\"DEFAULT\"] = 0] = \"DEFAULT\";\n MainViewState[MainViewState[\"CLIPBOARD\"] = 1] = \"CLIPBOARD\";\n MainViewState[MainViewState[\"UNUSED_ASSETS\"] = 2] = \"UNUSED_ASSETS\";\n})(MainViewState || (MainViewState = {}));\nexports.MainViewState = MainViewState;\nvar mainViewState = recoil_1.selector({\n key: 'mainViewState',\n get: function (_a) {\n var get = _a.get;\n var clipboardVisible = get(src_1.clipboardVisibleState);\n var showUnusedAssets = get(src_2.showUnusedAssetsState);\n if (clipboardVisible)\n return MainViewState.CLIPBOARD;\n if (showUnusedAssets)\n return MainViewState.UNUSED_ASSETS;\n return MainViewState.DEFAULT;\n },\n});\nexports.mainViewState = mainViewState;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar ClipboardItem_1 = __importDefault(require(\"./ClipboardItem\"));\nvar useClipboard_1 = __importDefault(require(\"../hooks/useClipboard\"));\nvar clipboardVisibleState_1 = __importDefault(require(\"../state/clipboardVisibleState\"));\nvar useStyles = src_1.createUseMediaUiStyles({\n clipboard: {\n height: '100%',\n alignSelf: 'flex-end',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n userSelect: 'none',\n margin: '0 -.3rem',\n '& > *': {\n margin: '0 .3rem',\n },\n },\n});\nvar ClipboardToggle = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var clipboard = useClipboard_1.default().clipboard;\n var _a = recoil_1.useRecoilState(clipboardVisibleState_1.default), clipboardVisible = _a[0], setClipboardVisible = _a[1];\n var initialLoadComplete = recoil_1.useRecoilValue(state_1.initialLoadCompleteState);\n var toggleClipboard = react_1.useCallback(function () { return setClipboardVisible(function (prev) { return !prev; }); }, [setClipboardVisible]);\n var size = Object.keys(clipboard).length;\n if (!initialLoadComplete)\n return null;\n return (React.createElement(\"div\", { className: classes.clipboard },\n React.createElement(react_ui_components_1.Button, { disabled: size === 0, size: \"regular\", style: clipboardVisible ? 'brand' : 'lighter', hoverStyle: \"brand\", onClick: toggleClipboard },\n translate('clipboard.toggle', 'Clipboard'),\n \" (\",\n size,\n \")\"),\n Object.values(clipboard)\n .slice()\n .reverse()\n .slice(0, 3)\n .map(function (assetIdentity) { return (React.createElement(ClipboardItem_1.default, { key: assetIdentity.assetId, assetIdentity: assetIdentity })); })));\n};\nexports.default = React.memo(ClipboardToggle);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar useClipboard_1 = __importDefault(require(\"../hooks/useClipboard\"));\nvar clipboardVisibleState_1 = __importDefault(require(\"../state/clipboardVisibleState\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n clipboardActions: {\n display: 'flex',\n alignItems: 'baseline',\n backgroundColor: theme.colors.captionBackground,\n },\n}); });\nvar ClipboardActions = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var clipboardVisible = recoil_1.useRecoilValue(clipboardVisibleState_1.default);\n var _a = useClipboard_1.default(), clipboard = _a.clipboard, flushClipboard = _a.flushClipboard;\n var deleteAsset = hooks_1.useDeleteAsset().deleteAsset;\n var Notify = src_1.useNotify();\n var onDeleteClipboard = react_1.useCallback(function () {\n if (!confirm(translate('clipboard.deleteAssets.confirm', 'Delete all assets in the clipboard?')))\n return;\n Promise.all(Object.values(clipboard).map(function (assetIdentity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, deleteAsset(assetIdentity)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); }))\n .then(function () {\n Notify.ok(translate('clipboard.deleteAssets.success', 'The assets have been deleted'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('clipboard.deleteAssets.error', 'Error while trying to delete the assets'), message);\n });\n }, [translate, clipboard, deleteAsset, Notify]);\n var onFlushClipboard = react_1.useCallback(function () {\n if (!confirm(translate('clipboard.flush.confirm', 'Remove all assets from clipboard?')))\n return;\n flushClipboard();\n }, [flushClipboard, translate]);\n if (!clipboardVisible)\n return null;\n return (React.createElement(\"div\", { className: classes.clipboardActions },\n React.createElement(react_ui_components_1.IconButton, { title: translate('clipboard.deleteAsset', 'Delete all assets in clipboard'), icon: \"trash\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\", onClick: onDeleteClipboard }),\n React.createElement(react_ui_components_1.IconButton, { title: translate('clipboard.flush', 'Flush clipboard'), icon: \"clipboard\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\", onClick: onFlushClipboard })));\n};\nexports.default = React.memo(ClipboardActions);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar events_1 = require(\"@media-ui/core/src/events\");\nvar index_1 = require(\"../index\");\n/**\n * Renderless component to keep the clipboard updated when certain event occur\n */\nvar ClipboardWatcher = function () {\n var toggleClipboardState = index_1.useClipboard().toggleClipboardState;\n var assetRemoved = hooks_1.useEvent(events_1.assetRemovedEvent);\n react_1.useEffect(function () {\n var onAssetDelete = function (topic, assetIdentity) {\n toggleClipboardState(assetIdentity, false);\n };\n var token = assetRemoved.subscribe(onAssetDelete);\n return function () {\n assetRemoved.unsubscribe(token);\n };\n }, [toggleClipboardState, assetRemoved]);\n return null;\n};\nexports.default = ClipboardWatcher;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\n/**\n * This resolver is used by the Apollo Cache to allow identifying\n * the entities for modification, especially for optimistic responses.\n *\n * This is only helpful for entities without unique ids\n */\nfunction IdFromObjectResolver(object) {\n var id = object.__typename + \"_\";\n switch (object.__typename) {\n case 'Image':\n return id + object.url;\n case 'AssetFile':\n return id + object.url;\n default:\n return client_1.defaultDataIdFromObject(object);\n }\n}\nexports.default = IdFromObjectResolver;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar error_1 = require(\"@apollo/client/link/error\");\n// TODO: Use NotificationHandler to show simplified error message to user\nvar ApolloErrorHandler = error_1.onError(function (_a) {\n var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError;\n if (graphQLErrors) {\n graphQLErrors.map(function (data) {\n return console.error(data.extensions.category === 'internal' ? '[Internal server error]' : '[GraphQL error]', data.path, data);\n });\n }\n if (networkError)\n console.error(\"[Network error]: \" + networkError);\n});\nexports.default = ApolloErrorHandler;\n","import { __extends } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nexport function onError(errorHandler) {\n return new ApolloLink(function (operation, forward) {\n return new Observable(function (observer) {\n var sub;\n var retriedSub;\n var retriedResult;\n try {\n sub = forward(operation).subscribe({\n next: function (result) {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation: operation,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: function (networkError) {\n retriedResult = errorHandler({\n operation: operation,\n networkError: networkError,\n graphQLErrors: networkError &&\n networkError.result &&\n networkError.result.errors,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: function () {\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n }\n catch (e) {\n errorHandler({ networkError: e, operation: operation, forward: forward });\n observer.error(e);\n }\n return function () {\n if (sub)\n sub.unsubscribe();\n if (retriedSub)\n sub.unsubscribe();\n };\n });\n });\n}\nvar ErrorLink = (function (_super) {\n __extends(ErrorLink, _super);\n function ErrorLink(errorHandler) {\n var _this = _super.call(this) || this;\n _this.link = onError(errorHandler);\n return _this;\n }\n ErrorLink.prototype.request = function (operation, forward) {\n return this.link.request(operation, forward);\n };\n return ErrorLink;\n}(ApolloLink));\nexport { ErrorLink };\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar index_1 = require(\"./index\");\nvar CacheFactory = /** @class */ (function () {\n function CacheFactory() {\n }\n CacheFactory.createCache = function (featureFlags) {\n return new client_1.InMemoryCache({\n dataIdFromObject: index_1.IdFromObjectResolver,\n typePolicies: {\n Query: {\n fields: {\n // These resolvers allow fetching single entities from the cache that were already retrieved from any previous query\n asset: function (_, _a) {\n var args = _a.args, toReference = _a.toReference;\n return args.id ? toReference({ __typename: 'Asset', id: args.id }) : null;\n },\n tag: function (_, _a) {\n var args = _a.args, toReference = _a.toReference;\n return args.id ? toReference({ __typename: 'Tag', id: args.id }) : null;\n },\n assetCollection: function (_, _a) {\n var args = _a.args, toReference = _a.toReference;\n return args.id ? toReference({ __typename: 'AssetCollection', id: args.id }) : null;\n },\n includeUsage: function () {\n return featureFlags.queryAssetUsage;\n },\n },\n },\n Mutation: {\n fields: {\n includeUsage: function () {\n return featureFlags.queryAssetUsage;\n },\n },\n },\n Asset: {\n keyFields: ['id'],\n fields: {\n isInClipboard: function (_, _a) {\n var variables = _a.variables;\n var clipboard = index_1.PersistentStateManager.getItem('clipboard') || [];\n return {}.hasOwnProperty.call(clipboard, variables.id);\n },\n },\n },\n Tag: {\n keyFields: ['id'],\n },\n AssetCollection: {\n keyFields: ['id'],\n },\n AssetSource: {\n keyFields: ['id'],\n },\n },\n });\n };\n return CacheFactory;\n}());\nexports.default = CacheFactory;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-asset-usage/src\");\nvar src_3 = require(\"@media-ui/feature-clipboard/src\");\nvar src_4 = require(\"@media-ui/feature-concurrent-editing/src\");\nvar src_5 = require(\"@media-ui/feature-similar-assets/src\");\nvar state_1 = require(\"@media-ui/feature-asset-upload/src/state\");\nvar components_1 = require(\"@media-ui/feature-asset-upload/src/components\");\nvar src_6 = require(\"@media-ui/feature-asset-preview/src\");\nvar SideBarLeft_1 = require(\"./SideBarLeft\");\nvar SideBarRight_1 = require(\"./SideBarRight\");\nvar LoadingIndicator_1 = __importDefault(require(\"./LoadingIndicator\"));\nvar BottomBar_1 = require(\"./BottomBar\");\nvar TopBar_1 = require(\"./TopBar\");\nvar Main_1 = require(\"./Main\");\nvar ErrorBoundary_1 = __importDefault(require(\"./ErrorBoundary\"));\nvar state_2 = require(\"../state\");\nvar Dialogs_1 = require(\"./Dialogs\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n container: function (_a) {\n var selectionMode = _a.selectionMode, isInNodeCreationDialog = _a.isInNodeCreationDialog;\n return ({\n display: 'grid',\n // TODO: Find a way to not calculate height to allow scrolling in main grid area\n height: isInNodeCreationDialog\n ? \"calc(100% - 61px - 8px)\" // Remove bottom bar and add padding\n : \"calc(100vh - 48px - 61px - 41px)\",\n gridTemplateRows: '40px 1fr',\n gridTemplateColumns: selectionMode\n ? theme.size.sidebarWidth + ' 1fr'\n : theme.size.sidebarWidth + ' 1fr ' + theme.size.sidebarWidth,\n gridTemplateAreas: selectionMode\n ? \"\\n \\\"left top\\\"\\n \\\"left main\\\"\\n \"\n : \"\\n \\\"left top right\\\"\\n \\\"left main right\\\"\\n \",\n gridGap: theme.spacing.full,\n lineHeight: 1.5,\n overflow: 'hidden',\n });\n },\n gridColumn: {\n height: '100%',\n overflowY: 'auto',\n },\n gridRight: {\n extend: 'gridColumn',\n gridArea: 'right',\n },\n gridLeft: {\n extend: 'gridColumn',\n gridArea: 'left',\n },\n gridMain: {\n extend: 'gridColumn',\n gridArea: 'main',\n },\n gridTop: {\n gridArea: 'top',\n },\n '@global': {\n '#media-ui-app': {\n scrollbarWidth: 'thin',\n scrollbarColor: theme.colors.scrollbarForeground + \" \" + theme.colors.scrollbarBackground,\n '& ::-webkit-scrollbar': {\n width: theme.size.scrollbarSize,\n },\n '& ::-webkit-scrollbar-track': {\n background: theme.colors.scrollbarBackground,\n },\n '& ::-webkit-scrollbar-thumb': {\n backgroundColor: theme.colors.scrollbarForeground,\n },\n },\n '.neos.neos-module-management-mediaui > .neos-module-wrap': {\n paddingLeft: '1rem',\n paddingRight: '1rem',\n paddingTop: '3rem',\n paddingBottom: '0',\n },\n // Hack to prevent a dropdown to be behind the bottom bar - issue #79\n 'body > [class*=\"_selectBox__contents_\"]': {\n zIndex: 99999,\n },\n },\n}); });\nvar App = function () {\n var _a = src_1.useMediaUi(), selectionMode = _a.selectionMode, isInNodeCreationDialog = _a.isInNodeCreationDialog, containerRef = _a.containerRef;\n var showUploadDialog = recoil_1.useRecoilValue(state_1.uploadDialogVisibleState).visible;\n var showCreateTagDialog = recoil_1.useRecoilValue(state_2.createTagDialogState).visible;\n var showCreateAssetCollectionDialog = recoil_1.useRecoilValue(state_2.createAssetCollectionDialogState).visible;\n var showAssetUsagesModal = recoil_1.useRecoilValue(src_2.assetUsageDetailsModalState);\n var showSimilarAssetsModal = recoil_1.useRecoilValue(src_5.similarAssetsModalState);\n var classes = useStyles({ selectionMode: selectionMode, isInNodeCreationDialog: isInNodeCreationDialog });\n return (React.createElement(\"div\", { className: classes.container, ref: containerRef },\n React.createElement(LoadingIndicator_1.default, null),\n React.createElement(\"div\", { className: classes.gridLeft },\n React.createElement(ErrorBoundary_1.default, null,\n React.createElement(SideBarLeft_1.SideBarLeft, null))),\n React.createElement(\"div\", { className: classes.gridTop },\n React.createElement(TopBar_1.TopBar, null)),\n React.createElement(\"div\", { className: classes.gridMain },\n React.createElement(ErrorBoundary_1.default, null,\n React.createElement(Main_1.Main, null))),\n React.createElement(BottomBar_1.BottomBar, null),\n !selectionMode && (React.createElement(\"div\", { className: classes.gridRight },\n React.createElement(ErrorBoundary_1.default, null,\n React.createElement(SideBarRight_1.SideBarRight, null)))),\n React.createElement(src_6.AssetPreview, null),\n showAssetUsagesModal && React.createElement(src_2.AssetUsagesModal, null),\n showUploadDialog && React.createElement(components_1.UploadDialog, null),\n showCreateTagDialog && React.createElement(Dialogs_1.CreateTagDialog, null),\n showCreateAssetCollectionDialog && React.createElement(Dialogs_1.CreateAssetCollectionDialog, null),\n showSimilarAssetsModal && React.createElement(src_5.SimilarAssetsModal, null),\n React.createElement(src_3.ClipboardWatcher, null),\n React.createElement(src_4.ConcurrentChangeMonitor, null)));\n};\nexports.default = React.memo(App);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetChangeType = exports.changedAssets = exports.useChangedAssetsQuery = exports.ConcurrentChangeMonitor = void 0;\nvar ConcurrentChangeMonitor_1 = __importDefault(require(\"./components/ConcurrentChangeMonitor\"));\nexports.ConcurrentChangeMonitor = ConcurrentChangeMonitor_1.default;\nvar useChangedAssetsQuery_1 = __importStar(require(\"./hooks/useChangedAssetsQuery\"));\nexports.useChangedAssetsQuery = useChangedAssetsQuery_1.default;\nObject.defineProperty(exports, \"AssetChangeType\", { enumerable: true, get: function () { return useChangedAssetsQuery_1.AssetChangeType; } });\nvar changedAssets_1 = __importDefault(require(\"./queries/changedAssets\"));\nexports.changedAssets = changedAssets_1.default;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar neos_1 = require(\"@media-ui/core/src/constants/neos\");\nvar events_1 = require(\"@media-ui/core/src/events\");\nvar useChangedAssetsQuery_1 = __importStar(require(\"../hooks/useChangedAssetsQuery\"));\n/**\n * Renderless component to watch for remote changes, update cached assets and inform the user if necessary\n */\nvar ConcurrentChangeMonitor = function () {\n var changedAssets = useChangedAssetsQuery_1.default();\n var refetchAsset = hooks_1.useAssetQuery().refetch;\n var refetchAssets = hooks_1.useAssetsQuery().refetch;\n react_1.useEffect(function () {\n changedAssets === null || changedAssets === void 0 ? void 0 : changedAssets.forEach(function (change) {\n switch (change.type) {\n case useChangedAssetsQuery_1.AssetChangeType.ASSET_REPLACED:\n case useChangedAssetsQuery_1.AssetChangeType.ASSET_UPDATED:\n refetchAsset({ id: change.assetId, assetSourceId: neos_1.NEOS_ASSET_SOURCE }).then(function () {\n // TODO: Show some notification in the ui\n console.info(change.assetId, change.type, 'An asset was updated due to a remote change');\n });\n events_1.assetUpdatedEvent({ assetId: change.assetId, assetSourceId: neos_1.NEOS_ASSET_SOURCE });\n break;\n case useChangedAssetsQuery_1.AssetChangeType.ASSET_CREATED:\n refetchAssets().then(function () {\n // TODO: Show some notification in the ui\n console.info(change.assetId, change.type, 'An asset was created remotely');\n });\n events_1.assetCreatedEvent({ assetId: change.assetId, assetSourceId: neos_1.NEOS_ASSET_SOURCE });\n break;\n case useChangedAssetsQuery_1.AssetChangeType.ASSET_REMOVED:\n refetchAssets().then(function () {\n // TODO: Show some notification in the ui\n console.info(change.assetId, change.type, 'An asset was removed remotely');\n });\n events_1.assetRemovedEvent({ assetId: change.assetId, assetSourceId: neos_1.NEOS_ASSET_SOURCE });\n break;\n default:\n console.debug(change, 'unhandled remote change');\n }\n });\n }, [changedAssets, refetchAsset, refetchAssets]);\n return null;\n};\nexports.default = React.memo(ConcurrentChangeMonitor);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar similarAssetsModalState_1 = __importDefault(require(\"../state/similarAssetsModalState\"));\nvar SimilarAssetsToggleButton = function () {\n var _a = recoil_1.useRecoilState(similarAssetsModalState_1.default), similarAssetsModalOpen = _a[0], setSimilarAssetsModalOpen = _a[1];\n var translate = src_1.useIntl().translate;\n return (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: similarAssetsModalOpen ? 'brand' : 'lighter', hoverStyle: \"brand\", onClick: function () { return setSimilarAssetsModalOpen(true); } }, translate('similarAssetsModal.show', 'Show similar assets')));\n};\nexports.default = React.memo(SimilarAssetsToggleButton);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar similarAssetsModalState_1 = __importDefault(require(\"../state/similarAssetsModalState\"));\nvar useSimilarAssets_1 = __importDefault(require(\"../hooks/useSimilarAssets\"));\nvar SimilarAsset_1 = __importDefault(require(\"./SimilarAsset\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetUsage: {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',\n gridGap: theme.spacing.full,\n padding: theme.spacing.full,\n },\n}); });\nvar SimilarAssetsModal = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var _a = recoil_1.useRecoilState(similarAssetsModalState_1.default), isOpen = _a[0], setIsOpen = _a[1];\n var asset = hooks_1.useSelectedAsset();\n var _b = useSimilarAssets_1.default(asset ? { assetId: asset.id, assetSourceId: asset.assetSource.id } : null), similarAssets = _b.similarAssets, loading = _b.loading;\n var handleRequestClose = react_1.useCallback(function () { return setIsOpen(false); }, [setIsOpen]);\n return (React.createElement(react_ui_components_1.Dialog, { isOpen: isOpen, title: translate('similarAssetsModal.title', \"Similar assets to \" + asset.label, { asset: asset.label }), onRequestClose: handleRequestClose, style: \"wide\", actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: handleRequestClose }, translate('similarAssetsModal.cancel', 'Cancel')),\n ] },\n React.createElement(\"div\", { className: classes.assetUsage }, (similarAssets === null || similarAssets === void 0 ? void 0 : similarAssets.length) > 0 ? (similarAssets.map(function (asset, index) { return React.createElement(SimilarAsset_1.default, { key: index, asset: asset }); })) : (React.createElement(\"span\", null, loading\n ? translate('similarAssetsModal.loading', 'Loading...')\n : translate('similarAssetsModal.noResults', 'No results'))))));\n};\nexports.default = React.memo(SimilarAssetsModal);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n similarAsset: {\n margin: '0',\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n },\n picture: {\n backgroundColor: theme.colors.assetBackground,\n '& img': {\n display: 'block',\n height: '250px',\n width: '100%',\n objectFit: 'contain',\n },\n },\n caption: {\n backgroundColor: theme.colors.captionBackground,\n transition: \"background-color \" + theme.transition.fast,\n padding: theme.spacing.half,\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n '& img': {\n width: '1.3rem',\n height: 'auto',\n marginRight: theme.spacing.half,\n },\n },\n}); });\nvar SimilarAsset = function (_a) {\n var asset = _a.asset;\n var classes = useStyles();\n var dummyImage = src_1.useMediaUi().dummyImage;\n return (React.createElement(\"figure\", { className: classes.similarAsset },\n React.createElement(\"picture\", { className: classes.picture },\n React.createElement(\"img\", { src: !asset ? dummyImage : asset.thumbnailUrl, alt: asset === null || asset === void 0 ? void 0 : asset.label })),\n React.createElement(\"figcaption\", { className: classes.caption }, asset && (React.createElement(React.Fragment, null,\n React.createElement(\"img\", { src: asset.file.typeIcon.url, alt: asset.file.typeIcon.alt }),\n React.createElement(\"span\", null, asset.label))))));\n};\nexports.default = React.memo(SimilarAsset);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../state\");\nvar uploadDialogVisibleState_1 = require(\"../state/uploadDialogVisibleState\");\nvar useUploadDialogState = function () {\n // TODO: Use reducer instead to manage the state of files in their various states -> simplifies code in dialogs\n var _a = react_1.useState({\n selected: [],\n finished: [],\n rejected: [],\n }), files = _a[0], setFiles = _a[1];\n var _b = recoil_1.useRecoilState(state_1.uploadDialogVisibleState), dialogState = _b[0], setDialogState = _b[1];\n var handleClose = react_1.useCallback(function () {\n // Make sure to revoke the data uris to avoid memory leaks\n files.selected.forEach(function (file) { return URL.revokeObjectURL(file.preview); });\n files.finished.forEach(function (file) { return URL.revokeObjectURL(file.preview); });\n files.rejected.forEach(function (file) { return URL.revokeObjectURL(file.preview); });\n setFiles({\n selected: [],\n finished: [],\n rejected: [],\n });\n setDialogState({ uploadType: uploadDialogVisibleState_1.UPLOAD_TYPE.new, visible: false });\n }, [files, setFiles, setDialogState]);\n return {\n state: __assign(__assign({}, dialogState), { files: files }),\n closeDialog: handleClose,\n setFiles: setFiles,\n };\n};\nexports.default = useUploadDialogState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUploadFile() {\n var _a = client_1.useMutation(mutations_1.UPLOAD_FILE), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var tagId = recoil_1.useRecoilValue(state_1.selectedTagIdState);\n var assetCollectionId = recoil_1.useRecoilValue(state_1.selectedAssetCollectionIdState);\n var uploadFile = function (file) {\n return action({\n variables: {\n file: file,\n tagId: tagId,\n assetCollectionId: assetCollectionId,\n },\n });\n };\n return { uploadFile: uploadFile, uploadState: (data === null || data === void 0 ? void 0 : data.uploadFile) || {}, error: error, loading: loading };\n}\nexports.default = useUploadFile;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar REPLACE_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation ReplaceAsset(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $file: Upload!\\n $options: AssetReplacementOptionsInput!\\n ) {\\n replaceAsset(id: $id, assetSourceId: $assetSourceId, file: $file, options: $options) {\\n filename\\n success\\n result\\n }\\n }\\n\"], [\"\\n mutation ReplaceAsset(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $file: Upload!\\n $options: AssetReplacementOptionsInput!\\n ) {\\n replaceAsset(id: $id, assetSourceId: $assetSourceId, file: $file, options: $options) {\\n filename\\n success\\n result\\n }\\n }\\n\"])));\nexports.default = REPLACE_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar UPLOAD_FILES = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UploadFiles($files: [Upload!]!, $tagId: TagId, $assetCollectionId: AssetCollectionId) {\\n uploadFiles(files: $files, tagId: $tagId, assetCollectionId: $assetCollectionId) {\\n filename\\n success\\n result\\n }\\n }\\n\"], [\"\\n mutation UploadFiles($files: [Upload!]!, $tagId: TagId, $assetCollectionId: AssetCollectionId) {\\n uploadFiles(files: $files, tagId: $tagId, assetCollectionId: $assetCollectionId) {\\n filename\\n success\\n result\\n }\\n }\\n\"])));\nexports.default = UPLOAD_FILES;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar UPLOAD_FILE = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UploadFile($file: Upload!, $tagId: TagId, $assetCollectionId: AssetCollectionId) {\\n uploadFile(file: $file, tagId: $tagId, assetCollectionId: $assetCollectionId) {\\n filename\\n success\\n result\\n }\\n }\\n\"], [\"\\n mutation UploadFile($file: Upload!, $tagId: TagId, $assetCollectionId: AssetCollectionId) {\\n uploadFile(file: $file, tagId: $tagId, assetCollectionId: $assetCollectionId) {\\n filename\\n success\\n result\\n }\\n }\\n\"])));\nexports.default = UPLOAD_FILE;\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUploadFiles() {\n var _a = client_1.useMutation(mutations_1.UPLOAD_FILES), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var tagId = recoil_1.useRecoilValue(state_1.selectedTagIdState);\n var assetCollectionId = recoil_1.useRecoilValue(state_1.selectedAssetCollectionIdState);\n var uploadFiles = function (files) {\n return action({\n variables: {\n files: files,\n tagId: tagId,\n assetCollectionId: assetCollectionId,\n },\n });\n };\n return { uploadFiles: uploadFiles, uploadState: (data === null || data === void 0 ? void 0 : data.uploadFiles) || [], error: error, loading: loading };\n}\nexports.default = useUploadFiles;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useReplaceAsset() {\n var _a = client_1.useMutation(mutations_1.REPLACE_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var replaceAsset = function (_a) {\n var asset = _a.asset, file = _a.file, options = _a.options;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n file: file,\n options: options,\n },\n });\n };\n return { replaceAsset: replaceAsset, uploadState: (data === null || data === void 0 ? void 0 : data.replaceAsset) || null, error: error, loading: loading };\n}\nexports.default = useReplaceAsset;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../../state\");\nvar uploadDialogVisibleState_1 = require(\"../../state/uploadDialogVisibleState\");\nvar NewAssetDialog_1 = __importDefault(require(\"./NewAssetDialog\"));\nvar ReplaceAssetDialog_1 = __importDefault(require(\"./ReplaceAssetDialog\"));\nvar UploadDialog = function () {\n var _a = recoil_1.useRecoilValue(state_1.uploadDialogVisibleState), visible = _a.visible, uploadType = _a.uploadType;\n return (visible && (uploadType === uploadDialogVisibleState_1.UPLOAD_TYPE.update ? React.createElement(ReplaceAssetDialog_1.default, null) : React.createElement(NewAssetDialog_1.default, null))) || null;\n};\nexports.default = React.memo(UploadDialog);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"../state\");\nvar uploadDialogVisibleState_1 = require(\"../state/uploadDialogVisibleState\");\nvar AssetReplacementButton = function () {\n var _a = recoil_1.useRecoilState(state_1.uploadDialogVisibleState), dialogState = _a[0], setDialogState = _a[1];\n var translate = src_1.useIntl().translate;\n return (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: dialogState.visible && dialogState.uploadType === uploadDialogVisibleState_1.UPLOAD_TYPE.update ? 'brand' : 'lighter', hoverStyle: \"brand\", onClick: function () { return setDialogState({ visible: true, uploadType: uploadDialogVisibleState_1.UPLOAD_TYPE.update }); } }, translate('asssetReplacement.toggle', 'Replace asset')));\n};\nexports.default = React.memo(AssetReplacementButton);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"../state\");\nvar uploadDialogVisibleState_1 = require(\"../state/uploadDialogVisibleState\");\nfunction UploadButton() {\n var translate = src_1.useIntl().translate;\n var setUploadDialogState = recoil_1.useSetRecoilState(state_1.uploadDialogVisibleState);\n return (React.createElement(\"div\", null,\n React.createElement(react_ui_components_1.Button, { size: \"regular\", style: \"lighter\", hoverStyle: \"brand\", onClick: function () { return setUploadDialogState({ visible: true, uploadType: uploadDialogVisibleState_1.UPLOAD_TYPE.new }); } },\n React.createElement(react_ui_components_1.Icon, { icon: \"upload\" }),\n \" \",\n translate('uploadButton.label', 'Upload'))));\n}\nexports.default = UploadButton;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_image_lightbox_1 = __importDefault(require(\"react-image-lightbox\"));\nvar recoil_1 = require(\"recoil\");\nrequire(\"react-image-lightbox/style.css\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar selectedAssetForPreviewState_1 = __importDefault(require(\"../state/selectedAssetForPreviewState\"));\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar react_1 = require(\"react\");\nvar useStyles = src_1.createUseMediaUiStyles({\n lightbox: {\n '& .ril__image': {\n maxWidth: '100%',\n },\n },\n});\nvar useLightBoxContainer = function (defaultContainer) {\n if (defaultContainer === void 0) { defaultContainer = null; }\n var lightBoxContainerRef = React.useRef(defaultContainer);\n React.useEffect(function () {\n if (defaultContainer === null) {\n var newLightBoxContainer_1 = document.createElement('div');\n newLightBoxContainer_1.setAttribute('data-ignore_click_outside', 'true');\n document.body.appendChild(newLightBoxContainer_1);\n lightBoxContainerRef.current = newLightBoxContainer_1;\n return function () { return newLightBoxContainer_1.remove(); };\n }\n lightBoxContainerRef.current = defaultContainer;\n }, [defaultContainer]);\n return lightBoxContainerRef;\n};\nfunction AssetPreview() {\n var classes = useStyles();\n var theme = src_1.useMediaUiTheme();\n var _a = src_1.useMediaUi(), containerRef = _a.containerRef, isInNodeCreationDialog = _a.isInNodeCreationDialog, assets = _a.assets;\n var _b = recoil_1.useRecoilState(selectedAssetForPreviewState_1.default), selectedAssetForPreview = _b[0], setSelectedAssetForPreview = _b[1];\n var asset = hooks_1.useAssetQuery(selectedAssetForPreview).asset;\n var lightBoxContainer = useLightBoxContainer(isInNodeCreationDialog ? null : containerRef.current);\n var _c = react_1.useMemo(function () {\n if (!asset)\n return [null, null];\n var currentAssetIndex = assets.findIndex(function (_a) {\n var id = _a.id;\n return id === asset.id;\n });\n return [\n currentAssetIndex > 0 ? assets[currentAssetIndex - 1] : null,\n currentAssetIndex < assets.length - 1 ? assets[currentAssetIndex + 1] : null,\n ];\n }, [assets, asset]), prevAsset = _c[0], nextAsset = _c[1];\n // TODO: Handle pdf fiels with pdf viewer https://github.com/Flowpack/media-ui/issues/29\n if (!asset)\n return null;\n return (React.createElement(react_image_lightbox_1.default, { reactModalStyle: { overlay: { zIndex: theme.lightboxZIndex } }, reactModalProps: { parentSelector: function () { return lightBoxContainer.current; } }, wrapperClassName: classes.lightbox, mainSrc: asset.previewUrl, mainSrcThumbnail: asset.thumbnailUrl, imageTitle: asset.label, imageCaption: asset.caption, onCloseRequest: function () { return setSelectedAssetForPreview(null); }, prevSrc: prevAsset === null || prevAsset === void 0 ? void 0 : prevAsset.previewUrl, prevSrcThumbnail: prevAsset === null || prevAsset === void 0 ? void 0 : prevAsset.thumbnailUrl, prevLabel: prevAsset === null || prevAsset === void 0 ? void 0 : prevAsset.label, onMovePrevRequest: function () {\n return setSelectedAssetForPreview(prevAsset ? { assetId: prevAsset.id, assetSourceId: prevAsset.assetSource.id } : null);\n }, nextSrc: nextAsset === null || nextAsset === void 0 ? void 0 : nextAsset.previewUrl, nextSrcThumbnail: nextAsset === null || nextAsset === void 0 ? void 0 : nextAsset.thumbnailUrl, nextLabel: nextAsset === null || nextAsset === void 0 ? void 0 : nextAsset.label, onMoveNextRequest: function () {\n return setSelectedAssetForPreview(nextAsset ? { assetId: nextAsset.id, assetSourceId: nextAsset.assetSource.id } : null);\n } }));\n}\nexports.default = AssetPreview;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Modal from 'react-modal';\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\n/**\n * Placeholder for future translate functionality\n */\nfunction translate(str) {\n var replaceStrings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (!str) {\n return '';\n }\n\n var translated = str;\n\n if (replaceStrings) {\n Object.keys(replaceStrings).forEach(function (placeholder) {\n translated = translated.replace(placeholder, replaceStrings[placeholder]);\n });\n }\n\n return translated;\n}\nfunction getWindowWidth() {\n return typeof global.window !== 'undefined' ? global.window.innerWidth : 0;\n}\nfunction getWindowHeight() {\n return typeof global.window !== 'undefined' ? global.window.innerHeight : 0;\n} // Get the highest window context that isn't cross-origin\n// (When in an iframe)\n\nfunction getHighestSafeWindowContext() {\n var self = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.window.self;\n var referrer = self.document.referrer; // If we reached the top level, return self\n\n if (self === global.window.top || !referrer) {\n return self;\n }\n\n var getOrigin = function getOrigin(href) {\n return href.match(/(.*\\/\\/.*?)(\\/|$)/)[1];\n }; // If parent is the same origin, we can move up one context\n // Reference: https://stackoverflow.com/a/21965342/1601953\n\n\n if (getOrigin(self.location.href) === getOrigin(referrer)) {\n return getHighestSafeWindowContext(self.parent);\n } // If a different origin, we consider the current level\n // as the top reachable one\n\n\n return self;\n}\n\n// Min image zoom level\nvar MIN_ZOOM_LEVEL = 0; // Max image zoom level\n\nvar MAX_ZOOM_LEVEL = 300; // Size ratio between previous and next zoom levels\n\nvar ZOOM_RATIO = 1.007; // How much to increase/decrease the zoom level when the zoom buttons are clicked\n\nvar ZOOM_BUTTON_INCREMENT_SIZE = 100; // Used to judge the amount of horizontal scroll needed to initiate a image move\n\nvar WHEEL_MOVE_X_THRESHOLD = 200; // Used to judge the amount of vertical scroll needed to initiate a zoom action\n\nvar WHEEL_MOVE_Y_THRESHOLD = 1;\nvar KEYS = {\n ESC: 27,\n LEFT_ARROW: 37,\n RIGHT_ARROW: 39\n}; // Actions\n\nvar ACTION_NONE = 0;\nvar ACTION_MOVE = 1;\nvar ACTION_SWIPE = 2;\nvar ACTION_PINCH = 3;\n\nvar SOURCE_ANY = 0;\nvar SOURCE_MOUSE = 1;\nvar SOURCE_TOUCH = 2;\nvar SOURCE_POINTER = 3; // Minimal swipe distance\n\nvar MIN_SWIPE_DISTANCE = 200;\n\nvar ReactImageLightbox =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ReactImageLightbox, _Component);\n\n _createClass(ReactImageLightbox, null, [{\n key: \"isTargetMatchImage\",\n value: function isTargetMatchImage(target) {\n return target && /ril-image-current/.test(target.className);\n }\n }, {\n key: \"parseMouseEvent\",\n value: function parseMouseEvent(mouseEvent) {\n return {\n id: 'mouse',\n source: SOURCE_MOUSE,\n x: parseInt(mouseEvent.clientX, 10),\n y: parseInt(mouseEvent.clientY, 10)\n };\n }\n }, {\n key: \"parseTouchPointer\",\n value: function parseTouchPointer(touchPointer) {\n return {\n id: touchPointer.identifier,\n source: SOURCE_TOUCH,\n x: parseInt(touchPointer.clientX, 10),\n y: parseInt(touchPointer.clientY, 10)\n };\n }\n }, {\n key: \"parsePointerEvent\",\n value: function parsePointerEvent(pointerEvent) {\n return {\n id: pointerEvent.pointerId,\n source: SOURCE_POINTER,\n x: parseInt(pointerEvent.clientX, 10),\n y: parseInt(pointerEvent.clientY, 10)\n };\n } // Request to transition to the previous image\n\n }, {\n key: \"getTransform\",\n value: function getTransform(_ref) {\n var _ref$x = _ref.x,\n x = _ref$x === void 0 ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === void 0 ? 0 : _ref$y,\n _ref$zoom = _ref.zoom,\n zoom = _ref$zoom === void 0 ? 1 : _ref$zoom,\n width = _ref.width,\n targetWidth = _ref.targetWidth;\n var nextX = x;\n var windowWidth = getWindowWidth();\n\n var scaleFactor = zoom * (targetWidth / width);\n return {\n transform: \"translate3d(\".concat(nextX, \"px,\").concat(y, \"px,0) scale3d(\").concat(scaleFactor, \",\").concat(scaleFactor, \",1)\")\n };\n }\n }]);\n\n function ReactImageLightbox(props) {\n var _this;\n\n _classCallCheck(this, ReactImageLightbox);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactImageLightbox).call(this, props));\n _this.state = {\n //-----------------------------\n // Animation\n //-----------------------------\n // Lightbox is closing\n // When Lightbox is mounted, if animation is enabled it will open with the reverse of the closing animation\n isClosing: !props.animationDisabled,\n // Component parts should animate (e.g., when images are moving, or image is being zoomed)\n shouldAnimate: false,\n //-----------------------------\n // Zoom settings\n //-----------------------------\n // Zoom level of image\n zoomLevel: MIN_ZOOM_LEVEL,\n //-----------------------------\n // Image position settings\n //-----------------------------\n // Horizontal offset from center\n offsetX: 0,\n // Vertical offset from center\n offsetY: 0,\n // image load error for srcType\n loadErrorStatus: {}\n }; // Refs\n\n _this.outerEl = React.createRef();\n _this.zoomInBtn = React.createRef();\n _this.zoomOutBtn = React.createRef();\n _this.caption = React.createRef();\n _this.closeIfClickInner = _this.closeIfClickInner.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageDoubleClick = _this.handleImageDoubleClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageMouseWheel = _this.handleImageMouseWheel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyInput = _this.handleKeyInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMouseUp = _this.handleMouseUp.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleOuterMousewheel = _this.handleOuterMousewheel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTouchStart = _this.handleTouchStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTouchMove = _this.handleTouchMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTouchEnd = _this.handleTouchEnd.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePointerEvent = _this.handlePointerEvent.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCaptionMousewheel = _this.handleCaptionMousewheel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleWindowResize = _this.handleWindowResize.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleZoomInButtonClick = _this.handleZoomInButtonClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleZoomOutButtonClick = _this.handleZoomOutButtonClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestClose = _this.requestClose.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestMoveNext = _this.requestMoveNext.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestMovePrev = _this.requestMovePrev.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(ReactImageLightbox, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n // Timeouts - always clear it before umount\n this.timeouts = []; // Current action\n\n this.currentAction = ACTION_NONE; // Events source\n\n this.eventsSource = SOURCE_ANY; // Empty pointers list\n\n this.pointerList = []; // Prevent inner close\n\n this.preventInnerClose = false;\n this.preventInnerCloseTimeout = null; // Used to disable animation when changing props.mainSrc|nextSrc|prevSrc\n\n this.keyPressed = false; // Used to store load state / dimensions of images\n\n this.imageCache = {}; // Time the last keydown event was called (used in keyboard action rate limiting)\n\n this.lastKeyDownTime = 0; // Used for debouncing window resize event\n\n this.resizeTimeout = null; // Used to determine when actions are triggered by the scroll wheel\n\n this.wheelActionTimeout = null;\n this.resetScrollTimeout = null;\n this.scrollX = 0;\n this.scrollY = 0; // Used in panning zoomed images\n\n this.moveStartX = 0;\n this.moveStartY = 0;\n this.moveStartOffsetX = 0;\n this.moveStartOffsetY = 0; // Used to swipe\n\n this.swipeStartX = 0;\n this.swipeStartY = 0;\n this.swipeEndX = 0;\n this.swipeEndY = 0; // Used to pinch\n\n this.pinchTouchList = null;\n this.pinchDistance = 0; // Used to differentiate between images with identical src\n\n this.keyCounter = 0; // Used to detect a move when all src's remain unchanged (four or more of the same image in a row)\n\n this.moveRequested = false;\n\n if (!this.props.animationDisabled) {\n // Make opening animation play\n this.setState({\n isClosing: false\n });\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n // Prevents cross-origin errors when using a cross-origin iframe\n this.windowContext = getHighestSafeWindowContext();\n this.listeners = {\n resize: this.handleWindowResize,\n mouseup: this.handleMouseUp,\n touchend: this.handleTouchEnd,\n touchcancel: this.handleTouchEnd,\n pointerdown: this.handlePointerEvent,\n pointermove: this.handlePointerEvent,\n pointerup: this.handlePointerEvent,\n pointercancel: this.handlePointerEvent\n };\n Object.keys(this.listeners).forEach(function (type) {\n _this2.windowContext.addEventListener(type, _this2.listeners[type]);\n });\n this.loadAllImages();\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var _this3 = this;\n\n // Iterate through the source types for prevProps and nextProps to\n // determine if any of the sources changed\n var sourcesChanged = false;\n var prevSrcDict = {};\n var nextSrcDict = {};\n this.getSrcTypes().forEach(function (srcType) {\n if (_this3.props[srcType.name] !== nextProps[srcType.name]) {\n sourcesChanged = true;\n prevSrcDict[_this3.props[srcType.name]] = true;\n nextSrcDict[nextProps[srcType.name]] = true;\n }\n });\n\n if (sourcesChanged || this.moveRequested) {\n // Reset the loaded state for images not rendered next\n Object.keys(prevSrcDict).forEach(function (prevSrc) {\n if (!(prevSrc in nextSrcDict) && prevSrc in _this3.imageCache) {\n _this3.imageCache[prevSrc].loaded = false;\n }\n });\n this.moveRequested = false; // Load any new images\n\n this.loadAllImages(nextProps);\n }\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate() {\n // Wait for move...\n return !this.moveRequested;\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var _this4 = this;\n\n this.didUnmount = true;\n Object.keys(this.listeners).forEach(function (type) {\n _this4.windowContext.removeEventListener(type, _this4.listeners[type]);\n });\n this.timeouts.forEach(function (tid) {\n return clearTimeout(tid);\n });\n }\n }, {\n key: \"setTimeout\",\n value: function (_setTimeout) {\n function setTimeout(_x, _x2) {\n return _setTimeout.apply(this, arguments);\n }\n\n setTimeout.toString = function () {\n return _setTimeout.toString();\n };\n\n return setTimeout;\n }(function (func, time) {\n var _this5 = this;\n\n var id = setTimeout(function () {\n _this5.timeouts = _this5.timeouts.filter(function (tid) {\n return tid !== id;\n });\n func();\n }, time);\n this.timeouts.push(id);\n return id;\n })\n }, {\n key: \"setPreventInnerClose\",\n value: function setPreventInnerClose() {\n var _this6 = this;\n\n if (this.preventInnerCloseTimeout) {\n this.clearTimeout(this.preventInnerCloseTimeout);\n }\n\n this.preventInnerClose = true;\n this.preventInnerCloseTimeout = this.setTimeout(function () {\n _this6.preventInnerClose = false;\n _this6.preventInnerCloseTimeout = null;\n }, 100);\n } // Get info for the best suited image to display with the given srcType\n\n }, {\n key: \"getBestImageForType\",\n value: function getBestImageForType(srcType) {\n var imageSrc = this.props[srcType];\n var fitSizes = {};\n\n if (this.isImageLoaded(imageSrc)) {\n // Use full-size image if available\n fitSizes = this.getFitSizes(this.imageCache[imageSrc].width, this.imageCache[imageSrc].height);\n } else if (this.isImageLoaded(this.props[\"\".concat(srcType, \"Thumbnail\")])) {\n // Fall back to using thumbnail if the image has not been loaded\n imageSrc = this.props[\"\".concat(srcType, \"Thumbnail\")];\n fitSizes = this.getFitSizes(this.imageCache[imageSrc].width, this.imageCache[imageSrc].height, true);\n } else {\n return null;\n }\n\n return {\n src: imageSrc,\n height: this.imageCache[imageSrc].height,\n width: this.imageCache[imageSrc].width,\n targetHeight: fitSizes.height,\n targetWidth: fitSizes.width\n };\n } // Get sizing for when an image is larger than the window\n\n }, {\n key: \"getFitSizes\",\n value: function getFitSizes(width, height, stretch) {\n var boxSize = this.getLightboxRect();\n var maxHeight = boxSize.height - this.props.imagePadding * 2;\n var maxWidth = boxSize.width - this.props.imagePadding * 2;\n\n if (!stretch) {\n maxHeight = Math.min(maxHeight, height);\n maxWidth = Math.min(maxWidth, width);\n }\n\n var maxRatio = maxWidth / maxHeight;\n var srcRatio = width / height;\n\n if (maxRatio > srcRatio) {\n // height is the constraining dimension of the photo\n return {\n width: width * maxHeight / height,\n height: maxHeight\n };\n }\n\n return {\n width: maxWidth,\n height: height * maxWidth / width\n };\n }\n }, {\n key: \"getMaxOffsets\",\n value: function getMaxOffsets() {\n var zoomLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.zoomLevel;\n var currentImageInfo = this.getBestImageForType('mainSrc');\n\n if (currentImageInfo === null) {\n return {\n maxX: 0,\n minX: 0,\n maxY: 0,\n minY: 0\n };\n }\n\n var boxSize = this.getLightboxRect();\n var zoomMultiplier = this.getZoomMultiplier(zoomLevel);\n var maxX = 0;\n\n if (zoomMultiplier * currentImageInfo.width - boxSize.width < 0) {\n // if there is still blank space in the X dimension, don't limit except to the opposite edge\n maxX = (boxSize.width - zoomMultiplier * currentImageInfo.width) / 2;\n } else {\n maxX = (zoomMultiplier * currentImageInfo.width - boxSize.width) / 2;\n }\n\n var maxY = 0;\n\n if (zoomMultiplier * currentImageInfo.height - boxSize.height < 0) {\n // if there is still blank space in the Y dimension, don't limit except to the opposite edge\n maxY = (boxSize.height - zoomMultiplier * currentImageInfo.height) / 2;\n } else {\n maxY = (zoomMultiplier * currentImageInfo.height - boxSize.height) / 2;\n }\n\n return {\n maxX: maxX,\n maxY: maxY,\n minX: -1 * maxX,\n minY: -1 * maxY\n };\n } // Get image src types\n\n }, {\n key: \"getSrcTypes\",\n value: function getSrcTypes() {\n return [{\n name: 'mainSrc',\n keyEnding: \"i\".concat(this.keyCounter)\n }, {\n name: 'mainSrcThumbnail',\n keyEnding: \"t\".concat(this.keyCounter)\n }, {\n name: 'nextSrc',\n keyEnding: \"i\".concat(this.keyCounter + 1)\n }, {\n name: 'nextSrcThumbnail',\n keyEnding: \"t\".concat(this.keyCounter + 1)\n }, {\n name: 'prevSrc',\n keyEnding: \"i\".concat(this.keyCounter - 1)\n }, {\n name: 'prevSrcThumbnail',\n keyEnding: \"t\".concat(this.keyCounter - 1)\n }];\n }\n /**\n * Get sizing when the image is scaled\n */\n\n }, {\n key: \"getZoomMultiplier\",\n value: function getZoomMultiplier() {\n var zoomLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.zoomLevel;\n return Math.pow(ZOOM_RATIO, zoomLevel);\n }\n /**\n * Get the size of the lightbox in pixels\n */\n\n }, {\n key: \"getLightboxRect\",\n value: function getLightboxRect() {\n if (this.outerEl.current) {\n return this.outerEl.current.getBoundingClientRect();\n }\n\n return {\n width: getWindowWidth(),\n height: getWindowHeight(),\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n }\n }, {\n key: \"clearTimeout\",\n value: function (_clearTimeout) {\n function clearTimeout(_x3) {\n return _clearTimeout.apply(this, arguments);\n }\n\n clearTimeout.toString = function () {\n return _clearTimeout.toString();\n };\n\n return clearTimeout;\n }(function (id) {\n this.timeouts = this.timeouts.filter(function (tid) {\n return tid !== id;\n });\n clearTimeout(id);\n }) // Change zoom level\n\n }, {\n key: \"changeZoom\",\n value: function changeZoom(zoomLevel, clientX, clientY) {\n // Ignore if zoom disabled\n if (!this.props.enableZoom) {\n return;\n } // Constrain zoom level to the set bounds\n\n\n var nextZoomLevel = Math.max(MIN_ZOOM_LEVEL, Math.min(MAX_ZOOM_LEVEL, zoomLevel)); // Ignore requests that don't change the zoom level\n\n if (nextZoomLevel === this.state.zoomLevel) {\n return;\n }\n\n if (nextZoomLevel === MIN_ZOOM_LEVEL) {\n // Snap back to center if zoomed all the way out\n this.setState({\n zoomLevel: nextZoomLevel,\n offsetX: 0,\n offsetY: 0\n });\n return;\n }\n\n var imageBaseSize = this.getBestImageForType('mainSrc');\n\n if (imageBaseSize === null) {\n return;\n }\n\n var currentZoomMultiplier = this.getZoomMultiplier();\n var nextZoomMultiplier = this.getZoomMultiplier(nextZoomLevel); // Default to the center of the image to zoom when no mouse position specified\n\n var boxRect = this.getLightboxRect();\n var pointerX = typeof clientX !== 'undefined' ? clientX - boxRect.left : boxRect.width / 2;\n var pointerY = typeof clientY !== 'undefined' ? clientY - boxRect.top : boxRect.height / 2;\n var currentImageOffsetX = (boxRect.width - imageBaseSize.width * currentZoomMultiplier) / 2;\n var currentImageOffsetY = (boxRect.height - imageBaseSize.height * currentZoomMultiplier) / 2;\n var currentImageRealOffsetX = currentImageOffsetX - this.state.offsetX;\n var currentImageRealOffsetY = currentImageOffsetY - this.state.offsetY;\n var currentPointerXRelativeToImage = (pointerX - currentImageRealOffsetX) / currentZoomMultiplier;\n var currentPointerYRelativeToImage = (pointerY - currentImageRealOffsetY) / currentZoomMultiplier;\n var nextImageRealOffsetX = pointerX - currentPointerXRelativeToImage * nextZoomMultiplier;\n var nextImageRealOffsetY = pointerY - currentPointerYRelativeToImage * nextZoomMultiplier;\n var nextImageOffsetX = (boxRect.width - imageBaseSize.width * nextZoomMultiplier) / 2;\n var nextImageOffsetY = (boxRect.height - imageBaseSize.height * nextZoomMultiplier) / 2;\n var nextOffsetX = nextImageOffsetX - nextImageRealOffsetX;\n var nextOffsetY = nextImageOffsetY - nextImageRealOffsetY; // When zooming out, limit the offset so things don't get left askew\n\n if (this.currentAction !== ACTION_PINCH) {\n var maxOffsets = this.getMaxOffsets();\n\n if (this.state.zoomLevel > nextZoomLevel) {\n nextOffsetX = Math.max(maxOffsets.minX, Math.min(maxOffsets.maxX, nextOffsetX));\n nextOffsetY = Math.max(maxOffsets.minY, Math.min(maxOffsets.maxY, nextOffsetY));\n }\n }\n\n this.setState({\n zoomLevel: nextZoomLevel,\n offsetX: nextOffsetX,\n offsetY: nextOffsetY\n });\n }\n }, {\n key: \"closeIfClickInner\",\n value: function closeIfClickInner(event) {\n if (!this.preventInnerClose && event.target.className.search(/\\bril-inner\\b/) > -1) {\n this.requestClose(event);\n }\n }\n /**\n * Handle user keyboard actions\n */\n\n }, {\n key: \"handleKeyInput\",\n value: function handleKeyInput(event) {\n event.stopPropagation(); // Ignore key input during animations\n\n if (this.isAnimating()) {\n return;\n } // Allow slightly faster navigation through the images when user presses keys repeatedly\n\n\n if (event.type === 'keyup') {\n this.lastKeyDownTime -= this.props.keyRepeatKeyupBonus;\n return;\n }\n\n var keyCode = event.which || event.keyCode; // Ignore key presses that happen too close to each other (when rapid fire key pressing or holding down the key)\n // But allow it if it's a lightbox closing action\n\n var currentTime = new Date();\n\n if (currentTime.getTime() - this.lastKeyDownTime < this.props.keyRepeatLimit && keyCode !== KEYS.ESC) {\n return;\n }\n\n this.lastKeyDownTime = currentTime.getTime();\n\n switch (keyCode) {\n // ESC key closes the lightbox\n case KEYS.ESC:\n event.preventDefault();\n this.requestClose(event);\n break;\n // Left arrow key moves to previous image\n\n case KEYS.LEFT_ARROW:\n if (!this.props.prevSrc) {\n return;\n }\n\n event.preventDefault();\n this.keyPressed = true;\n this.requestMovePrev(event);\n break;\n // Right arrow key moves to next image\n\n case KEYS.RIGHT_ARROW:\n if (!this.props.nextSrc) {\n return;\n }\n\n event.preventDefault();\n this.keyPressed = true;\n this.requestMoveNext(event);\n break;\n }\n }\n /**\n * Handle a mouse wheel event over the lightbox container\n */\n\n }, {\n key: \"handleOuterMousewheel\",\n value: function handleOuterMousewheel(event) {\n var _this7 = this;\n\n // Prevent scrolling of the background\n event.stopPropagation();\n var xThreshold = WHEEL_MOVE_X_THRESHOLD;\n var actionDelay = 0;\n var imageMoveDelay = 500;\n this.clearTimeout(this.resetScrollTimeout);\n this.resetScrollTimeout = this.setTimeout(function () {\n _this7.scrollX = 0;\n _this7.scrollY = 0;\n }, 300); // Prevent rapid-fire zoom behavior\n\n if (this.wheelActionTimeout !== null || this.isAnimating()) {\n return;\n }\n\n if (Math.abs(event.deltaY) < Math.abs(event.deltaX)) {\n // handle horizontal scrolls with image moves\n this.scrollY = 0;\n this.scrollX += event.deltaX;\n var bigLeapX = xThreshold / 2; // If the scroll amount has accumulated sufficiently, or a large leap was taken\n\n if (this.scrollX >= xThreshold || event.deltaX >= bigLeapX) {\n // Scroll right moves to next\n this.requestMoveNext(event);\n actionDelay = imageMoveDelay;\n this.scrollX = 0;\n } else if (this.scrollX <= -1 * xThreshold || event.deltaX <= -1 * bigLeapX) {\n // Scroll left moves to previous\n this.requestMovePrev(event);\n actionDelay = imageMoveDelay;\n this.scrollX = 0;\n }\n } // Allow successive actions after the set delay\n\n\n if (actionDelay !== 0) {\n this.wheelActionTimeout = this.setTimeout(function () {\n _this7.wheelActionTimeout = null;\n }, actionDelay);\n }\n }\n }, {\n key: \"handleImageMouseWheel\",\n value: function handleImageMouseWheel(event) {\n var yThreshold = WHEEL_MOVE_Y_THRESHOLD;\n\n if (Math.abs(event.deltaY) >= Math.abs(event.deltaX)) {\n event.stopPropagation(); // If the vertical scroll amount was large enough, perform a zoom\n\n if (Math.abs(event.deltaY) < yThreshold) {\n return;\n }\n\n this.scrollX = 0;\n this.scrollY += event.deltaY;\n this.changeZoom(this.state.zoomLevel - event.deltaY, event.clientX, event.clientY);\n }\n }\n /**\n * Handle a double click on the current image\n */\n\n }, {\n key: \"handleImageDoubleClick\",\n value: function handleImageDoubleClick(event) {\n if (this.state.zoomLevel > MIN_ZOOM_LEVEL) {\n // A double click when zoomed in zooms all the way out\n this.changeZoom(MIN_ZOOM_LEVEL, event.clientX, event.clientY);\n } else {\n // A double click when zoomed all the way out zooms in\n this.changeZoom(this.state.zoomLevel + ZOOM_BUTTON_INCREMENT_SIZE, event.clientX, event.clientY);\n }\n }\n }, {\n key: \"shouldHandleEvent\",\n value: function shouldHandleEvent(source) {\n if (this.eventsSource === source) {\n return true;\n }\n\n if (this.eventsSource === SOURCE_ANY) {\n this.eventsSource = source;\n return true;\n }\n\n switch (source) {\n case SOURCE_MOUSE:\n return false;\n\n case SOURCE_TOUCH:\n this.eventsSource = SOURCE_TOUCH;\n this.filterPointersBySource();\n return true;\n\n case SOURCE_POINTER:\n if (this.eventsSource === SOURCE_MOUSE) {\n this.eventsSource = SOURCE_POINTER;\n this.filterPointersBySource();\n return true;\n }\n\n return false;\n\n default:\n return false;\n }\n }\n }, {\n key: \"addPointer\",\n value: function addPointer(pointer) {\n this.pointerList.push(pointer);\n }\n }, {\n key: \"removePointer\",\n value: function removePointer(pointer) {\n this.pointerList = this.pointerList.filter(function (_ref2) {\n var id = _ref2.id;\n return id !== pointer.id;\n });\n }\n }, {\n key: \"filterPointersBySource\",\n value: function filterPointersBySource() {\n var _this8 = this;\n\n this.pointerList = this.pointerList.filter(function (_ref3) {\n var source = _ref3.source;\n return source === _this8.eventsSource;\n });\n }\n }, {\n key: \"handleMouseDown\",\n value: function handleMouseDown(event) {\n if (this.shouldHandleEvent(SOURCE_MOUSE) && ReactImageLightbox.isTargetMatchImage(event.target)) {\n this.addPointer(ReactImageLightbox.parseMouseEvent(event));\n this.multiPointerStart(event);\n }\n }\n }, {\n key: \"handleMouseMove\",\n value: function handleMouseMove(event) {\n if (this.shouldHandleEvent(SOURCE_MOUSE)) {\n this.multiPointerMove(event, [ReactImageLightbox.parseMouseEvent(event)]);\n }\n }\n }, {\n key: \"handleMouseUp\",\n value: function handleMouseUp(event) {\n if (this.shouldHandleEvent(SOURCE_MOUSE)) {\n this.removePointer(ReactImageLightbox.parseMouseEvent(event));\n this.multiPointerEnd(event);\n }\n }\n }, {\n key: \"handlePointerEvent\",\n value: function handlePointerEvent(event) {\n if (this.shouldHandleEvent(SOURCE_POINTER)) {\n switch (event.type) {\n case 'pointerdown':\n if (ReactImageLightbox.isTargetMatchImage(event.target)) {\n this.addPointer(ReactImageLightbox.parsePointerEvent(event));\n this.multiPointerStart(event);\n }\n\n break;\n\n case 'pointermove':\n this.multiPointerMove(event, [ReactImageLightbox.parsePointerEvent(event)]);\n break;\n\n case 'pointerup':\n case 'pointercancel':\n this.removePointer(ReactImageLightbox.parsePointerEvent(event));\n this.multiPointerEnd(event);\n break;\n }\n }\n }\n }, {\n key: \"handleTouchStart\",\n value: function handleTouchStart(event) {\n var _this9 = this;\n\n if (this.shouldHandleEvent(SOURCE_TOUCH) && ReactImageLightbox.isTargetMatchImage(event.target)) {\n [].forEach.call(event.changedTouches, function (eventTouch) {\n return _this9.addPointer(ReactImageLightbox.parseTouchPointer(eventTouch));\n });\n this.multiPointerStart(event);\n }\n }\n }, {\n key: \"handleTouchMove\",\n value: function handleTouchMove(event) {\n if (this.shouldHandleEvent(SOURCE_TOUCH)) {\n this.multiPointerMove(event, [].map.call(event.changedTouches, function (eventTouch) {\n return ReactImageLightbox.parseTouchPointer(eventTouch);\n }));\n }\n }\n }, {\n key: \"handleTouchEnd\",\n value: function handleTouchEnd(event) {\n var _this10 = this;\n\n if (this.shouldHandleEvent(SOURCE_TOUCH)) {\n [].map.call(event.changedTouches, function (touch) {\n return _this10.removePointer(ReactImageLightbox.parseTouchPointer(touch));\n });\n this.multiPointerEnd(event);\n }\n }\n }, {\n key: \"decideMoveOrSwipe\",\n value: function decideMoveOrSwipe(pointer) {\n if (this.state.zoomLevel <= MIN_ZOOM_LEVEL) {\n this.handleSwipeStart(pointer);\n } else {\n this.handleMoveStart(pointer);\n }\n }\n }, {\n key: \"multiPointerStart\",\n value: function multiPointerStart(event) {\n this.handleEnd(null);\n\n switch (this.pointerList.length) {\n case 1:\n {\n event.preventDefault();\n this.decideMoveOrSwipe(this.pointerList[0]);\n break;\n }\n\n case 2:\n {\n event.preventDefault();\n this.handlePinchStart(this.pointerList);\n break;\n }\n }\n }\n }, {\n key: \"multiPointerMove\",\n value: function multiPointerMove(event, pointerList) {\n switch (this.currentAction) {\n case ACTION_MOVE:\n {\n event.preventDefault();\n this.handleMove(pointerList[0]);\n break;\n }\n\n case ACTION_SWIPE:\n {\n event.preventDefault();\n this.handleSwipe(pointerList[0]);\n break;\n }\n\n case ACTION_PINCH:\n {\n event.preventDefault();\n this.handlePinch(pointerList);\n break;\n }\n }\n }\n }, {\n key: \"multiPointerEnd\",\n value: function multiPointerEnd(event) {\n if (this.currentAction !== ACTION_NONE) {\n this.setPreventInnerClose();\n this.handleEnd(event);\n }\n\n switch (this.pointerList.length) {\n case 0:\n {\n this.eventsSource = SOURCE_ANY;\n break;\n }\n\n case 1:\n {\n event.preventDefault();\n this.decideMoveOrSwipe(this.pointerList[0]);\n break;\n }\n\n case 2:\n {\n event.preventDefault();\n this.handlePinchStart(this.pointerList);\n break;\n }\n }\n }\n }, {\n key: \"handleEnd\",\n value: function handleEnd(event) {\n switch (this.currentAction) {\n case ACTION_MOVE:\n this.handleMoveEnd(event);\n break;\n\n case ACTION_SWIPE:\n this.handleSwipeEnd(event);\n break;\n\n case ACTION_PINCH:\n this.handlePinchEnd(event);\n break;\n }\n } // Handle move start over the lightbox container\n // This happens:\n // - On a mouseDown event\n // - On a touchstart event\n\n }, {\n key: \"handleMoveStart\",\n value: function handleMoveStart(_ref4) {\n var clientX = _ref4.x,\n clientY = _ref4.y;\n\n if (!this.props.enableZoom) {\n return;\n }\n\n this.currentAction = ACTION_MOVE;\n this.moveStartX = clientX;\n this.moveStartY = clientY;\n this.moveStartOffsetX = this.state.offsetX;\n this.moveStartOffsetY = this.state.offsetY;\n } // Handle dragging over the lightbox container\n // This happens:\n // - After a mouseDown and before a mouseUp event\n // - After a touchstart and before a touchend event\n\n }, {\n key: \"handleMove\",\n value: function handleMove(_ref5) {\n var clientX = _ref5.x,\n clientY = _ref5.y;\n var newOffsetX = this.moveStartX - clientX + this.moveStartOffsetX;\n var newOffsetY = this.moveStartY - clientY + this.moveStartOffsetY;\n\n if (this.state.offsetX !== newOffsetX || this.state.offsetY !== newOffsetY) {\n this.setState({\n offsetX: newOffsetX,\n offsetY: newOffsetY\n });\n }\n }\n }, {\n key: \"handleMoveEnd\",\n value: function handleMoveEnd() {\n var _this11 = this;\n\n this.currentAction = ACTION_NONE;\n this.moveStartX = 0;\n this.moveStartY = 0;\n this.moveStartOffsetX = 0;\n this.moveStartOffsetY = 0; // Snap image back into frame if outside max offset range\n\n var maxOffsets = this.getMaxOffsets();\n var nextOffsetX = Math.max(maxOffsets.minX, Math.min(maxOffsets.maxX, this.state.offsetX));\n var nextOffsetY = Math.max(maxOffsets.minY, Math.min(maxOffsets.maxY, this.state.offsetY));\n\n if (nextOffsetX !== this.state.offsetX || nextOffsetY !== this.state.offsetY) {\n this.setState({\n offsetX: nextOffsetX,\n offsetY: nextOffsetY,\n shouldAnimate: true\n });\n this.setTimeout(function () {\n _this11.setState({\n shouldAnimate: false\n });\n }, this.props.animationDuration);\n }\n }\n }, {\n key: \"handleSwipeStart\",\n value: function handleSwipeStart(_ref6) {\n var clientX = _ref6.x,\n clientY = _ref6.y;\n this.currentAction = ACTION_SWIPE;\n this.swipeStartX = clientX;\n this.swipeStartY = clientY;\n this.swipeEndX = clientX;\n this.swipeEndY = clientY;\n }\n }, {\n key: \"handleSwipe\",\n value: function handleSwipe(_ref7) {\n var clientX = _ref7.x,\n clientY = _ref7.y;\n this.swipeEndX = clientX;\n this.swipeEndY = clientY;\n }\n }, {\n key: \"handleSwipeEnd\",\n value: function handleSwipeEnd(event) {\n var xDiff = this.swipeEndX - this.swipeStartX;\n var xDiffAbs = Math.abs(xDiff);\n var yDiffAbs = Math.abs(this.swipeEndY - this.swipeStartY);\n this.currentAction = ACTION_NONE;\n this.swipeStartX = 0;\n this.swipeStartY = 0;\n this.swipeEndX = 0;\n this.swipeEndY = 0;\n\n if (!event || this.isAnimating() || xDiffAbs < yDiffAbs * 1.5) {\n return;\n }\n\n if (xDiffAbs < MIN_SWIPE_DISTANCE) {\n var boxRect = this.getLightboxRect();\n\n if (xDiffAbs < boxRect.width / 4) {\n return;\n }\n }\n\n if (xDiff > 0 && this.props.prevSrc) {\n event.preventDefault();\n this.requestMovePrev();\n } else if (xDiff < 0 && this.props.nextSrc) {\n event.preventDefault();\n this.requestMoveNext();\n }\n }\n }, {\n key: \"calculatePinchDistance\",\n value: function calculatePinchDistance() {\n var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pinchTouchList,\n _ref9 = _slicedToArray(_ref8, 2),\n a = _ref9[0],\n b = _ref9[1];\n\n return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));\n }\n }, {\n key: \"calculatePinchCenter\",\n value: function calculatePinchCenter() {\n var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pinchTouchList,\n _ref11 = _slicedToArray(_ref10, 2),\n a = _ref11[0],\n b = _ref11[1];\n\n return {\n x: a.x - (a.x - b.x) / 2,\n y: a.y - (a.y - b.y) / 2\n };\n }\n }, {\n key: \"handlePinchStart\",\n value: function handlePinchStart(pointerList) {\n if (!this.props.enableZoom) {\n return;\n }\n\n this.currentAction = ACTION_PINCH;\n this.pinchTouchList = pointerList.map(function (_ref12) {\n var id = _ref12.id,\n x = _ref12.x,\n y = _ref12.y;\n return {\n id: id,\n x: x,\n y: y\n };\n });\n this.pinchDistance = this.calculatePinchDistance();\n }\n }, {\n key: \"handlePinch\",\n value: function handlePinch(pointerList) {\n this.pinchTouchList = this.pinchTouchList.map(function (oldPointer) {\n for (var i = 0; i < pointerList.length; i += 1) {\n if (pointerList[i].id === oldPointer.id) {\n return pointerList[i];\n }\n }\n\n return oldPointer;\n });\n var newDistance = this.calculatePinchDistance();\n var zoomLevel = this.state.zoomLevel + newDistance - this.pinchDistance;\n this.pinchDistance = newDistance;\n\n var _this$calculatePinchC = this.calculatePinchCenter(this.pinchTouchList),\n clientX = _this$calculatePinchC.x,\n clientY = _this$calculatePinchC.y;\n\n this.changeZoom(zoomLevel, clientX, clientY);\n }\n }, {\n key: \"handlePinchEnd\",\n value: function handlePinchEnd() {\n this.currentAction = ACTION_NONE;\n this.pinchTouchList = null;\n this.pinchDistance = 0;\n } // Handle the window resize event\n\n }, {\n key: \"handleWindowResize\",\n value: function handleWindowResize() {\n this.clearTimeout(this.resizeTimeout);\n this.resizeTimeout = this.setTimeout(this.forceUpdate.bind(this), 100);\n }\n }, {\n key: \"handleZoomInButtonClick\",\n value: function handleZoomInButtonClick() {\n var nextZoomLevel = this.state.zoomLevel + ZOOM_BUTTON_INCREMENT_SIZE;\n this.changeZoom(nextZoomLevel);\n\n if (nextZoomLevel === MAX_ZOOM_LEVEL) {\n this.zoomOutBtn.current.focus();\n }\n }\n }, {\n key: \"handleZoomOutButtonClick\",\n value: function handleZoomOutButtonClick() {\n var nextZoomLevel = this.state.zoomLevel - ZOOM_BUTTON_INCREMENT_SIZE;\n this.changeZoom(nextZoomLevel);\n\n if (nextZoomLevel === MIN_ZOOM_LEVEL) {\n this.zoomInBtn.current.focus();\n }\n }\n }, {\n key: \"handleCaptionMousewheel\",\n value: function handleCaptionMousewheel(event) {\n event.stopPropagation();\n\n if (!this.caption.current) {\n return;\n }\n\n var _this$caption$current = this.caption.current.getBoundingClientRect(),\n height = _this$caption$current.height;\n\n var _this$caption$current2 = this.caption.current,\n scrollHeight = _this$caption$current2.scrollHeight,\n scrollTop = _this$caption$current2.scrollTop;\n\n if (event.deltaY > 0 && height + scrollTop >= scrollHeight || event.deltaY < 0 && scrollTop <= 0) {\n event.preventDefault();\n }\n } // Detach key and mouse input events\n\n }, {\n key: \"isAnimating\",\n value: function isAnimating() {\n return this.state.shouldAnimate || this.state.isClosing;\n } // Check if image is loaded\n\n }, {\n key: \"isImageLoaded\",\n value: function isImageLoaded(imageSrc) {\n return imageSrc && imageSrc in this.imageCache && this.imageCache[imageSrc].loaded;\n } // Load image from src and call callback with image width and height on load\n\n }, {\n key: \"loadImage\",\n value: function loadImage(srcType, imageSrc, done) {\n var _this12 = this;\n\n // Return the image info if it is already cached\n if (this.isImageLoaded(imageSrc)) {\n this.setTimeout(function () {\n done();\n }, 1);\n return;\n }\n\n var inMemoryImage = new global.Image();\n\n if (this.props.imageCrossOrigin) {\n inMemoryImage.crossOrigin = this.props.imageCrossOrigin;\n }\n\n inMemoryImage.onerror = function (errorEvent) {\n _this12.props.onImageLoadError(imageSrc, srcType, errorEvent); // failed to load so set the state loadErrorStatus\n\n\n _this12.setState(function (prevState) {\n return {\n loadErrorStatus: _objectSpread({}, prevState.loadErrorStatus, _defineProperty({}, srcType, true))\n };\n });\n\n done(errorEvent);\n };\n\n inMemoryImage.onload = function () {\n _this12.props.onImageLoad(imageSrc, srcType, inMemoryImage);\n\n _this12.imageCache[imageSrc] = {\n loaded: true,\n width: inMemoryImage.width,\n height: inMemoryImage.height\n };\n done();\n };\n\n inMemoryImage.src = imageSrc;\n } // Load all images and their thumbnails\n\n }, {\n key: \"loadAllImages\",\n value: function loadAllImages() {\n var _this13 = this;\n\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n\n var generateLoadDoneCallback = function generateLoadDoneCallback(srcType, imageSrc) {\n return function (err) {\n // Give up showing image on error\n if (err) {\n return;\n } // Don't rerender if the src is not the same as when the load started\n // or if the component has unmounted\n\n\n if (_this13.props[srcType] !== imageSrc || _this13.didUnmount) {\n return;\n } // Force rerender with the new image\n\n\n _this13.forceUpdate();\n };\n }; // Load the images\n\n\n this.getSrcTypes().forEach(function (srcType) {\n var type = srcType.name; // there is no error when we try to load it initially\n\n if (props[type] && _this13.state.loadErrorStatus[type]) {\n _this13.setState(function (prevState) {\n return {\n loadErrorStatus: _objectSpread({}, prevState.loadErrorStatus, _defineProperty({}, type, false))\n };\n });\n } // Load unloaded images\n\n\n if (props[type] && !_this13.isImageLoaded(props[type])) {\n _this13.loadImage(type, props[type], generateLoadDoneCallback(type, props[type]));\n }\n });\n } // Request that the lightbox be closed\n\n }, {\n key: \"requestClose\",\n value: function requestClose(event) {\n var _this14 = this;\n\n // Call the parent close request\n var closeLightbox = function closeLightbox() {\n return _this14.props.onCloseRequest(event);\n };\n\n if (this.props.animationDisabled || event.type === 'keydown' && !this.props.animationOnKeyInput) {\n // No animation\n closeLightbox();\n return;\n } // With animation\n // Start closing animation\n\n\n this.setState({\n isClosing: true\n }); // Perform the actual closing at the end of the animation\n\n this.setTimeout(closeLightbox, this.props.animationDuration);\n }\n }, {\n key: \"requestMove\",\n value: function requestMove(direction, event) {\n var _this15 = this;\n\n // Reset the zoom level on image move\n var nextState = {\n zoomLevel: MIN_ZOOM_LEVEL,\n offsetX: 0,\n offsetY: 0\n }; // Enable animated states\n\n if (!this.props.animationDisabled && (!this.keyPressed || this.props.animationOnKeyInput)) {\n nextState.shouldAnimate = true;\n this.setTimeout(function () {\n return _this15.setState({\n shouldAnimate: false\n });\n }, this.props.animationDuration);\n }\n\n this.keyPressed = false;\n this.moveRequested = true;\n\n if (direction === 'prev') {\n this.keyCounter -= 1;\n this.setState(nextState);\n this.props.onMovePrevRequest(event);\n } else {\n this.keyCounter += 1;\n this.setState(nextState);\n this.props.onMoveNextRequest(event);\n }\n } // Request to transition to the next image\n\n }, {\n key: \"requestMoveNext\",\n value: function requestMoveNext(event) {\n this.requestMove('next', event);\n } // Request to transition to the previous image\n\n }, {\n key: \"requestMovePrev\",\n value: function requestMovePrev(event) {\n this.requestMove('prev', event);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this16 = this;\n\n var _this$props = this.props,\n animationDisabled = _this$props.animationDisabled,\n animationDuration = _this$props.animationDuration,\n clickOutsideToClose = _this$props.clickOutsideToClose,\n discourageDownloads = _this$props.discourageDownloads,\n enableZoom = _this$props.enableZoom,\n imageTitle = _this$props.imageTitle,\n nextSrc = _this$props.nextSrc,\n prevSrc = _this$props.prevSrc,\n toolbarButtons = _this$props.toolbarButtons,\n reactModalStyle = _this$props.reactModalStyle,\n _onAfterOpen = _this$props.onAfterOpen,\n imageCrossOrigin = _this$props.imageCrossOrigin,\n reactModalProps = _this$props.reactModalProps;\n var _this$state = this.state,\n zoomLevel = _this$state.zoomLevel,\n offsetX = _this$state.offsetX,\n offsetY = _this$state.offsetY,\n isClosing = _this$state.isClosing,\n loadErrorStatus = _this$state.loadErrorStatus;\n var boxSize = this.getLightboxRect();\n var transitionStyle = {}; // Transition settings for sliding animations\n\n if (!animationDisabled && this.isAnimating()) {\n transitionStyle = _objectSpread({}, transitionStyle, {\n transition: \"transform \".concat(animationDuration, \"ms\")\n });\n } // Key endings to differentiate between images with the same src\n\n\n var keyEndings = {};\n this.getSrcTypes().forEach(function (_ref13) {\n var name = _ref13.name,\n keyEnding = _ref13.keyEnding;\n keyEndings[name] = keyEnding;\n }); // Images to be displayed\n\n var images = [];\n\n var addImage = function addImage(srcType, imageClass, transforms) {\n // Ignore types that have no source defined for their full size image\n if (!_this16.props[srcType]) {\n return;\n }\n\n var bestImageInfo = _this16.getBestImageForType(srcType);\n\n var imageStyle = _objectSpread({}, transitionStyle, ReactImageLightbox.getTransform(_objectSpread({}, transforms, bestImageInfo)));\n\n if (zoomLevel > MIN_ZOOM_LEVEL) {\n imageStyle.cursor = 'move';\n } // support IE 9 and 11\n\n\n var hasTrueValue = function hasTrueValue(object) {\n return Object.keys(object).some(function (key) {\n return object[key];\n });\n }; // when error on one of the loads then push custom error stuff\n\n\n if (bestImageInfo === null && hasTrueValue(loadErrorStatus)) {\n images.push(React.createElement(\"div\", {\n className: \"\".concat(imageClass, \" ril__image ril-errored\"),\n style: imageStyle,\n key: _this16.props[srcType] + keyEndings[srcType]\n }, React.createElement(\"div\", {\n className: \"ril__errorContainer\"\n }, _this16.props.imageLoadErrorMessage)));\n return;\n }\n\n if (bestImageInfo === null) {\n var loadingIcon = React.createElement(\"div\", {\n className: \"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon\"\n }, _toConsumableArray(new Array(12)).map(function (_, index) {\n return React.createElement(\"div\", {\n // eslint-disable-next-line react/no-array-index-key\n key: index,\n className: \"ril-loading-circle-point ril__loadingCirclePoint\"\n });\n })); // Fall back to loading icon if the thumbnail has not been loaded\n\n images.push(React.createElement(\"div\", {\n className: \"\".concat(imageClass, \" ril__image ril-not-loaded\"),\n style: imageStyle,\n key: _this16.props[srcType] + keyEndings[srcType]\n }, React.createElement(\"div\", {\n className: \"ril__loadingContainer\"\n }, loadingIcon)));\n return;\n }\n\n var imageSrc = bestImageInfo.src;\n\n if (discourageDownloads) {\n imageStyle.backgroundImage = \"url('\".concat(imageSrc, \"')\");\n images.push(React.createElement(\"div\", {\n className: \"\".concat(imageClass, \" ril__image ril__imageDiscourager\"),\n onDoubleClick: _this16.handleImageDoubleClick,\n onWheel: _this16.handleImageMouseWheel,\n style: imageStyle,\n key: imageSrc + keyEndings[srcType]\n }, React.createElement(\"div\", {\n className: \"ril-download-blocker ril__downloadBlocker\"\n })));\n } else {\n images.push(React.createElement(\"img\", _extends({}, imageCrossOrigin ? {\n crossOrigin: imageCrossOrigin\n } : {}, {\n className: \"\".concat(imageClass, \" ril__image\"),\n onDoubleClick: _this16.handleImageDoubleClick,\n onWheel: _this16.handleImageMouseWheel,\n onDragStart: function onDragStart(e) {\n return e.preventDefault();\n },\n style: imageStyle,\n src: imageSrc,\n key: imageSrc + keyEndings[srcType],\n alt: typeof imageTitle === 'string' ? imageTitle : translate('Image'),\n draggable: false\n })));\n }\n };\n\n var zoomMultiplier = this.getZoomMultiplier(); // Next Image (displayed on the right)\n\n addImage('nextSrc', 'ril-image-next ril__imageNext', {\n x: boxSize.width\n }); // Main Image\n\n addImage('mainSrc', 'ril-image-current', {\n x: -1 * offsetX,\n y: -1 * offsetY,\n zoom: zoomMultiplier\n }); // Previous Image (displayed on the left)\n\n addImage('prevSrc', 'ril-image-prev ril__imagePrev', {\n x: -1 * boxSize.width\n });\n var modalStyle = {\n overlay: _objectSpread({\n zIndex: 1000,\n backgroundColor: 'transparent'\n }, reactModalStyle.overlay),\n content: _objectSpread({\n backgroundColor: 'transparent',\n overflow: 'hidden',\n // Needed, otherwise keyboard shortcuts scroll the page\n border: 'none',\n borderRadius: 0,\n padding: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0\n }, reactModalStyle.content)\n };\n return React.createElement(Modal, _extends({\n isOpen: true,\n onRequestClose: clickOutsideToClose ? this.requestClose : undefined,\n onAfterOpen: function onAfterOpen() {\n // Focus on the div with key handlers\n if (_this16.outerEl.current) {\n _this16.outerEl.current.focus();\n }\n\n _onAfterOpen();\n },\n style: modalStyle,\n contentLabel: translate('Lightbox'),\n appElement: typeof global.window !== 'undefined' ? global.window.document.body : undefined\n }, reactModalProps), React.createElement(\"div\", {\n // eslint-disable-line jsx-a11y/no-static-element-interactions\n // Floating modal with closing animations\n className: \"ril-outer ril__outer ril__outerAnimating \".concat(this.props.wrapperClassName, \" \").concat(isClosing ? 'ril-closing ril__outerClosing' : ''),\n style: {\n transition: \"opacity \".concat(animationDuration, \"ms\"),\n animationDuration: \"\".concat(animationDuration, \"ms\"),\n animationDirection: isClosing ? 'normal' : 'reverse'\n },\n ref: this.outerEl,\n onWheel: this.handleOuterMousewheel,\n onMouseMove: this.handleMouseMove,\n onMouseDown: this.handleMouseDown,\n onTouchStart: this.handleTouchStart,\n onTouchMove: this.handleTouchMove,\n tabIndex: \"-1\" // Enables key handlers on div\n ,\n onKeyDown: this.handleKeyInput,\n onKeyUp: this.handleKeyInput\n }, React.createElement(\"div\", {\n // eslint-disable-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n // Image holder\n className: \"ril-inner ril__inner\",\n onClick: clickOutsideToClose ? this.closeIfClickInner : undefined\n }, images), prevSrc && React.createElement(\"button\", {\n // Move to previous image button\n type: \"button\",\n className: \"ril-prev-button ril__navButtons ril__navButtonPrev\",\n key: \"prev\",\n \"aria-label\": this.props.prevLabel,\n onClick: !this.isAnimating() ? this.requestMovePrev : undefined // Ignore clicks during animation\n\n }), nextSrc && React.createElement(\"button\", {\n // Move to next image button\n type: \"button\",\n className: \"ril-next-button ril__navButtons ril__navButtonNext\",\n key: \"next\",\n \"aria-label\": this.props.nextLabel,\n onClick: !this.isAnimating() ? this.requestMoveNext : undefined // Ignore clicks during animation\n\n }), React.createElement(\"div\", {\n // Lightbox toolbar\n className: \"ril-toolbar ril__toolbar\"\n }, React.createElement(\"ul\", {\n className: \"ril-toolbar-left ril__toolbarSide ril__toolbarLeftSide\"\n }, React.createElement(\"li\", {\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, React.createElement(\"span\", {\n className: \"ril-toolbar__item__child ril__toolbarItemChild\"\n }, imageTitle))), React.createElement(\"ul\", {\n className: \"ril-toolbar-right ril__toolbarSide ril__toolbarRightSide\"\n }, toolbarButtons && toolbarButtons.map(function (button, i) {\n return React.createElement(\"li\", {\n key: \"button_\".concat(i + 1),\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, button);\n }), enableZoom && React.createElement(\"li\", {\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, React.createElement(\"button\", {\n // Lightbox zoom in button\n type: \"button\",\n key: \"zoom-in\",\n \"aria-label\": this.props.zoomInLabel,\n className: ['ril-zoom-in', 'ril__toolbarItemChild', 'ril__builtinButton', 'ril__zoomInButton'].concat(_toConsumableArray(zoomLevel === MAX_ZOOM_LEVEL ? ['ril__builtinButtonDisabled'] : [])).join(' '),\n ref: this.zoomInBtn,\n disabled: this.isAnimating() || zoomLevel === MAX_ZOOM_LEVEL,\n onClick: !this.isAnimating() && zoomLevel !== MAX_ZOOM_LEVEL ? this.handleZoomInButtonClick : undefined\n })), enableZoom && React.createElement(\"li\", {\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, React.createElement(\"button\", {\n // Lightbox zoom out button\n type: \"button\",\n key: \"zoom-out\",\n \"aria-label\": this.props.zoomOutLabel,\n className: ['ril-zoom-out', 'ril__toolbarItemChild', 'ril__builtinButton', 'ril__zoomOutButton'].concat(_toConsumableArray(zoomLevel === MIN_ZOOM_LEVEL ? ['ril__builtinButtonDisabled'] : [])).join(' '),\n ref: this.zoomOutBtn,\n disabled: this.isAnimating() || zoomLevel === MIN_ZOOM_LEVEL,\n onClick: !this.isAnimating() && zoomLevel !== MIN_ZOOM_LEVEL ? this.handleZoomOutButtonClick : undefined\n })), React.createElement(\"li\", {\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, React.createElement(\"button\", {\n // Lightbox close button\n type: \"button\",\n key: \"close\",\n \"aria-label\": this.props.closeLabel,\n className: \"ril-close ril-toolbar__item__child ril__toolbarItemChild ril__builtinButton ril__closeButton\",\n onClick: !this.isAnimating() ? this.requestClose : undefined // Ignore clicks during animation\n\n })))), this.props.imageCaption && // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n React.createElement(\"div\", {\n // Image caption\n onWheel: this.handleCaptionMousewheel,\n onMouseDown: function onMouseDown(event) {\n return event.stopPropagation();\n },\n className: \"ril-caption ril__caption\",\n ref: this.caption\n }, React.createElement(\"div\", {\n className: \"ril-caption-content ril__captionContent\"\n }, this.props.imageCaption))));\n }\n }]);\n\n return ReactImageLightbox;\n}(Component);\n\nReactImageLightbox.propTypes = {\n //-----------------------------\n // Image sources\n //-----------------------------\n // Main display image url\n mainSrc: PropTypes.string.isRequired,\n // eslint-disable-line react/no-unused-prop-types\n // Previous display image url (displayed to the left)\n // If left undefined, movePrev actions will not be performed, and the button not displayed\n prevSrc: PropTypes.string,\n // Next display image url (displayed to the right)\n // If left undefined, moveNext actions will not be performed, and the button not displayed\n nextSrc: PropTypes.string,\n //-----------------------------\n // Image thumbnail sources\n //-----------------------------\n // Thumbnail image url corresponding to props.mainSrc\n mainSrcThumbnail: PropTypes.string,\n // eslint-disable-line react/no-unused-prop-types\n // Thumbnail image url corresponding to props.prevSrc\n prevSrcThumbnail: PropTypes.string,\n // eslint-disable-line react/no-unused-prop-types\n // Thumbnail image url corresponding to props.nextSrc\n nextSrcThumbnail: PropTypes.string,\n // eslint-disable-line react/no-unused-prop-types\n //-----------------------------\n // Event Handlers\n //-----------------------------\n // Close window event\n // Should change the parent state such that the lightbox is not rendered\n onCloseRequest: PropTypes.func.isRequired,\n // Move to previous image event\n // Should change the parent state such that props.prevSrc becomes props.mainSrc,\n // props.mainSrc becomes props.nextSrc, etc.\n onMovePrevRequest: PropTypes.func,\n // Move to next image event\n // Should change the parent state such that props.nextSrc becomes props.mainSrc,\n // props.mainSrc becomes props.prevSrc, etc.\n onMoveNextRequest: PropTypes.func,\n // Called when an image fails to load\n // (imageSrc: string, srcType: string, errorEvent: object): void\n onImageLoadError: PropTypes.func,\n // Called when image successfully loads\n onImageLoad: PropTypes.func,\n // Open window event\n onAfterOpen: PropTypes.func,\n //-----------------------------\n // Download discouragement settings\n //-----------------------------\n // Enable download discouragement (prevents [right-click -> Save Image As...])\n discourageDownloads: PropTypes.bool,\n //-----------------------------\n // Animation settings\n //-----------------------------\n // Disable all animation\n animationDisabled: PropTypes.bool,\n // Disable animation on actions performed with keyboard shortcuts\n animationOnKeyInput: PropTypes.bool,\n // Animation duration (ms)\n animationDuration: PropTypes.number,\n //-----------------------------\n // Keyboard shortcut settings\n //-----------------------------\n // Required interval of time (ms) between key actions\n // (prevents excessively fast navigation of images)\n keyRepeatLimit: PropTypes.number,\n // Amount of time (ms) restored after each keyup\n // (makes rapid key presses slightly faster than holding down the key to navigate images)\n keyRepeatKeyupBonus: PropTypes.number,\n //-----------------------------\n // Image info\n //-----------------------------\n // Image title\n imageTitle: PropTypes.node,\n // Image caption\n imageCaption: PropTypes.node,\n // Optional crossOrigin attribute\n imageCrossOrigin: PropTypes.string,\n //-----------------------------\n // Lightbox style\n //-----------------------------\n // Set z-index style, etc., for the parent react-modal (format: https://github.com/reactjs/react-modal#styles )\n reactModalStyle: PropTypes.shape({}),\n // Padding (px) between the edge of the window and the lightbox\n imagePadding: PropTypes.number,\n wrapperClassName: PropTypes.string,\n //-----------------------------\n // Other\n //-----------------------------\n // Array of custom toolbar buttons\n toolbarButtons: PropTypes.arrayOf(PropTypes.node),\n // When true, clicks outside of the image close the lightbox\n clickOutsideToClose: PropTypes.bool,\n // Set to false to disable zoom functionality and hide zoom buttons\n enableZoom: PropTypes.bool,\n // Override props set on react-modal (https://github.com/reactjs/react-modal)\n reactModalProps: PropTypes.shape({}),\n // Aria-labels\n nextLabel: PropTypes.string,\n prevLabel: PropTypes.string,\n zoomInLabel: PropTypes.string,\n zoomOutLabel: PropTypes.string,\n closeLabel: PropTypes.string,\n imageLoadErrorMessage: PropTypes.node\n};\nReactImageLightbox.defaultProps = {\n imageTitle: null,\n imageCaption: null,\n toolbarButtons: null,\n reactModalProps: {},\n animationDisabled: false,\n animationDuration: 300,\n animationOnKeyInput: false,\n clickOutsideToClose: true,\n closeLabel: 'Close lightbox',\n discourageDownloads: false,\n enableZoom: true,\n imagePadding: 10,\n imageCrossOrigin: null,\n keyRepeatKeyupBonus: 40,\n keyRepeatLimit: 180,\n mainSrcThumbnail: null,\n nextLabel: 'Next image',\n nextSrc: null,\n nextSrcThumbnail: null,\n onAfterOpen: function onAfterOpen() {},\n onImageLoadError: function onImageLoadError() {},\n onImageLoad: function onImageLoad() {},\n onMoveNextRequest: function onMoveNextRequest() {},\n onMovePrevRequest: function onMovePrevRequest() {},\n prevLabel: 'Previous image',\n prevSrc: null,\n prevSrcThumbnail: null,\n reactModalStyle: {},\n wrapperClassName: '',\n zoomInLabel: 'Zoom in',\n zoomOutLabel: 'Zoom out',\n imageLoadErrorMessage: 'This image failed to load'\n};\n\nexport default ReactImageLightbox;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.bodyOpenClassName = exports.portalClassName = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ModalPortal = require(\"./ModalPortal\");\n\nvar _ModalPortal2 = _interopRequireDefault(_ModalPortal);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar portalClassName = exports.portalClassName = \"ReactModalPortal\";\nvar bodyOpenClassName = exports.bodyOpenClassName = \"ReactModal__Body--open\";\n\nvar isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;\n\nvar getCreatePortal = function getCreatePortal() {\n return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;\n};\n\nfunction getParentElement(parentSelector) {\n return parentSelector();\n}\n\nvar Modal = function (_Component) {\n _inherits(Modal, _Component);\n\n function Modal() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Modal);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {\n !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);\n var parent = getParentElement(_this.props.parentSelector);\n if (parent && parent.contains(_this.node)) {\n parent.removeChild(_this.node);\n } else {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"parentSelector\" prop did not returned any DOM ' + \"element. Make sure that the parent element is unmounted to \" + \"avoid any memory leaks.\");\n }\n }, _this.portalRef = function (ref) {\n _this.portal = ref;\n }, _this.renderPortal = function (props) {\n var createPortal = getCreatePortal();\n var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node);\n _this.portalRef(portal);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Modal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!_safeHTMLElement.canUseDOM) return;\n\n if (!isReact16) {\n this.node = document.createElement(\"div\");\n }\n this.node.className = this.props.portalClassName;\n\n var parent = getParentElement(this.props.parentSelector);\n parent.appendChild(this.node);\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps) {\n var prevParent = getParentElement(prevProps.parentSelector);\n var nextParent = getParentElement(this.props.parentSelector);\n return { prevParent: prevParent, nextParent: nextParent };\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, _, snapshot) {\n if (!_safeHTMLElement.canUseDOM) return;\n var _props = this.props,\n isOpen = _props.isOpen,\n portalClassName = _props.portalClassName;\n\n\n if (prevProps.portalClassName !== portalClassName) {\n this.node.className = portalClassName;\n }\n\n var prevParent = snapshot.prevParent,\n nextParent = snapshot.nextParent;\n\n if (nextParent !== prevParent) {\n prevParent.removeChild(this.node);\n nextParent.appendChild(this.node);\n }\n\n // Stop unnecessary renders if modal is remaining closed\n if (!prevProps.isOpen && !isOpen) return;\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;\n\n var state = this.portal.state;\n var now = Date.now();\n var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);\n\n if (closesAt) {\n if (!state.beforeClose) {\n this.portal.closeWithTimeout();\n }\n\n setTimeout(this.removePortal, closesAt - now);\n } else {\n this.removePortal();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!_safeHTMLElement.canUseDOM || !isReact16) {\n return null;\n }\n\n if (!this.node && isReact16) {\n this.node = document.createElement(\"div\");\n }\n\n var createPortal = getCreatePortal();\n return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({\n ref: this.portalRef,\n defaultStyles: Modal.defaultStyles\n }, this.props)), this.node);\n }\n }], [{\n key: \"setAppElement\",\n value: function setAppElement(element) {\n ariaAppHider.setElement(element);\n }\n\n /* eslint-disable react/no-unused-prop-types */\n\n /* eslint-enable react/no-unused-prop-types */\n\n }]);\n\n return Modal;\n}(_react.Component);\n\nModal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n portalClassName: _propTypes2.default.string,\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n ariaHideApp: _propTypes2.default.bool,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n parentSelector: _propTypes2.default.func,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func\n};\nModal.defaultProps = {\n isOpen: false,\n portalClassName: portalClassName,\n bodyOpenClassName: bodyOpenClassName,\n role: \"dialog\",\n ariaHideApp: true,\n closeTimeoutMS: 0,\n shouldFocusAfterRender: true,\n shouldCloseOnEsc: true,\n shouldCloseOnOverlayClick: true,\n shouldReturnFocusAfterClose: true,\n preventScroll: false,\n parentSelector: function parentSelector() {\n return document.body;\n },\n overlayElement: function overlayElement(props, contentEl) {\n return _react2.default.createElement(\n \"div\",\n props,\n contentEl\n );\n },\n contentElement: function contentElement(props, children) {\n return _react2.default.createElement(\n \"div\",\n props,\n children\n );\n }\n};\nModal.defaultStyles = {\n overlay: {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(255, 255, 255, 0.75)\"\n },\n content: {\n position: \"absolute\",\n top: \"40px\",\n left: \"40px\",\n right: \"40px\",\n bottom: \"40px\",\n border: \"1px solid #ccc\",\n background: \"#fff\",\n overflow: \"auto\",\n WebkitOverflowScrolling: \"touch\",\n borderRadius: \"4px\",\n outline: \"none\",\n padding: \"20px\"\n }\n};\n\n\n(0, _reactLifecyclesCompat.polyfill)(Modal);\n\nexports.default = Modal;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _focusManager = require(\"../helpers/focusManager\");\n\nvar focusManager = _interopRequireWildcard(_focusManager);\n\nvar _scopeTab = require(\"../helpers/scopeTab\");\n\nvar _scopeTab2 = _interopRequireDefault(_scopeTab);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _classList = require(\"../helpers/classList\");\n\nvar classList = _interopRequireWildcard(_classList);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _portalOpenInstances = require(\"../helpers/portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nrequire(\"../helpers/bodyTrap\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// so that our CSS is statically analyzable\nvar CLASS_NAMES = {\n overlay: \"ReactModal__Overlay\",\n content: \"ReactModal__Content\"\n};\n\nvar TAB_KEY = 9;\nvar ESC_KEY = 27;\n\nvar ariaHiddenInstances = 0;\n\nvar ModalPortal = function (_Component) {\n _inherits(ModalPortal, _Component);\n\n function ModalPortal(props) {\n _classCallCheck(this, ModalPortal);\n\n var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));\n\n _this.setOverlayRef = function (overlay) {\n _this.overlay = overlay;\n _this.props.overlayRef && _this.props.overlayRef(overlay);\n };\n\n _this.setContentRef = function (content) {\n _this.content = content;\n _this.props.contentRef && _this.props.contentRef(content);\n };\n\n _this.afterClose = function () {\n var _this$props = _this.props,\n appElement = _this$props.appElement,\n ariaHideApp = _this$props.ariaHideApp,\n htmlOpenClassName = _this$props.htmlOpenClassName,\n bodyOpenClassName = _this$props.bodyOpenClassName;\n\n // Remove classes.\n\n bodyOpenClassName && classList.remove(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.remove(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n // Reset aria-hidden attribute if all modals have been removed\n if (ariaHideApp && ariaHiddenInstances > 0) {\n ariaHiddenInstances -= 1;\n\n if (ariaHiddenInstances === 0) {\n ariaAppHider.show(appElement);\n }\n }\n\n if (_this.props.shouldFocusAfterRender) {\n if (_this.props.shouldReturnFocusAfterClose) {\n focusManager.returnFocus(_this.props.preventScroll);\n focusManager.teardownScopedFocus();\n } else {\n focusManager.popWithoutFocus();\n }\n }\n\n if (_this.props.onAfterClose) {\n _this.props.onAfterClose();\n }\n\n _portalOpenInstances2.default.deregister(_this);\n };\n\n _this.open = function () {\n _this.beforeOpen();\n if (_this.state.afterOpen && _this.state.beforeClose) {\n clearTimeout(_this.closeTimer);\n _this.setState({ beforeClose: false });\n } else {\n if (_this.props.shouldFocusAfterRender) {\n focusManager.setupScopedFocus(_this.node);\n focusManager.markForFocusLater();\n }\n\n _this.setState({ isOpen: true }, function () {\n _this.setState({ afterOpen: true });\n\n if (_this.props.isOpen && _this.props.onAfterOpen) {\n _this.props.onAfterOpen({\n overlayEl: _this.overlay,\n contentEl: _this.content\n });\n }\n });\n }\n };\n\n _this.close = function () {\n if (_this.props.closeTimeoutMS > 0) {\n _this.closeWithTimeout();\n } else {\n _this.closeWithoutTimeout();\n }\n };\n\n _this.focusContent = function () {\n return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });\n };\n\n _this.closeWithTimeout = function () {\n var closesAt = Date.now() + _this.props.closeTimeoutMS;\n _this.setState({ beforeClose: true, closesAt: closesAt }, function () {\n _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());\n });\n };\n\n _this.closeWithoutTimeout = function () {\n _this.setState({\n beforeClose: false,\n isOpen: false,\n afterOpen: false,\n closesAt: null\n }, _this.afterClose);\n };\n\n _this.handleKeyDown = function (event) {\n if (event.keyCode === TAB_KEY) {\n (0, _scopeTab2.default)(_this.content, event);\n }\n\n if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) {\n event.stopPropagation();\n _this.requestClose(event);\n }\n };\n\n _this.handleOverlayOnClick = function (event) {\n if (_this.shouldClose === null) {\n _this.shouldClose = true;\n }\n\n if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {\n if (_this.ownerHandlesClose()) {\n _this.requestClose(event);\n } else {\n _this.focusContent();\n }\n }\n _this.shouldClose = null;\n };\n\n _this.handleContentOnMouseUp = function () {\n _this.shouldClose = false;\n };\n\n _this.handleOverlayOnMouseDown = function (event) {\n if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {\n event.preventDefault();\n }\n };\n\n _this.handleContentOnClick = function () {\n _this.shouldClose = false;\n };\n\n _this.handleContentOnMouseDown = function () {\n _this.shouldClose = false;\n };\n\n _this.requestClose = function (event) {\n return _this.ownerHandlesClose() && _this.props.onRequestClose(event);\n };\n\n _this.ownerHandlesClose = function () {\n return _this.props.onRequestClose;\n };\n\n _this.shouldBeClosed = function () {\n return !_this.state.isOpen && !_this.state.beforeClose;\n };\n\n _this.contentHasFocus = function () {\n return document.activeElement === _this.content || _this.content.contains(document.activeElement);\n };\n\n _this.buildClassName = function (which, additional) {\n var classNames = (typeof additional === \"undefined\" ? \"undefined\" : _typeof(additional)) === \"object\" ? additional : {\n base: CLASS_NAMES[which],\n afterOpen: CLASS_NAMES[which] + \"--after-open\",\n beforeClose: CLASS_NAMES[which] + \"--before-close\"\n };\n var className = classNames.base;\n if (_this.state.afterOpen) {\n className = className + \" \" + classNames.afterOpen;\n }\n if (_this.state.beforeClose) {\n className = className + \" \" + classNames.beforeClose;\n }\n return typeof additional === \"string\" && additional ? className + \" \" + additional : className;\n };\n\n _this.attributesFromObject = function (prefix, items) {\n return Object.keys(items).reduce(function (acc, name) {\n acc[prefix + \"-\" + name] = items[name];\n return acc;\n }, {});\n };\n\n _this.state = {\n afterOpen: false,\n beforeClose: false\n };\n\n _this.shouldClose = null;\n _this.moveFromContentToOverlay = null;\n return _this;\n }\n\n _createClass(ModalPortal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.isOpen) {\n this.open();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== \"production\") {\n if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"bodyOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"htmlOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n }\n\n if (this.props.isOpen && !prevProps.isOpen) {\n this.open();\n } else if (!this.props.isOpen && prevProps.isOpen) {\n this.close();\n }\n\n // Focus only needs to be set once when the modal is being opened\n if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {\n this.focusContent();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.state.isOpen) {\n this.afterClose();\n }\n clearTimeout(this.closeTimer);\n }\n }, {\n key: \"beforeOpen\",\n value: function beforeOpen() {\n var _props = this.props,\n appElement = _props.appElement,\n ariaHideApp = _props.ariaHideApp,\n htmlOpenClassName = _props.htmlOpenClassName,\n bodyOpenClassName = _props.bodyOpenClassName;\n\n // Add classes.\n\n bodyOpenClassName && classList.add(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.add(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n if (ariaHideApp) {\n ariaHiddenInstances += 1;\n ariaAppHider.hide(appElement);\n }\n\n _portalOpenInstances2.default.register(this);\n }\n\n // Don't steal focus from inner elements\n\n }, {\n key: \"render\",\n value: function render() {\n var _props2 = this.props,\n id = _props2.id,\n className = _props2.className,\n overlayClassName = _props2.overlayClassName,\n defaultStyles = _props2.defaultStyles,\n children = _props2.children;\n\n var contentStyles = className ? {} : defaultStyles.content;\n var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;\n\n if (this.shouldBeClosed()) {\n return null;\n }\n\n var overlayProps = {\n ref: this.setOverlayRef,\n className: this.buildClassName(\"overlay\", overlayClassName),\n style: _extends({}, overlayStyles, this.props.style.overlay),\n onClick: this.handleOverlayOnClick,\n onMouseDown: this.handleOverlayOnMouseDown\n };\n\n var contentProps = _extends({\n id: id,\n ref: this.setContentRef,\n style: _extends({}, contentStyles, this.props.style.content),\n className: this.buildClassName(\"content\", className),\n tabIndex: \"-1\",\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleContentOnMouseDown,\n onMouseUp: this.handleContentOnMouseUp,\n onClick: this.handleContentOnClick,\n role: this.props.role,\n \"aria-label\": this.props.contentLabel\n }, this.attributesFromObject(\"aria\", _extends({ modal: true }, this.props.aria)), this.attributesFromObject(\"data\", this.props.data || {}), {\n \"data-testid\": this.props.testId\n });\n\n var contentElement = this.props.contentElement(contentProps, children);\n return this.props.overlayElement(overlayProps, contentElement);\n }\n }]);\n\n return ModalPortal;\n}(_react.Component);\n\nModalPortal.defaultProps = {\n style: {\n overlay: {},\n content: {}\n },\n defaultStyles: {}\n};\nModalPortal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n defaultStyles: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n ariaHideApp: _propTypes2.default.bool,\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onAfterClose: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n children: _propTypes2.default.node,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func,\n testId: _propTypes2.default.string\n};\nexports.default = ModalPortal;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleBlur = handleBlur;\nexports.handleFocus = handleFocus;\nexports.markForFocusLater = markForFocusLater;\nexports.returnFocus = returnFocus;\nexports.popWithoutFocus = popWithoutFocus;\nexports.setupScopedFocus = setupScopedFocus;\nexports.teardownScopedFocus = teardownScopedFocus;\n\nvar _tabbable = require(\"../helpers/tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar focusLaterElements = [];\nvar modalElement = null;\nvar needToFocus = false;\n\nfunction handleBlur() {\n needToFocus = true;\n}\n\nfunction handleFocus() {\n if (needToFocus) {\n needToFocus = false;\n if (!modalElement) {\n return;\n }\n // need to see how jQuery shims document.on('focusin') so we don't need the\n // setTimeout, firefox doesn't support focusin, if it did, we could focus\n // the element outside of a setTimeout. Side-effect of this implementation\n // is that the document.body gets focus, and then we focus our element right\n // after, seems fine.\n setTimeout(function () {\n if (modalElement.contains(document.activeElement)) {\n return;\n }\n var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;\n el.focus();\n }, 0);\n }\n}\n\nfunction markForFocusLater() {\n focusLaterElements.push(document.activeElement);\n}\n\n/* eslint-disable no-console */\nfunction returnFocus() {\n var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var toFocus = null;\n try {\n if (focusLaterElements.length !== 0) {\n toFocus = focusLaterElements.pop();\n toFocus.focus({ preventScroll: preventScroll });\n }\n return;\n } catch (e) {\n console.warn([\"You tried to return focus to\", toFocus, \"but it is not in the DOM anymore\"].join(\" \"));\n }\n}\n/* eslint-enable no-console */\n\nfunction popWithoutFocus() {\n focusLaterElements.length > 0 && focusLaterElements.pop();\n}\n\nfunction setupScopedFocus(element) {\n modalElement = element;\n\n if (window.addEventListener) {\n window.addEventListener(\"blur\", handleBlur, false);\n document.addEventListener(\"focus\", handleFocus, true);\n } else {\n window.attachEvent(\"onBlur\", handleBlur);\n document.attachEvent(\"onFocus\", handleFocus);\n }\n}\n\nfunction teardownScopedFocus() {\n modalElement = null;\n\n if (window.addEventListener) {\n window.removeEventListener(\"blur\", handleBlur);\n document.removeEventListener(\"focus\", handleFocus);\n } else {\n window.detachEvent(\"onBlur\", handleBlur);\n document.detachEvent(\"onFocus\", handleFocus);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = scopeTab;\n\nvar _tabbable = require(\"./tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction scopeTab(node, event) {\n var tabbable = (0, _tabbable2.default)(node);\n\n if (!tabbable.length) {\n // Do nothing, since there are no elements that can receive focus.\n event.preventDefault();\n return;\n }\n\n var target = void 0;\n\n var shiftKey = event.shiftKey;\n var head = tabbable[0];\n var tail = tabbable[tabbable.length - 1];\n\n // proceed with default browser behavior on tab.\n // Focus on last element on shift + tab.\n if (node === document.activeElement) {\n if (!shiftKey) return;\n target = tail;\n }\n\n if (tail === document.activeElement && !shiftKey) {\n target = head;\n }\n\n if (head === document.activeElement && shiftKey) {\n target = tail;\n }\n\n if (target) {\n event.preventDefault();\n target.focus();\n return;\n }\n\n // Safari radio issue.\n //\n // Safari does not move the focus to the radio button,\n // so we need to force it to really walk through all elements.\n //\n // This is very error prone, since we are trying to guess\n // if it is a safari browser from the first occurence between\n // chrome or safari.\n //\n // The chrome user agent contains the first ocurrence\n // as the 'chrome/version' and later the 'safari/version'.\n var checkSafari = /(\\bChrome\\b|\\bSafari\\b)\\//.exec(navigator.userAgent);\n var isSafariDesktop = checkSafari != null && checkSafari[1] != \"Chrome\" && /\\biPod\\b|\\biPad\\b/g.exec(navigator.userAgent) == null;\n\n // If we are not in safari desktop, let the browser control\n // the focus\n if (!isSafariDesktop) return;\n\n var x = tabbable.indexOf(document.activeElement);\n\n if (x > -1) {\n x += shiftKey ? -1 : 1;\n }\n\n target = tabbable[x];\n\n // If the tabbable element does not exist,\n // focus head/tail based on shiftKey\n if (typeof target === \"undefined\") {\n event.preventDefault();\n target = shiftKey ? tail : head;\n target.focus();\n return;\n }\n\n event.preventDefault();\n\n target.focus();\n}\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\n}());\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.dumpClassLists = dumpClassLists;\nvar htmlClassList = {};\nvar docBodyClassList = {};\n\nfunction dumpClassLists() {\n if (process.env.NODE_ENV !== \"production\") {\n var classes = document.getElementsByTagName(\"html\")[0].className;\n var buffer = \"Show tracked classes:\\n\\n\";\n\n buffer += \" (\" + classes + \"):\\n\";\n for (var x in htmlClassList) {\n buffer += \" \" + x + \" \" + htmlClassList[x] + \"\\n\";\n }\n\n classes = document.body.className;\n\n // eslint-disable-next-line max-len\n buffer += \"\\n\\ndoc.body (\" + classes + \"):\\n\";\n for (var _x in docBodyClassList) {\n buffer += \" \" + _x + \" \" + docBodyClassList[_x] + \"\\n\";\n }\n\n buffer += \"\\n\";\n\n // eslint-disable-next-line no-console\n console.log(buffer);\n }\n}\n\n/**\n * Track the number of reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar incrementReference = function incrementReference(poll, className) {\n if (!poll[className]) {\n poll[className] = 0;\n }\n poll[className] += 1;\n return className;\n};\n\n/**\n * Drop the reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar decrementReference = function decrementReference(poll, className) {\n if (poll[className]) {\n poll[className] -= 1;\n }\n return className;\n};\n\n/**\n * Track a class and add to the given class list.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be tracked.\n */\nvar trackClass = function trackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n incrementReference(poll, className);\n classListRef.add(className);\n });\n};\n\n/**\n * Untrack a class and remove from the given class list if the reference\n * reaches 0.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be untracked.\n */\nvar untrackClass = function untrackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n decrementReference(poll, className);\n poll[className] === 0 && classListRef.remove(className);\n });\n};\n\n/**\n * Public inferface to add classes to the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar add = exports.add = function add(element, classString) {\n return trackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};\n\n/**\n * Public inferface to remove classes from the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar remove = exports.remove = function remove(element, classString) {\n return untrackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};","\"use strict\";\n\nvar _portalOpenInstances = require(\"./portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Body focus trap see Issue #742\n\nvar before = void 0,\n after = void 0,\n instances = [];\n\nfunction focusContent() {\n if (instances.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Open instances > 0 expected\");\n }\n return;\n }\n instances[instances.length - 1].focusContent();\n}\n\nfunction bodyTrap(eventType, openInstances) {\n if (!before || !after) {\n before = document.createElement(\"div\");\n before.setAttribute(\"data-react-modal-body-trap\", \"\");\n before.style.position = \"absolute\";\n before.style.opacity = \"0\";\n before.setAttribute(\"tabindex\", \"0\");\n before.addEventListener(\"focus\", focusContent);\n after = before.cloneNode();\n after.addEventListener(\"focus\", focusContent);\n }\n\n instances = openInstances;\n\n if (instances.length > 0) {\n // Add focus trap\n if (document.body.firstChild !== before) {\n document.body.insertBefore(before, document.body.firstChild);\n }\n if (document.body.lastChild !== after) {\n document.body.appendChild(after);\n }\n } else {\n // Remove focus trap\n if (before.parentElement) {\n before.parentElement.removeChild(before);\n }\n if (after.parentElement) {\n after.parentElement.removeChild(after);\n }\n }\n}\n\n_portalOpenInstances2.default.subscribe(bodyTrap);","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n }\n // Binding \"this\" is important for shallow renderer support.\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(\n prevProps,\n prevState\n );\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n}\n\n// React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (\n typeof Component.getDerivedStateFromProps !== 'function' &&\n typeof prototype.getSnapshotBeforeUpdate !== 'function'\n ) {\n return Component;\n }\n\n // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n if (\n foundWillMountName !== null ||\n foundWillReceivePropsName !== null ||\n foundWillUpdateName !== null\n ) {\n var componentName = Component.displayName || Component.name;\n var newApiName =\n typeof Component.getDerivedStateFromProps === 'function'\n ? 'getDerivedStateFromProps()'\n : 'getSnapshotBeforeUpdate()';\n\n throw Error(\n 'Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' +\n componentName +\n ' uses ' +\n newApiName +\n ' but also contains the following legacy lifecycles:' +\n (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') +\n (foundWillReceivePropsName !== null\n ? '\\n ' + foundWillReceivePropsName\n : '') +\n (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') +\n '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' +\n 'https://fb.me/react-async-component-lifecycle-hooks'\n );\n }\n\n // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n }\n\n // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error(\n 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'\n );\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(\n prevProps,\n prevState,\n maybeSnapshot\n ) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag\n ? this.__reactInternalSnapshot\n : maybeSnapshot;\n\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"ril__outer\":\"style__ril__outer___1zYzZ\",\"ril__outerClosing\":\"style__ril__outerClosing___3n_rB\",\"ril__inner\":\"style__ril__inner___dYbbg\",\"ril__image\":\"style__ril__image___ohhGk\",\"ril__imagePrev\":\"style__ril__imagePrev___1TitV\",\"ril__imageNext\":\"style__ril__imageNext___qIMp_\",\"ril__imageDiscourager\":\"style__ril__imageDiscourager___1loUi\",\"ril__navButtons\":\"style__ril__navButtons___rD-18\",\"ril__navButtonPrev\":\"style__ril__navButtonPrev___3XfSU\",\"ril__navButtonNext\":\"style__ril__navButtonNext___lV26z\",\"ril__downloadBlocker\":\"style__ril__downloadBlocker___2Jwql\",\"ril__caption\":\"style__ril__caption___20juT\",\"ril__toolbar\":\"style__ril__toolbar___10lYy\",\"ril__captionContent\":\"style__ril__captionContent___6dnIh\",\"ril__toolbarSide\":\"style__ril__toolbarSide___1-5RY\",\"ril__toolbarLeftSide\":\"style__ril__toolbarLeftSide___33kts\",\"ril__toolbarRightSide\":\"style__ril__toolbarRightSide___3xRiA\",\"ril__toolbarItem\":\"style__ril__toolbarItem___33nhp\",\"ril__toolbarItemChild\":\"style__ril__toolbarItemChild___1uo52\",\"ril__builtinButton\":\"style__ril__builtinButton___2ew22\",\"ril__builtinButtonDisabled\":\"style__ril__builtinButtonDisabled___3xK7K\",\"ril__closeButton\":\"style__ril__closeButton___2Ge8S\",\"ril__zoomInButton\":\"style__ril__zoomInButton___2okkJ\",\"ril__zoomOutButton\":\"style__ril__zoomOutButton___2U6Nk\",\"ril__outerAnimating\":\"style__ril__outerAnimating___2Z5fK\",\"closeWindow\":\"style__closeWindow___2YNOe\",\"ril__loadingCircle\":\"style__ril__loadingCircle___23cHC\",\"ril__loadingCirclePoint\":\"style__ril__loadingCirclePoint___3pCVl\",\"pointFade\":\"style__pointFade___2ppwA\",\"ril__loadingContainer\":\"style__ril__loadingContainer___38L0C\",\"ril__errorContainer\":\"style__ril__errorContainer___3sKjX\",\"ril__loadingContainer__icon\":\"style__ril__loadingContainer__icon___2nrVt\"};","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Presentation_1 = require(\"../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetSourceList: {\n border: \"1px solid \" + theme.colors.border,\n padding: \"0 \" + theme.spacing.full,\n },\n item: {\n display: 'flex',\n alignItems: 'center',\n '& a': {\n fontWeight: 'normal',\n cursor: 'pointer',\n userSelect: 'none',\n '&:hover': {\n color: theme.colors.primary,\n },\n },\n },\n itemSelected: {\n '&, .neos.neos-module &': {\n color: theme.colors.primary,\n },\n },\n}); });\nfunction AssetSourceList() {\n var classes = useStyles();\n var assetSources = hooks_1.useAssetSourcesQuery().assetSources;\n var translate = src_1.useIntl().translate;\n var _a = hooks_1.useSelectAssetSource(), selectedAssetSource = _a[0], setSelectedAssetSource = _a[1];\n // We don't show the source selection if there is only one\n if (!assetSources || assetSources.length < 2)\n return null;\n return (React.createElement(\"nav\", { className: classes.assetSourceList },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"box\", label: translate('assetSourceList.header', 'Media sources') })), assetSources === null || assetSources === void 0 ? void 0 :\n assetSources.map(function (assetSource) { return (React.createElement(Presentation_1.IconLabel, { key: assetSource.id, label: assetSource.label, iconUri: assetSource.iconUri, className: classes.item },\n React.createElement(\"a\", { className: (selectedAssetSource === null || selectedAssetSource === void 0 ? void 0 : selectedAssetSource.id) === assetSource.id ? classes.itemSelected : null, onClick: function () { return setSelectedAssetSource(assetSource); } }, assetSource.id === 'neos' ? translate('assetsource.local', 'Local') : assetSource.label))); })));\n}\nexports.default = AssetSourceList;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles({\n assetLabel: {\n display: 'inline-block',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n },\n});\nvar AssetLabel = function (_a) {\n var label = _a.label;\n var classes = useStyles();\n return React.createElement(\"span\", { className: classes.assetLabel }, label);\n};\nexports.default = React.memo(AssetLabel);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n column: {\n display: 'grid',\n gridAutoRows: 'min-content',\n gridGap: theme.spacing.full,\n overflowY: 'auto',\n overflowX: 'hidden',\n height: '100%',\n },\n}); });\nfunction Column(_a) {\n var children = _a.children;\n var classes = useStyles();\n return React.createElement(\"div\", { className: classes.column }, children);\n}\nexports.default = Column;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n iconWrap: {\n verticalAlign: 'middle',\n },\n label: {\n fontWeight: 'bold',\n lineHeight: theme.spacing.goldenUnit,\n paddingLeft: theme.spacing.half,\n userSelect: 'none',\n },\n imgIcon: {\n width: 'auto',\n height: '18px',\n },\n}); });\nvar IconLabel = function (_a) {\n var _b = _a.icon, icon = _b === void 0 ? 'question' : _b, _c = _a.iconUri, iconUri = _c === void 0 ? '' : _c, _d = _a.label, label = _d === void 0 ? '' : _d, _e = _a.className, className = _e === void 0 ? '' : _e, _f = _a.children, children = _f === void 0 ? null : _f;\n var classes = useStyles();\n return (React.createElement(\"div\", { className: className },\n React.createElement(\"span\", { className: classes.iconWrap }, iconUri ? React.createElement(\"img\", { src: iconUri, alt: label, className: classes.imgIcon }) : React.createElement(react_ui_components_1.Icon, { icon: icon })),\n React.createElement(\"span\", { className: classes.label }, children || label || '')));\n};\nexports.default = React.memo(IconLabel);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n propertyList: {\n overflow: 'hidden',\n width: '100%',\n maxWidth: '100%',\n '& dt': {\n backgroundColor: theme.colors.alternatingBackground,\n color: 'white',\n fontWeight: 'bold',\n padding: theme.spacing.half + \" \" + theme.spacing.half + \" 0\",\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n width: \"calc(\" + theme.size.sidebarWidth + \" - \" + theme.spacing.full + \")\",\n },\n '& dd': {\n backgroundColor: theme.colors.alternatingBackground,\n color: theme.colors.inactive,\n margin: '0 0 1px',\n padding: theme.spacing.half,\n textOverflow: 'ellipsis',\n overflowX: 'hidden',\n whiteSpace: 'nowrap',\n width: \"calc(\" + theme.size.sidebarWidth + \" - \" + theme.spacing.full + \")\",\n },\n },\n}); });\nvar PropertyList = function (_a) {\n var children = _a.children;\n var classes = useStyles();\n return React.createElement(\"dl\", { className: classes.propertyList }, children);\n};\nexports.default = React.memo(PropertyList);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar PropertyListItem = function (_a) {\n var label = _a.label, value = _a.value;\n return (React.createElement(React.Fragment, null,\n React.createElement(\"dt\", null, label),\n React.createElement(\"dd\", null, value)));\n};\nexports.default = React.memo(PropertyListItem);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Presentation_1 = require(\"../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetSourceDescription: {\n border: \"1px solid \" + theme.colors.border,\n '& .ReactCollapse--collapse': {\n transition: \"height \" + theme.transition.slow,\n },\n },\n panelHeader: {\n '& button': {\n position: 'absolute',\n },\n },\n}); });\nfunction AssetSourceDescription() {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var selectedAssetSource = hooks_1.useSelectAssetSource()[0];\n if (!(selectedAssetSource === null || selectedAssetSource === void 0 ? void 0 : selectedAssetSource.description))\n return null;\n return (React.createElement(react_ui_components_1.ToggablePanel, { closesToBottom: true, className: classes.assetSourceDescription },\n React.createElement(react_ui_components_1.ToggablePanel.Header, { className: classes.panelHeader },\n React.createElement(Presentation_1.IconLabel, { icon: \"info-circle\", label: translate('assetSourceDe' + 'scription.header', 'Media source description') })),\n React.createElement(react_ui_components_1.ToggablePanel.Contents, null,\n React.createElement(\"p\", null, selectedAssetSource.description))));\n}\nexports.default = AssetSourceDescription;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar Tree_1 = require(\"./Tree\");\nvar index_1 = require(\"./index\");\nvar Presentation_1 = require(\"../Presentation\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar components_1 = require(\"@media-ui/feature-asset-upload/src/components\");\nvar SideBarLeft = function () {\n var selectionMode = src_1.useMediaUi().selectionMode;\n var components = [\n !selectionMode && components_1.UploadButton,\n index_1.AssetSourceList,\n Tree_1.AssetCollectionTree,\n index_1.AssetSourceDescription,\n ].filter(Boolean);\n return (React.createElement(Presentation_1.Column, null, components.map(function (Component, index) { return (React.createElement(Component, { key: index })); })));\n};\nexports.default = React.memo(SideBarLeft);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar AssetCollectionTreeNode_1 = __importDefault(require(\"./AssetCollectionTreeNode\"));\nvar TagTreeNode_1 = __importDefault(require(\"./TagTreeNode\"));\nvar Presentation_1 = require(\"../../Presentation\");\nvar AddAssetCollectionButton_1 = __importDefault(require(\"./AddAssetCollectionButton\"));\nvar AddTagButton_1 = __importDefault(require(\"./AddTagButton\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetCollectionTree: {\n border: \"1px solid \" + theme.colors.border,\n },\n headline: {\n padding: \"0 \" + theme.spacing.full,\n },\n iconWrap: {\n width: theme.spacing.goldenUnit,\n display: 'inline-flex',\n justifyContent: 'center',\n },\n toolbar: {\n borderTop: \"1px solid \" + theme.colors.border,\n },\n tree: {\n borderTop: \"1px solid \" + theme.colors.border,\n },\n}); });\nvar AssetCollectionTree = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var selectAssetCollection = hooks_1.useSelectAssetCollection();\n var selectTag = hooks_1.useSelectTag();\n var setSelectedAssetCollectionId = recoil_1.useSetRecoilState(state_1.selectedAssetCollectionIdState);\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var selectedTag = hooks_1.useSelectedTag();\n var setSelectedAssetId = recoil_1.useSetRecoilState(state_1.selectedAssetIdState);\n var setSelectedTagId = recoil_1.useSetRecoilState(state_1.selectedTagIdState);\n var tags = hooks_1.useTagsQuery().tags;\n var assetCollections = hooks_1.useAssetCollectionsQuery().assetCollections;\n var selectedAssetSource = hooks_1.useSelectAssetSource()[0];\n var deleteTag = hooks_1.useDeleteTag().deleteTag;\n var deleteAssetCollection = hooks_1.useDeleteAssetCollection().deleteAssetCollection;\n var onClickDelete = react_1.useCallback(function () {\n if (selectedTag) {\n // TODO: Use custom modal\n var confirm_1 = window.confirm(translate('action.deleteTag.confirm', 'Do you really want to delete the tag ' + selectedTag.label, [\n selectedTag.label,\n ]));\n if (!confirm_1)\n return;\n deleteTag(selectedTag.id)\n .then(function () {\n Notify.ok(translate('action.deleteTag.success', 'The tag has been deleted'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('action.deleteTag.error', 'Error while trying to delete the tag'), message);\n });\n setSelectedTagId(null);\n setSelectedAssetCollectionId(null);\n setSelectedAssetId(null);\n }\n else if (selectedAssetCollection) {\n // TODO: Use custom modal\n var confirm_2 = window.confirm(translate('action.deleteAssetCollection.confirm', 'Do you really want to delete the asset collection ' + selectedAssetCollection.title, [selectedAssetCollection.title]));\n if (!confirm_2)\n return;\n deleteAssetCollection(selectedAssetCollection.id)\n .then(function () {\n Notify.ok(translate('assetCollectionActions.delete.success', 'Asset collection was successfully deleted'));\n })\n .catch(function (error) {\n Notify.error(translate('assetCollectionActions.delete.error', 'Failed to delete asset collection'), error.message);\n });\n setSelectedTagId(null);\n setSelectedAssetCollectionId(null);\n setSelectedAssetId(null);\n }\n }, [\n selectedTag,\n selectedAssetCollection,\n translate,\n deleteTag,\n setSelectedTagId,\n setSelectedAssetCollectionId,\n setSelectedAssetId,\n Notify,\n deleteAssetCollection,\n ]);\n if (!(selectedAssetSource === null || selectedAssetSource === void 0 ? void 0 : selectedAssetSource.supportsCollections))\n return null;\n return (React.createElement(\"nav\", { className: classes.assetCollectionTree },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\", className: classes.headline },\n React.createElement(Presentation_1.IconLabel, { icon: \"folder\", label: translate('assetCollectionList.header', 'Collections') })),\n React.createElement(\"div\", { className: classes.toolbar },\n React.createElement(AddAssetCollectionButton_1.default, null),\n React.createElement(AddTagButton_1.default, null),\n React.createElement(react_ui_components_1.IconButton, { icon: \"trash-alt\", size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", disabled: !selectedAssetCollection && !selectedTag, title: translate('assetCollectionTree.toolbar.delete', 'Delete'), onClick: onClickDelete })),\n React.createElement(react_ui_components_1.Tree, { className: classes.tree },\n React.createElement(AssetCollectionTreeNode_1.default, { isActive: !selectedAssetCollection && !selectedTag, label: translate('assetCollectionList.showAll', 'All'), title: translate('assetCollectionList.showAll.title', 'Show assets for all collections'), level: 1, onClick: selectAssetCollection, assetCollection: null, collapsedByDefault: false }, tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return (React.createElement(TagTreeNode_1.default, { key: tag.id, tag: tag, isActive: !selectedAssetCollection && tag.id == (selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id), level: 2, onClick: selectTag })); })),\n assetCollections.map(function (assetCollection, index) {\n var _a;\n return (React.createElement(AssetCollectionTreeNode_1.default, { key: index, assetCollection: assetCollection, onClick: selectAssetCollection, level: 1, isActive: assetCollection.title == (selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.title) && !selectedTag }, (_a = assetCollection.tags) === null || _a === void 0 ? void 0 : _a.map(function (tag) { return (React.createElement(TagTreeNode_1.default, { key: tag.id, tag: tag, assetCollection: assetCollection, isActive: assetCollection.id == (selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id) && tag.id == (selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id), level: 2, onClick: selectTag })); })));\n }))));\n};\nexports.default = React.memo(AssetCollectionTree);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar dndTypes_1 = __importDefault(require(\"@media-ui/core/src/constants/dndTypes\"));\nvar AssetCollectionTreeNode = function (_a) {\n var isActive = _a.isActive, assetCollection = _a.assetCollection, label = _a.label, title = _a.title, children = _a.children, level = _a.level, onClick = _a.onClick, _b = _a.collapsedByDefault, collapsedByDefault = _b === void 0 ? true : _b;\n var _c = react_1.useState(collapsedByDefault), collapsed = _c[0], setCollapsed = _c[1];\n var handleToggle = react_1.useCallback(function () { return setCollapsed(!collapsed); }, [collapsed]);\n var handleClick = react_1.useCallback(function () { return onClick(assetCollection); }, [onClick, assetCollection]);\n return (React.createElement(react_ui_components_1.Tree.Node, null,\n React.createElement(react_ui_components_1.Tree.Node.Header, { isActive: isActive, isCollapsed: children.length === 0 || collapsed, isFocused: isActive, isLoading: false, hasError: false, label: label || assetCollection.title, title: title || assetCollection.title, icon: \"folder\", nodeDndType: dndTypes_1.default.COLLECTION, level: level, onToggle: handleToggle, onClick: handleClick, hasChildren: children.length > 0 }),\n !collapsed && children));\n};\nexports.default = React.memo(AssetCollectionTreeNode);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar dndTypes_1 = __importDefault(require(\"@media-ui/core/src/constants/dndTypes\"));\nvar TagTreeNode = function (_a) {\n var tag = _a.tag, isActive = _a.isActive, assetCollection = _a.assetCollection, label = _a.label, title = _a.title, onClick = _a.onClick, level = _a.level;\n var handleClick = react_1.useCallback(function () { return onClick(tag, assetCollection); }, [onClick, tag, assetCollection]);\n // TODO: Adjust rendering for nested tags\n return (React.createElement(react_ui_components_1.Tree.Node, null,\n React.createElement(react_ui_components_1.Tree.Node.Header, { isActive: isActive, isCollapsed: true, isFocused: isActive, isLoading: false, hasError: false, label: label || tag.label, title: title || tag.label, icon: \"tag\", nodeDndType: dndTypes_1.default.TAG, level: level, onClick: handleClick, hasChildren: false })));\n};\nexports.default = React.memo(TagTreeNode);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"../../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n plusIcon: {\n top: '15px !important',\n left: '13px !important',\n width: '9px !important',\n },\n});\nvar AddAssetCollectionButton = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var setCreateAssetCollectionDialogState = recoil_1.useSetRecoilState(state_1.createAssetCollectionDialogState);\n var onClickCreate = react_1.useCallback(function () {\n setCreateAssetCollectionDialogState({ title: '', visible: true });\n }, [setCreateAssetCollectionDialogState]);\n return (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", title: translate('assetCollectionTree.toolbar.createAssetCollection', 'Create new asset collection'), onClick: onClickCreate },\n React.createElement(\"span\", { className: \"fa-layers fa-fw\" },\n React.createElement(react_ui_components_1.Icon, { icon: \"folder\" }),\n React.createElement(react_ui_components_1.Icon, { icon: \"plus\", color: \"primaryBlue\", className: classes.plusIcon }))));\n};\nexports.default = React.memo(AddAssetCollectionButton);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"../../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n plusIcon: {\n top: '13px !important',\n left: '11px !important',\n width: '9px !important',\n },\n});\nvar AddTagButton = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var setCreateTagDialogState = recoil_1.useSetRecoilState(state_1.createTagDialogState);\n var onClickCreate = react_1.useCallback(function () {\n setCreateTagDialogState({ label: '', visible: true });\n }, [setCreateTagDialogState]);\n return (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", title: translate('assetCollectionTree.toolbar.createTag', 'Create new tag'), onClick: onClickCreate },\n React.createElement(\"span\", { className: \"fa-layers fa-fw\" },\n React.createElement(react_ui_components_1.Icon, { icon: \"tag\" }),\n React.createElement(react_ui_components_1.Icon, { icon: \"plus\", color: \"primaryBlue\", className: classes.plusIcon }))));\n};\nexports.default = React.memo(AddTagButton);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CurrentSelection = exports.SideBarRight = void 0;\nvar SideBarRight_1 = __importDefault(require(\"./SideBarRight\"));\nexports.SideBarRight = SideBarRight_1.default;\nvar CurrentSelection_1 = __importDefault(require(\"./CurrentSelection\"));\nexports.CurrentSelection = CurrentSelection_1.default;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar Inspector_1 = require(\"./Inspector\");\nvar CurrentSelection_1 = __importDefault(require(\"./CurrentSelection\"));\nvar Presentation_1 = require(\"../Presentation\");\nvar SideBarRight = function () {\n // TODO: Read from component store\n var components = [\n CurrentSelection_1.default,\n Inspector_1.AssetInspector,\n Inspector_1.AssetCollectionInspector,\n Inspector_1.TagInspector,\n Inspector_1.IptcMetadataInspector,\n ];\n return (React.createElement(Presentation_1.Column, null, components.map(function (Component, index) { return (React.createElement(Component, { key: index })); })));\n};\nexports.default = React.memo(SideBarRight);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/feature-asset-usage/src\");\nvar src_2 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar src_3 = require(\"@media-ui/feature-similar-assets/src\");\nvar components_1 = require(\"@media-ui/feature-asset-upload/src/components\");\nvar index_1 = require(\"./index\");\nvar recoil_1 = require(\"recoil\");\nvar Property_1 = __importDefault(require(\"./Property\"));\nvar Actions_1 = __importDefault(require(\"./Actions\"));\nvar InspectorContainer_1 = __importDefault(require(\"./InspectorContainer\"));\nvar useStyles = src_2.createUseMediaUiStyles(function (theme) { return ({\n textArea: {\n // TODO: Remove when overriding rule is removed from Minimal Module Style in Neos\n '.neos textarea&': {\n padding: theme.spacing.half,\n },\n },\n}); });\nvar AssetInspector = function () {\n var classes = useStyles();\n var selectedAsset = hooks_1.useSelectedAsset();\n var Notify = src_2.useNotify();\n var translate = src_2.useIntl().translate;\n var featureFlags = src_2.useMediaUi().featureFlags;\n var _a = react_1.useState(null), label = _a[0], setLabel = _a[1];\n var _b = react_1.useState(null), caption = _b[0], setCaption = _b[1];\n var _c = react_1.useState(null), copyrightNotice = _c[0], setCopyrightNotice = _c[1];\n var selectedInspectorView = recoil_1.useRecoilValue(state_1.selectedInspectorViewState);\n var _d = hooks_1.useUpdateAsset(), updateAsset = _d.updateAsset, loading = _d.loading;\n var isEditable = (selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.localId) && !loading;\n var hasUnpublishedChanges = selectedAsset &&\n (label !== selectedAsset.label ||\n caption !== selectedAsset.caption ||\n copyrightNotice !== selectedAsset.copyrightNotice);\n var handleDiscard = react_1.useCallback(function () {\n if (selectedAsset) {\n setLabel(selectedAsset.label);\n setCaption(selectedAsset.caption);\n setCopyrightNotice(selectedAsset.copyrightNotice);\n }\n }, [selectedAsset, setLabel, setCaption, setCopyrightNotice]);\n var handleApply = react_1.useCallback(function () {\n if (label !== selectedAsset.label ||\n caption !== selectedAsset.caption ||\n copyrightNotice !== selectedAsset.copyrightNotice) {\n updateAsset({\n asset: selectedAsset,\n label: label,\n caption: caption,\n copyrightNotice: copyrightNotice,\n })\n .then(function () {\n Notify.ok(translate('actions.updateAsset.success', 'The asset has been updated'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.deleteAsset.error', 'Error while updating the asset'), message);\n });\n }\n }, [Notify, translate, caption, copyrightNotice, label, selectedAsset, updateAsset]);\n react_1.useEffect(function () {\n handleDiscard();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.id]);\n if (!selectedAsset || selectedInspectorView !== 'asset')\n return null;\n return (React.createElement(InspectorContainer_1.default, null,\n React.createElement(Property_1.default, { label: translate('inspector.title', 'Title') },\n React.createElement(react_ui_components_1.TextInput, { disabled: !isEditable, type: \"text\", value: label || '', onChange: setLabel, onEnterKey: handleApply })),\n React.createElement(Property_1.default, { label: translate('inspector.caption', 'Caption') },\n React.createElement(react_ui_components_1.TextArea, { className: classes.textArea, disabled: !isEditable, minRows: 3, expandedRows: 6, value: caption || '', onChange: setCaption })),\n React.createElement(Property_1.default, { label: translate('inspector.copyrightNotice', 'Copyright notice') },\n React.createElement(react_ui_components_1.TextArea, { className: classes.textArea, disabled: !isEditable, minRows: 2, expandedRows: 4, value: copyrightNotice || '', onChange: setCopyrightNotice })),\n isEditable && (React.createElement(Actions_1.default, { handleApply: handleApply, handleDiscard: handleDiscard, hasUnpublishedChanges: hasUnpublishedChanges })),\n selectedAsset.assetSource.supportsCollections && React.createElement(index_1.CollectionSelectBox, null),\n selectedAsset.assetSource.supportsTagging && React.createElement(index_1.TagSelectBoxAsset, null),\n React.createElement(src_1.AssetUsagesToggleButton, null),\n featureFlags.showSimilarAssets && React.createElement(src_3.SimilarAssetsToggleButton, null),\n !selectedAsset.assetSource.readOnly && React.createElement(components_1.AssetReplacementButton, null),\n React.createElement(index_1.MetadataView, null)));\n};\nexports.default = React.memo(AssetInspector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar _1 = require(\".\");\nvar recoil_1 = require(\"recoil\");\nvar Actions_1 = __importDefault(require(\"./Actions\"));\nvar Property_1 = __importDefault(require(\"./Property\"));\nvar InspectorContainer_1 = __importDefault(require(\"./InspectorContainer\"));\nvar AssetCollectionInspector = function () {\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var selectedInspectorView = recoil_1.useRecoilValue(state_1.selectedInspectorViewState);\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var _a = react_1.useState(null), title = _a[0], setTitle = _a[1];\n var updateAssetCollection = hooks_1.useUpdateAssetCollection().updateAssetCollection;\n var hasUnpublishedChanges = selectedAssetCollection && title !== selectedAssetCollection.title;\n var handleDiscard = react_1.useCallback(function () {\n if (selectedAssetCollection) {\n setTitle(selectedAssetCollection.title);\n }\n }, [selectedAssetCollection, setTitle]);\n var handleApply = react_1.useCallback(function () {\n if (title !== selectedAssetCollection.title) {\n updateAssetCollection({\n assetCollection: selectedAssetCollection,\n title: title,\n })\n .then(function () {\n Notify.ok(translate('actions.updateAssetCollection.success', 'The asset collection has been updated'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.deleteAssetCollection.error', 'Error while updating the asset collection'), message);\n });\n }\n }, [Notify, translate, selectedAssetCollection, updateAssetCollection, title]);\n react_1.useEffect(function () {\n handleDiscard();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id]);\n if (!selectedAssetCollection || selectedInspectorView !== 'assetCollection')\n return null;\n return (React.createElement(InspectorContainer_1.default, null,\n React.createElement(Property_1.default, { label: translate('inspector.title', 'Title') },\n React.createElement(react_ui_components_1.TextInput, { type: \"text\", value: title || '', onChange: setTitle, onEnterKey: handleApply })),\n React.createElement(Actions_1.default, { handleApply: handleApply, handleDiscard: handleDiscard, hasUnpublishedChanges: hasUnpublishedChanges }),\n React.createElement(_1.TagSelectBoxAssetCollection, null)));\n};\nexports.default = React.memo(AssetCollectionInspector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Presentation_1 = require(\"../../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n iptcData: {\n '& dl': {\n '& dt': {\n backgroundColor: theme.colors.alternatingBackground,\n fontWeight: 'bold',\n color: 'white',\n padding: '8px 8px 0',\n },\n '& dd': {\n backgroundColor: theme.colors.alternatingBackground,\n marginBottom: '1px',\n padding: '8px',\n color: theme.colors.inactive,\n },\n },\n },\n}); });\nvar IptcMetadataInspector = function () {\n var _a;\n var classes = useStyles();\n var selectedAsset = hooks_1.useSelectedAsset();\n var translate = src_1.useIntl().translate;\n if (!((_a = selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.iptcProperties) === null || _a === void 0 ? void 0 : _a.length))\n return null;\n return (React.createElement(\"div\", { className: classes.iptcData },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"camera\", label: translate('inspector.iptcMetadata', 'IPTC Metadata') })),\n React.createElement(Presentation_1.PropertyList, null, selectedAsset.iptcProperties.map(function (iptcProperty) { return (React.createElement(Presentation_1.PropertyListItem, { key: iptcProperty.propertyName, label: iptcProperty.propertyName, value: iptcProperty.value })); }))));\n};\nexports.default = React.memo(IptcMetadataInspector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar helper_1 = require(\"@media-ui/core/src/helper\");\nvar Presentation_1 = require(\"../../Presentation\");\nvar MetadataView = function () {\n var translate = src_1.useIntl().translate;\n var selectedAsset = hooks_1.useSelectedAsset();\n if (!selectedAsset)\n return null;\n return (React.createElement(\"div\", null,\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"info-circle\", label: translate('inspector.metadata', 'Metadata') })),\n React.createElement(Presentation_1.PropertyList, null,\n selectedAsset.file.size > 0 && (React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.fileSize', 'Size'), value: helper_1.humanFileSize(selectedAsset.file.size) })),\n React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.lastModified', 'Last modified'), value: new Date(selectedAsset.lastModified).toLocaleString() }),\n React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.dimensions', 'Dimensions'), value: selectedAsset.width + \"px x \" + selectedAsset.height + \"px\" }),\n React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.mediaType', 'MIME type'), value: selectedAsset.file.mediaType }),\n React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.filename', 'Filename'), value: selectedAsset.filename }))));\n};\nexports.default = React.memo(MetadataView);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Actions_1 = __importDefault(require(\"./Actions\"));\nvar Property_1 = __importDefault(require(\"./Property\"));\nvar InspectorContainer_1 = __importDefault(require(\"./InspectorContainer\"));\nvar TagInspector = function () {\n var selectedTag = hooks_1.useSelectedTag();\n var selectedInspectorView = recoil_1.useRecoilValue(state_1.selectedInspectorViewState);\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var _a = react_1.useState(null), label = _a[0], setLabel = _a[1];\n var updateTag = hooks_1.useUpdateTag().updateTag;\n var hasUnpublishedChanges = selectedTag && label !== selectedTag.label;\n var handleDiscard = react_1.useCallback(function () {\n if (selectedTag) {\n setLabel(selectedTag.label);\n }\n }, [selectedTag, setLabel]);\n var handleApply = react_1.useCallback(function () {\n if (label !== selectedTag.label) {\n updateTag({\n tag: selectedTag,\n label: label,\n })\n .then(function () {\n Notify.ok(translate('actions.updateTag.success', 'The tag has been updated'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.updateTag.error', 'Error while updating the tag'), message);\n });\n }\n }, [Notify, translate, selectedTag, updateTag, label]);\n react_1.useEffect(function () {\n handleDiscard();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id]);\n if (!selectedTag || selectedInspectorView !== 'tag')\n return null;\n return (React.createElement(InspectorContainer_1.default, null,\n React.createElement(Property_1.default, { label: translate('inspector.label', 'Label') },\n React.createElement(react_ui_components_1.TextInput, { type: \"text\", value: label || '', onChange: setLabel, onEnterKey: handleApply })),\n React.createElement(Actions_1.default, { handleApply: handleApply, handleDiscard: handleDiscard, hasUnpublishedChanges: hasUnpublishedChanges })));\n};\nexports.default = React.memo(TagInspector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar Presentation_1 = require(\"../../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles({\n tagSelectBox: {},\n tagSelection: {},\n});\nvar TagSelectBox = function (_a) {\n var values = _a.values, options = _a.options, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b;\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var handleChange = function (tagIds) { return onChange(tagIds.map(function (tagId) { return options.find(function (o) { return o.id === tagId; }); })); };\n return (React.createElement(\"div\", { className: classes.tagSelectBox },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"tags\", label: translate('inspector.tags', 'Tags') })),\n React.createElement(react_ui_components_1.MultiSelectBox, { className: classes.tagSelection, disabled: disabled, placeholder: translate('inspector.tags.placeholder', 'Select a tag'), noMatchesFoundLabel: translate('general.noMatchesFound', 'No matches found'), values: values, optionValueField: \"id\", options: options, searchOptions: options, onValuesChange: handleChange })));\n};\nexports.default = React.memo(TagSelectBox);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar _1 = require(\".\");\nvar tagsMatchAsset = function (tags, asset) {\n return (tags\n .map(function (tag) { return tag.id; })\n .sort()\n .join(',') ===\n asset.tags\n .map(function (tag) { return tag.id; })\n .sort()\n .join(','));\n};\nvar TagSelectBoxAsset = function () {\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var allTags = hooks_1.useTagsQuery().tags;\n var _a = hooks_1.useSetAssetTags(), setAssetTags = _a.setAssetTags, loading = _a.loading;\n var selectedAsset = hooks_1.useSelectedAsset();\n var selectedTagIds = react_1.useMemo(function () { return selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.tags.map(function (_a) {\n var id = _a.id;\n return id;\n }).sort(); }, [selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.tags]);\n var handleChange = react_1.useCallback(function (newTags) {\n if (!tagsMatchAsset(newTags, selectedAsset)) {\n setAssetTags({\n asset: selectedAsset,\n tags: newTags,\n })\n .then(function () {\n Notify.ok(translate('actions.setAssetTags.success', 'The asset has been tagged'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.setAssetTags.error', 'Error while tagging the asset'), message);\n });\n }\n }, [Notify, selectedAsset, setAssetTags, translate]);\n if (!selectedAsset)\n return null;\n return (React.createElement(_1.TagSelectBox, { values: selectedTagIds, options: allTags, onChange: handleChange, disabled: loading || selectedAsset.assetSource.readOnly }));\n};\nexports.default = React.memo(TagSelectBoxAsset);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar _1 = require(\".\");\nvar tagsMatchAssetCollection = function (tags, assetCollection) {\n return (tags\n .map(function (tag) { return tag.id; })\n .sort()\n .join(',') ===\n assetCollection.tags\n .map(function (tag) { return tag.id; })\n .sort()\n .join(','));\n};\nvar TagSelectBoxAssetCollection = function () {\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var allTags = hooks_1.useTagsQuery().tags;\n var updateAssetCollection = hooks_1.useUpdateAssetCollection().updateAssetCollection;\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var tagIds = react_1.useMemo(function () { return selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.tags.map(function (_a) {\n var id = _a.id;\n return id;\n }).sort(); }, [\n selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.tags,\n ]);\n var handleChange = react_1.useCallback(function (newTags) {\n if (!tagsMatchAssetCollection(newTags, selectedAssetCollection)) {\n updateAssetCollection({\n assetCollection: selectedAssetCollection,\n tags: newTags,\n })\n .then(function () {\n Notify.ok(translate('actions.tagAssetCollection.success', 'The asset collection has been tagged'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.tagAssetCollection.error', 'Error while tagging the asset collection'), message);\n });\n }\n }, [Notify, selectedAssetCollection, updateAssetCollection, translate]);\n if (!selectedAssetCollection)\n return null;\n return React.createElement(_1.TagSelectBox, { values: tagIds, options: allTags, onChange: handleChange });\n};\nexports.default = React.memo(TagSelectBoxAssetCollection);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Presentation_1 = require(\"../../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles({\n collectionSelectBox: {},\n collectionSelection: {},\n});\nvar collectionsMatchAsset = function (assetCollectionIds, asset) {\n return assetCollectionIds.join(',') === asset.collections.map(function (collection) { return collection.id; }).join(',');\n};\nvar CollectionSelectBox = function () {\n var classes = useStyles();\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var assetCollections = hooks_1.useAssetCollectionsQuery().assetCollections;\n var _a = hooks_1.useSetAssetCollections(), setAssetCollections = _a.setAssetCollections, loading = _a.loading;\n var selectedAsset = hooks_1.useSelectedAsset();\n var assetCollectionsWithLabel = react_1.useMemo(function () { return assetCollections.map(function (_a) {\n var title = _a.title, rest = __rest(_a, [\"title\"]);\n return (__assign({ label: title }, rest));\n }); }, [assetCollections]);\n var assetCollectionIds = react_1.useMemo(function () { return selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.collections.map(function (_a) {\n var id = _a.id;\n return id;\n }); }, [selectedAsset]);\n var handleChange = react_1.useCallback(function (newAssetCollectionIds) {\n if (!collectionsMatchAsset(newAssetCollectionIds, selectedAsset)) {\n setAssetCollections({\n asset: selectedAsset,\n assetCollections: assetCollections.filter(function (c) { return newAssetCollectionIds.includes(c.id); }),\n })\n .then(function () {\n Notify.ok(translate('actions.setAssetCollections.success', 'The collections for the asset have been set'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.setAssetCollections.error', 'Error while setting the collections for the asset'), message);\n });\n }\n }, [Notify, selectedAsset, setAssetCollections, assetCollections, translate]);\n if (!selectedAsset)\n return null;\n return (React.createElement(\"div\", { className: classes.collectionSelectBox },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"folder\", label: translate('inspector.assetCollections', 'Collections') })),\n React.createElement(react_ui_components_1.MultiSelectBox, { className: classes.collectionSelection, disabled: loading || selectedAsset.assetSource.readOnly, placeholder: translate('inspector.collections.placeholder', 'Select a collection'), values: assetCollectionIds, optionValueField: \"id\", options: assetCollectionsWithLabel, searchOptions: assetCollectionsWithLabel, noMatchesFoundLabel: translate('general.noMatchesFound', 'No matches found'), onValuesChange: handleChange })));\n};\nexports.default = React.memo(CollectionSelectBox);\n","/**\n * media-type\n * @author Lovell Fuller\n *\n * This code is distributed under the Apache License Version 2.0, the terms of\n * which may be found at http://www.apache.org/licenses/LICENSE-2.0.html\n */\n\nvar MediaType = function() {\n this.type = null;\n this._setSubtypeAndSuffix(null);\n this.parameters = {};\n};\n\nMediaType.prototype.isValid = function() {\n return this.type !== null && this.subtype !== null && this.subtype !== \"example\";\n};\n\nMediaType.prototype._setSubtypeAndSuffix = function(subtype) {\n this.subtype = subtype;\n this.subtypeFacets = [];\n this.suffix = null;\n if (subtype) {\n if (subtype.indexOf(\"+\") > -1 && subtype.substr(-1) !== \"+\") {\n var fixes = subtype.split(\"+\", 2);\n this.subtype = fixes[0];\n this.subtypeFacets = fixes[0].split(\".\");\n this.suffix = fixes[1];\n } else {\n this.subtypeFacets = subtype.split(\".\");\n }\n }\n};\n\nMediaType.prototype.hasSuffix = function() {\n return !!this.suffix;\n};\n\nMediaType.prototype._firstSubtypeFacetEquals = function(str) {\n return this.subtypeFacets.length > 0 && this.subtypeFacets[0] === str;\n};\n\nMediaType.prototype.isVendor = function() {\n return this._firstSubtypeFacetEquals(\"vnd\");\n};\n\nMediaType.prototype.isPersonal = function() {\n return this._firstSubtypeFacetEquals(\"prs\");\n};\n\nMediaType.prototype.isExperimental = function() {\n return this._firstSubtypeFacetEquals(\"x\") || this.subtype.substring(0, 2).toLowerCase() === \"x-\";\n};\n\nMediaType.prototype.asString = function() {\n var str = \"\";\n if (this.isValid()) {\n str = str + this.type + \"/\" + this.subtype;\n if (this.hasSuffix()) {\n str = str + \"+\" + this.suffix;\n }\n var parameterKeys = Object.keys(this.parameters);\n if (parameterKeys.length > 0) {\n var parameters = [];\n var that = this;\n parameterKeys.sort(function(a, b) {\n return a.localeCompare(b);\n }).forEach(function(element) {\n parameters.push(element + \"=\" + wrapQuotes(that.parameters[element]));\n });\n str = str + \";\" + parameters.join(\";\");\n }\n }\n return str;\n};\n\nvar wrapQuotes = function(str) {\n return (str.indexOf(\";\") > -1) ? '\"' + str + '\"' : str;\n};\n\nvar unwrapQuotes = function(str) {\n return (str.substr(0, 1) === '\"' && str.substr(-1) === '\"') ? str.substr(1, str.length - 2) : str;\n};\n\nvar mediaTypeMatcher = /^(application|audio|font|image|message|model|multipart|text|video|\\*)\\/([a-zA-Z0-9!#$%^&\\*_\\-\\+{}\\|'.`~]{1,127})(;.*)?$/;\n\nvar parameterSplitter = /;(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*(?![^\\\"]*\\\"))/;\n\nexports.fromString = function(str) {\n var mediaType = new MediaType();\n if (str) {\n var match = str.match(mediaTypeMatcher);\n if (match && !(match[1] === '*' && match[2] !== '*')) { \n mediaType.type = match[1];\n mediaType._setSubtypeAndSuffix(match[2]);\n if (match[3]) {\n match[3].substr(1).split(parameterSplitter).forEach(function(parameter) {\n var keyAndValue = parameter.split('=', 2);\n if (keyAndValue.length === 2) {\n mediaType.parameters[keyAndValue[0].toLowerCase().trim()] = unwrapQuotes(keyAndValue[1].trim());\n }\n });\n }\n }\n }\n return mediaType;\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n '@keyframes cssloadWidth': {\n '0%, 100%': {\n transitionTimingFunction: 'cubic-bezier(1, 0, .65, .85)',\n },\n '0%': {\n width: 0,\n },\n '100%': {\n width: '100%',\n },\n },\n container: {\n left: 0,\n top: 0,\n height: '2px',\n position: 'fixed',\n width: '100vw',\n zIndex: theme.loadingIndicatorZIndex,\n },\n indicator: {\n height: '2px',\n position: 'relative',\n width: '100%',\n },\n bar: {\n height: '100%',\n position: 'relative',\n backgroundColor: theme.colors.warn,\n animation: '$cssloadWidth 2s cubic-bezier(.45, 0, 1, 1) infinite',\n },\n}); });\nfunction LoadingIndicator() {\n var classes = useStyles();\n var isLoading = recoil_1.useRecoilValue(state_1.loadingState);\n return (React.createElement(React.Fragment, null, isLoading && (React.createElement(\"div\", { className: classes.container },\n React.createElement(\"div\", { className: classes.indicator },\n React.createElement(\"div\", { className: classes.bar }))))));\n}\nexports.default = LoadingIndicator;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BottomBar = exports.Pagination = exports.AssetCount = void 0;\nvar BottomBar_1 = __importDefault(require(\"./BottomBar\"));\nexports.BottomBar = BottomBar_1.default;\nvar Pagination_1 = __importDefault(require(\"./Pagination/Pagination\"));\nexports.Pagination = Pagination_1.default;\nvar AssetCount_1 = __importDefault(require(\"./AssetCount/AssetCount\"));\nexports.AssetCount = AssetCount_1.default;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar AssetCount_1 = __importDefault(require(\"./AssetCount/AssetCount\"));\nvar Pagination_1 = __importDefault(require(\"./Pagination/Pagination\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n bottomBar: function (_a) {\n var isInNodeCreationDialog = _a.isInNodeCreationDialog, selectionMode = _a.selectionMode;\n return ({\n display: 'grid',\n gridTemplateColumns: isInNodeCreationDialog || selectionMode ? 'repeat(3, 1fr)' : '350px 1fr 350px',\n gridGap: theme.spacing.goldenUnit,\n position: 'fixed',\n bottom: isInNodeCreationDialog ? -16 : 0,\n left: isInNodeCreationDialog ? -16 : 0,\n right: isInNodeCreationDialog ? -16 : 0,\n borderTop: \"1px solid \" + theme.colors.border,\n backgroundColor: theme.colors.moduleBackground,\n zIndex: theme.paginationZIndex,\n });\n },\n}); });\nvar BottomBar = function () {\n var _a = src_1.useMediaUi(), isInNodeCreationDialog = _a.isInNodeCreationDialog, selectionMode = _a.selectionMode;\n var classes = useStyles({ isInNodeCreationDialog: isInNodeCreationDialog, selectionMode: selectionMode });\n var components = react_1.useMemo(function () { return [AssetCount_1.default, Pagination_1.default, src_2.ClipboardToggle]; }, []);\n return (React.createElement(\"div\", { className: classes.bottomBar }, components.map(function (Component, index) { return (React.createElement(Component, { key: index })); })));\n};\nexports.default = React.memo(BottomBar);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles({\n item: {\n userSelect: 'none',\n '& button': {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n },\n },\n});\nvar PaginationItem = function (_a) {\n var title = _a.title, label = _a.label, onClick = _a.onClick, _b = _a.page, page = _b === void 0 ? null : _b, _c = _a.selected, selected = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, icon = _a.icon;\n var classes = useStyles();\n return (React.createElement(\"li\", { className: [classes.item, selected ? classes.selected : ''].join(' ') }, icon ? (React.createElement(react_ui_components_1.IconButton, { icon: icon, disabled: disabled, size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", title: title, onClick: function () { return onClick(page); } })) : (React.createElement(react_ui_components_1.Button, { icon: icon, disabled: disabled, size: \"regular\", style: selected ? 'brand' : 'transparent', hoverStyle: \"brand\", title: title, onClick: function () { return onClick(page); } }, label || page))));\n};\nexports.default = React.memo(PaginationItem);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar state_2 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n searchBox: {\n flex: 1,\n '& input[type=\"search\"]': {\n '-webkit-appearance': 'auto',\n width: '100%',\n '&::-webkit-search-cancel-button': {\n '-webkit-appearance': 'searchfield-cancel-button',\n cursor: 'pointer',\n },\n },\n },\n});\nvar SearchBox = function () {\n var classes = useStyles();\n var _a = recoil_1.useRecoilState(state_1.searchTermState), searchTerm = _a[0], setSearchTerm = _a[1];\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n var _b = react_1.useState(searchTerm), searchValue = _b[0], setSearchValue = _b[1];\n var translate = src_1.useIntl().translate;\n var mainView = recoil_1.useRecoilValue(state_2.mainViewState);\n var handleSearch = react_1.useCallback(function () {\n setSearchTerm(searchValue);\n setCurrentPage(1);\n }, [searchValue, setCurrentPage, setSearchTerm]);\n if (mainView !== state_2.MainViewState.DEFAULT)\n return null;\n return (React.createElement(\"div\", { className: classes.searchBox },\n React.createElement(react_ui_components_1.TextInput, { value: searchValue, type: \"search\", onChange: function (value) { return setSearchValue(value); }, onEnterKey: handleSearch, placeholder: translate('searchBox.placeholder', 'Search') })));\n};\nexports.default = React.memo(SearchBox);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar index_1 = require(\"./index\");\nvar SortOrderSelector_1 = __importDefault(require(\"./SortOrderSelector\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n topBar: {\n display: 'flex',\n flexWrap: 'nowrap',\n justifyContent: 'flex-end',\n margin: \"0 -\" + theme.spacing.half,\n // Add spacing in selection mode to prevent overlap with close button of secondary inspector view\n paddingRight: function (props) { return (props.selectionMode ? theme.spacing.goldenUnit : null); },\n '& > *': {\n margin: \"0 \" + theme.spacing.half,\n },\n },\n}); });\nvar TopBar = function () {\n var selectionMode = src_1.useMediaUi().selectionMode;\n var classes = useStyles({ selectionMode: selectionMode });\n var components = react_1.useMemo(function () { return [src_2.ClipboardActions, index_1.SearchBox, index_1.TypeFilter, SortOrderSelector_1.default, index_1.ViewModeSelector]; }, []);\n return (React.createElement(\"div\", { className: classes.topBar }, components.map(function (Component, index) { return (React.createElement(Component, { key: index })); })));\n};\nexports.default = React.memo(TopBar);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar selectedSortOrderState_1 = __importStar(require(\"@media-ui/core/src/state/selectedSortOrderState\"));\nvar useStyles = src_1.createUseMediaUiStyles({\n sortingState: {\n display: 'flex',\n flex: 1,\n minWidth: 0,\n },\n selectBox: {\n minWidth: 0,\n },\n});\nvar SortOrderSelector = function () {\n var _a = src_1.useMediaUi(), isInNodeCreationDialog = _a.isInNodeCreationDialog, selectionMode = _a.selectionMode;\n var classes = useStyles();\n var _b = recoil_1.useRecoilState(selectedSortOrderState_1.default), sortOrderState = _b[0], setSortOrderState = _b[1];\n var translate = src_1.useIntl().translate;\n var hideOptionIcon = isInNodeCreationDialog || selectionMode;\n var handleChangeSortBy = react_1.useCallback(function (sortBy) {\n setSortOrderState(__assign(__assign({}, sortOrderState), { sortBy: sortBy }));\n }, [sortOrderState, setSortOrderState]);\n var handleSwitchSortDirection = react_1.useCallback(function () {\n setSortOrderState(__assign(__assign({}, sortOrderState), { sortDirection: sortOrderState.sortDirection === selectedSortOrderState_1.SORT_DIRECTION.Asc ? selectedSortOrderState_1.SORT_DIRECTION.Desc : selectedSortOrderState_1.SORT_DIRECTION.Asc }));\n }, [sortOrderState, setSortOrderState]);\n var sortByOptions = react_1.useMemo(function () {\n return [\n {\n value: selectedSortOrderState_1.SORT_BY.LastModified,\n label: translate('sortingState.sortBy.values.lastModified', 'Last Modified'),\n icon: hideOptionIcon ? '' : 'calendar',\n },\n {\n value: selectedSortOrderState_1.SORT_BY.Name,\n label: translate('sortingState.sortBy.values.name', 'Name'),\n icon: hideOptionIcon ? '' : 'font',\n },\n ];\n }, [translate, hideOptionIcon]);\n return (React.createElement(\"div\", { className: classes.sortingState },\n React.createElement(\"div\", { className: classes.selectBox },\n React.createElement(react_ui_components_1.SelectBox, { className: classes.selectBox, options: Object.values(sortByOptions), onValueChange: handleChangeSortBy, value: sortOrderState.sortBy, optionValueField: \"value\" })),\n React.createElement(react_ui_components_1.IconButton, { icon: sortOrderState.sortDirection === selectedSortOrderState_1.SORT_DIRECTION.Asc ? 'sort-amount-up' : 'sort-amount-down', size: \"regular\", title: translate(\"sortingState.dortOrder.value.\" + (sortOrderState.sortDirection === selectedSortOrderState_1.SORT_DIRECTION.Asc ? selectedSortOrderState_1.SORT_DIRECTION.Desc : selectedSortOrderState_1.SORT_DIRECTION.Asc), \"Switch sort direction\"), style: \"neutral\", hoverStyle: \"brand\", onClick: handleSwitchSortDirection })));\n};\nexports.default = React.memo(SortOrderSelector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar src_2 = require(\"@media-ui/feature-asset-usage/src\");\nvar state_2 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n typeFilter: {},\n selectBox: {\n minWidth: 'auto',\n },\n});\nvar UNUSED_FILTER_VALUE = 'unused';\nvar TypeFilter = function () {\n var classes = useStyles();\n var _a = src_1.useMediaUi(), featureFlags = _a.featureFlags, assetType = _a.assetType;\n var _b = recoil_1.useRecoilState(state_1.selectedMediaTypeState), mediaTypeFilter = _b[0], setMediaTypeFilter = _b[1];\n var _c = recoil_1.useRecoilState(src_2.showUnusedAssetsState), showUnusedAssets = _c[0], setShowUnusedAssets = _c[1];\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n var translate = src_1.useIntl().translate;\n var mainView = recoil_1.useRecoilValue(state_2.mainViewState);\n var currentValue = showUnusedAssets ? UNUSED_FILTER_VALUE : mediaTypeFilter;\n var onValueChange = react_1.useCallback(function (value) {\n setShowUnusedAssets(value === 'unused');\n if (value !== UNUSED_FILTER_VALUE) {\n setMediaTypeFilter(value);\n }\n setCurrentPage(1);\n }, [setCurrentPage, setShowUnusedAssets, setMediaTypeFilter]);\n var mediaTypeOptions = react_1.useMemo(function () {\n var options = {\n video: {\n value: 'video',\n label: translate('typeFilter.mediaType.values.video', 'Video'),\n icon: 'file-video',\n disabled: assetType !== 'all' && assetType !== 'video',\n },\n audio: {\n value: 'audio',\n label: translate('typeFilter.mediaType.values.audio', 'Audio'),\n icon: 'file-audio',\n disabled: assetType !== 'all' && assetType !== 'audio',\n },\n image: {\n value: 'image',\n label: translate('typeFilter.mediaType.values.image', 'Images'),\n icon: 'file-image',\n disabled: assetType !== 'all' && assetType !== 'image',\n },\n // TODO: The Media API currently only knows \"Document\" internally which is not a valid mimetype\n document: {\n value: 'document',\n label: translate('typeFilter.mediaType.values.document', 'Document'),\n icon: 'file',\n disabled: assetType !== 'all' && assetType !== 'document',\n },\n };\n if (featureFlags.queryAssetUsage) {\n options[UNUSED_FILTER_VALUE] = {\n value: UNUSED_FILTER_VALUE,\n label: translate('typeFilter.mediaType.values.unused', 'Unused'),\n icon: 'fab fa-creative-commons-zero',\n disabled: assetType !== 'all',\n };\n }\n return options;\n }, [translate, featureFlags, assetType]);\n if (![state_2.MainViewState.DEFAULT, state_2.MainViewState.UNUSED_ASSETS].includes(mainView))\n return null;\n return (React.createElement(\"div\", { className: classes.typeFilter },\n React.createElement(react_ui_components_1.SelectBox, { className: classes.selectBox, options: Object.values(mediaTypeOptions), onValueChange: onValueChange, value: currentValue, allowEmpty: assetType === 'all', placeholderIcon: \"photo-video\", placeholder: translate('typeFilter.mediaType.values.all', 'All'), optionValueField: \"value\" })));\n};\nexports.default = React.memo(TypeFilter);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"../../hooks\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n viewModeSelector: {\n display: 'flex',\n alignItems: 'baseline',\n '& label': {\n marginRight: theme.spacing.quarter,\n },\n },\n selectBox: {\n minWidth: 'auto',\n },\n}); });\nvar ViewModeSelector = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var _a = hooks_1.useViewModeSelection(), viewModeSelection = _a[0], setViewModeSelection = _a[1];\n return (React.createElement(\"div\", { className: classes.viewModeSelector },\n React.createElement(react_ui_components_1.IconButton, { icon: viewModeSelection === hooks_1.VIEW_MODES.List ? 'th' : 'th-list', size: \"regular\", title: translate(\"viewModeSelector.viewMode.\" + (viewModeSelection === hooks_1.VIEW_MODES.List ? hooks_1.VIEW_MODES.Thumbnails : hooks_1.VIEW_MODES.List), \"Switch mode\"), style: \"neutral\", hoverStyle: \"brand\", onClick: function () {\n return setViewModeSelection(viewModeSelection === hooks_1.VIEW_MODES.List ? hooks_1.VIEW_MODES.Thumbnails : hooks_1.VIEW_MODES.List);\n } })));\n};\nexports.default = React.memo(ViewModeSelector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar src_3 = require(\"@media-ui/feature-asset-preview/src\");\nvar AssetActions = function (_a) {\n var _b;\n var asset = _a.asset;\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var handleDeleteAsset = src_1.useMediaUi().handleDeleteAsset;\n var setSelectedAssetForPreview = recoil_1.useSetRecoilState(src_3.selectedAssetForPreviewState);\n var importAsset = hooks_1.useImportAsset().importAsset;\n var toggleClipboardState = src_2.useClipboard().toggleClipboardState;\n // TODO: Optimize rendering this component when hooks change, as it takes quite a bit of time\n var onImportAsset = react_1.useCallback(function () {\n importAsset({ assetId: asset.id, assetSourceId: asset.assetSource.id })\n .then(function () {\n Notify.ok(translate('assetActions.import.success', 'Asset was successfully imported'));\n })\n .catch(function (error) {\n Notify.error(translate('assetActions.import.error', 'Failed to import asset'), error.message);\n });\n }, [importAsset, asset, Notify, translate]);\n return (React.createElement(React.Fragment, null,\n React.createElement(react_ui_components_1.IconButton, { title: translate('itemActions.preview', 'Preview asset'), icon: \"expand-alt\", size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", onClick: function () { return setSelectedAssetForPreview({ assetId: asset.id, assetSourceId: asset.assetSource.id }); } }),\n !asset.imported && !asset.localId && (React.createElement(react_ui_components_1.IconButton, { title: translate('itemActions.import', 'Import asset'), icon: \"cloud-download-alt\", size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", onClick: onImportAsset })),\n !asset.assetSource.readOnly && (React.createElement(react_ui_components_1.IconButton, { title: asset.isInUse\n ? translate('itemActions.delete.disabled', 'Cannot delete an asset that is in use')\n : translate('itemActions.delete', 'Delete asset'), disabled: asset.isInUse, icon: \"trash\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\", onClick: function () { return handleDeleteAsset(asset); } })),\n ((_b = asset.file) === null || _b === void 0 ? void 0 : _b.url) && (React.createElement(\"a\", { href: asset.file.url, download: true, title: translate('itemActions.download', 'Download asset') },\n React.createElement(react_ui_components_1.IconButton, { icon: \"download\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\" }))),\n asset.localId && (React.createElement(react_ui_components_1.IconButton, { title: translate('itemActions.copyToClipboard', 'Copy to clipboard'), icon: asset.isInClipboard ? 'clipboard-check' : 'clipboard', size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", className: asset.isInClipboard ? 'button--active' : '', onClick: function () { return toggleClipboardState({ assetId: asset.id, assetSourceId: asset.assetSource.id }); } }))));\n};\nexports.default = React.memo(AssetActions);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_2 = require(\"@media-ui/feature-asset-preview/src\");\nvar index_1 = require(\"./index\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n listView: function (_a) {\n var isInNodeCreationDialog = _a.isInNodeCreationDialog;\n return ({\n height: isInNodeCreationDialog ? '100%' : 'auto',\n '& table': {\n borderSpacing: '0 1px',\n width: '100%',\n '& th': {\n textAlign: 'left',\n lineHeight: theme.spacing.goldenUnit,\n padding: \"0 \" + theme.spacing.half,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n userSelect: 'none',\n '&:first-child, &:last-child': {\n padding: 0,\n },\n },\n },\n });\n },\n tableHeader: {\n position: 'sticky',\n backgroundColor: 'var(--grayDark)',\n top: '0px',\n zIndex: '1',\n },\n}); });\nvar ListView = function (_a) {\n var assetIdentities = _a.assetIdentities;\n var isInNodeCreationDialog = src_1.useMediaUi().isInNodeCreationDialog;\n var classes = useStyles({ isInNodeCreationDialog: isInNodeCreationDialog });\n var translate = src_1.useIntl().translate;\n var setSelectedAssetForPreview = recoil_1.useSetRecoilState(src_2.selectedAssetForPreviewState);\n var selectAsset = hooks_1.useSelectAsset();\n var onSelect = react_1.useCallback(function (assetIdentity, openPreview) {\n if (openPreview === void 0) { openPreview = false; }\n if (openPreview) {\n setSelectedAssetForPreview(assetIdentity);\n }\n else {\n selectAsset(assetIdentity);\n }\n }, [setSelectedAssetForPreview, selectAsset]);\n return (React.createElement(\"section\", { className: classes.listView },\n React.createElement(\"table\", null,\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"th\", { className: classes.tableHeader }),\n React.createElement(\"th\", { className: classes.tableHeader }, translate('thumbnailView.header.name', 'Name')),\n React.createElement(\"th\", { className: classes.tableHeader }, translate('thumbnailView.header.lastModified', 'Last Modified')),\n React.createElement(\"th\", { className: classes.tableHeader }, translate('thumbnailView.header.fileSize', 'File size')),\n React.createElement(\"th\", { className: classes.tableHeader }, translate('thumbnailView.header.mediaType', 'Type')),\n React.createElement(\"th\", { className: classes.tableHeader }))),\n React.createElement(\"tbody\", null, assetIdentities.map(function (assetIdentity, index) { return (React.createElement(index_1.ListViewItem, { key: index, assetIdentity: assetIdentity, onSelect: onSelect })); })))));\n};\nexports.default = React.memo(ListView);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar helper_1 = require(\"@media-ui/core/src/helper\");\nvar index_1 = require(\"./index\");\nvar Presentation_1 = require(\"../Presentation\");\nvar MissingAssetActions_1 = __importDefault(require(\"./MissingAssetActions\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n listViewItem: {\n backgroundColor: theme.colors.mainBackground,\n '&:nth-of-type(2n)': {\n backgroundColor: theme.colors.alternatingBackground,\n },\n '&:hover': {\n backgroundColor: theme.colors.primary,\n },\n },\n selected: {\n backgroundColor: theme.colors.primary,\n '&:nth-of-type(2n)': {\n backgroundColor: theme.colors.primary,\n },\n },\n textColumn: {\n padding: \"0 \" + theme.spacing.half,\n whiteSpace: 'nowrap',\n userSelect: 'none',\n cursor: 'pointer',\n width: '1px',\n '& > *': {\n verticalAlign: 'middle',\n },\n },\n previewColumn: {\n minWidth: theme.spacing.goldenUnit,\n width: theme.spacing.goldenUnit,\n cursor: 'pointer',\n '& picture': {\n display: 'block',\n width: '100%',\n height: theme.spacing.goldenUnit,\n textAlign: 'center',\n '& img, & svg': {\n display: 'inline-block',\n width: '100%',\n height: '100%',\n objectFit: 'contain',\n },\n },\n },\n labelColumn: {\n extend: 'textColumn',\n display: 'table',\n tableLayout: 'fixed',\n width: '100%',\n lineHeight: theme.spacing.goldenUnit,\n userSelect: 'text',\n '& > *': {\n width: '100%',\n },\n },\n lastModifiedColumn: {\n extend: 'textColumn',\n },\n fileSizeColumn: {\n extend: 'textColumn',\n },\n mediaTypeColumn: {\n extend: 'textColumn',\n maxWidth: '100px',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n actionsColumn: {\n extend: 'textColumn',\n textAlign: 'right',\n },\n}); });\nvar dateFormatOptions = {\n weekday: 'short',\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n};\nvar ListViewItem = function (_a) {\n var assetIdentity = _a.assetIdentity, onSelect = _a.onSelect;\n var classes = useStyles();\n var _b = src_1.useMediaUi(), dummyImage = _b.dummyImage, isAssetSelectable = _b.isAssetSelectable;\n var _c = hooks_1.useAssetQuery(assetIdentity), asset = _c.asset, loading = _c.loading;\n var selectedAssetId = recoil_1.useRecoilState(state_1.selectedAssetIdState)[0];\n var isSelected = (selectedAssetId === null || selectedAssetId === void 0 ? void 0 : selectedAssetId.assetId) === assetIdentity.assetId;\n var canBeSelected = react_1.useMemo(function () { return isAssetSelectable(asset); }, [asset, isAssetSelectable]);\n var onSelectItem = react_1.useCallback(function () { return onSelect(assetIdentity, isSelected); }, [onSelect, assetIdentity, isSelected]);\n return (React.createElement(\"tr\", { className: [classes.listViewItem, isSelected ? classes.selected : ''].join(' ') },\n React.createElement(\"td\", { className: classes.previewColumn, onClick: onSelectItem },\n React.createElement(\"picture\", null, canBeSelected ? (React.createElement(\"img\", { src: (asset === null || asset === void 0 ? void 0 : asset.thumbnailUrl) || dummyImage, alt: asset === null || asset === void 0 ? void 0 : asset.label, width: 40, height: 36 })) : (React.createElement(react_ui_components_1.Icon, { icon: \"ban\", color: \"error\" })))),\n React.createElement(\"td\", { className: classes.labelColumn, onClick: onSelectItem }, asset && React.createElement(Presentation_1.AssetLabel, { label: asset.label })),\n React.createElement(\"td\", { className: classes.lastModifiedColumn, onClick: onSelectItem }, asset && new Date(asset.lastModified).toLocaleString([], dateFormatOptions)),\n React.createElement(\"td\", { className: classes.fileSizeColumn, onClick: onSelectItem }, asset && helper_1.humanFileSize(asset.file.size)),\n React.createElement(\"td\", { className: classes.mediaTypeColumn, onClick: onSelectItem, title: asset === null || asset === void 0 ? void 0 : asset.file.mediaType }, asset === null || asset === void 0 ? void 0 : asset.file.mediaType),\n React.createElement(\"td\", { className: classes.actionsColumn }, !loading &&\n (asset ? React.createElement(index_1.AssetActions, { asset: asset }) : React.createElement(MissingAssetActions_1.default, { assetIdentity: assetIdentity })))));\n};\nexports.default = React.memo(ListViewItem, function (prev, next) { return prev.assetIdentity.assetId === next.assetIdentity.assetId; });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar src_3 = require(\"@media-ui/feature-asset-usage/src\");\nvar hooks_1 = require(\"../../hooks\");\nvar index_1 = require(\"./index\");\nvar LoadingLabel_1 = __importDefault(require(\"../LoadingLabel\"));\nvar state_1 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n emptyStateWrapper: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: 'inherit',\n },\n});\nvar Main = function () {\n var classes = useStyles();\n var viewModeSelection = hooks_1.useViewModeSelection()[0];\n var assets = src_1.useMediaUi().assets;\n var unusedAssets = src_3.useUnusedAssetsQuery().assets;\n var clipboard = src_2.useClipboard().clipboard;\n var mainView = recoil_1.useRecoilValue(state_1.mainViewState);\n var setClipboardVisible = recoil_1.useSetRecoilState(src_2.clipboardVisibleState);\n var translate = src_1.useIntl().translate;\n var _a = react_1.useState([]), assetIdentities = _a[0], setAssetIdentities = _a[1];\n var queriedAssets = react_1.useMemo(function () {\n return assets\n .filter(function (asset) { return asset === null || asset === void 0 ? void 0 : asset.id; })\n .map(function (_a) {\n var id = _a.id, assetSource = _a.assetSource;\n return { assetId: id, assetSourceId: assetSource.id };\n });\n }, [assets]);\n var queriedUnusedAssets = react_1.useMemo(function () {\n return unusedAssets\n .filter(function (asset) { return asset === null || asset === void 0 ? void 0 : asset.id; })\n .map(function (_a) {\n var id = _a.id, assetSource = _a.assetSource;\n return { assetId: id, assetSourceId: assetSource.id };\n });\n }, [unusedAssets]);\n react_1.useEffect(function () {\n if (mainView === state_1.MainViewState.CLIPBOARD) {\n setAssetIdentities(Object.values(clipboard));\n }\n else if (mainView === state_1.MainViewState.UNUSED_ASSETS) {\n setAssetIdentities(queriedUnusedAssets);\n }\n else {\n setAssetIdentities(queriedAssets);\n }\n }, [mainView, queriedAssets, queriedUnusedAssets, clipboard, setAssetIdentities]);\n return assetIdentities.length > 0 ? (viewModeSelection === hooks_1.VIEW_MODES.List ? (React.createElement(index_1.ListView, { assetIdentities: assetIdentities })) : (React.createElement(index_1.ThumbnailView, { assetIdentities: assetIdentities }))) : (React.createElement(\"div\", { className: classes.emptyStateWrapper }, mainView === state_1.MainViewState.CLIPBOARD ? (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: \"brand\", hoverStyle: \"brand\", onClick: function () { return setClipboardVisible(false); } }, translate('clipboard.close', 'Close clipboard'))) : (React.createElement(LoadingLabel_1.default, { loadingText: translate('assetList.loading', 'Loading assets'), emptyText: translate('assetList.empty', 'No assets found') }))));\n};\nexports.default = React.memo(Main);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n loadingLabel: {},\n});\nvar LoadingLabel = function (_a) {\n var loadingText = _a.loadingText, emptyText = _a.emptyText;\n var classes = useStyles();\n var isLoading = recoil_1.useRecoilValue(state_1.loadingState);\n return React.createElement(\"div\", { className: classes.loadingLabel }, isLoading ? loadingText : emptyText);\n};\nexports.default = React.memo(LoadingLabel);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar index_1 = require(\"./index\");\nvar Presentation_1 = require(\"../Presentation\");\nvar MissingAssetActions_1 = __importDefault(require(\"./MissingAssetActions\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n thumbnail: {\n margin: '0',\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n '&:hover $caption': {\n backgroundColor: theme.colors.primary,\n },\n '&:hover $toolBar': {\n pointerEvents: 'all',\n backgroundColor: 'rgba(0.15, 0.15, 0.15, 0.25)',\n '& button': {\n opacity: 1,\n '&[disabled]': {\n opacity: 0.5,\n },\n '&.button--active': {\n '& svg': {\n color: 'white',\n },\n },\n },\n },\n },\n picture: {\n cursor: 'pointer',\n height: '250px',\n display: 'flex',\n alignItems: 'center',\n alignContent: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.assetBackground,\n '& img': {\n display: 'block',\n backgroundImage: 'repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)',\n backgroundPosition: '0 0, 10px 10px',\n backgroundSize: '20px 20px',\n maxHeight: '250px',\n },\n },\n caption: {\n backgroundColor: theme.colors.captionBackground,\n transition: \"background-color \" + theme.transition.fast,\n padding: theme.spacing.half,\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n '& img, & svg': {\n width: '1.3rem',\n height: 'auto',\n marginRight: theme.spacing.half,\n },\n },\n selected: {\n backgroundColor: theme.colors.primary,\n },\n toolBar: {\n display: 'flex',\n position: 'absolute',\n top: theme.spacing.quarter,\n right: theme.spacing.quarter,\n pointerEvents: 'none',\n backgroundColor: 'transparent',\n transition: 'background-color .1s ease-in',\n '& button, & button[disabled]': {\n transition: 'opacity .1s ease-in',\n opacity: 0,\n '&.button--active': {\n opacity: 1,\n '& svg': {\n color: theme.colors.primary,\n },\n },\n },\n },\n label: {\n position: 'absolute',\n top: theme.spacing.quarter,\n left: theme.spacing.quarter,\n fontSize: theme.fontSize.small,\n borderRadius: '3px',\n padding: '2px 4px',\n userSelect: 'none',\n },\n disabled: {\n '& $picture': {\n filter: 'grayscale(1)',\n cursor: 'not-allowed',\n },\n },\n}); });\nvar Thumbnail = function (_a) {\n var assetIdentity = _a.assetIdentity, onSelect = _a.onSelect;\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var _b = src_1.useMediaUi(), dummyImage = _b.dummyImage, isAssetSelectable = _b.isAssetSelectable;\n var _c = hooks_1.useAssetQuery(assetIdentity), asset = _c.asset, loading = _c.loading;\n var selectedAssetId = recoil_1.useRecoilValue(state_1.selectedAssetIdState);\n var isSelected = (selectedAssetId === null || selectedAssetId === void 0 ? void 0 : selectedAssetId.assetId) === assetIdentity.assetId;\n var canBeSelected = react_1.useMemo(function () { return isAssetSelectable(asset); }, [asset, isAssetSelectable]);\n return (React.createElement(\"figure\", { className: [classes.thumbnail, !canBeSelected && classes.disabled].join(' '), title: asset === null || asset === void 0 ? void 0 : asset.label },\n (asset === null || asset === void 0 ? void 0 : asset.imported) && React.createElement(\"span\", { className: classes.label }, translate('asset.label.imported', 'Imported')),\n React.createElement(\"picture\", { onClick: function () { return onSelect(assetIdentity, isSelected); }, className: classes.picture },\n React.createElement(\"img\", { src: loading || !asset ? dummyImage : asset.thumbnailUrl, alt: asset === null || asset === void 0 ? void 0 : asset.label })),\n React.createElement(\"figcaption\", { className: [classes.caption, isSelected ? classes.selected : ''].join(' ') }, asset && (React.createElement(React.Fragment, null,\n canBeSelected && asset.file ? (React.createElement(\"img\", { src: asset.file.typeIcon.url, alt: asset.file.typeIcon.alt })) : (React.createElement(react_ui_components_1.Icon, { icon: \"ban\", color: \"error\" })),\n React.createElement(Presentation_1.AssetLabel, { label: asset.label })))),\n React.createElement(\"div\", { className: classes.toolBar }, !loading &&\n (asset ? React.createElement(index_1.AssetActions, { asset: asset }) : React.createElement(MissingAssetActions_1.default, { assetIdentity: assetIdentity })))));\n};\nexports.default = React.memo(Thumbnail, function (prev, next) { return prev.assetIdentity.assetId === next.assetIdentity.assetId; });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_2 = require(\"@media-ui/feature-asset-preview/src\");\nvar index_1 = require(\"./index\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n thumbnailView: {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',\n gridGap: theme.spacing.full,\n },\n}); });\nvar ThumbnailView = function (_a) {\n var assetIdentities = _a.assetIdentities;\n var classes = useStyles();\n var setSelectedAssetForPreview = recoil_1.useSetRecoilState(src_2.selectedAssetForPreviewState);\n var selectAsset = hooks_1.useSelectAsset();\n var onSelect = react_1.useCallback(function (assetIdentity, openPreview) {\n if (openPreview === void 0) { openPreview = false; }\n if (openPreview) {\n setSelectedAssetForPreview(assetIdentity);\n }\n else {\n selectAsset(assetIdentity);\n }\n }, [setSelectedAssetForPreview, selectAsset]);\n return (React.createElement(\"section\", { className: classes.thumbnailView }, assetIdentities.map(function (assetIdentity, index) { return (React.createElement(index_1.Thumbnail, { key: index, assetIdentity: assetIdentity, onSelect: onSelect })); })));\n};\nexports.default = React.memo(ThumbnailView);\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __importDefault(require(\"react\"));\nvar Notify_1 = require(\"@media-ui/core/src/provider/Notify\");\nvar ErrorBoundary = /** @class */ (function (_super) {\n __extends(ErrorBoundary, _super);\n function ErrorBoundary(props) {\n var _this = _super.call(this, props) || this;\n _this.state = { hasError: false };\n return _this;\n }\n ErrorBoundary.getDerivedStateFromError = function () {\n return { hasError: true };\n };\n ErrorBoundary.prototype.componentDidCatch = function (error) {\n this.context.error(error.name, error.message);\n };\n ErrorBoundary.prototype.render = function () {\n if (this.state.hasError) {\n return (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(\"p\", { style: { color: 'red' } }, \"Something went wrong.\"),\n react_1.default.createElement(\"br\", null),\n react_1.default.createElement(\"button\", { className: \"neos-button\", onClick: function () { return window.location.reload(); } }, \"Reload\")));\n }\n return this.props.children;\n };\n ErrorBoundary.contextType = Notify_1.NotifyContext;\n return ErrorBoundary;\n}(react_1.default.Component));\nexports.default = ErrorBoundary;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CreateAssetCollectionDialog = exports.CreateTagDialog = void 0;\nvar CreateTagDialog_1 = __importDefault(require(\"./CreateTagDialog\"));\nexports.CreateTagDialog = CreateTagDialog_1.default;\nvar CreateAssetCollectionDialog_1 = __importDefault(require(\"./CreateAssetCollectionDialog\"));\nexports.CreateAssetCollectionDialog = CreateAssetCollectionDialog_1.default;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar components_1 = require(\"@media-ui/core/src/components\");\nvar state_1 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles(function () { return ({\n formBody: {\n padding: 16,\n },\n}); });\nvar CreateTagDialog = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var _a = recoil_1.useRecoilState(state_1.createTagDialogState), dialogState = _a[0], setDialogState = _a[1];\n var createPossible = !!(dialogState.label && dialogState.label.trim());\n var createTag = hooks_1.useCreateTag().createTag;\n var handleRequestClose = react_1.useCallback(function () { return setDialogState({ visible: false, label: '' }); }, [setDialogState]);\n var handleCreate = react_1.useCallback(function () {\n setDialogState(function (state) { return (__assign(__assign({}, state), { visible: false })); });\n createTag(dialogState.label, selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id)\n .then(function () {\n Notify.ok(translate('assetCollectionActions.create.success', 'Tag was created'));\n })\n .catch(function (error) {\n Notify.error(translate('assetCollectionActions.create.error', 'Failed to create tag'), error.message);\n });\n }, [Notify, setDialogState, createTag, dialogState, translate, selectedAssetCollection]);\n var setLabel = react_1.useCallback(function (label) { return setDialogState(function (state) { return (__assign(__assign({}, state), { label: label })); }); }, [setDialogState]);\n return (React.createElement(components_1.Dialog, { isOpen: dialogState.visible, title: translate('createTagDialog.title', 'Create tag'), onRequestClose: handleRequestClose, actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: handleRequestClose }, translate('general.cancel', 'Cancel')),\n React.createElement(react_ui_components_1.Button, { key: \"upload\", style: \"success\", hoverStyle: \"success\", disabled: !createPossible, onClick: handleCreate }, translate('general.create', 'Create')),\n ] },\n React.createElement(\"div\", { className: classes.formBody },\n React.createElement(react_ui_components_1.Label, null, translate('general.label', 'Label')),\n React.createElement(react_ui_components_1.TextInput, { setFocus: true, type: \"text\", value: dialogState.label, onChange: setLabel, onEnterKey: createPossible ? handleCreate : null }))));\n};\nexports.default = React.memo(CreateTagDialog);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar components_1 = require(\"@media-ui/core/src/components\");\nvar react_1 = require(\"react\");\nvar state_1 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles(function () { return ({\n formBody: {\n padding: 16,\n },\n}); });\nvar CreateAssetCollectionDialog = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var _a = recoil_1.useRecoilState(state_1.createAssetCollectionDialogState), dialogState = _a[0], setDialogState = _a[1];\n var createPossible = !!(dialogState.title && dialogState.title.trim());\n var createAssetCollection = hooks_1.useCreateAssetCollection().createAssetCollection;\n var handleRequestClose = react_1.useCallback(function () { return setDialogState({ title: '', visible: false }); }, [setDialogState]);\n var handleCreate = react_1.useCallback(function () {\n setDialogState(function (state) { return (__assign(__assign({}, state), { visible: false })); });\n createAssetCollection(dialogState.title)\n .then(function () {\n Notify.ok(translate('assetCollectionActions.create.success', 'Asset collection was created'));\n })\n .catch(function (error) {\n Notify.error(translate('assetCollectionActions.create.error', 'Failed to create asset collection'), error.message);\n });\n }, [Notify, setDialogState, createAssetCollection, dialogState, translate]);\n var setTitle = react_1.useCallback(function (title) { return setDialogState(function (state) { return (__assign(__assign({}, state), { title: title })); }); }, [setDialogState]);\n return (React.createElement(components_1.Dialog, { isOpen: dialogState.visible, title: translate('createAssetCollectionDialog.title', 'Create Asset Collection'), onRequestClose: handleRequestClose, actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: handleRequestClose }, translate('general.cancel', 'Cancel')),\n React.createElement(react_ui_components_1.Button, { key: \"upload\", style: \"success\", hoverStyle: \"success\", disabled: !createPossible, onClick: handleCreate }, translate('general.create', 'Create')),\n ] },\n React.createElement(\"div\", { className: classes.formBody },\n React.createElement(react_ui_components_1.Label, null, translate('general.title', 'Title')),\n React.createElement(react_ui_components_1.TextInput, { setFocus: true, type: \"text\", value: dialogState.title, onChange: setTitle, onEnterKey: createPossible ? handleCreate : null }))));\n};\nexports.default = React.memo(CreateAssetCollectionDialog);\n","module.exports = \"directive @client(always: Boolean!) on FIELD\\n\\ndirective @export(as: String!) on FIELD\\n\\ntype AssetIdentity {\\n id: AssetId!\\n assetSourceId: AssetSourceId!\\n}\\n\\nextend type Query {\\n selectedAssetSourceId: String\\n viewModeSelection: String\\n}\\n\\nextend type Mutation {\\n setSelectedAssetSourceId(selectedAssetSourceId: String): String\\n setViewModeSelection(viewModeSelection: String): String\\n}\\n\"","module.exports = \"extend type Query {\\n clipboard: [AssetIdentity]!\\n}\\n\\nextend type Asset {\\n isInClipboard: Boolean!\\n}\\n\\nextend type Mutation {\\n toggleClipboardState(assetId: AssetId!, assetSourceId: AssetSourceId!, force: Boolean): [AssetIdentity]!\\n}\\n\"","module.exports = \"extend type Query {\\n includeUsage: Boolean!\\n}\\n\\nextend type Mutation {\\n includeUsage: Boolean!\\n}\\n\"","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar buildResolvers = function (updateLocalState) {\n return {\n Mutation: {\n setSelectedAssetSourceId: function (_, _a, _b) {\n var selectedAssetSourceId = _a.selectedAssetSourceId;\n var cache = _b.cache;\n updateLocalState({ selectedAssetSourceId: selectedAssetSourceId }, cache);\n return selectedAssetSourceId;\n },\n setViewModeSelection: function (_, _a, _b) {\n var viewModeSelection = _a.viewModeSelection;\n var cache = _b.cache;\n updateLocalState({ viewModeSelection: viewModeSelection }, cache);\n return viewModeSelection;\n },\n },\n };\n};\nexports.default = buildResolvers;\n","import React, { createContext } from 'react';\nimport warning from 'tiny-warning';\nimport PropTypes from 'prop-types';\nimport hoist from 'hoist-non-react-statics';\nimport getDisplayName from 'react-display-name';\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object' && !Array.isArray(obj);\n}\n\nfunction createThemeProvider(context) {\n var ThemeProvider =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(ThemeProvider, _React$Component);\n\n function ThemeProvider() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"cachedTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"lastOuterTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"lastTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"renderProvider\", function (outerTheme) {\n var children = _this.props.children;\n return React.createElement(context.Provider, {\n value: _this.getTheme(outerTheme)\n }, children);\n });\n\n return _this;\n }\n\n var _proto = ThemeProvider.prototype;\n\n // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation\n _proto.getTheme = function getTheme(outerTheme) {\n if (this.props.theme !== this.lastTheme || outerTheme !== this.lastOuterTheme || !this.cachedTheme) {\n this.lastOuterTheme = outerTheme;\n this.lastTheme = this.props.theme;\n\n if (typeof this.lastTheme === 'function') {\n var theme = this.props.theme;\n this.cachedTheme = theme(outerTheme);\n process.env.NODE_ENV !== \"production\" ? warning(isObject(this.cachedTheme), '[ThemeProvider] Please return an object from your theme function') : void 0;\n } else {\n var _theme = this.props.theme;\n process.env.NODE_ENV !== \"production\" ? warning(isObject(_theme), '[ThemeProvider] Please make your theme prop a plain object') : void 0;\n this.cachedTheme = outerTheme ? _extends({}, outerTheme, _theme) : _theme;\n }\n }\n\n return this.cachedTheme;\n };\n\n _proto.render = function render() {\n var children = this.props.children;\n\n if (!children) {\n return null;\n }\n\n return React.createElement(context.Consumer, null, this.renderProvider);\n };\n\n return ThemeProvider;\n }(React.Component);\n\n if (process.env.NODE_ENV !== 'production') {\n ThemeProvider.propTypes = {\n // eslint-disable-next-line react/require-default-props\n children: PropTypes.node,\n theme: PropTypes.oneOfType([PropTypes.shape({}), PropTypes.func]).isRequired\n };\n }\n\n return ThemeProvider;\n}\n\nfunction createWithTheme(context) {\n return function hoc(Component) {\n var withTheme = React.forwardRef(function (props, ref) {\n return React.createElement(context.Consumer, null, function (theme) {\n process.env.NODE_ENV !== \"production\" ? warning(isObject(theme), '[theming] Please use withTheme only with the ThemeProvider') : void 0;\n return React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n });\n });\n\n if (process.env.NODE_ENV !== 'production') {\n withTheme.displayName = \"WithTheme(\" + getDisplayName(Component) + \")\";\n }\n\n hoist(withTheme, Component);\n return withTheme;\n };\n}\n\nfunction createUseTheme(context) {\n var useTheme = function useTheme() {\n var theme = React.useContext(context);\n process.env.NODE_ENV !== \"production\" ? warning(isObject(theme), '[theming] Please use useTheme only with the ThemeProvider') : void 0;\n return theme;\n };\n\n return useTheme;\n}\n\nfunction createTheming(context) {\n return {\n context: context,\n withTheme: createWithTheme(context),\n useTheme: createUseTheme(context),\n ThemeProvider: createThemeProvider(context)\n };\n}\n\nvar ThemeContext = createContext();\n\nvar _createTheming = createTheming(ThemeContext),\n withTheme = _createTheming.withTheme,\n ThemeProvider = _createTheming.ThemeProvider,\n useTheme = _createTheming.useTheme;\n\nexport { useTheme, ThemeContext, withTheme, createTheming, ThemeProvider };\n","import warning from 'tiny-warning';\nimport { createRule } from 'jss';\n\nvar now = Date.now();\nvar fnValuesNs = \"fnValues\" + now;\nvar fnRuleNs = \"fnStyle\" + ++now;\n\nvar functionPlugin = function functionPlugin() {\n return {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (typeof decl !== 'function') return null;\n var rule = createRule(name, {}, options);\n rule[fnRuleNs] = decl;\n return rule;\n },\n onProcessStyle: function onProcessStyle(style, rule) {\n // We need to extract function values from the declaration, so that we can keep core unaware of them.\n // We need to do that only once.\n // We don't need to extract functions on each style update, since this can happen only once.\n // We don't support function values inside of function rules.\n if (fnValuesNs in rule || fnRuleNs in rule) return style;\n var fnValues = {};\n\n for (var prop in style) {\n var value = style[prop];\n if (typeof value !== 'function') continue;\n delete style[prop];\n fnValues[prop] = value;\n } // $FlowFixMe[prop-missing]\n\n\n rule[fnValuesNs] = fnValues;\n return style;\n },\n onUpdate: function onUpdate(data, rule, sheet, options) {\n var styleRule = rule; // $FlowFixMe[prop-missing]\n\n var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object\n // will be returned from that function.\n\n if (fnRule) {\n // Empty object will remove all currently defined props\n // in case function rule returns a falsy value.\n styleRule.style = fnRule(data) || {};\n\n if (process.env.NODE_ENV === 'development') {\n for (var prop in styleRule.style) {\n if (typeof styleRule.style[prop] === 'function') {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;\n break;\n }\n }\n }\n } // $FlowFixMe[prop-missing]\n\n\n var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.\n\n if (fnValues) {\n for (var _prop in fnValues) {\n styleRule.prop(_prop, fnValues[_prop](data), options);\n }\n }\n }\n };\n};\n\nexport default functionPlugin;\n","import $$observable from 'symbol-observable';\nimport { createRule } from 'jss';\n\nvar isObservable = function isObservable(value) {\n return value && value[$$observable] && value === value[$$observable]();\n};\n\nvar observablePlugin = function observablePlugin(updateOptions) {\n return {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (!isObservable(decl)) return null; // Cast `decl` to `Observable`, since it passed the type guard.\n\n var style$ = decl;\n var rule = createRule(name, {}, options); // TODO\n // Call `stream.subscribe()` returns a subscription, which should be explicitly\n // unsubscribed from when we know this sheet is no longer needed.\n\n style$.subscribe(function (style) {\n for (var prop in style) {\n rule.prop(prop, style[prop], updateOptions);\n }\n });\n return rule;\n },\n onProcessRule: function onProcessRule(rule) {\n if (rule && rule.type !== 'style') return;\n var styleRule = rule;\n var style = styleRule.style;\n\n var _loop = function _loop(prop) {\n var value = style[prop];\n if (!isObservable(value)) return \"continue\";\n delete style[prop];\n value.subscribe({\n next: function next(nextValue) {\n styleRule.prop(prop, nextValue, updateOptions);\n }\n });\n };\n\n for (var prop in style) {\n var _ret = _loop(prop);\n\n if (_ret === \"continue\") continue;\n }\n }\n };\n};\n\nexport default observablePlugin;\n","import warning from 'tiny-warning';\n\nvar semiWithNl = /;\\n/;\n\n/**\n * Naive CSS parser.\n * - Supports only rule body (no selectors)\n * - Requires semicolon and new line after the value (except of last line)\n * - No nested rules support\n */\nvar parse = function parse(cssText) {\n var style = {};\n var split = cssText.split(semiWithNl);\n\n for (var i = 0; i < split.length; i++) {\n var decl = (split[i] || '').trim();\n if (!decl) continue;\n var colonIndex = decl.indexOf(':');\n\n if (colonIndex === -1) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Malformed CSS string \\\"\" + decl + \"\\\"\") : void 0;\n continue;\n }\n\n var prop = decl.substr(0, colonIndex).trim();\n var value = decl.substr(colonIndex + 1).trim();\n style[prop] = value;\n }\n\n return style;\n};\n\nvar onProcessRule = function onProcessRule(rule) {\n if (typeof rule.style === 'string') {\n // $FlowFixMe[prop-missing] We can safely assume that rule has the style property\n rule.style = parse(rule.style);\n }\n};\n\nfunction templatePlugin() {\n return {\n onProcessRule: onProcessRule\n };\n}\n\nexport default templatePlugin;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport { RuleList } from 'jss';\n\nvar at = '@global';\nvar atPrefix = '@global ';\n\nvar GlobalContainerRule =\n/*#__PURE__*/\nfunction () {\n function GlobalContainerRule(key, styles, options) {\n this.type = 'global';\n this.at = at;\n this.rules = void 0;\n this.options = void 0;\n this.key = void 0;\n this.isProcessed = false;\n this.key = key;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var selector in styles) {\n this.rules.add(selector, styles[selector]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = GlobalContainerRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (rule) this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString() {\n return this.rules.toString();\n };\n\n return GlobalContainerRule;\n}();\n\nvar GlobalPrefixedRule =\n/*#__PURE__*/\nfunction () {\n function GlobalPrefixedRule(key, style, options) {\n this.type = 'global';\n this.at = at;\n this.options = void 0;\n this.rule = void 0;\n this.isProcessed = false;\n this.key = void 0;\n this.key = key;\n this.options = options;\n var selector = key.substr(atPrefix.length);\n this.rule = options.jss.createRule(selector, style, _extends({}, options, {\n parent: this\n }));\n }\n\n var _proto2 = GlobalPrefixedRule.prototype;\n\n _proto2.toString = function toString(options) {\n return this.rule ? this.rule.toString(options) : '';\n };\n\n return GlobalPrefixedRule;\n}();\n\nvar separatorRegExp = /\\s*,\\s*/g;\n\nfunction addScope(selector, scope) {\n var parts = selector.split(separatorRegExp);\n var scoped = '';\n\n for (var i = 0; i < parts.length; i++) {\n scoped += scope + \" \" + parts[i].trim();\n if (parts[i + 1]) scoped += ', ';\n }\n\n return scoped;\n}\n\nfunction handleNestedGlobalContainerRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n var rules = style ? style[at] : null;\n if (!rules) return;\n\n for (var name in rules) {\n sheet.addRule(name, rules[name], _extends({}, options, {\n selector: addScope(name, rule.selector)\n }));\n }\n\n delete style[at];\n}\n\nfunction handlePrefixedGlobalRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n\n for (var prop in style) {\n if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;\n var selector = addScope(prop.substr(at.length), rule.selector);\n sheet.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n delete style[prop];\n }\n}\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssGlobal() {\n function onCreateRule(name, styles, options) {\n if (!name) return null;\n\n if (name === at) {\n return new GlobalContainerRule(name, styles, options);\n }\n\n if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {\n return new GlobalPrefixedRule(name, styles, options);\n }\n\n var parent = options.parent;\n\n if (parent) {\n if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {\n options.scoped = false;\n }\n }\n\n if (options.scoped === false) {\n options.selector = name;\n }\n\n return null;\n }\n\n function onProcessRule(rule, sheet) {\n if (rule.type !== 'style' || !sheet) return;\n handleNestedGlobalContainerRule(rule, sheet);\n handlePrefixedGlobalRule(rule, sheet);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}\n\nexport default jssGlobal;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport warning from 'tiny-warning';\n\nvar isObject = function isObject(obj) {\n return obj && typeof obj === 'object' && !Array.isArray(obj);\n};\n\nvar valueNs = \"extendCurrValue\" + Date.now();\n\nfunction mergeExtend(style, rule, sheet, newStyle) {\n var extendType = typeof style.extend; // Extend using a rule name.\n\n if (extendType === 'string') {\n if (!sheet) return;\n var refRule = sheet.getRule(style.extend);\n if (!refRule) return;\n\n if (refRule === rule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] A rule tries to extend itself \\n\" + rule.toString()) : void 0;\n return;\n }\n\n var parent = refRule.options.parent;\n\n if (parent) {\n var originalStyle = parent.rules.raw[style.extend];\n extend(originalStyle, rule, sheet, newStyle);\n }\n\n return;\n } // Extend using an array.\n\n\n if (Array.isArray(style.extend)) {\n for (var index = 0; index < style.extend.length; index++) {\n var singleExtend = style.extend[index];\n var singleStyle = typeof singleExtend === 'string' ? _extends({}, style, {\n extend: singleExtend\n }) : style.extend[index];\n extend(singleStyle, rule, sheet, newStyle);\n }\n\n return;\n } // Extend is a style object.\n\n\n for (var prop in style.extend) {\n if (prop === 'extend') {\n extend(style.extend.extend, rule, sheet, newStyle);\n continue;\n }\n\n if (isObject(style.extend[prop])) {\n if (!(prop in newStyle)) newStyle[prop] = {};\n extend(style.extend[prop], rule, sheet, newStyle[prop]);\n continue;\n }\n\n newStyle[prop] = style.extend[prop];\n }\n}\n\nfunction mergeRest(style, rule, sheet, newStyle) {\n // Copy base style.\n for (var prop in style) {\n if (prop === 'extend') continue;\n\n if (isObject(newStyle[prop]) && isObject(style[prop])) {\n extend(style[prop], rule, sheet, newStyle[prop]);\n continue;\n }\n\n if (isObject(style[prop])) {\n newStyle[prop] = extend(style[prop], rule, sheet);\n continue;\n }\n\n newStyle[prop] = style[prop];\n }\n}\n/**\n * Recursively extend styles.\n */\n\n\nfunction extend(style, rule, sheet, newStyle) {\n if (newStyle === void 0) {\n newStyle = {};\n }\n\n mergeExtend(style, rule, sheet, newStyle);\n mergeRest(style, rule, sheet, newStyle);\n return newStyle;\n}\n/**\n * Handle `extend` property.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssExtend() {\n function onProcessStyle(style, rule, sheet) {\n if ('extend' in style) return extend(style, rule, sheet);\n return style;\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop !== 'extend') return value; // Value is empty, remove properties set previously.\n\n if (value == null || value === false) {\n // $FlowFixMe[prop-missing]\n for (var key in rule[valueNs]) {\n rule.prop(key, null);\n } // $FlowFixMe[prop-missing] Flow complains because there is no indexer property in StyleRule\n\n\n rule[valueNs] = null;\n return null;\n }\n\n if (typeof value === 'object') {\n // $FlowFixMe[invalid-in-rhs] This will be an object\n for (var _key in value) {\n // $FlowFixMe[incompatible-use] This will be an object\n rule.prop(_key, value[_key]);\n } // $FlowFixMe[prop-missing] Flow complains because there is no indexer property in StyleRule\n\n\n rule[valueNs] = value;\n } // Make sure we don't set the value in the core.\n\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default jssExtend;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport warning from 'tiny-warning';\n\nvar separatorRegExp = /\\s*,\\s*/g;\nvar parentRegExp = /&/g;\nvar refRegExp = /\\$([\\w-]+)/g;\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\nfunction jssNested() {\n // Get a function to be used for $ref replacement.\n function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : void 0;\n return key;\n };\n }\n\n function replaceParentRefs(nestedProp, parentProp) {\n var parentSelectors = parentProp.split(separatorRegExp);\n var nestedSelectors = nestedProp.split(separatorRegExp);\n var result = '';\n\n for (var i = 0; i < parentSelectors.length; i++) {\n var parent = parentSelectors[i];\n\n for (var j = 0; j < nestedSelectors.length; j++) {\n var nested = nestedSelectors[j];\n if (result) result += ', '; // Replace all & by the parent or prefix & with the parent.\n\n result += nested.indexOf('&') !== -1 ? nested.replace(parentRegExp, parent) : parent + \" \" + nested;\n }\n }\n\n return result;\n }\n\n function getOptions(rule, container, prevOptions) {\n // Options has been already created, now we only increase index.\n if (prevOptions) return _extends({}, prevOptions, {\n index: prevOptions.index + 1 // $FlowFixMe[prop-missing]\n\n });\n var nestingLevel = rule.options.nestingLevel;\n nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;\n\n var options = _extends({}, rule.options, {\n nestingLevel: nestingLevel,\n index: container.indexOf(rule) + 1 // We don't need the parent name to be set options for chlid.\n\n });\n\n delete options.name;\n return options;\n }\n\n function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style') return style;\n var styleRule = rule;\n var container = styleRule.options.parent;\n var options;\n var replaceRef;\n\n for (var prop in style) {\n var isNested = prop.indexOf('&') !== -1;\n var isNestedConditional = prop[0] === '@';\n if (!isNested && !isNestedConditional) continue;\n options = getOptions(styleRule, container, options);\n\n if (isNested) {\n var selector = replaceParentRefs(prop, styleRule.selector); // Lazily create the ref replacer function just once for\n // all nested rules within the sheet.\n\n if (!replaceRef) replaceRef = getReplaceRef(container, sheet); // Replace all $refs.\n\n selector = selector.replace(refRegExp, replaceRef);\n container.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n } else if (isNestedConditional) {\n // Place conditional right after the parent rule to ensure right ordering.\n container.addRule(prop, {}, options) // Flow expects more options but they aren't required\n // And flow doesn't know this will always be a StyleRule which has the addRule method\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n .addRule(styleRule.key, style[prop], {\n selector: styleRule.selector\n });\n }\n\n delete style[prop];\n }\n\n return style;\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssNested;\n","import warning from 'tiny-warning';\n\n/**\n * Set selector.\n *\n * @param {Object} original rule\n * @param {String} className class string\n * @return {Boolean} flag, indicating function was successfull or not\n */\nfunction registerClass(rule, className) {\n // Skip falsy values\n if (!className) return true; // Support array of class names `{composes: ['foo', 'bar']}`\n\n if (Array.isArray(className)) {\n for (var index = 0; index < className.length; index++) {\n var isSetted = registerClass(rule, className[index]);\n if (!isSetted) return false;\n }\n\n return true;\n } // Support space separated class names `{composes: 'foo bar'}`\n\n\n if (className.indexOf(' ') > -1) {\n return registerClass(rule, className.split(' '));\n }\n\n var _ref = rule.options,\n parent = _ref.parent; // It is a ref to a local rule.\n\n if (className[0] === '$') {\n var refRule = parent.getRule(className.substr(1));\n\n if (!refRule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced rule is not defined. \\n\" + rule.toString()) : void 0;\n return false;\n }\n\n if (refRule === rule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Cyclic composition detected. \\n\" + rule.toString()) : void 0;\n return false;\n }\n\n parent.classes[rule.key] += \" \" + parent.classes[refRule.key];\n return true;\n }\n\n parent.classes[rule.key] += \" \" + className;\n return true;\n}\n/**\n * Convert compose property to additional class, remove property from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssCompose() {\n function onProcessStyle(style, rule) {\n if (!('composes' in style)) return style;\n registerClass(rule, style.composes); // Remove composes property to prevent infinite loop.\n\n delete style.composes;\n return style;\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssCompose;\n","/* eslint-disable no-var, prefer-template */\nvar uppercasePattern = /[A-Z]/g\nvar msPattern = /^ms-/\nvar cache = {}\n\nfunction toHyphenLower(match) {\n return '-' + match.toLowerCase()\n}\n\nfunction hyphenateStyleName(name) {\n if (cache.hasOwnProperty(name)) {\n return cache[name]\n }\n\n var hName = name.replace(uppercasePattern, toHyphenLower)\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)\n}\n\nexport default hyphenateStyleName\n","import hyphenate from 'hyphenate-style-name';\n\n/**\n * Convert camel cased property names to dash separated.\n *\n * @param {Object} style\n * @return {Object}\n */\n\nfunction convertCase(style) {\n var converted = {};\n\n for (var prop in style) {\n var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop);\n converted[key] = style[prop];\n }\n\n if (style.fallbacks) {\n if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);\n }\n\n return converted;\n}\n/**\n * Allow camel cased property names by converting them back to dasherized.\n *\n * @param {Rule} rule\n */\n\n\nfunction camelCase() {\n function onProcessStyle(style) {\n if (Array.isArray(style)) {\n // Handle rules like @font-face, which can have multiple styles in an array\n for (var index = 0; index < style.length; index++) {\n style[index] = convertCase(style[index]);\n }\n\n return style;\n }\n\n return convertCase(style);\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop.indexOf('--') === 0) {\n return value;\n }\n\n var hyphenatedProp = hyphenate(prop); // There was no camel case in place\n\n if (prop === hyphenatedProp) return value;\n rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default camelCase;\n","import { hasCSSTOMSupport } from 'jss';\n\nvar px = hasCSSTOMSupport && CSS ? CSS.px : 'px';\nvar ms = hasCSSTOMSupport && CSS ? CSS.ms : 'ms';\nvar percent = hasCSSTOMSupport && CSS ? CSS.percent : '%';\n/**\n * Generated jss-plugin-default-unit CSS property units\n *\n * @type object\n */\n\nvar defaultUnits = {\n // Animation properties\n 'animation-delay': ms,\n 'animation-duration': ms,\n // Background properties\n 'background-position': px,\n 'background-position-x': px,\n 'background-position-y': px,\n 'background-size': px,\n // Border Properties\n border: px,\n 'border-bottom': px,\n 'border-bottom-left-radius': px,\n 'border-bottom-right-radius': px,\n 'border-bottom-width': px,\n 'border-left': px,\n 'border-left-width': px,\n 'border-radius': px,\n 'border-right': px,\n 'border-right-width': px,\n 'border-top': px,\n 'border-top-left-radius': px,\n 'border-top-right-radius': px,\n 'border-top-width': px,\n 'border-width': px,\n 'border-block': px,\n 'border-block-end': px,\n 'border-block-end-width': px,\n 'border-block-start': px,\n 'border-block-start-width': px,\n 'border-block-width': px,\n 'border-inline': px,\n 'border-inline-end': px,\n 'border-inline-end-width': px,\n 'border-inline-start': px,\n 'border-inline-start-width': px,\n 'border-inline-width': px,\n 'border-start-start-radius': px,\n 'border-start-end-radius': px,\n 'border-end-start-radius': px,\n 'border-end-end-radius': px,\n // Margin properties\n margin: px,\n 'margin-bottom': px,\n 'margin-left': px,\n 'margin-right': px,\n 'margin-top': px,\n 'margin-block': px,\n 'margin-block-end': px,\n 'margin-block-start': px,\n 'margin-inline': px,\n 'margin-inline-end': px,\n 'margin-inline-start': px,\n // Padding properties\n padding: px,\n 'padding-bottom': px,\n 'padding-left': px,\n 'padding-right': px,\n 'padding-top': px,\n 'padding-block': px,\n 'padding-block-end': px,\n 'padding-block-start': px,\n 'padding-inline': px,\n 'padding-inline-end': px,\n 'padding-inline-start': px,\n // Mask properties\n 'mask-position-x': px,\n 'mask-position-y': px,\n 'mask-size': px,\n // Width and height properties\n height: px,\n width: px,\n 'min-height': px,\n 'max-height': px,\n 'min-width': px,\n 'max-width': px,\n // Position properties\n bottom: px,\n left: px,\n top: px,\n right: px,\n inset: px,\n 'inset-block': px,\n 'inset-block-end': px,\n 'inset-block-start': px,\n 'inset-inline': px,\n 'inset-inline-end': px,\n 'inset-inline-start': px,\n // Shadow properties\n 'box-shadow': px,\n 'text-shadow': px,\n // Column properties\n 'column-gap': px,\n 'column-rule': px,\n 'column-rule-width': px,\n 'column-width': px,\n // Font and text properties\n 'font-size': px,\n 'font-size-delta': px,\n 'letter-spacing': px,\n 'text-decoration-thickness': px,\n 'text-indent': px,\n 'text-stroke': px,\n 'text-stroke-width': px,\n 'word-spacing': px,\n // Motion properties\n motion: px,\n 'motion-offset': px,\n // Outline properties\n outline: px,\n 'outline-offset': px,\n 'outline-width': px,\n // Perspective properties\n perspective: px,\n 'perspective-origin-x': percent,\n 'perspective-origin-y': percent,\n // Transform properties\n 'transform-origin': percent,\n 'transform-origin-x': percent,\n 'transform-origin-y': percent,\n 'transform-origin-z': percent,\n // Transition properties\n 'transition-delay': ms,\n 'transition-duration': ms,\n // Alignment properties\n 'vertical-align': px,\n 'flex-basis': px,\n // Some random properties\n 'shape-margin': px,\n size: px,\n gap: px,\n // Grid properties\n grid: px,\n 'grid-gap': px,\n 'row-gap': px,\n 'grid-row-gap': px,\n 'grid-column-gap': px,\n 'grid-template-rows': px,\n 'grid-template-columns': px,\n 'grid-auto-rows': px,\n 'grid-auto-columns': px,\n // Not existing properties.\n // Used to avoid issues with jss-plugin-expand integration.\n 'box-shadow-x': px,\n 'box-shadow-y': px,\n 'box-shadow-blur': px,\n 'box-shadow-spread': px,\n 'font-line-height': px,\n 'text-shadow-x': px,\n 'text-shadow-y': px,\n 'text-shadow-blur': px\n};\n\n/**\n * Clones the object and adds a camel cased property version.\n */\nfunction addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n\n var newObj = {};\n\n for (var _key in obj) {\n newObj[_key] = obj[_key];\n newObj[_key.replace(regExp, replace)] = obj[_key];\n }\n\n return newObj;\n}\n\nvar units = addCamelCasedVersion(defaultUnits);\n/**\n * Recursive deep style passing function\n */\n\nfunction iterate(prop, value, options) {\n if (value == null) return value;\n\n if (Array.isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n value[i] = iterate(prop, value[i], options);\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n for (var innerProp in value) {\n value[innerProp] = iterate(innerProp, value[innerProp], options);\n }\n } else {\n for (var _innerProp in value) {\n value[_innerProp] = iterate(prop + \"-\" + _innerProp, value[_innerProp], options);\n }\n } // eslint-disable-next-line no-restricted-globals\n\n } else if (typeof value === 'number' && isNaN(value) === false) {\n var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.\n\n if (unit && !(value === 0 && unit === px)) {\n return typeof unit === 'function' ? unit(value).toString() : \"\" + value + unit;\n }\n\n return value.toString();\n }\n\n return value;\n}\n/**\n * Add unit to numeric values.\n */\n\n\nfunction defaultUnit(options) {\n if (options === void 0) {\n options = {};\n }\n\n var camelCasedOptions = addCamelCasedVersion(options);\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n for (var prop in style) {\n style[prop] = iterate(prop, style[prop], camelCasedOptions);\n }\n\n return style;\n }\n\n function onChangeValue(value, prop) {\n return iterate(prop, value, camelCasedOptions);\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default defaultUnit;\n","/**\n * A scheme for converting properties from array to regular style.\n * All properties listed below will be transformed to a string separated by space.\n */\nvar propArray = {\n 'background-size': true,\n 'background-position': true,\n border: true,\n 'border-bottom': true,\n 'border-left': true,\n 'border-top': true,\n 'border-right': true,\n 'border-radius': true,\n 'border-image': true,\n 'border-width': true,\n 'border-style': true,\n 'border-color': true,\n 'box-shadow': true,\n flex: true,\n margin: true,\n padding: true,\n outline: true,\n 'transform-origin': true,\n transform: true,\n transition: true\n /**\n * A scheme for converting arrays to regular styles inside of objects.\n * For e.g.: \"{position: [0, 0]}\" => \"background-position: 0 0;\".\n */\n\n};\nvar propArrayInObj = {\n position: true,\n // background-position\n size: true // background-size\n\n /**\n * A scheme for parsing and building correct styles from passed objects.\n */\n\n};\nvar propObj = {\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n background: {\n attachment: null,\n color: null,\n image: null,\n position: null,\n repeat: null\n },\n border: {\n width: null,\n style: null,\n color: null\n },\n 'border-top': {\n width: null,\n style: null,\n color: null\n },\n 'border-right': {\n width: null,\n style: null,\n color: null\n },\n 'border-bottom': {\n width: null,\n style: null,\n color: null\n },\n 'border-left': {\n width: null,\n style: null,\n color: null\n },\n outline: {\n width: null,\n style: null,\n color: null\n },\n 'list-style': {\n type: null,\n position: null,\n image: null\n },\n transition: {\n property: null,\n duration: null,\n 'timing-function': null,\n timingFunction: null,\n // Needed for avoiding comilation issues with jss-plugin-camel-case\n delay: null\n },\n animation: {\n name: null,\n duration: null,\n 'timing-function': null,\n timingFunction: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n delay: null,\n 'iteration-count': null,\n iterationCount: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n direction: null,\n 'fill-mode': null,\n fillMode: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n 'play-state': null,\n playState: null // Needed to avoid compilation issues with jss-plugin-camel-case\n\n },\n 'box-shadow': {\n x: 0,\n y: 0,\n blur: 0,\n spread: 0,\n color: null,\n inset: null\n },\n 'text-shadow': {\n x: 0,\n y: 0,\n blur: null,\n color: null\n }\n /**\n * A scheme for converting non-standart properties inside object.\n * For e.g.: include 'border-radius' property inside 'border' object.\n */\n\n};\nvar customPropObj = {\n border: {\n radius: 'border-radius',\n image: 'border-image',\n width: 'border-width',\n style: 'border-style',\n color: 'border-color'\n },\n 'border-bottom': {\n width: 'border-bottom-width',\n style: 'border-bottom-style',\n color: 'border-bottom-color'\n },\n 'border-top': {\n width: 'border-top-width',\n style: 'border-top-style',\n color: 'border-top-color'\n },\n 'border-left': {\n width: 'border-left-width',\n style: 'border-left-style',\n color: 'border-left-color'\n },\n 'border-right': {\n width: 'border-right-width',\n style: 'border-right-style',\n color: 'border-right-color'\n },\n background: {\n size: 'background-size',\n image: 'background-image'\n },\n font: {\n style: 'font-style',\n variant: 'font-variant',\n weight: 'font-weight',\n stretch: 'font-stretch',\n size: 'font-size',\n family: 'font-family',\n lineHeight: 'line-height',\n // Needed to avoid compilation issues with jss-plugin-camel-case\n 'line-height': 'line-height'\n },\n flex: {\n grow: 'flex-grow',\n basis: 'flex-basis',\n direction: 'flex-direction',\n wrap: 'flex-wrap',\n flow: 'flex-flow',\n shrink: 'flex-shrink'\n },\n align: {\n self: 'align-self',\n items: 'align-items',\n content: 'align-content'\n },\n grid: {\n 'template-columns': 'grid-template-columns',\n templateColumns: 'grid-template-columns',\n 'template-rows': 'grid-template-rows',\n templateRows: 'grid-template-rows',\n 'template-areas': 'grid-template-areas',\n templateAreas: 'grid-template-areas',\n template: 'grid-template',\n 'auto-columns': 'grid-auto-columns',\n autoColumns: 'grid-auto-columns',\n 'auto-rows': 'grid-auto-rows',\n autoRows: 'grid-auto-rows',\n 'auto-flow': 'grid-auto-flow',\n autoFlow: 'grid-auto-flow',\n row: 'grid-row',\n column: 'grid-column',\n 'row-start': 'grid-row-start',\n rowStart: 'grid-row-start',\n 'row-end': 'grid-row-end',\n rowEnd: 'grid-row-end',\n 'column-start': 'grid-column-start',\n columnStart: 'grid-column-start',\n 'column-end': 'grid-column-end',\n columnEnd: 'grid-column-end',\n area: 'grid-area',\n gap: 'grid-gap',\n 'row-gap': 'grid-row-gap',\n rowGap: 'grid-row-gap',\n 'column-gap': 'grid-column-gap',\n columnGap: 'grid-column-gap'\n }\n};\n\n/* eslint-disable no-use-before-define */\n\n/**\n * Map values by given prop.\n *\n * @param {Array} array of values\n * @param {String} original property\n * @param {String} original rule\n * @return {String} mapped values\n */\nfunction mapValuesByProp(value, prop, rule) {\n return value.map(function (item) {\n return objectToArray(item, prop, rule, false, true);\n });\n}\n/**\n * Convert array to nested array, if needed\n */\n\n\nfunction processArray(value, prop, scheme, rule) {\n if (scheme[prop] == null) return value;\n if (value.length === 0) return [];\n if (Array.isArray(value[0])) return processArray(value[0], prop, scheme, rule);\n\n if (typeof value[0] === 'object') {\n return mapValuesByProp(value, prop, rule);\n }\n\n return [value];\n}\n/**\n * Convert object to array.\n */\n\n\nfunction objectToArray(value, prop, rule, isFallback, isInArray) {\n if (!(propObj[prop] || customPropObj[prop])) return [];\n var result = []; // Check if exists any non-standard property\n\n if (customPropObj[prop]) {\n // eslint-disable-next-line no-param-reassign\n value = customPropsToStyle(value, rule, customPropObj[prop], isFallback);\n } // Pass throught all standart props\n\n\n if (Object.keys(value).length) {\n for (var baseProp in propObj[prop]) {\n if (value[baseProp]) {\n if (Array.isArray(value[baseProp])) {\n result.push(propArrayInObj[baseProp] === null ? value[baseProp] : value[baseProp].join(' '));\n } else result.push(value[baseProp]);\n\n continue;\n } // Add default value from props config.\n\n\n if (propObj[prop][baseProp] != null) {\n result.push(propObj[prop][baseProp]);\n }\n }\n }\n\n if (!result.length || isInArray) return result;\n return [result];\n}\n/**\n * Convert custom properties values to styles adding them to rule directly\n */\n\n\nfunction customPropsToStyle(value, rule, customProps, isFallback) {\n for (var prop in customProps) {\n var propName = customProps[prop]; // If current property doesn't exist already in rule - add new one\n\n if (typeof value[prop] !== 'undefined' && (isFallback || !rule.prop(propName))) {\n var _styleDetector;\n\n var appendedValue = styleDetector((_styleDetector = {}, _styleDetector[propName] = value[prop], _styleDetector), rule)[propName]; // Add style directly in rule\n\n if (isFallback) rule.style.fallbacks[propName] = appendedValue;else rule.style[propName] = appendedValue;\n } // Delete converted property to avoid double converting\n\n\n delete value[prop];\n }\n\n return value;\n}\n/**\n * Detect if a style needs to be converted.\n */\n\n\nfunction styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}\n/**\n * Adds possibility to write expanded styles.\n */\n\n\nfunction jssExpand() {\n function onProcessStyle(style, rule) {\n if (!style || rule.type !== 'style') return style;\n\n if (Array.isArray(style)) {\n // Pass rules one by one and reformat them\n for (var index = 0; index < style.length; index++) {\n style[index] = styleDetector(style[index], rule);\n }\n\n return style;\n }\n\n return styleDetector(style, rule);\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssExpand;\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import isInBrowser from 'is-in-browser';\nimport _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';\n\n// Export javascript style and css style vendor prefixes.\nvar js = '';\nvar css = '';\nvar vendor = '';\nvar browser = '';\nvar isTouch = isInBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.\n\nif (isInBrowser) {\n // Order matters. We need to check Webkit the last one because\n // other vendors use to add Webkit prefixes to some properties\n var jsCssMap = {\n Moz: '-moz-',\n ms: '-ms-',\n O: '-o-',\n Webkit: '-webkit-'\n };\n\n var _document$createEleme = document.createElement('p'),\n style = _document$createEleme.style;\n\n var testProp = 'Transform';\n\n for (var key in jsCssMap) {\n if (key + testProp in style) {\n js = key;\n css = jsCssMap[key];\n break;\n }\n } // Correctly detect the Edge browser.\n\n\n if (js === 'Webkit' && 'msHyphens' in style) {\n js = 'ms';\n css = jsCssMap.ms;\n browser = 'edge';\n } // Correctly detect the Safari browser.\n\n\n if (js === 'Webkit' && '-apple-trailing-word' in style) {\n vendor = 'apple';\n }\n}\n/**\n * Vendor prefix string for the current browser.\n *\n * @type {{js: String, css: String, vendor: String, browser: String}}\n * @api public\n */\n\n\nvar prefix = {\n js: js,\n css: css,\n vendor: vendor,\n browser: browser,\n isTouch: isTouch\n};\n\n/**\n * Test if a keyframe at-rule should be prefixed or not\n *\n * @param {String} vendor prefix string for the current browser.\n * @return {String}\n * @api public\n */\n\nfunction supportedKeyframes(key) {\n // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'\n if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.\n // https://caniuse.com/#search=keyframes\n\n if (prefix.js === 'ms') return key;\n return \"@\" + prefix.css + \"keyframes\" + key.substr(10);\n}\n\n// https://caniuse.com/#search=appearance\n\nvar appearence = {\n noPrefill: ['appearance'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'appearance') return false;\n if (prefix.js === 'ms') return \"-webkit-\" + prop;\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=color-adjust\n\nvar colorAdjust = {\n noPrefill: ['color-adjust'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'color-adjust') return false;\n if (prefix.js === 'Webkit') return prefix.css + \"print-\" + prop;\n return prop;\n }\n};\n\nvar regExp = /[-\\s]+(.)?/g;\n/**\n * Replaces the letter with the capital letter\n *\n * @param {String} match\n * @param {String} c\n * @return {String}\n * @api private\n */\n\nfunction toUpper(match, c) {\n return c ? c.toUpperCase() : '';\n}\n/**\n * Convert dash separated strings to camel-cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\n\nfunction camelize(str) {\n return str.replace(regExp, toUpper);\n}\n\n/**\n * Convert dash separated strings to pascal cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction pascalize(str) {\n return camelize(\"-\" + str);\n}\n\n// but we can use a longhand property instead.\n// https://caniuse.com/#search=mask\n\nvar mask = {\n noPrefill: ['mask'],\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^mask/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var longhand = 'mask-image';\n\n if (camelize(longhand) in style) {\n return prop;\n }\n\n if (prefix.js + pascalize(longhand) in style) {\n return prefix.css + prop;\n }\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=text-orientation\n\nvar textOrientation = {\n noPrefill: ['text-orientation'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'text-orientation') return false;\n\n if (prefix.vendor === 'apple' && !prefix.isTouch) {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=transform\n\nvar transform = {\n noPrefill: ['transform'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transform') return false;\n\n if (options.transform) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=transition\n\nvar transition = {\n noPrefill: ['transition'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transition') return false;\n\n if (options.transition) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=writing-mode\n\nvar writingMode = {\n noPrefill: ['writing-mode'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'writing-mode') return false;\n\n if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=user-select\n\nvar userSelect = {\n noPrefill: ['user-select'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'user-select') return false;\n\n if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=multicolumn\n// https://github.com/postcss/autoprefixer/issues/491\n// https://github.com/postcss/autoprefixer/issues/177\n\nvar breakPropsOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^break-/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var jsProp = \"WebkitColumn\" + pascalize(prop);\n return jsProp in style ? prefix.css + \"column-\" + prop : false;\n }\n\n if (prefix.js === 'Moz') {\n var _jsProp = \"page\" + pascalize(prop);\n\n return _jsProp in style ? \"page-\" + prop : false;\n }\n\n return false;\n }\n};\n\n// See https://github.com/postcss/autoprefixer/issues/324.\n\nvar inlineLogicalOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^(border|margin|padding)-inline/.test(prop)) return false;\n if (prefix.js === 'Moz') return prop;\n var newProp = prop.replace('-inline', '');\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\n// Camelization is required because we can't test using.\n// CSS syntax for e.g. in FF.\n\nvar unprefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n return camelize(prop) in style ? prop : false;\n }\n};\n\nvar prefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.\n\n if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.\n\n if (prop[0] === '-' && prop[1] === '-') return prop;\n if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback.\n\n if (prefix.js !== 'Webkit' && \"Webkit\" + pascalized in style) return \"-webkit-\" + prop;\n return false;\n }\n};\n\n// https://caniuse.com/#search=scroll-snap\n\nvar scrollSnap = {\n supportedProperty: function supportedProperty(prop) {\n if (prop.substring(0, 11) !== 'scroll-snap') return false;\n\n if (prefix.js === 'ms') {\n return \"\" + prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=overscroll-behavior\n\nvar overscrollBehavior = {\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'overscroll-behavior') return false;\n\n if (prefix.js === 'ms') {\n return prefix.css + \"scroll-chaining\";\n }\n\n return prop;\n }\n};\n\nvar propMap = {\n 'flex-grow': 'flex-positive',\n 'flex-shrink': 'flex-negative',\n 'flex-basis': 'flex-preferred-size',\n 'justify-content': 'flex-pack',\n order: 'flex-order',\n 'align-items': 'flex-align',\n 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.\n\n}; // Support old flex spec from 2012.\n\nvar flex2012 = {\n supportedProperty: function supportedProperty(prop, style) {\n var newProp = propMap[prop];\n if (!newProp) return false;\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\nvar propMap$1 = {\n flex: 'box-flex',\n 'flex-grow': 'box-flex',\n 'flex-direction': ['box-orient', 'box-direction'],\n order: 'box-ordinal-group',\n 'align-items': 'box-align',\n 'flex-flow': ['box-orient', 'box-direction'],\n 'justify-content': 'box-pack'\n};\nvar propKeys = Object.keys(propMap$1);\n\nvar prefixCss = function prefixCss(p) {\n return prefix.css + p;\n}; // Support old flex spec from 2009.\n\n\nvar flex2009 = {\n supportedProperty: function supportedProperty(prop, style, _ref) {\n var multiple = _ref.multiple;\n\n if (propKeys.indexOf(prop) > -1) {\n var newProp = propMap$1[prop];\n\n if (!Array.isArray(newProp)) {\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n\n if (!multiple) return false;\n\n for (var i = 0; i < newProp.length; i++) {\n if (!(prefix.js + pascalize(newProp[0]) in style)) {\n return false;\n }\n }\n\n return newProp.map(prefixCss);\n }\n\n return false;\n }\n};\n\n// plugins = [\n// ...plugins,\n// breakPropsOld,\n// inlineLogicalOld,\n// unprefixed,\n// prefixed,\n// scrollSnap,\n// flex2012,\n// flex2009\n// ]\n// Plugins without 'noPrefill' value, going last.\n// 'flex-*' plugins should be at the bottom.\n// 'flex2009' going after 'flex2012'.\n// 'prefixed' going after 'unprefixed'\n\nvar plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];\nvar propertyDetectors = plugins.filter(function (p) {\n return p.supportedProperty;\n}).map(function (p) {\n return p.supportedProperty;\n});\nvar noPrefill = plugins.filter(function (p) {\n return p.noPrefill;\n}).reduce(function (a, p) {\n a.push.apply(a, _toConsumableArray(p.noPrefill));\n return a;\n}, []);\n\nvar el;\nvar cache = {};\n\nif (isInBrowser) {\n el = document.createElement('p'); // We test every property on vendor prefix requirement.\n // Once tested, result is cached. It gives us up to 70% perf boost.\n // http://jsperf.com/element-style-object-access-vs-plain-object\n //\n // Prefill cache with known css properties to reduce amount of\n // properties we need to feature test at runtime.\n // http://davidwalsh.name/vendor-prefix\n\n var computed = window.getComputedStyle(document.documentElement, '');\n\n for (var key$1 in computed) {\n // eslint-disable-next-line no-restricted-globals\n if (!isNaN(key$1)) cache[computed[key$1]] = computed[key$1];\n } // Properties that cannot be correctly detected using the\n // cache prefill method.\n\n\n noPrefill.forEach(function (x) {\n return delete cache[x];\n });\n}\n/**\n * Test if a property is supported, returns supported property with vendor\n * prefix if required. Returns `false` if not supported.\n *\n * @param {String} prop dash separated\n * @param {Object} [options]\n * @return {String|Boolean}\n * @api public\n */\n\n\nfunction supportedProperty(prop, options) {\n if (options === void 0) {\n options = {};\n }\n\n // For server-side rendering.\n if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache[prop] != null) {\n return cache[prop];\n } // Check if 'transition' or 'transform' natively supported in browser.\n\n\n if (prop === 'transition' || prop === 'transform') {\n options[prop] = prop in el.style;\n } // Find a plugin for current prefix property.\n\n\n for (var i = 0; i < propertyDetectors.length; i++) {\n cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.\n\n if (cache[prop]) break;\n } // Reset styles for current property.\n // Firefox can even throw an error for invalid properties, e.g., \"0\".\n\n\n try {\n el.style[prop] = '';\n } catch (err) {\n return false;\n }\n\n return cache[prop];\n}\n\nvar cache$1 = {};\nvar transitionProperties = {\n transition: 1,\n 'transition-property': 1,\n '-webkit-transition': 1,\n '-webkit-transition-property': 1\n};\nvar transPropsRegExp = /(^\\s*[\\w-]+)|, (\\s*[\\w-]+)(?![^()]*\\))/g;\nvar el$1;\n/**\n * Returns prefixed value transition/transform if needed.\n *\n * @param {String} match\n * @param {String} p1\n * @param {String} p2\n * @return {String}\n * @api private\n */\n\nfunction prefixTransitionCallback(match, p1, p2) {\n if (p1 === 'var') return 'var';\n if (p1 === 'all') return 'all';\n if (p2 === 'all') return ', all';\n var prefixedValue = p1 ? supportedProperty(p1) : \", \" + supportedProperty(p2);\n if (!prefixedValue) return p1 || p2;\n return prefixedValue;\n}\n\nif (isInBrowser) el$1 = document.createElement('p');\n/**\n * Returns prefixed value if needed. Returns `false` if value is not supported.\n *\n * @param {String} property\n * @param {String} value\n * @return {String|Boolean}\n * @api public\n */\n\nfunction supportedValue(property, value) {\n // For server-side rendering.\n var prefixedValue = value;\n if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.\n // We want only prefixable values here.\n // eslint-disable-next-line no-restricted-globals\n\n if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {\n return prefixedValue;\n } // Create cache key for current value.\n\n\n var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache$1[cacheKey] != null) {\n return cache$1[cacheKey];\n } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.\n\n\n try {\n // Test value as it is.\n el$1.style[property] = prefixedValue;\n } catch (err) {\n // Return false if value not supported.\n cache$1[cacheKey] = false;\n return false;\n } // If 'transition' or 'transition-property' property.\n\n\n if (transitionProperties[property]) {\n prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);\n } else if (el$1.style[property] === '') {\n // Value with a vendor prefix.\n prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert \"flex\" to \"-ms-flexbox\" for IE10.\n\n if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.\n\n el$1.style[property] = prefixedValue; // Return false if value not supported.\n\n if (el$1.style[property] === '') {\n cache$1[cacheKey] = false;\n return false;\n }\n } // Reset styles for current property.\n\n\n el$1.style[property] = ''; // Write current value to cache.\n\n cache$1[cacheKey] = prefixedValue;\n return cache$1[cacheKey];\n}\n\nexport { prefix, supportedKeyframes, supportedProperty, supportedValue };\n","import { supportedKeyframes, supportedValue, supportedProperty } from 'css-vendor';\nimport { toCssValue } from 'jss';\n\n/**\n * Add vendor prefix to a property name when needed.\n *\n * @api public\n */\n\nfunction jssVendorPrefixer() {\n function onProcessRule(rule) {\n if (rule.type === 'keyframes') {\n var atRule = rule;\n atRule.at = supportedKeyframes(atRule.at);\n }\n }\n\n function prefixStyle(style) {\n for (var prop in style) {\n var value = style[prop];\n\n if (prop === 'fallbacks' && Array.isArray(value)) {\n style[prop] = value.map(prefixStyle);\n continue;\n }\n\n var changeProp = false;\n var supportedProp = supportedProperty(prop);\n if (supportedProp && supportedProp !== prop) changeProp = true;\n var changeValue = false;\n var supportedValue$1 = supportedValue(supportedProp, toCssValue(value));\n if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;\n\n if (changeProp || changeValue) {\n if (changeProp) delete style[prop];\n style[supportedProp || prop] = supportedValue$1 || value;\n }\n }\n\n return style;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n return prefixStyle(style);\n }\n\n function onChangeValue(value, prop) {\n return supportedValue(prop, toCssValue(value)) || value;\n }\n\n return {\n onProcessRule: onProcessRule,\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default jssVendorPrefixer;\n","/**\n * Sort props by length.\n */\nfunction jssPropsSort() {\n var sort = function sort(prop0, prop1) {\n if (prop0.length === prop1.length) {\n return prop0 > prop1 ? 1 : -1;\n }\n\n return prop0.length - prop1.length;\n };\n\n return {\n onProcessStyle: function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n\n for (var i = 0; i < props.length; i++) {\n newStyle[props[i]] = style[props[i]];\n }\n\n return newStyle;\n }\n };\n}\n\nexport default jssPropsSort;\n","import functions from 'jss-plugin-rule-value-function';\nimport observable from 'jss-plugin-rule-value-observable';\nimport template from 'jss-plugin-template';\nimport global from 'jss-plugin-global';\nimport extend from 'jss-plugin-extend';\nimport nested from 'jss-plugin-nested';\nimport compose from 'jss-plugin-compose';\nimport camelCase from 'jss-plugin-camel-case';\nimport defaultUnit from 'jss-plugin-default-unit';\nimport expand from 'jss-plugin-expand';\nimport vendorPrefixer from 'jss-plugin-vendor-prefixer';\nimport propsSort from 'jss-plugin-props-sort';\n\nvar create = function create(options) {\n if (options === void 0) {\n options = {};\n }\n\n return {\n plugins: [functions(), observable(options.observable), template(), global(), extend(), nested(), compose(), camelCase(), defaultUnit(options.defaultUnit), expand(), vendorPrefixer(), propsSort()]\n };\n};\n\nexport default create;\n","function shallowEqualObjects(objA, objB) {\n if (objA === objB) {\n return true;\n }\n\n if (!objA || !objB) {\n return false;\n }\n\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n var len = aKeys.length;\n\n if (bKeys.length !== len) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n var key = aKeys[i];\n\n if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction shallowEqualArrays(arrA, arrB) {\n if (arrA === arrB) {\n return true;\n }\n\n if (!arrA || !arrB) {\n return false;\n }\n\n var len = arrA.length;\n\n if (arrB.length !== len) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n if (arrA[i] !== arrB[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport { shallowEqualArrays, shallowEqualObjects };\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import { create } from 'jss';\nimport preset from 'jss-preset-default';\n\n// I have been trying to benchmark and I have seen a slow down after about 10k rules.\n// Since we are in a single sheet mode, user shouldn't care about this.\nvar MAX_RULES_PER_SHEET = 10000;\nvar defaultJss = create(preset());\n\nvar createCss = function createCss(jss) {\n if (jss === void 0) {\n jss = defaultJss;\n }\n\n var cache = new Map();\n var ruleIndex = 0;\n var sheet;\n\n var getSheet = function getSheet() {\n if (!sheet || sheet.rules.index.length > MAX_RULES_PER_SHEET) {\n sheet = jss.createStyleSheet().attach();\n }\n\n return sheet;\n };\n\n function css() {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments; // We can avoid the need for stringification with a babel plugin,\n // which could generate a hash at build time and add it to the object.\n\n var argsStr = JSON.stringify(args);\n var cached = cache.get(argsStr);\n if (cached) return cached.className;\n var flatArgs = []; // Flatten arguments which can be\n // - style objects\n // - array of style objects\n // - arrays of style objects\n\n for (var argIndex in args) {\n var arg = args[argIndex];\n\n if (!Array.isArray(arg)) {\n flatArgs.push(arg);\n continue;\n }\n\n for (var innerArgIndex = 0; innerArgIndex < arg.length; innerArgIndex++) {\n flatArgs.push(arg[innerArgIndex]);\n }\n }\n\n var mergedStyle = {};\n var labels = [];\n\n for (var i = 0; i < flatArgs.length; i++) {\n var style = flatArgs[i];\n if (!style) continue;\n var styleObject = style; // It can be a class name that css() has previously generated.\n\n if (typeof style === 'string') {\n // eslint-disable-next-line no-shadow\n var _cached = cache.get(style);\n\n if (_cached) {\n // eslint-disable-next-line prefer-spread\n if (_cached.labels.length) labels.push.apply(labels, _cached.labels);\n styleObject = _cached.style;\n }\n }\n\n if (styleObject.label && labels.indexOf(styleObject.label) === -1) labels.push(styleObject.label);\n Object.assign(mergedStyle, styleObject);\n }\n\n delete mergedStyle.label;\n var label = labels.length === 0 ? 'css' : labels.join('-');\n var key = label + \"-\" + ruleIndex++;\n getSheet().addRule(key, mergedStyle);\n var className = getSheet().classes[key];\n var cacheValue = {\n style: mergedStyle,\n labels: labels,\n className: className\n };\n cache.set(argsStr, cacheValue);\n cache.set(className, cacheValue);\n return className;\n } // For testing only.\n\n\n css.getSheet = getSheet;\n return css;\n};\n\nvar css = createCss();\n\nexport default css;\nexport { createCss as create };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport { createContext, forwardRef, createElement as createElement$1, Component, useRef, useContext, useMemo, useDebugValue, useEffect, useLayoutEffect } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { ThemeContext } from 'theming';\nexport { ThemeProvider, createTheming, useTheme, withTheme } from 'theming';\nimport warning from 'tiny-warning';\nimport defaultJss, { SheetsManager, create as create$1, getDynamicStyles, createGenerateId, SheetsRegistry } from 'jss';\nexport { SheetsRegistry, createGenerateId } from 'jss';\nimport preset from 'jss-preset-default';\nimport isInBrowser from 'is-in-browser';\nimport PropTypes from 'prop-types';\nimport { shallowEqualObjects } from 'shallow-equal';\nimport isPropValid from '@emotion/is-prop-valid';\nimport defaultCss from 'css-jss';\n\n// eslint-disable-next-line no-unused-vars\nvar getDisplayName = function getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component';\n};\n\nvar memoize = function memoize(fn) {\n var lastArgs;\n var lastResult;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (Array.isArray(lastArgs) && args.length === lastArgs.length) {\n var isSame = true;\n\n for (var i = 0; i < args.length; i++) {\n if (args[i] !== lastArgs[i]) {\n isSame = false;\n }\n }\n\n if (isSame) {\n return lastResult;\n }\n }\n\n lastArgs = args;\n lastResult = fn.apply(void 0, args);\n return lastResult;\n };\n};\n\nvar mergeClasses = function mergeClasses(baseClasses, additionalClasses) {\n var combinedClasses = _extends({}, baseClasses);\n\n for (var name in additionalClasses) {\n combinedClasses[name] = name in combinedClasses ? combinedClasses[name] + \" \" + additionalClasses[name] : additionalClasses[name];\n }\n\n return combinedClasses;\n};\n\nvar JssContext = createContext({\n classNamePrefix: '',\n disableStylesGeneration: false\n});\n\n/**\n * Global index counter to preserve source order.\n * As we create the style sheet during componentWillMount lifecycle,\n * children are handled after the parents, so the order of style elements would\n * be parent->child. It is a problem though when a parent passes a className\n * which needs to override any childs styles. StyleSheet of the child has a higher\n * specificity, because of the source order.\n * So our solution is to render sheets them in the reverse order child->sheet, so\n * that parent has a higher specificity.\n *\n * We start at [Number.MIN_SAFE_INTEGER] to always insert sheets from react-jss first before any\n * sheet which might be inserted manually by the user.\n */\nvar index = Number.MIN_SAFE_INTEGER || -1e9;\n\nvar getSheetIndex = function getSheetIndex() {\n return index++;\n};\n\nvar defaultManagers = new Map();\nvar getManager = function getManager(context, managerId) {\n // If `managers` map is present in the context, we use it in order to\n // let JssProvider reset them when new response has to render server-side.\n if (context.managers) {\n if (!context.managers[managerId]) {\n context.managers[managerId] = new SheetsManager();\n }\n\n return context.managers[managerId];\n }\n\n var manager = defaultManagers.get(managerId);\n\n if (!manager) {\n manager = new SheetsManager();\n defaultManagers.set(managerId, manager);\n }\n\n return manager;\n};\nvar manageSheet = function manageSheet(options) {\n var sheet = options.sheet,\n context = options.context,\n index = options.index,\n theme = options.theme;\n\n if (!sheet) {\n return;\n }\n\n var manager = getManager(context, index);\n manager.manage(theme);\n\n if (context.registry) {\n context.registry.add(sheet);\n }\n};\nvar unmanageSheet = function unmanageSheet(options) {\n if (!options.sheet) {\n return;\n }\n\n var manager = getManager(options.context, options.index);\n manager.unmanage(options.theme);\n};\n\nvar jss = create$1(preset());\n\nvar sheetsMeta = new WeakMap();\nvar getMeta = function getMeta(sheet) {\n return sheetsMeta.get(sheet);\n};\nvar addMeta = function addMeta(sheet, meta) {\n sheetsMeta.set(sheet, meta);\n};\n\n// eslint-disable-next-line no-unused-vars\nvar getStyles = function getStyles(options) {\n var styles = options.styles;\n\n if (typeof styles !== 'function') {\n return styles;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(styles.length !== 0, \"[JSS] <\" + (options.name || 'Hook') + \" />'s styles function doesn't rely on the \\\"theme\\\" argument. We recommend declaring styles as an object instead.\") : void 0;\n return styles(options.theme);\n};\n\nfunction getSheetOptions(options, link) {\n var minify;\n\n if (options.context.id && options.context.id.minify != null) {\n minify = options.context.id.minify;\n }\n\n var classNamePrefix = options.context.classNamePrefix || '';\n\n if (options.name && !minify) {\n classNamePrefix += options.name.replace(/\\s/g, '-') + \"-\";\n }\n\n var meta = '';\n if (options.name) meta = options.name + \", \";\n meta += typeof options.styles === 'function' ? 'Themed' : 'Unthemed';\n return _extends({}, options.sheetOptions, {\n index: options.index,\n meta: meta,\n classNamePrefix: classNamePrefix,\n link: link,\n generateId: options.sheetOptions.generateId || options.context.generateId\n });\n}\n\n// eslint-disable-next-line no-unused-vars\nvar createStyleSheet = function createStyleSheet(options) {\n if (options.context.disableStylesGeneration) {\n return undefined;\n }\n\n var manager = getManager(options.context, options.index);\n var existingSheet = manager.get(options.theme);\n\n if (existingSheet) {\n return existingSheet;\n }\n\n var jss$1 = options.context.jss || jss;\n var styles = getStyles(options);\n var dynamicStyles = getDynamicStyles(styles);\n var sheet = jss$1.createStyleSheet(styles, getSheetOptions(options, dynamicStyles !== null));\n addMeta(sheet, {\n dynamicStyles: dynamicStyles,\n styles: styles\n });\n manager.add(options.theme, sheet);\n return sheet;\n};\nvar removeDynamicRules = function removeDynamicRules(sheet, rules) {\n // Loop over each dynamic rule and remove the dynamic rule\n // We can't just remove the whole sheet as this has all of the rules for every component instance\n for (var key in rules) {\n sheet.deleteRule(rules[key]);\n }\n};\nvar updateDynamicRules = function updateDynamicRules(data, sheet, rules) {\n // Loop over each dynamic rule and update it\n // We can't just update the whole sheet as this has all of the rules for every component instance\n for (var key in rules) {\n sheet.updateOne(rules[key], data);\n }\n};\nvar addDynamicRules = function addDynamicRules(sheet, data) {\n var meta = getMeta(sheet);\n\n if (!meta) {\n return undefined;\n }\n\n var rules = {}; // Loop over each dynamic rule and add it to the stylesheet\n\n for (var key in meta.dynamicStyles) {\n var initialRuleCount = sheet.rules.index.length;\n var originalRule = sheet.addRule(key, meta.dynamicStyles[key]); // Loop through all created rules, fixes updating dynamic rules\n\n for (var i = initialRuleCount; i < sheet.rules.index.length; i++) {\n var rule = sheet.rules.index[i];\n sheet.updateOne(rule, data); // If it's the original rule, we need to add it by the correct key so the hook and hoc\n // can correctly concat the dynamic class with the static one\n\n rules[originalRule === rule ? key : rule.key] = rule;\n }\n }\n\n return rules;\n};\n\nvar getSheetClasses = function getSheetClasses(sheet, dynamicRules) {\n if (!dynamicRules) {\n return sheet.classes;\n }\n\n var classes = {};\n var meta = getMeta(sheet);\n\n if (!meta) {\n return sheet.classes;\n }\n\n for (var key in meta.styles) {\n classes[key] = sheet.classes[key];\n\n if (key in dynamicRules) {\n classes[key] += \" \" + sheet.classes[dynamicRules[key].key];\n }\n }\n\n return classes;\n};\n\nvar NoRenderer = function NoRenderer(props) {\n return props.children || null;\n};\n\nvar noTheme = {};\n\n/**\n * HOC creator function that wrapps the user component.\n *\n * `withStyles(styles, [options])(Component)`\n */\nvar createWithStyles = function createWithStyles(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$index = _options.index,\n index = _options$index === void 0 ? getSheetIndex() : _options$index,\n theming = _options.theming,\n injectTheme = _options.injectTheme,\n sheetOptions = _objectWithoutPropertiesLoose(_options, [\"index\", \"theming\", \"injectTheme\"]);\n\n var isThemingEnabled = typeof styles === 'function';\n var ThemeConsumer = theming && theming.context.Consumer || ThemeContext.Consumer;\n return function (InnerComponent) {\n if (InnerComponent === void 0) {\n InnerComponent = NoRenderer;\n }\n\n var displayName = getDisplayName(InnerComponent);\n\n var getTheme = function getTheme(props) {\n return isThemingEnabled ? props.theme : noTheme;\n };\n\n var WithStyles =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(WithStyles, _React$Component);\n\n // $FlowFixMe[prop-missing]\n WithStyles.createState = function createState(props) {\n var sheet = createStyleSheet({\n styles: styles,\n theme: getTheme(props),\n index: index,\n name: displayName,\n context: props.jssContext,\n sheetOptions: sheetOptions\n });\n\n if (!sheet) {\n return {\n classes: {},\n dynamicRules: undefined,\n sheet: undefined\n };\n }\n\n var dynamicRules = addDynamicRules(sheet, props);\n return {\n sheet: sheet,\n dynamicRules: dynamicRules,\n classes: getSheetClasses(sheet, dynamicRules)\n };\n };\n\n WithStyles.manage = function manage(props, state) {\n var sheet = state.sheet;\n\n if (sheet) {\n manageSheet({\n sheet: sheet,\n index: index,\n context: props.jssContext,\n theme: getTheme(props)\n });\n }\n };\n\n WithStyles.unmanage = function unmanage(props, state) {\n var sheet = state.sheet,\n dynamicRules = state.dynamicRules;\n\n if (sheet) {\n unmanageSheet({\n context: props.jssContext,\n index: index,\n sheet: sheet,\n theme: getTheme(props)\n });\n\n if (dynamicRules) {\n removeDynamicRules(sheet, dynamicRules);\n }\n }\n };\n\n function WithStyles(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.mergeClassesProp = memoize(function (sheetClasses, classesProp) {\n return classesProp ? mergeClasses(sheetClasses, classesProp) : sheetClasses;\n });\n _this.state = WithStyles.createState(props);\n var registry = props.jssContext.registry;\n var sheet = _this.state.sheet;\n\n if (sheet && registry) {\n registry.add(sheet);\n }\n\n return _this;\n }\n\n var _proto = WithStyles.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var props = this.props,\n state = this.state;\n\n if (props && state) {\n WithStyles.manage(props, state);\n }\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (isThemingEnabled && this.props.theme !== prevProps.theme) {\n var newState = WithStyles.createState(this.props);\n WithStyles.manage(this.props, newState);\n WithStyles.unmanage(prevProps, prevState); // eslint-disable-next-line react/no-did-update-set-state\n\n this.setState(newState);\n } else if (this.state.sheet && this.state.dynamicRules) {\n // Only update the rules when we don't generate a new sheet\n updateDynamicRules(this.props, this.state.sheet, this.state.dynamicRules);\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n WithStyles.unmanage(this.props, this.state);\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n innerRef = _this$props.innerRef,\n jssContext = _this$props.jssContext,\n theme = _this$props.theme,\n classes = _this$props.classes,\n rest = _objectWithoutPropertiesLoose(_this$props, [\"innerRef\", \"jssContext\", \"theme\", \"classes\"]);\n\n var sheetClasses = this.state.classes;\n\n var props = _extends({}, rest, {\n classes: this.mergeClassesProp(sheetClasses, classes)\n });\n\n if (innerRef) props.ref = innerRef;\n if (injectTheme) props.theme = theme;\n return createElement$1(InnerComponent, props);\n };\n\n return WithStyles;\n }(Component);\n\n WithStyles.displayName = \"WithStyles(\" + displayName + \")\";\n WithStyles.defaultProps = _extends({}, InnerComponent.defaultProps);\n var JssContextSubscriber = forwardRef(function (props, ref) {\n return createElement$1(JssContext.Consumer, null, function (context) {\n if (isThemingEnabled || injectTheme) {\n return createElement$1(ThemeConsumer, null, function (theme) {\n return createElement$1(WithStyles, _extends({\n innerRef: ref,\n theme: theme\n }, props, {\n jssContext: context\n }));\n });\n }\n\n return createElement$1(WithStyles, _extends({\n innerRef: ref\n }, props, {\n jssContext: context,\n theme: noTheme\n }));\n });\n });\n JssContextSubscriber.displayName = \"JssContextSubscriber(\" + displayName + \")\"; // $FlowFixMe[prop-missing] - React's types should allow custom static properties on component.\n\n JssContextSubscriber.InnerComponent = InnerComponent;\n return hoistNonReactStatics(JssContextSubscriber, InnerComponent);\n };\n};\n\nvar useEffectOrLayoutEffect = isInBrowser ? useLayoutEffect : useEffect;\nvar noTheme$1 = {};\n\nvar createUseStyles = function createUseStyles(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$index = _options.index,\n index = _options$index === void 0 ? getSheetIndex() : _options$index,\n theming = _options.theming,\n name = _options.name,\n sheetOptions = _objectWithoutPropertiesLoose(_options, [\"index\", \"theming\", \"name\"]);\n\n var ThemeContext$1 = theming && theming.context || ThemeContext;\n var useTheme = typeof styles === 'function' ? // $FlowFixMe[incompatible-return]\n function () {\n return useContext(ThemeContext$1) || noTheme$1;\n } : // $FlowFixMe[incompatible-return]\n function () {\n return noTheme$1;\n };\n return function useStyles(data) {\n var isFirstMount = useRef(true);\n var context = useContext(JssContext);\n var theme = useTheme();\n\n var _React$useMemo = useMemo(function () {\n var newSheet = createStyleSheet({\n context: context,\n styles: styles,\n name: name,\n theme: theme,\n index: index,\n sheetOptions: sheetOptions\n });\n var newDynamicRules = newSheet ? addDynamicRules(newSheet, data) : null;\n\n if (newSheet) {\n manageSheet({\n index: index,\n context: context,\n sheet: newSheet,\n theme: theme\n });\n }\n\n return [newSheet, newDynamicRules];\n }, [context, theme]),\n sheet = _React$useMemo[0],\n dynamicRules = _React$useMemo[1];\n\n useEffectOrLayoutEffect(function () {\n // We only need to update the rules on a subsequent update and not in the first mount\n if (sheet && dynamicRules && !isFirstMount.current) {\n updateDynamicRules(data, sheet, dynamicRules);\n }\n }, [data]);\n useEffectOrLayoutEffect(function () {\n return (// cleanup only\n function () {\n if (sheet) {\n unmanageSheet({\n index: index,\n context: context,\n sheet: sheet,\n theme: theme\n });\n }\n\n if (sheet && dynamicRules) {\n removeDynamicRules(sheet, dynamicRules);\n }\n }\n );\n }, [sheet]);\n var classes = sheet && dynamicRules ? getSheetClasses(sheet, dynamicRules) : {};\n useDebugValue(classes);\n useDebugValue(theme === noTheme$1 ? 'No theme' : theme);\n useEffect(function () {\n isFirstMount.current = false;\n });\n return classes;\n };\n};\n\nvar initialContext = {};\n\nvar JssProvider =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(JssProvider, _React$Component);\n\n function JssProvider() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.managers = {};\n\n _this.createContext = function (parentContext, prevContext) {\n if (prevContext === void 0) {\n prevContext = initialContext;\n }\n\n var _this$props = _this.props,\n registry = _this$props.registry,\n classNamePrefix = _this$props.classNamePrefix,\n jss = _this$props.jss,\n generateId = _this$props.generateId,\n disableStylesGeneration = _this$props.disableStylesGeneration,\n media = _this$props.media,\n id = _this$props.id;\n\n var context = _extends({}, parentContext);\n\n if (registry) {\n context.registry = registry; // This way we identify a new request on the server, because user will create\n // a new Registry instance for each.\n\n if (registry !== _this.registry) {\n // We reset managers because we have to regenerate all sheets for the new request.\n _this.managers = {};\n _this.registry = registry;\n }\n }\n\n context.managers = _this.managers;\n\n if (id !== undefined) {\n context.id = id;\n }\n\n if (generateId !== undefined) {\n context.generateId = generateId;\n } else if (!context.generateId || !prevContext || context.id !== prevContext.id) {\n context.generateId = createGenerateId(context.id);\n }\n\n if (classNamePrefix) {\n context.classNamePrefix = (context.classNamePrefix || '') + classNamePrefix;\n }\n\n if (media !== undefined) {\n context.media = media;\n }\n\n if (jss) {\n context.jss = jss;\n }\n\n if (disableStylesGeneration !== undefined) {\n context.disableStylesGeneration = disableStylesGeneration;\n }\n\n if (prevContext && shallowEqualObjects(prevContext, context)) {\n return prevContext;\n }\n\n return context;\n };\n\n _this.prevContext = void 0;\n _this.generateId = void 0;\n _this.registry = void 0;\n\n _this.renderProvider = function (parentContext) {\n var children = _this.props.children;\n\n var context = _this.createContext(parentContext, _this.prevContext);\n\n _this.prevContext = context;\n return createElement$1(JssContext.Provider, {\n value: context\n }, children);\n };\n\n return _this;\n }\n\n var _proto = JssProvider.prototype;\n\n _proto.render = function render() {\n return createElement$1(JssContext.Consumer, null, this.renderProvider);\n };\n\n return JssProvider;\n}(Component);\n\nJssProvider.propTypes = {\n registry: PropTypes.instanceOf(SheetsRegistry),\n jss: PropTypes.instanceOf(defaultJss.constructor),\n generateId: PropTypes.func,\n classNamePrefix: PropTypes.string,\n disableStylesGeneration: PropTypes.bool,\n children: PropTypes.node.isRequired,\n media: PropTypes.string,\n id: PropTypes.shape({\n minify: PropTypes.bool\n })\n};\n\n// eslint-disable-next-line no-unused-vars\nvar parseStyles = function parseStyles(args) {\n var dynamicStyles = [];\n var staticStyle;\n var labels = []; // Not using ...rest to optimize perf.\n\n for (var key in args) {\n var style = args[key];\n if (!style) continue;\n\n if (typeof style === 'function') {\n dynamicStyles.push(style);\n } else {\n if (!staticStyle) staticStyle = {};\n Object.assign(staticStyle, style);\n\n if (staticStyle.label) {\n if (labels.indexOf(staticStyle.label) === -1) labels.push(staticStyle.label);\n }\n }\n }\n\n var styles = {};\n var label = labels.length === 0 ? 'sc' : labels.join('-');\n\n if (staticStyle) {\n // Label should not leak to the core.\n if ('label' in staticStyle) delete staticStyle.label;\n styles[label] = staticStyle;\n } // When there is only one function rule, we don't need to wrap it.\n\n\n if (dynamicStyles.length === 1) {\n styles['scd'] = dynamicStyles[0];\n } // We create a new function rule which will call all other function rules\n // and merge the styles they return.\n\n\n if (dynamicStyles.length > 1) {\n styles['scd'] = function (props) {\n var merged = {};\n\n for (var i = 0; i < dynamicStyles.length; i++) {\n var dynamicStyle = dynamicStyles[i](props);\n if (dynamicStyle) Object.assign(merged, dynamicStyle);\n }\n\n return merged;\n };\n }\n\n return {\n styles: styles,\n label: label\n };\n};\n\nvar shouldForwardPropSymbol = Symbol('react-jss-styled');\n\nvar getShouldForwardProp = function getShouldForwardProp(tagOrComponent, options) {\n var shouldForwardProp = options.shouldForwardProp; // $FlowFixMe[invalid-computed-prop]\n // $FlowFixMe[incompatible-type]\n\n var childShouldForwardProp = tagOrComponent[shouldForwardPropSymbol];\n var finalShouldForwardProp = shouldForwardProp || childShouldForwardProp;\n\n if (shouldForwardProp && childShouldForwardProp) {\n finalShouldForwardProp = function finalShouldForwardProp(prop) {\n return childShouldForwardProp(prop) && shouldForwardProp(prop);\n };\n }\n\n return finalShouldForwardProp;\n};\n\nvar getChildProps = function getChildProps(props, shouldForwardProp, isTag) {\n var childProps = {};\n\n for (var prop in props) {\n if (shouldForwardProp) {\n if (shouldForwardProp(prop) === true) {\n childProps[prop] = props[prop];\n }\n\n continue;\n } // We don't want to pass non-dom props to the DOM.\n\n\n if (isTag) {\n if (isPropValid(prop)) {\n childProps[prop] = props[prop];\n }\n\n continue;\n }\n\n childProps[prop] = props[prop];\n }\n\n return childProps;\n};\n\n// eslint-disable-next-line no-unused-vars\nvar configureStyled = function configureStyled(tagOrComponent, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n theming = _options.theming;\n var isTag = typeof tagOrComponent === 'string';\n var ThemeContext$1 = theming ? theming.context : ThemeContext;\n var shouldForwardProp = getShouldForwardProp(tagOrComponent, options);\n\n var _options2 = options,\n _ = _options2.shouldForwardProp,\n hookOptions = _objectWithoutPropertiesLoose(_options2, [\"shouldForwardProp\"]);\n\n return function createStyledComponent() {\n // eslint-disable-next-line prefer-rest-params\n var _parseStyles = parseStyles(arguments),\n styles = _parseStyles.styles,\n label = _parseStyles.label;\n\n var useStyles = createUseStyles(styles, hookOptions);\n\n var Styled = function Styled(props) {\n var as = props.as,\n className = props.className;\n var theme = useContext(ThemeContext$1);\n var propsWithTheme = Object.assign({\n theme: theme\n }, props);\n var classes = useStyles(propsWithTheme);\n var childProps = getChildProps(props, shouldForwardProp, isTag);\n var classNames = ((classes[label] || classes.sc || '') + \" \" + (classes.scd || '')).trim();\n childProps.className = className ? className + \" \" + classNames : classNames;\n\n if (!isTag && shouldForwardProp) {\n // $FlowFixMe[invalid-computed-prop] we are not supposed to attach random properties to component functions.\n // $FlowFixMe[incompatible-use]\n tagOrComponent[shouldForwardPropSymbol] = shouldForwardProp;\n }\n\n if (isTag && as) {\n return createElement$1(as, childProps);\n }\n\n return createElement$1(tagOrComponent, childProps);\n };\n\n return Styled;\n };\n};\n\n/* eslint-disable prefer-rest-params, prefer-spread */\nvar create = function create(css) {\n if (css === void 0) {\n css = defaultCss;\n }\n\n return function createElement(type, props\n /* :: , ..._args: any */\n ) {\n var args = arguments;\n\n if (props && props.css) {\n var className = css(props.css);\n var newProps = Object.assign({}, props);\n newProps.className = props.className ? props.className + \" \" + className : className;\n delete newProps.css;\n args[1] = newProps;\n } // $FlowFixMe[missing-arg]\n\n\n return createElement$1.apply(undefined, args);\n };\n};\nvar createElement = create();\n\nexport default createWithStyles;\nexport { JssContext, JssProvider, create as createJsx, createUseStyles, jss, createElement as jsx, configureStyled as styled, createWithStyles as withStyles };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","export var COMMON_MIME_TYPES = new Map([\n ['avi', 'video/avi'],\n ['gif', 'image/gif'],\n ['ico', 'image/x-icon'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['mp4', 'video/mp4'],\n ['pdf', 'application/pdf'],\n ['png', 'image/png'],\n ['zip', 'application/zip'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']\n]);\nexport function toFileWithPath(file, path) {\n var f = withMimeType(file);\n if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path\n var webkitRelativePath = file.webkitRelativePath;\n Object.defineProperty(f, 'path', {\n value: typeof path === 'string'\n ? path\n // If is set,\n // the File will have a {webkitRelativePath} property\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n : typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0\n ? webkitRelativePath\n : file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return f;\n}\nfunction withMimeType(file) {\n var name = file.name;\n var hasExtension = name && name.lastIndexOf('.') !== -1;\n if (hasExtension && !file.type) {\n var ext = name.split('.')\n .pop().toLowerCase();\n var type = COMMON_MIME_TYPES.get(ext);\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n return file;\n}\n//# sourceMappingURL=file.js.map","import { __awaiter, __generator, __read, __spread } from \"tslib\";\nimport { toFileWithPath } from './file';\nvar FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store',\n 'Thumbs.db' // Windows\n];\n/**\n * Convert a DragEvent's DataTrasfer object to a list of File objects\n * NOTE: If some of the items are folders,\n * everything will be flattened and placed in the same list but the paths will be kept as a {path} property.\n * @param evt\n */\nexport function fromEvent(evt) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, isDragEvt(evt) && evt.dataTransfer\n ? getDataTransferFiles(evt.dataTransfer, evt.type)\n : getInputFiles(evt)];\n });\n });\n}\nfunction isDragEvt(value) {\n return !!value.dataTransfer;\n}\nfunction getInputFiles(evt) {\n var files = isInput(evt.target)\n ? evt.target.files\n ? fromList(evt.target.files)\n : []\n : [];\n return files.map(function (file) { return toFileWithPath(file); });\n}\nfunction isInput(value) {\n return value !== null;\n}\nfunction getDataTransferFiles(dt, type) {\n return __awaiter(this, void 0, void 0, function () {\n var items, files;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!dt.items) return [3 /*break*/, 2];\n items = fromList(dt.items)\n .filter(function (item) { return item.kind === 'file'; });\n // According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,\n // only 'dragstart' and 'drop' has access to the data (source node)\n if (type !== 'drop') {\n return [2 /*return*/, items];\n }\n return [4 /*yield*/, Promise.all(items.map(toFilePromises))];\n case 1:\n files = _a.sent();\n return [2 /*return*/, noIgnoredFiles(flatten(files))];\n case 2: return [2 /*return*/, noIgnoredFiles(fromList(dt.files)\n .map(function (file) { return toFileWithPath(file); }))];\n }\n });\n });\n}\nfunction noIgnoredFiles(files) {\n return files.filter(function (file) { return FILES_TO_IGNORE.indexOf(file.name) === -1; });\n}\n// IE11 does not support Array.from()\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility\n// https://developer.mozilla.org/en-US/docs/Web/API/FileList\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList\nfunction fromList(items) {\n var files = [];\n // tslint:disable: prefer-for-of\n for (var i = 0; i < items.length; i++) {\n var file = items[i];\n files.push(file);\n }\n return files;\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem\nfunction toFilePromises(item) {\n if (typeof item.webkitGetAsEntry !== 'function') {\n return fromDataTransferItem(item);\n }\n var entry = item.webkitGetAsEntry();\n // Safari supports dropping an image node from a different window and can be retrieved using\n // the DataTransferItem.getAsFile() API\n // NOTE: FileSystemEntry.file() throws if trying to get the file\n if (entry && entry.isDirectory) {\n return fromDirEntry(entry);\n }\n return fromDataTransferItem(item);\n}\nfunction flatten(items) {\n return items.reduce(function (acc, files) { return __spread(acc, (Array.isArray(files) ? flatten(files) : [files])); }, []);\n}\nfunction fromDataTransferItem(item) {\n var file = item.getAsFile();\n if (!file) {\n return Promise.reject(item + \" is not a File\");\n }\n var fwp = toFileWithPath(file);\n return Promise.resolve(fwp);\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry\nfunction fromEntry(entry) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)];\n });\n });\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry\nfunction fromDirEntry(entry) {\n var reader = entry.createReader();\n return new Promise(function (resolve, reject) {\n var entries = [];\n function readEntries() {\n var _this = this;\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries\n reader.readEntries(function (batch) { return __awaiter(_this, void 0, void 0, function () {\n var files, err_1, items;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!batch.length) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Promise.all(entries)];\n case 2:\n files = _a.sent();\n resolve(files);\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n reject(err_1);\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n items = Promise.all(batch.map(fromEntry));\n entries.push(items);\n // Continue reading\n readEntries();\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n }); }, function (err) {\n reject(err);\n });\n }\n readEntries();\n });\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry\nfunction fromFileEntry(entry) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve, reject) {\n entry.file(function (file) {\n var fwp = toFileWithPath(file, entry.fullPath);\n resolve(fwp);\n }, function (err) {\n reject(err);\n });\n })];\n });\n });\n}\n//# sourceMappingURL=file-selector.js.map","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport accepts from 'attr-accept'; // Error codes\n\nexport var FILE_INVALID_TYPE = 'file-invalid-type';\nexport var FILE_TOO_LARGE = 'file-too-large';\nexport var FILE_TOO_SMALL = 'file-too-small';\nexport var TOO_MANY_FILES = 'too-many-files'; // File Errors\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {\n accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;\n var messageSuffix = Array.isArray(accept) ? \"one of \".concat(accept.join(', ')) : accept;\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(messageSuffix)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" bytes\")\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" bytes\")\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: 'Too many files'\n}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === 'application/x-moz-file' || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n return accepted && sizeMatch;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === 'function') {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== 'undefined') {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === 'Files' || type === 'application/x-moz-file';\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === 'object' && item !== null && item.kind === 'file';\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf('MSIE') !== -1 || userAgent.indexOf('Trident/') !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf('Edge/') !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { fromEvent } from 'file-selector';\nimport { allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, isEvtWithFiles, isIeOrEdge, isPropagationStopped, onDocumentDragOver, TOO_MANY_FILES_REJECTION } from './utils/index';\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n *
\n * \n *

Drag 'n' drop some files here, or click to select files

\n *
\n * )}\n *
\n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, [\"children\"]);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, [\"open\"]);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = 'Dropzone'; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.draggedFiles Files in active drag\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n */\n accept: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Custom validation function \n * @param {File} file\n * @returns {FileError|FileError[]}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise)}\n */\n\n/**\n * An object with the current dropzone state and some helper functions.\n *\n * @typedef {object} DropzoneState\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} draggedFiles Files in active drag\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n draggedFiles: [],\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n *
\n * \n *

Drag and drop some files here, or click to select files

\n *
\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {string|string[]} [props.accept] Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n *\n * @returns {DropzoneState}\n */\n\nexport function useDropzone() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$options = _objectSpread(_objectSpread({}, defaultProps), options),\n accept = _defaultProps$options.accept,\n disabled = _defaultProps$options.disabled,\n getFilesFromEvent = _defaultProps$options.getFilesFromEvent,\n maxSize = _defaultProps$options.maxSize,\n minSize = _defaultProps$options.minSize,\n multiple = _defaultProps$options.multiple,\n maxFiles = _defaultProps$options.maxFiles,\n onDragEnter = _defaultProps$options.onDragEnter,\n onDragLeave = _defaultProps$options.onDragLeave,\n onDragOver = _defaultProps$options.onDragOver,\n onDrop = _defaultProps$options.onDrop,\n onDropAccepted = _defaultProps$options.onDropAccepted,\n onDropRejected = _defaultProps$options.onDropRejected,\n onFileDialogCancel = _defaultProps$options.onFileDialogCancel,\n preventDropOnDocument = _defaultProps$options.preventDropOnDocument,\n noClick = _defaultProps$options.noClick,\n noKeyboard = _defaultProps$options.noKeyboard,\n noDrag = _defaultProps$options.noDrag,\n noDragEventsBubbling = _defaultProps$options.noDragEventsBubbling,\n validator = _defaultProps$options.validator;\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive,\n draggedFiles = state.draggedFiles; // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n if (inputRef.current) {\n dispatch({\n type: 'openDialog'\n });\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch]); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: 'closeDialog'\n });\n\n if (typeof onFileDialogCancel === 'function') {\n onFileDialogCancel();\n }\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener('focus', onWindowFocus, false);\n return function () {\n window.removeEventListener('focus', onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancel]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, inputRef]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: 'focus'\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: 'blur'\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [inputRef, noClick]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener('dragover', onDocumentDragOver, false);\n document.addEventListener('drop', onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', onDocumentDragOver);\n document.removeEventListener('drop', onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (draggedFiles) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n dispatch({\n draggedFiles: draggedFiles,\n isDragActive: true,\n type: 'setDraggedFiles'\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n });\n }\n }, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = 'copy';\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n isDragActive: false,\n type: 'setDraggedFiles',\n draggedFiles: []\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: 'setFiles'\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n });\n }\n\n dispatch({\n type: 'reset'\n });\n }, [multiple, accept, minSize, maxSize, maxFiles, getFilesFromEvent, onDrop, onDropAccepted, onDropRejected, noDragEventsBubbling]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, [\"refKey\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"]);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb))\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, [\"refKey\", \"onChange\", \"onClick\"]);\n\n var inputProps = _defineProperty({\n accept: accept,\n multiple: multiple,\n type: 'file',\n style: {\n display: 'none'\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n autoComplete: 'off',\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n var fileCount = draggedFiles.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: draggedFiles,\n accept: accept,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case 'focus':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case 'blur':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case 'openDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: true\n });\n\n case 'closeDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case 'setDraggedFiles':\n /* eslint no-case-declarations: 0 */\n var isDragActive = action.isDragActive,\n draggedFiles = action.draggedFiles;\n return _objectSpread(_objectSpread({}, state), {}, {\n draggedFiles: draggedFiles,\n isDragActive: isDragActive\n });\n\n case 'setFiles':\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case 'reset':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false,\n isDragActive: false,\n draggedFiles: [],\n acceptedFiles: [],\n fileRejections: []\n });\n\n default:\n return state;\n }\n}","import escapeStringRegexp from 'escape-string-regexp';\n\nconst regexpCache = new Map();\n\nconst sanitizeArray = (input, inputName) => {\n\tif (!Array.isArray(input)) {\n\t\tswitch (typeof input) {\n\t\t\tcase 'string':\n\t\t\t\tinput = [input];\n\t\t\t\tbreak;\n\t\t\tcase 'undefined':\n\t\t\t\tinput = [];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new TypeError(`Expected '${inputName}' to be a string or an array, but got a type of '${typeof input}'`);\n\t\t}\n\t}\n\n\treturn input.filter(string => {\n\t\tif (typeof string !== 'string') {\n\t\t\tif (typeof string === 'undefined') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthrow new TypeError(`Expected '${inputName}' to be an array of strings, but found a type of '${typeof string}' in the array`);\n\t\t}\n\n\t\treturn true;\n\t});\n};\n\nconst makeRegexp = (pattern, options) => {\n\toptions = {\n\t\tcaseSensitive: false,\n\t\t...options,\n\t};\n\n\tconst cacheKey = pattern + JSON.stringify(options);\n\n\tif (regexpCache.has(cacheKey)) {\n\t\treturn regexpCache.get(cacheKey);\n\t}\n\n\tconst negated = pattern[0] === '!';\n\n\tif (negated) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tpattern = escapeStringRegexp(pattern).replace(/\\\\\\*/g, '[\\\\s\\\\S]*');\n\n\tconst regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i');\n\tregexp.negated = negated;\n\tregexpCache.set(cacheKey, regexp);\n\n\treturn regexp;\n};\n\nconst baseMatcher = (inputs, patterns, options, firstMatchOnly) => {\n\tinputs = sanitizeArray(inputs, 'inputs');\n\tpatterns = sanitizeArray(patterns, 'patterns');\n\n\tif (patterns.length === 0) {\n\t\treturn [];\n\t}\n\n\tpatterns = patterns.map(pattern => makeRegexp(pattern, options));\n\n\tconst {allPatterns} = options || {};\n\tconst result = [];\n\n\tfor (const input of inputs) {\n\t\t// String is included only if it matches at least one non-negated pattern supplied.\n\t\t// Note: the `allPatterns` option requires every non-negated pattern to be matched once.\n\t\t// Matching a negated pattern excludes the string.\n\t\tlet matches;\n\t\tconst didFit = [...patterns].fill(false);\n\n\t\tfor (const [index, pattern] of patterns.entries()) {\n\t\t\tif (pattern.test(input)) {\n\t\t\t\tdidFit[index] = true;\n\t\t\t\tmatches = !pattern.negated;\n\n\t\t\t\tif (!matches) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!(\n\t\t\t\tmatches === false\n\t\t\t\t|| (matches === undefined && patterns.some(pattern => !pattern.negated))\n\t\t\t\t|| (allPatterns && didFit.some((yes, index) => !yes && !patterns[index].negated))\n\t\t\t)\n\t\t) {\n\t\t\tresult.push(input);\n\n\t\t\tif (firstMatchOnly) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n};\n\nexport function matcher(inputs, patterns, options) {\n\treturn baseMatcher(inputs, patterns, options, false);\n}\n\nexport function isMatch(inputs, patterns, options) {\n\treturn baseMatcher(inputs, patterns, options, true).length > 0;\n}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/tslib/tslib.es6.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/graphql/directives.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/graphql/fragments.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/graphql/storeUtils.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/graphql/getFromAST.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/filterInPlace.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/graphql/transform.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/mergeDeep.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/observables/Observable.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/cloneDeep.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/observables/iteration.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/observables/asyncMap.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/observables/subclassing.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/observables/Concast.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/arrays.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/errorHandling.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/canUse.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/compact.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/node_modules/ts-invariant/lib/invariant.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/recoil/es/recoil.js","webpack:///../core/src/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///../core/src/hooks/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/inmemory/helpers.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@wry/equality/lib/equality.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/extends.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/core/networkStatus.js","webpack:///../core/src/state/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/createClass.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss/dist/jss.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/jsutils/defineInspect.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/jsutils/invariant.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/ast.mjs","webpack:///../core/src/queries/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@wry/trie/lib/trie.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/optimism/lib/bundle.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/utils/fromError.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/utils/toPromise.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/utils/fromPromise.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/utils/throwServerError.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/utils/validateOperation.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/utils/createOperation.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/utils/transformOperation.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/core/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/errors/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/context/ApolloContext.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/context/ApolloConsumer.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/context/ApolloProvider.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/parser/index.js","webpack:///../core/src/mutations/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/core/ApolloLink.js","webpack:///../core/src/fragments/asset.ts","webpack:///../media-module/src/components/Presentation/index.ts","webpack:///../media-module/src/state/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/tiny-warning/dist/tiny-warning.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/core/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/dist/readFromConsumerApi.js","webpack:///../clipboard/src/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@wry/context/lib/context.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/inmemory/reactiveVars.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/is-in-browser/dist/module.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///../core/src/fragments/tag.ts","webpack:///../asset-usage/src/index.ts","webpack:///../media-module/src/components/Main/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/core/types/common.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql-tag/node_modules/tslib/tslib.es6.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/jsutils/isObjectLike.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/polyfills/symbols.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/location.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/printLocation.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/error/GraphQLError.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/error/syntaxError.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/kinds.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/tokenKind.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/jsutils/devAssert.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/jsutils/instanceOf.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/source.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/directiveLocation.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/lexer.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/parser.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql-tag/lib/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack:///../core/src/components/index.ts","webpack:///../media-module/src/hooks/index.ts","webpack:///../asset-upload/src/state/index.ts","webpack:///../asset-upload/src/state/uploadDialogVisibleState.ts","webpack:///../media-module/src/components/SideBarRight/Inspector/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/serializeFetchParameter.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/printer.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/checkFetcher.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/createSignalIfSupported.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/selectURI.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/rewriteURIForGET.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/createHttpLink.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/http/HttpLink.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/inmemory/policies.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs","webpack:///(webpack)/buildin/global.js","webpack:///../core/src/fragments/assetCollection.ts","webpack:///../core/src/events/index.ts","webpack:///../core/src/helper/index.ts","webpack:///../asset-preview/src/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-dom/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/core/cache.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/core/Reobserver.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/core/ObservableQuery.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/jsutils/inspect.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/blockString.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack:///../core/src/provider/index.ts","webpack:///../core/src/provider/Notify.tsx","webpack:///../core/src/hooks/useSelectedTag.ts","webpack:///../core/src/state/selectedInspectorViewState.ts","webpack:///../core/src/hooks/useSelectedAssetCollection.ts","webpack:///../core/src/constants/pagination.ts","webpack:///../asset-usage/src/state/assetUsageDetailsModalState.ts","webpack:///../clipboard/src/state/clipboardVisibleState.ts","webpack:///../clipboard/src/queries/ClipboardQuery.ts","webpack:///../clipboard/src/hooks/useClipboard.ts","webpack:///../similar-assets/src/state/similarAssetsModalState.ts","webpack:///../asset-upload/src/components/index.ts","webpack:///../asset-upload/src/components/UploadSection.tsx","webpack:///../asset-upload/src/components/PreviewSection.tsx","webpack:///../asset-upload/src/mutations/index.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/helpers/safeHTMLElement.js","webpack:///../media-module/src/components/SideBarRight/Inspector/Property.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/Actions.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/InspectorContainer.tsx","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/core/LocalState.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/core/QueryInfo.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/core/QueryManager.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/core/ApolloClient.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/version.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/zen-observable/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/symbol-observable/es/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/dist/registry/SynchronousRegistry.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/process/browser.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/core/empty.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/core/from.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/core/split.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/core/concat.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/core/execute.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/core/types/Cache.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/extract-files/public/isExtractableFile.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/extract-files/public/ReactNativeFile.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/apollo-upload-client/public/formDataAppendFile.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/apollo-upload-client/public/isExtractableFile.js","webpack:///../core/src/fragments/assetSource.ts","webpack:///../core/src/state/selectedAssetIdState.ts","webpack:///../core/src/state/selectedSortOrderState.ts","webpack:///../core/src/hooks/useAssetQuery.ts","webpack:///../core/src/events/createEvent.ts","webpack:///../media-module/src/core/index.ts","webpack:///../core/src/constants/neos.ts","webpack:///../media-module/src/queries/index.ts","webpack:///../asset-usage/src/queries/assetUsages.ts","webpack:///../asset-usage/src/fragments/usageDetailsGroupFragment.ts","webpack:///../asset-usage/src/queries/unusedAssets.ts","webpack:///../asset-usage/src/hooks/useAssetUsages.ts","webpack:///../asset-usage/src/state/showUnusedAssetsState.ts","webpack:///../clipboard/src/components/ClipboardItem.tsx","webpack:///../clipboard/src/resolvers/mutation.ts","webpack:///../concurrent-editing/src/hooks/useChangedAssetsQuery.ts","webpack:///../concurrent-editing/src/queries/changedAssets.ts","webpack:///../similar-assets/src/index.ts","webpack:///../similar-assets/src/hooks/useSimilarAssets.ts","webpack:///../similar-assets/src/queries/similarAssets.ts","webpack:///../asset-upload/src/components/Dialogs/NewAssetDialog.tsx","webpack:///../asset-upload/src/components/FilePreview.tsx","webpack:///../asset-upload/src/hooks/index.ts","webpack:///../asset-upload/src/components/Dialogs/ReplaceAssetDialog.tsx","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/helpers/tabbable.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/helpers/ariaAppHider.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/helpers/portalOpenInstances.js","webpack:///../asset-preview/src/state/selectedAssetForPreviewState.ts","webpack:///../media-module/src/components/SideBarLeft/index.ts","webpack:///../media-module/src/components/SideBarLeft/Tree/index.ts","webpack:///../core/src/constants/dndTypes.ts","webpack:///../media-module/src/components/SideBarRight/Inspector/PropertyInspector.tsx","webpack:///../media-module/src/components/SideBarRight/CurrentSelection.tsx","webpack:///../media-module/src/components/BottomBar/AssetCount/AssetCount.tsx","webpack:///../media-module/src/components/BottomBar/Pagination/Pagination.tsx","webpack:///../media-module/src/components/TopBar/index.ts","webpack:///../media-module/src/components/Main/MissingAssetActions.tsx","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/hooks/useApolloClient.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/data/OperationData.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/data/SubscriptionData.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/data/MutationData.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/data/QueryData.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/hooks/utils/useBaseQuery.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/hooks/utils/useDeepMemo.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/hooks/useLazyQuery.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/hooks/useMutation.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/hooks/useQuery.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/hooks/useSubscription.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/react/hooks/useReactiveVar.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/inmemory/entityStore.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/inmemory/readFromStore.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/inmemory/writeToStore.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/cache/inmemory/inMemoryCache.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/node_modules/ts-invariant/node_modules/tslib/tslib.es6.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/graphql/language/visitor.mjs","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/fast-json-stable-stringify/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/node_modules/symbol-observable/es/ponyfill.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/symbol-observable/es/ponyfill.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/attr-accept/dist/es/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/index.js","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/dist/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/dist/createConsumerApi.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/dist/manifest.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/dist/registry/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/dist/registry/AbstractRegistry.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/positional-array-sorter/dist/positionalArraySorter.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/dist/registry/SynchronousMetaRegistry.js","webpack:///./src/MediaSelectionScreen.tsx","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/zen-observable/lib/Observable.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/node_modules/symbol-observable/es/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/utilities/common/environment.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/apollo-upload-client/public/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/apollo-upload-client/public/createUploadLink.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/extends.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/extract-files/public/extractFiles.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/apollo-upload-client/public/ReactNativeFile.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:///../core/src/provider/MediaUiProvider.tsx","webpack:///../core/src/hooks/useAssetCollectionsQuery.ts","webpack:///../core/src/queries/asset.ts","webpack:///../core/src/fragments/iptcProperty.ts","webpack:///../core/src/fragments/file.ts","webpack:///../core/src/queries/assets.ts","webpack:///../core/src/queries/assetCollection.ts","webpack:///../core/src/queries/assetCollections.ts","webpack:///../core/src/queries/assetCount.ts","webpack:///../core/src/queries/assetSources.ts","webpack:///../core/src/queries/config.ts","webpack:///../core/src/queries/tag.ts","webpack:///../core/src/queries/tags.ts","webpack:///../core/src/queries/selectedAssetSource.ts","webpack:///../core/src/hooks/useAssetCountQuery.ts","webpack:///../core/src/state/currentPageState.ts","webpack:///../core/src/state/initialLoadComplete.ts","webpack:///../core/src/state/loadingState.ts","webpack:///../core/src/state/searchTermState.ts","webpack:///../core/src/state/selectedAssetCollectionIdState.ts","webpack:///../core/src/state/selectedMediaTypeState.ts","webpack:///../core/src/state/selectedTagIdState.ts","webpack:///../core/src/hooks/useAssetSourcesQuery.ts","webpack:///../core/src/hooks/useAssetsQuery.ts","webpack:///../core/src/hooks/useConfigQuery.ts","webpack:///../core/src/hooks/useCreateAssetCollection.ts","webpack:///../core/src/mutations/createAssetCollection.ts","webpack:///../core/src/mutations/createTag.ts","webpack:///../core/src/mutations/deleteAsset.ts","webpack:///../core/src/mutations/deleteAssetCollection.ts","webpack:///../core/src/mutations/deleteTag.ts","webpack:///../core/src/mutations/importAsset.ts","webpack:///../core/src/mutations/setAssetCollections.ts","webpack:///../core/src/mutations/setAssetTags.ts","webpack:///../core/src/mutations/tagAsset.ts","webpack:///../core/src/mutations/untagAsset.ts","webpack:///../core/src/mutations/updateAsset.ts","webpack:///../core/src/mutations/updateAssetCollection.ts","webpack:///../core/src/mutations/updateTag.ts","webpack:///../core/src/hooks/useCreateTag.ts","webpack:///../core/src/hooks/useDeleteAsset.ts","webpack:///../core/src/events/asset.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/pubsub-js/src/pubsub.js","webpack:///(webpack)/buildin/module.js","webpack:///../core/src/hooks/useDeleteAssetCollection.ts","webpack:///../core/src/hooks/useDeleteTag.ts","webpack:///../core/src/hooks/useEvent.tsx","webpack:///../core/src/hooks/useImportAsset.ts","webpack:///../core/src/hooks/useSelectAsset.ts","webpack:///../core/src/hooks/useSelectAssetCollection.ts","webpack:///../core/src/hooks/useSelectAssetSource.ts","webpack:///../core/src/hooks/useSelectTag.ts","webpack:///../core/src/hooks/useSelectedAsset.ts","webpack:///../core/src/hooks/useSetAssetCollections.ts","webpack:///../core/src/hooks/useSetAssetTags.ts","webpack:///../core/src/hooks/useTagsQuery.ts","webpack:///../core/src/hooks/useUntagAsset.ts","webpack:///../core/src/hooks/useUpdateAsset.ts","webpack:///../core/src/hooks/useUpdateAssetCollection.ts","webpack:///../core/src/hooks/useUpdateTag.ts","webpack:///../core/src/provider/Intl.tsx","webpack:///../core/src/provider/MediaUiTheme.tsx","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-is/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-is/cjs/react-is.production.min.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-display-name/lib/getDisplayName.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-cache/dist/jss-plugin-cache.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@neos-project/build-essentials/src/styles/styleConstants.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/lodash.upperfirst/index.js","webpack:///../core/src/components/Dialog.tsx","webpack:///../core/src/helper/humanFileSize.ts","webpack:///../media-module/src/core/PersistentStateManager.ts","webpack:///../media-module/src/hooks/useViewModeSelection.ts","webpack:///../media-module/src/queries/ViewModeSelectionQuery.ts","webpack:///../media-module/src/hooks/useAssetCount.ts","webpack:///../asset-usage/src/interfaces/UsageDetails.ts","webpack:///../asset-usage/src/components/AssetUsagesModal.tsx","webpack:///../asset-usage/src/components/AssetUsageSection.tsx","webpack:///../asset-usage/src/components/AssetUsagesToggleButton.tsx","webpack:///../asset-usage/src/hooks/useUnusedAssetsQuery.ts","webpack:///../asset-usage/src/queries/useUnusedAssetCountQuery.ts","webpack:///../asset-usage/src/queries/unusedAssetCount.ts","webpack:///../media-module/src/state/createAssetCollectionDialogState.ts","webpack:///../media-module/src/state/createTagDialogState.ts","webpack:///../media-module/src/state/mainViewState.ts","webpack:///../clipboard/src/components/ClipboardToggle.tsx","webpack:///../clipboard/src/components/ClipboardActions.tsx","webpack:///../clipboard/src/components/ClipboardWatcher.ts","webpack:///../media-module/src/core/IdFromObjectResolver.ts","webpack:///../media-module/src/core/ApolloErrorHandler.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@apollo/client/link/error/index.js","webpack:///../media-module/src/core/Cache.ts","webpack:///../media-module/src/components/App.tsx","webpack:///../concurrent-editing/src/index.ts","webpack:///../concurrent-editing/src/components/ConcurrentChangeMonitor.tsx","webpack:///../similar-assets/src/components/SimilarAssetsToggleButton.tsx","webpack:///../similar-assets/src/components/SimilarAssetsModal.tsx","webpack:///../similar-assets/src/components/SimilarAsset.tsx","webpack:///../asset-upload/src/hooks/useUploadDialogState.ts","webpack:///../asset-upload/src/hooks/useUploadFile.ts","webpack:///../asset-upload/src/mutations/replaceAsset.ts","webpack:///../asset-upload/src/mutations/uploadFiles.ts","webpack:///../asset-upload/src/mutations/uploadFile.ts","webpack:///../asset-upload/src/hooks/useUploadFiles.ts","webpack:///../asset-upload/src/hooks/useReplaceAsset.ts","webpack:///../asset-upload/src/components/Dialogs/UploadDialog.tsx","webpack:///../asset-upload/src/components/AssetReplacementButton.tsx","webpack:///../asset-upload/src/components/UploadButton.tsx","webpack:///../asset-preview/src/components/AssetPreview.tsx","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-image-lightbox/dist/index.es.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/components/Modal.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/components/ModalPortal.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/helpers/focusManager.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/helpers/scopeTab.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/warning/warning.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/exenv/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/helpers/classList.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-modal/lib/helpers/bodyTrap.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-image-lightbox/style.css?fb44","webpack:///../media-module/src/components/SideBarLeft/AssetSourceList.tsx","webpack:///../media-module/src/components/Presentation/AssetLabel.tsx","webpack:///../media-module/src/components/Presentation/Column.tsx","webpack:///../media-module/src/components/Presentation/IconLabel.tsx","webpack:///../media-module/src/components/Presentation/PropertyList.tsx","webpack:///../media-module/src/components/Presentation/PropertyListItem.tsx","webpack:///../media-module/src/components/SideBarLeft/AssetSourceDescription.tsx","webpack:///../media-module/src/components/SideBarLeft/SideBarLeft.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/AssetCollectionTree.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/AssetCollectionTreeNode.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/TagTreeNode.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/AddAssetCollectionButton.tsx","webpack:///../media-module/src/components/SideBarLeft/Tree/AddTagButton.tsx","webpack:///../media-module/src/components/SideBarRight/index.ts","webpack:///../media-module/src/components/SideBarRight/SideBarRight.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/AssetInspector.tsx","webpack:///../asset-variants/src/components/VariantsInspector.tsx","webpack:///../asset-variants/src/hooks/useAssetVariants.ts","webpack:///../asset-variants/src/queries/assetVariants.ts","webpack:///../asset-variants/src/fragments/cropInformation.ts","webpack:///../asset-variants/src/components/Variant.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/AssetCollectionInspector.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/IptcMetadataInspector.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/MetadataView.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/TagInspector.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/TagSelectBox.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/TagSelectBoxAsset.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/TagSelectBoxAssetCollection.tsx","webpack:///../media-module/src/components/SideBarRight/Inspector/CollectionSelectBox.tsx","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/media-type/lib/mediaType.js","webpack:///../media-module/src/components/LoadingIndicator.tsx","webpack:///../media-module/src/components/BottomBar/index.ts","webpack:///../media-module/src/components/BottomBar/BottomBar.tsx","webpack:///../media-module/src/components/BottomBar/Pagination/PaginationItem.tsx","webpack:///../media-module/src/components/TopBar/SearchBox.tsx","webpack:///../media-module/src/components/TopBar/TopBar.tsx","webpack:///../media-module/src/components/TopBar/SortOrderSelector.tsx","webpack:///../media-module/src/components/TopBar/TypeFilter.tsx","webpack:///../media-module/src/components/TopBar/ViewModeSelector.tsx","webpack:///../media-module/src/components/Main/AssetActions.tsx","webpack:///../media-module/src/components/Main/ListView.tsx","webpack:///../media-module/src/components/Main/ListViewItem.tsx","webpack:///../media-module/src/components/Main/Main.tsx","webpack:///../media-module/src/components/LoadingLabel.tsx","webpack:///../media-module/src/components/Main/Thumbnail.tsx","webpack:///../media-module/src/components/Main/ThumbnailView.tsx","webpack:///../media-module/src/components/ErrorBoundary.tsx","webpack:///../media-module/src/components/Dialogs/index.ts","webpack:///../media-module/src/components/Dialogs/CreateTagDialog.tsx","webpack:///../media-module/src/components/Dialogs/CreateAssetCollectionDialog.tsx","webpack:///../core/schema.graphql","webpack:///../clipboard/schema.graphql","webpack:///../asset-usage/schema.graphql","webpack:///../media-module/src/resolvers/mutation.ts","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/theming/dist/theming.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-rule-value-observable/dist/jss-plugin-rule-value-observable.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-template/dist/jss-plugin-template.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-global/dist/jss-plugin-global.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-extend/dist/jss-plugin-extend.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-nested/dist/jss-plugin-nested.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-compose/dist/jss-plugin-compose.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/hyphenate-style-name/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-default-unit/dist/jss-plugin-default-unit.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-expand/dist/jss-plugin-expand.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/css-vendor/dist/css-vendor.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-vendor-prefixer/dist/jss-plugin-vendor-prefixer.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-plugin-props-sort/dist/jss-plugin-props-sort.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/jss-preset-default/dist/jss-preset-default.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/shallow-equal/dist/index.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/css-jss/dist/css-jss.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-jss/dist/react-jss.esm.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/file-selector/node_modules/tslib/tslib.es6.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/file-selector/dist/es5/file.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/file-selector/dist/es5/file-selector.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-dropzone/dist/es/utils/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/react-dropzone/dist/es/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/matcher/index.js","webpack:////home/wbehncke/Workspaces/Neos/neos-contributions/instances/media-ui-issue-147-repro/flowpack-media-ui/node_modules/matcher/node_modules/escape-string-regexp/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","React","extendStatics","b","setPrototypeOf","__proto__","Array","__extends","__","this","constructor","__assign","assign","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","desc","getOwnPropertyDescriptor","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","result","done","adopt","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","iterator","v","op","TypeError","pop","push","__createBinding","k","k2","undefined","__exportStar","__values","__read","ar","error","__spread","concat","__spreadArrays","il","a","j","jl","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","mod","default","__importDefault","__classPrivateFieldGet","receiver","privateMap","has","__classPrivateFieldSet","set","shouldInclude","_a","variables","directives","getInclusionDirectives","forEach","directive","isInclusionDirective","directiveArguments","ifArgument","ifValue","kind","every","evaledValue","hasDirectives","names","root","getDirectiveNames","Directive","node","some","hasClientExports","document","getFragmentQueryDocument","fragmentName","actualFragmentName","fragments","definitions","definition","operation","selectionSet","selections","createFragmentMap","symTable","fragment","getFragmentFromSelection","selection","fragmentMap","makeReference","id","__ref","String","obj","Boolean","valueToObjectRepresentation","argObj","isIntValue","isFloatValue","Number","isBooleanValue","isStringValue","isObjectValue","nestedArgObj_1","fields","map","isVariable","variableValue","isListValue","values","listValue","nestedArgArrayObj","isEnumValue","isNullValue","storeKeyNameFromField","field","directivesObj","getStoreKeyName","KNOWN_DIRECTIVES","fieldName","args","filterKeys","sort","filteredArgs_1","JSON","stringify","completeFieldName","stringifiedArgs","keys","argumentsObjectFromField","argObj_1","resultKeyNameFromField","alias","getTypenameFromResult","__typename","_i","isField","typename","isInlineFragment","checkDocument","doc","operations","filter","getOperationDefinition","getOperationName","x","getFragmentDefinitions","getQueryDefinition","queryDef","getMainDefinition","queryDoc","fragmentDefinition","getDefaultValues","defaultValues","defs","variableDefinitions","def","defaultValue","variable","filterInPlace","array","test","context","elem","TYPENAME_FIELD","nullIfDocIsEmpty","isEmpty","getFragmentDefinition","fragmentDef","getDirectiveMatcher","directiveMatcher","dir","removeDirectivesFromDocument","variablesInUse","variablesToRemove","fragmentSpreadsInUse","fragmentSpreadsToRemove","modifiedDoc","Variable","enter","_key","parent","Field","remove","arg","getAllFragmentSpreadsFromSelectionSet","allFragments","frag","FragmentSpread","removeArgumentsFromDocument","config","argMatcher","getArgumentMatcher","argumentMatcher","argument","aConfig","OperationDefinition","varDef","argConfig","argMatchCount_1","Argument","fs","removeFragmentSpreadFromDocument","FragmentDefinition","addTypenameToDocument","SelectionSet","lastIndexOf","added","connectionRemoveConfig","willRemove","removeConnectionDirectiveFromDocument","buildQueryFromSelectionSet","removeClientSetsFromDocument","mergeDeep","sources","mergeDeepArray","count","merger","merge","isObject","defaultReconciler","source","DeepMerger","reconciler","pastCopies","Set","_this","sourceKey","targetValue","shallowCopyForMerge","isArray","slice","getPrototypeOf","add","toString","cloneDeep","cloneDeepHelper","val","seen","Map","copy_1","child","copy_2","maybeDeepFreeze","iterateObserversSafely","observers","method","observersWithMethod","obs","asyncMap","observable","mapFn","catchFn","observer","complete","activeCallbackCount","completed","promiseQueue","callback","makeCallback","examiner","delegate","both","handler","catch","caught","sub","subscribe","unsubscribe","fixObservableSubclass","subclass","species","isPromiseLike","_super","Concast","addObserver","removeObserver","addCount","promise","handlers","latest","cancel","reason","iterable","start","from","deliverLastMessage","nextOrError","quietly","delete","Error","cleanup","called","once","isNonEmptyArray","graphQLResultHasError","errors","canUseWeakMap","WeakMap","navigator","product","compact","objects","proto","InvariantError","message","genericMessage","framesToPop","invariant","condition","verbosityLevels","verbosityLevel","wrapConsoleMethod","console","setVerbosity","level","old","Math","max","log","warn","process","env","PropTypes","Recoil_nullthrows","nullthrows","Recoil_recoverableViolation","recoverableViolation","projectName","Recoil_CopyOnWrite","setByAddingToSet","setByDeletingFromSet","mapBySettingInMap","mapByUpdatingInMap","updater","mapByDeletingFromMap","mapByDeletingMultipleFromMap","ks","Recoil_filterIterable","filterIterable","predicate","index","gks","Recoil_gkx","gk","_gks$get","setPass","setFail","Recoil_gkx_1","Recoil_mapIterable","mapIterable","Recoil_expectationViolation","expectationViolation","format","_defineProperty","configurable","writable","AbstractRecoilValue","newKey","RecoilState","RecoilValueReadOnly","Recoil_RecoilValue","isRecoilValue","Recoil_RecoilValue_1","Recoil_RecoilValue_2","Recoil_RecoilValue_3","Recoil_RecoilValue_4","Recoil_RecoilValue$1","freeze","DefaultValue","DEFAULT_VALUE","RecoilValueNotReady","super","nodes","recoilValues","NodeMissingError","configDeletionHandlers","getConfigDeletionHandler","Recoil_Node","registerNode","recoilValue","getNode","getNodeMaybe","deleteNodeConfigIfPossible","_node$shouldDeleteCon","_getConfigDeletionHan","shouldDeleteConfigOnRelease","setConfigDeletionHandler","fn","recoilValuesForKeys","RetentionZone","Recoil_RetentionZone","retentionZone","setByAddingToSet$1","getNode$1","getNodeMaybe$1","recoilValuesForKeys$1","RetentionZone$1","emptySet","ReadOnlyRecoilValueError","initializeNodeIfNewToStore","store","treeState","trigger","storeState","getState","nodeCleanupFunctions","retentionCleanup","initializeRetentionForNode","nodeKey","retainedBy","nodesRetainedByZone","retention","addToZone","zone","deleteFromZone","size","nodeCleanup","init","peekNodeLoadable","state","peek","getDownstreamNodes","visitedNodes","visitingNodes","graph","getGraph","version","_graph$nodeToNodeSubs","subscribedNodes","nodeToNodeSubscriptions","downstreamNode","Recoil_FunctionalCore","getNodeLoadable","setNodeValue","newValue","cleanUpNode","_state$nodeCleanupFun","setUnvalidatedAtomValue_DEPRECATED","_node$invalidate","invalidate","atomValues","clone","nonvalidatedAtoms","dirtyAtoms","peekNodeInfo","_graph$nodeDeps$get","_storeState$nodeToCom","_storeState$nodeToCom2","type","knownAtoms","knownSelectors","downstreamNodes","loadable","isActive","isSet","isModified","deps","nodeDeps","subscribers","components","nodeToComponentSubscriptions","getDownstreamNodes$1","getNodeLoadable$1","setNodeValue$1","getNodeMaybe$2","DefaultValue$1","RecoilValueNotReady$1","AbstractRecoilValue$1","RecoilState$1","RecoilValueReadOnly$1","isRecoilValue$1","applyAction","action","valueOrUpdater","valueFromValueOrUpdater","current","contents","writes","entries","writeLoadableToTreeState","unvalidatedValue","applyActionsToStore","actions","replaceState","newState","copyTreeState","invalidateDownstreams","queueOrPerformStateUpdate","batchStack","actionsByStore","downstreams","_getNodeMaybe","_getNodeMaybe$invalid","setRecoilValue","subscriptionID","Recoil_RecoilValueInterface","getRecoilValueAsLoadable","currentTree","_storeState$nextTree","_storeState$previousT","nextTree","previousTree","setRecoilValueLoadable","markRecoilValueModified","setUnvalidatedRecoilValue","subscribeToRecoilValue","componentDebugName","subID","release","subs","applyAtomValueWrites","batchStart","invalidateDownstreams_FOR_TESTING","unstable_batchedUpdates","ReactBatchedUpdates","unstable_batchedUpdates$1","Recoil_ReactBatchedUpdates","batchStart$1","unstable_batchedUpdates$2","batcher","Recoil_Batching","getBatcher","setBatcher","newBatcher","batchUpdates","batchEnd","Recoil_Queue","enqueueExecution","Recoil_differenceSets","differenceSets","setsWithValuesToRemove","ret","FIRST","otherSet","Recoil_mapMap","mapMap","mergeDependencyMapIntoGraph","olderGraph","upstreams","downstream","existingUpstreams","upstream","existing","Recoil_Graph","addToDependencyMap","dependencyMap","cloneGraph","mergeDepsIntoDependencyMap","into","upstreamDeps","dep","saveDependencyMapToStore","_storeState$previousT2","_storeState$previousT3","_storeState$nextTree2","nextVersion","hamt_1","createCommonjsModule","_typeof","hamt","BUCKET_SIZE","pow","MASK","MAX_INDEX_NODE","MIN_ARRAY_NODE","nothing","constant","hash","str","len","charCodeAt","hashFragment","h","toBitmap","fromBitmap","bitmap","bit","popcount","arrayUpdate","mutate","at","arr","out","arraySpliceOut","newLen","empty","__hamt_isEmpty","isEmptyNode","Leaf","edit","_modify","Leaf__modify","Collision","children","Collision__modify","IndexedNode","mask","IndexedNode__modify","ArrayNode","ArrayNode__modify","mergeLeaves","h1","n1","h2","n2","subH1","subH2","canEditNode","keyEq","_v","list","updateCollisionList","_newValue","indx","exists","canEdit","newChildren","isLeaf","expand","subNodes","arraySpliceIn","newChild","pack","removed","elements","editable","_editable","_edit","_config","_root","_size","setTree","newRoot","newSize","tryGetHash","alt","tryGet","getHash","hasHash","defKeyCompare","make","modifyHash","NaN","modify","setHash","del","removeHash","deleteHash","beginMutation","endMutation","transient","appk","lazyVisitChildren","lazyVisit","rest","DONE","MapIterator","v0","visit","buildPairs","buildKeys","buildValues","fold","z","toVisit","BuiltInMap","_map","persistentMap","HashArrayMappedTrieMap","_hamt","Recoil_PersistentMap_1","Recoil_PersistentMap$1","graph$1","persistentMap$1","nextTreeStateVersion","getNextTreeStateVersion","makeEmptyTreeState","stateID","transactionMetadata","Recoil_State","makeEmptyStoreState","transactionSubscriptions","nodeTransactionSubscriptions","queuedComponentCallbacks_DEPRECATED","suspendedComponentResolvers","graphsByVersion","versionsUsedByComponent","referenceCounts","retainablesToCheckForRelease","Recoil_unionSets","unionSets","sets","Recoil_someSet","someSet","entry","cleanUpNode$1","deleteNodeConfigIfPossible$1","getNode$2","RetentionZone$2","emptySet$1","releaseRetainablesNowOnCurrentTree","retainables","releasableNodes","findReleasableNodes","searchFromNodes","nonReleasableNodes","findReleasableNodesInner","releasableNodesFoundThisIteration","getDownstreamNodesInTopologicalOrder","doNotDescendInto1","doNotDescendInto2","answer","visited","_storeState$retention","zonesThatCouldRetainNode","nodeChildren","parents","releaseNode","zones","_storeState$retention2","_storeState$retention3","Recoil_Retention","updateRetainCount","retainable","delta","_map$get","newCount","scheduleOrPerformPossibleReleaseOfRetainable","releaseScheduledRetainablesNow","clear","retainedByOptionWithDefault","Recoil_concatIterables","concatIterables","iters","iter","Recoil_Environment","isSSR","window","isReactNative","isSSR$1","batchUpdates$1","initializeNodeIfNewToStore$1","peekNodeInfo$1","graph$2","DEFAULT_VALUE$1","recoilValues$1","recoilValuesForKeys$2","AbstractRecoilValue$2","getRecoilValueAsLoadable$1","setRecoilValue$1","setUnvalidatedRecoilValue$1","getNextTreeStateVersion$1","makeEmptyStoreState$1","Snapshot","checkRefCount_INTERNAL","_store","getLoadable","toPromise","opt","isInitialized","mapper","mutableSnapshot","MutableSnapshot","cloneSnapshot","getStore_INTERNAL","async","replacer","graphs","newGraph","subscribeToTransactions","addTransactionMetadata","retain","autorelease","_refCount","released","setTimeout","getID_INTERNAL","cloneStoreState","bumpVersion","snapshot","recoilState","newValueOrUpdater","Recoil_Snapshot","freshSnapshot","initializeState","Recoil_Snapshot_1","Recoil_Snapshot_2","Recoil_Snapshot_3","Recoil_Snapshot_4","Recoil_Snapshot$1","getNextTreeStateVersion$2","makeEmptyStoreState$2","cleanUpNode$2","getDownstreamNodes$2","setNodeValue$2","setUnvalidatedAtomValue_DEPRECATED$1","graph$3","cloneGraph$1","applyAtomValueWrites$1","releaseScheduledRetainablesNow$1","freshSnapshot$1","useCallback","useContext","useEffect","useMemo","useRef","useState","notInAContext","defaultStore","stateReplacerIsBeingExecuted","startNextTreeIfNeeded","AppContext","createContext","useStoreRef","MutableSourceContext","sendEndOfBatchNotifications","subscriptions","subscription","dependentNodes","comps","_subID","_debugName","cb","splice","Batcher","setNotifyBatcherOfChange","storeRef","setState","discardedVersion","nextID","Recoil_RecoilRoot_react","useRecoilMutableSource","mutableSource","RecoilRoot","initializeState_DEPRECATED","store_INTERNAL","storeProp","_createMutableSource","notifyBatcherOfChange","createMutableSource","unstable_createMutableSource","replaced","initialStoreState_DEPRECATED","initial","atom","writtenNodes","setUnvalidatedAtomValues","initialStoreState","atomKey","createElement","Provider","sendEndOfBatchNotifications_FOR_TESTING","Recoil_filterMap","filterMap","Recoil_filterSet","filterSet","Recoil_invariant","_useMutableSource","Recoil_mergeMaps","mergeMaps","maps","nextKey","useMutableSource","unstable_useMutableSource","Recoil_mutableSource","mutableSourceExists","$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE","Recoil_shallowArrayEqual","shallowArrayEqual","useRef$1","Recoil_useComponentName","useComponentName","batchUpdates$2","DEFAULT_VALUE$2","getNode$3","nodes$1","useRecoilMutableSource$1","useStoreRef$1","isRecoilValue$2","AbstractRecoilValue$3","getRecoilValueAsLoadable$2","setRecoilValue$2","setRecoilValueLoadable$1","setUnvalidatedRecoilValue$2","subscribeToRecoilValue$1","updateRetainCount$1","RetentionZone$3","Snapshot$1","cloneSnapshot$1","setByAddingToSet$2","isSSR$2","mutableSourceExists$1","useMutableSource$1","useCallback$1","useEffect$1","useMemo$1","useRef$2","useState$1","handleLoadable","useRecoilValueLoadable","useRetain","useRecoilValueLoadable_MUTABLESOURCE","getLoadableWithTesting","componentName","_storeState","newLoadable","prevLoadableRef","is","useRecoilValueLoadable_LEGACY","forceUpdate","_state","_prevLoadableRef$curr","_prevLoadableRef$curr2","useRecoilValue","useSetRecoilState","useTransactionSubscription","externallyVisibleAtomValuesInState","toMap","persistedAtomContentsValues","persistence","persistence_UNSTABLE","usePrevious","ref","useGotoRecoilSnapshot","prev","keysToUpdate","_prev$atomValues$get","_next$atomValues$get","shouldRestoreFromSnapshots","Sentinel","SENTINEL","toRetain","useRetain_ACTUAL","timeoutID","clearTimeout","previousRetainables","Recoil_Hooks","recoilComponentGetRecoilValueCount_FOR_TESTING","useRecoilCallback","gotoSnapshot","reset","errMsg","useRecoilInterface","useRecoilInterface_DEPRECATED","recoilValuesUsed","previousSubscriptions","unsubscribeFrom","updateState","getRecoilValue","getRecoilValueLoadable","getRecoilState","useRecoilState","getRecoilStateLoadable","useRecoilStateLoadable","getSetRecoilState","getResetRecoilState","useResetRecoilState","useRecoilSnapshot","setSnapshot","previousSnapshot","useRecoilTransactionObserver","useSetUnvalidatedAtomValues","useTransactionObservation_DEPRECATED","previousAtomValues","atomInfo","_node$persistence_UNS","_node$persistence_UNS2","_node$persistence_UNS3","_node$persistence_UNS4","backButton","modifiedAtoms","useTransactionSubscription_DEPRECATED","peekNodeInfo$2","useStoreRef$2","Recoil_useGetRecoilValueInfo","useGetRecoilValueInfo","RecoilRoot$1","useStoreRef$3","useMemo$2","Recoil_useRecoilBridgeAcrossReactRoots","useRecoilBridgeAcrossReactRoots","RecoilBridge","Recoil_isPromise","isPromise","Canceled","CANCELED","loadableAccessors","__value","other","loadableWithPromise","loadableWithValue","loadableWithError","Recoil_Loadable","loadableLoading","loadableAll","inputs","find","all","isReactNative$1","isSSR$3","Recoil_stableStringify","stableStringify","allowFunctions","includes","_JSON$stringify","toJSON","localeCompare","join","findLeaf","getNodeValue","_handlers$onNodeVisit","onNodeVisit","nodeValue","branches","addLeaf","route","branchKey","_handlers$onNodeVisit2","path","pruneNodeFromTree","pruneUpstreamBranches","branchNode","countDownstreamLeaves","reduce","sum","currNode","Recoil_TreeCache_1","TreeCache","options","_options$onHit","_options$onSet","_options$mapNodeValue","_numLeafs","_onHit","onHit","_onSet","onSet","_mapNodeValue","mapNodeValue","_this$getLeafNode","getLeafNode","leafNode","Recoil_TreeCache$1","Recoil_LRUCache_1","LRUCache","_options$mapKey","_maxSize","maxSize","_head","_tail","_keyMapper","mapKey","mappedKey","head","right","left","_maybeDeleteLRU","deleteLru","tail","Recoil_LRUCache$1","LRUCache$1","TreeCache$1","Recoil_treeCacheLRU","treeCacheLRU","lruCache","cache","lruNode","TreeCache$2","defaultPolicy","equality","eviction","Infinity","Recoil_treeCacheFromPolicy","treeCacheFromPolicy","getTreeCache","getValueMapper","Recoil_PerformanceTimings","startPerfBlock","_id","CANCELED$1","Canceled$1","loadableWithError$1","loadableWithPromise$1","loadableWithValue$1","getNodeLoadable$2","peekNodeLoadable$1","setNodeValue$3","saveDependencyMapToStore$1","DEFAULT_VALUE$3","RecoilValueNotReady$2","getConfigDeletionHandler$1","registerNode$1","isRecoilValue$3","AbstractRecoilValue$4","setRecoilValueLoadable$2","retainedByOptionWithDefault$1","startPerfBlock$1","dependencyStack","waitingStores","getNewExecutionId","executionId","Recoil_selector","selector","cachePolicy_UNSTABLE","cachePolicy","retainedBy_UNSTABLE","executionInfoMap","liveStoresCount","selectorIsLive","getExecutionInfo","depValuesDiscoveredSoFarDuringAsyncWork","latestLoadable","latestExecutionId","stateVersion","selectorInit","selectorShouldDeleteConfigOnRelease","notifyStoreWhenAsyncSettles","stores","getCachedNodeLoadable","isKeyPointingToSelector","wrapPendingDependencyPromise","existingDeps","resolvedDep","clearExecutionInfo","__key","resolvedDepKey","depValue","bypassSelectorDepCacheOnReevaluation","depValues","evaluateSelectorGetter","isLatestExecution","updateExecutionInfoDepValues","maybeFreezeLoadableContents","setCache","depValuesToDepRoute","setDepsInStore","setLoadableInStoreToNotifyDeps","maybeFreezeValue","setExecutionInfo","notifyStoresOfSettledAsync","_store$getState","_store$getState$curre","_store$getState2","_store$getState2$next","_store$getState$nextT","_store$getState3","_store$getState3$next","bypassSelectorDepCache","endPerfBlock","resultIsError","depKey","setNewDepInStore","newDepKey","depLoadable","wrapPendingPromise","errorOrPromise","finally","errorOrDepPromise","valLoadable","getValFromRunningNewExecutionAndUpdatedDeps","newExecutionId","newDepValues","maybeSetCacheWithLoadable","depRoute","getSelectorValAndUpdatedDeps","cachedVal","getValFromCacheAndUpdatedDownstreamDeps","depsAfterCacheDone","executionInfo","inProgressExecutionInfo","getExecutionInfoOfInProgressExecution","_Array$from$find","haveAsyncDepsChanged","_executionInfo$depVal","_mapOfCheckedVersions","oldDepValues","cachedDepValuesCheckedForThisVersion","mapOfCheckedVersions","isCachedVersionSame","nodeVal","oldVal","cacheRoute","selectorPeek","selectorGet","detectCircularDependencies","invalidateSelector","selectorSet","syncSelectorSetFinished","setRecoilState","resetRecoilState","dangerouslyAllowMutability","loadableWithError$2","loadableWithPromise$2","loadableWithValue$2","DEFAULT_VALUE$4","DefaultValue$2","getConfigDeletionHandler$2","registerNode$2","setConfigDeletionHandler$1","isRecoilValue$4","markRecoilValueModified$1","setRecoilValue$3","setRecoilValueLoadable$3","retainedByOptionWithDefault$2","baseAtom","defaultLoadable","cachedAnswerForUnvalidatedValue","cleanupEffectsByStore","peekAtom","_ref","_state$atomValues$get3","_cachedAnswerForUnval","getAtom","nonvalidatedValue","validatorResult","validator","validatedValueLoadable","setAtom","initAtom","initState","alreadyKnown","notifyDefaultSubscribers","_store$getState$nextT3","initValue","pendingSetSelf","effects_UNSTABLE","duringInit","setSelf","effect","currentValue","resetSelf","currentStore","_pendingSetSelf3","_previousTree$atomVal","_pendingSetSelf","_pendingSetSelf2","oldLoadable","oldValue","_options$effects_UNST","_store$getState$nextT4","initLoadable","wrappedPromise","_state$atomValues$get","_store$getState$nextT2","_state$atomValues$get2","_cleanupEffectsByStor","invalidateAtom","shouldDeleteConfigOnReleaseAtom","optionsDefault","restOptions","atomWithFallback","base","storedValue","sel","baseValue","Recoil_atom","Recoil_MapCache_1","MapCache","Recoil_MapCache$1","LRUCache$2","MapCache$1","defaultPolicy$1","Recoil_cacheFromPolicy","cacheFromPolicy","getCache","getValueMapper$1","setConfigDeletionHandler$2","nextIndex","Recoil_selectorFamily","selectorFamily","_options$cachePolicyF","selectorCache","cachePolicyForParams_UNSTABLE","params","_stableStringify","cachedSelector","myKey","myGet","callbacks","myCachePolicy","newSelector","DEFAULT_VALUE$5","DefaultValue$3","setConfigDeletionHandler$3","Recoil_atomFamily","atomFamily","atomCache","legacyAtomOptions","legacyAtom","atomFamilyDefault","param","legacyValue","cachedAtom","atomOptions","newAtom","constantSelector","Recoil_constSelector","constSelector","throwingSelector","Recoil_errorSelector","errorSelector","Recoil_readOnlySelector","readOnlySelector","loadableWithError$3","loadableWithPromise$3","loadableWithValue$3","concurrentRequests","results","fill","exceptions","isError","exp","unwrapDependencies","dependencies","getOwnPropertyNames","getValueFromLoadablePromiseResult","wrapResults","idx","wrapLoadables","exception","Recoil_WaitFor","waitForNone","waitForAny","waitForAll","exceptionResults","combineAsyncResultsWithSyncResults","syncResults","asyncResults","waitForAllSettled","noWait","dependency","batchUpdates$3","setBatcher$1","DefaultValue$4","RecoilRoot$2","isRecoilValue$5","retentionZone$1","freshSnapshot$2","useGotoRecoilSnapshot$1","useRecoilCallback$1","useRecoilSnapshot$1","useRecoilState$1","useRecoilStateLoadable$1","useRecoilTransactionObserver$1","useRecoilValue$1","useRecoilValueLoadable$1","useResetRecoilState$1","useRetain$1","useSetRecoilState$1","useSetUnvalidatedAtomValues$1","useTransactionObservation_DEPRECATED$1","noWait$1","waitForAll$1","waitForAllSettled$1","waitForAny$1","waitForNone$1","Recoil_index","useRecoilBridgeAcrossReactRoots_UNSTABLE","useGetRecoilValueInfo_UNSTABLE","useRecoilTransactionObserver_UNSTABLE","useTransactionObservation_UNSTABLE","useSetUnvalidatedAtomValues_UNSTABLE","snapshot_UNSTABLE","Recoil_index_1","Recoil_index_2","Recoil_index_3","Recoil_index_4","Recoil_index_5","Recoil_index_6","Recoil_index_7","Recoil_index_8","Recoil_index_9","Recoil_index_10","Recoil_index_11","Recoil_index_12","Recoil_index_13","Recoil_index_14","Recoil_index_15","Recoil_index_16","Recoil_index_17","Recoil_index_18","Recoil_index_19","Recoil_index_20","Recoil_index_21","Recoil_index_22","Recoil_index_23","Recoil_index_24","Recoil_index_25","Recoil_index_26","Recoil_index_27","Recoil_index_28","Recoil_index_29","Recoil_index_30","Recoil_index_31","Recoil_index_32","Recoil_index_33","Recoil_index_34","__setModuleDefault","useNotify","useMediaUiTheme","useMediaUi","useIntl","createUseMediaUiStyles","NotifyProvider","MediaUiThemeProvider","MediaUiProvider","IntlProvider","Helper","Events","Components","provider_1","ReactUiComponents","useUpdateTag","useUpdateAssetCollection","useUpdateAsset","useUntagAsset","useTagsQuery","useSetAssetTags","useSetAssetCollections","useSelectedTag","useSelectedAssetCollection","useSelectedAsset","useSelectTag","useSelectAssetSource","useSelectAssetCollection","useSelectAsset","useImportAsset","useEvent","useDeleteTag","useDeleteAssetCollection","useDeleteAsset","useCreateTag","useCreateAssetCollection","useConfigQuery","useAssetsQuery","useAssetSourcesQuery","useAssetQuery","useAssetCountQuery","useAssetCollectionsQuery","useAssetCollectionsQuery_1","useAssetCountQuery_1","useAssetQuery_1","useAssetSourcesQuery_1","useAssetsQuery_1","useConfigQuery_1","useCreateAssetCollection_1","useCreateTag_1","useDeleteAsset_1","useDeleteAssetCollection_1","useDeleteTag_1","useEvent_1","useImportAsset_1","useSelectAsset_1","useSelectAssetCollection_1","useSelectAssetSource_1","useSelectTag_1","useSelectedAsset_1","useSelectedAssetCollection_1","useSelectedTag_1","useSetAssetCollections_1","useSetAssetTags_1","useTagsQuery_1","useUntagAsset_1","useUpdateAsset_1","useUpdateAssetCollection_1","useUpdateTag_1","hasOwn","TypeOrFieldNameRegExp","fieldNameFromStoreName","storeFieldName","match","selectionSetMatchesResult","item","storeValueIsStoreObject","makeProcessedFieldsMerger","fnToStr","Function","previousComparisons","equal","check","aTag","bTag","previouslyCompared","aKeys","definedKeys","bKeys","keyCount","aIterator","isMap","info","aKey","aValue","aCode","endsWith","full","suffix","fromIndex","nativeCodeSuffix","isDefinedKey","bSet","_extends","NetworkStatus","isNetworkRequestInFlight","networkStatus","selectedTagIdState","selectedSortOrderState","selectedMediaTypeState","selectedInspectorViewState","selectedAssetIdState","selectedAssetCollectionIdState","searchTermState","loadingState","initialLoadCompleteState","currentPageState","currentPageState_1","initialLoadComplete_1","loadingState_1","searchTermState_1","selectedAssetCollectionIdState_1","selectedAssetIdState_1","selectedInspectorViewState_1","selectedMediaTypeState_1","selectedSortOrderState_1","selectedTagIdState_1","_defineProperties","props","descriptor","_createClass","Constructor","protoProps","staticProps","_assertThisInitialized","self","ReferenceError","plainObjectConstrurctor","cloneStyle","style","newStyle","createRule","decl","jss","declCopy","rule","plugins","onCreateRule","by","toCssValue","ignoreImportant","cssValue","indentStr","indent","toCss","_options$indent","fallbacks","fallback","prop","_prop","_value","_prop2","_value2","allowEmpty","escapeRegex","nativeEscape","CSS","escape","replace","BaseStyleRule","isProcessed","renderer","renderable","sheet","Renderer","force","onChangeValue","isDefined","removeProperty","setProperty","attached","_BaseStyleRule","StyleRule","selectorText","scoped","generateId","_proto2","applyTo","json","opts","link","setSelector","replaceRule","pluginStyleRule","defaultToStringOptions","atRegExp","ConditionalRule","styles","query","rules","atMatch","_proto","getRule","addRule","onProcessRule","keyRegExp","pluginConditionalRule","defaultToStringOptions$1","nameRegExp","KeyframesRule","frames","nameMatch","keyRegExp$1","refRegExp","findReferencedKeyframe","keyframes","replaceRef","refKeyframe","onProcessStyle","KeyframeRule","_len","pluginKeyframeRule","FontFaceRule","keyRegExp$2","pluginFontFaceRule","ViewportRule","pluginViewportRule","SimpleRule","keysMap","defaultUpdateOptions","forceUpdateOptions","RuleList","counter","classes","ruleOptions","_this$options","register","unregister","update","data","updateOne","_this$options2","styleRule","onUpdate","nextValue","_nextValue","_prevValue","css","StyleSheet","deployed","queue","attach","deploy","detach","insertRule","addRules","deleteRule","_this$rules","PluginsRegistry","internal","external","registry","onProcessSheet","processedValue","use","newPlugin","plugin","SheetsRegistry","_temp","globalThis$1","globalThis","createGenerateId","ruleCounter","jssId","prefix","classNamePrefix","minify","memoize","getPropertyValue","cssRule","attributeStyleMap","err","getHead","querySelector","findPrevNode","registry$1","findHigherSheet","insertionPoint","element","parentNode","findHighestSheet","nextSibling","comment","findCommentNode","text","childNodes","nodeType","trim","getNonce","getAttribute","_insertRule","container","appendRule","cssRules","getValidRuleInsertionIndex","maxIndex","DomRenderer","hasInsertedRules","media","meta","createStyle","el","textContent","setAttribute","nonce","insertStyle","nextNode","insertBefore","insertionPointElement","appendChild","removeChild","insertRules","nativeParent","latestNativeParent","_insertionIndex","refCssRule","ruleStr","insertionIndex","nativeRule","getRules","instanceCounter","Jss","setup","createStyleSheet","removeStyleSheet","createRule$1","getDynamicStyles","to","extracted","SheetsManager","sheets","refs","manage","unmanage","hasCSSTOMSupport","defineInspect","classObject","inspect","nodejsCustomInspectSymbol","Location","startToken","endToken","end","Token","line","column","isNode","maybeNode","TAGS","TAG","SET_SELECTED_ASSET_SOURCE_ID","SELECTED_ASSET_SOURCE_ID","CONFIG","ASSET_SOURCES","ASSET_COUNT","ASSET_COLLECTIONS","ASSET_COLLECTION","ASSETS","ASSET","asset_1","assets_1","assetCollection_1","assetCollections_1","assetCount_1","assetSources_1","config_1","tag_1","tags_1","selectedAssetSource_1","defaultMakeData","Trie","weakness","makeData","lookup","lookupArray","getChildTrie","isObjRef","weak","strong","defaultDispose","Cache","dispose","newest","oldest","older","newer","clean","parentEntrySlot","maybeUnsubscribe","entryOrDep","emptySetPool","assert","optionalMessage","valueGet","Entry","childValues","dirtyChildren","dirty","recomputing","mightBeDirty","recompute","rememberParent","getValue","reportDirtyChild","reportCleanChild","reallyRecompute","forgetChildren","withValue","recomputeNewValue","maybeSubscribe","setDirty","setClean","reportClean","reportDirty","forgetChild","dependOn","forgetDeps","childValue","valueCopy","valueIs","removeDirtyChild","dc","depsByKey","depend","dep_1","keyTrie","defaultMakeCacheKey","caches","wrap","originalFunction","keyArgs","makeCacheKey","optimistic","hasValue","forget","fromError","errorValue","fromPromise","throwServerError","response","statusCode","status","validateOperation","OPERATION_FIELDS","createOperation","starting","transformOperation","transformedOperation","extensions","operationName","isApolloError","ApolloError","graphQLErrors","networkError","errorMessage","extraInfo","graphQLError","getApolloContext","displayName","ApolloConsumer","ApolloContext","Consumer","client","ApolloProvider","DocumentType","Query","Mutation","Subscription","parser","cached","queries","mutations","payload","UPDATE_TAG","UPDATE_ASSET_COLLECTION","UPDATE_ASSET","UNTAG_ASSET","TAG_ASSET","SET_ASSET_TAGS","SET_ASSET_COLLECTIONS","IMPORT_ASSET","DELETE_TAG","DELETE_ASSET_COLLECTION","DELETE_ASSET","CREATE_TAG","CREATE_ASSET_COLLECTION","createAssetCollection_1","createTag_1","deleteAsset_1","deleteAssetCollection_1","deleteTag_1","importAsset_1","setAssetCollections_1","setAssetTags_1","tagAsset_1","untagAsset_1","updateAsset_1","updateAssetCollection_1","updateTag_1","passthrough","forward","of","toLink","ApolloLink","isTerminating","request","LinkError","links","split","leftLink","rightLink","execute","first","second","firstLink","nextLink","onError","setOnError","ASSET_FRAGMENT","templateObject_1","client_1","assetSource_1","iptcProperty_1","file_1","gql","ASSET_SOURCE_FRAGMENT","IPTC_PROPERTY_FRAGMENT","FILE_FRAGMENT","TAG_FRAGMENT","PropertyListItem","PropertyList","IconLabel","Column","AssetLabel","AssetLabel_1","Column_1","IconLabel_1","PropertyList_1","PropertyListItem_1","MainViewState","mainViewState","createTagDialogState","createAssetCollectionDialogState","createAssetCollectionDialogState_1","createTagDialogState_1","mainViewState_1","warning","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","tslib_1","require","readFromConsumerApi","useClipboard","clipboardVisibleState","buildResolvers","ClipboardWatcher","ClipboardItem","ClipboardActions","ClipboardToggle","CLIPBOARD","TOGGLE_CLIPBOARD_STATE","clipboardVisibleState_1","ClipboardQuery_1","useClipboard_1","ClipboardToggle_1","ClipboardItem_1","ClipboardActions_1","ClipboardWatcher_1","mutation_1","currentContext","MISSING_VALUE","idCounter","host","Slot","Date","now","random","context_1","slots","saved","noContext","cacheSlot","consumeAndIterate","items_1","cacheInfoMap","getCacheInfo","vars","forgetCache","rv","recallCache","attachCache","makeVar","listeners","broadcast","listener","onNextChange","broadcastWatches","isBrowser","_objectWithoutPropertiesLoose","excluded","sourceKeys","useUnusedAssetCountQuery","useUnusedAssetsQuery","useAssetUsagesQuery","showUnusedAssetsState","assetUsageDetailsModalState","UsageDetailsMetadataType","USAGE_DETAILS_GROUP_FRAGMENT","UNUSED_ASSETS","AssetUsagesToggleButton","AssetUsagesModal","ASSET_USAGE_DETAILS","assetUsages_1","unusedAssets_1","usageDetailsGroupFragment_1","UsageDetails_1","AssetUsagesModal_1","AssetUsagesToggleButton_1","assetUsageDetailsModalState_1","showUnusedAssetsState_1","useAssetUsages_1","useUnusedAssetsQuery_1","useUnusedAssetCountQuery_1","Main","AssetActions","ListViewItem","ListView","Thumbnail","ThumbnailView","AssetActions_1","ListView_1","ListViewItem_1","Main_1","Thumbnail_1","ThumbnailView_1","MissingFieldError","clientOnly","SYMBOL_TO_STRING_TAG","getLocation","position","lineRegexp","exec","printLocation","location","printSourceLocation","sourceLocation","firstLineColumnOffset","locationOffset","whitespace","lineIndex","lineOffset","lineNum","columnOffset","columnNum","locationStr","lines","locationLine","subLineIndex","floor","subLineColumnNum","subLines","printPrefixedLines","subLine","existingLines","padLen","_ref2","_ref3","leftPad","_possibleConstructorReturn","_wrapNativeSuper","Class","_cache","_isNativeFunction","Wrapper","_construct","_getPrototypeOf","_setPrototypeOf","Parent","_isNativeReflectConstruct","construct","instance","sham","Proxy","_Error","_inherits","subClass","superClass","GraphQLError","_createSuper","Derived","hasNativeReflectConstruct","_createSuperInternal","Super","NewTarget","positions","originalError","_locations2","_source2","_positions2","_extensions2","_classCallCheck","_nodes$0$loc","_nodes","_source","loc","_locations","_positions","pos","_extensions","originalExtensions","isObjectLike","defineProperties","locations","stack","captureStackTrace","printError","output","_i2","_error$nodes2","_i4","_error$locations2","syntaxError","description","Kind","NAME","DOCUMENT","OPERATION_DEFINITION","VARIABLE_DEFINITION","SELECTION_SET","FIELD","ARGUMENT","FRAGMENT_SPREAD","INLINE_FRAGMENT","FRAGMENT_DEFINITION","VARIABLE","INT","FLOAT","STRING","BOOLEAN","NULL","ENUM","LIST","OBJECT","OBJECT_FIELD","DIRECTIVE","NAMED_TYPE","LIST_TYPE","NON_NULL_TYPE","SCHEMA_DEFINITION","OPERATION_TYPE_DEFINITION","SCALAR_TYPE_DEFINITION","OBJECT_TYPE_DEFINITION","FIELD_DEFINITION","INPUT_VALUE_DEFINITION","INTERFACE_TYPE_DEFINITION","UNION_TYPE_DEFINITION","ENUM_TYPE_DEFINITION","ENUM_VALUE_DEFINITION","INPUT_OBJECT_TYPE_DEFINITION","DIRECTIVE_DEFINITION","SCHEMA_EXTENSION","SCALAR_TYPE_EXTENSION","OBJECT_TYPE_EXTENSION","INTERFACE_TYPE_EXTENSION","UNION_TYPE_EXTENSION","ENUM_TYPE_EXTENSION","INPUT_OBJECT_TYPE_EXTENSION","TokenKind","SOF","EOF","BANG","DOLLAR","AMP","PAREN_L","PAREN_R","SPREAD","COLON","EQUALS","AT","BRACKET_L","BRACKET_R","BRACE_L","PIPE","BRACE_R","BLOCK_STRING","COMMENT","devAssert","instanceOf","Source","DirectiveLocation","QUERY","MUTATION","SUBSCRIPTION","SCHEMA","SCALAR","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","Lexer","startOfFileToken","lastToken","token","lineStart","advance","lookahead","_token$next","readToken","printCharCode","code","isNaN","fromCharCode","toUpperCase","lexer","bodyLength","_line","_col","readComment","readBlockString","readString","readNumber","readName","unexpectedCharacterMessage","col","firstCode","isFloat","readDigits","isNameStart","chunkStart","charCode","char2hex","invalidSequence","rawValue","Parser","sourceObj","isSource","_lexer","_options","parseName","expectToken","parseDocument","many","parseDefinition","parseOperationDefinition","parseFragmentDefinition","parseTypeSystemDefinition","parseTypeSystemExtension","peekDescription","unexpected","parseSelectionSet","parseOperationType","parseVariableDefinitions","parseDirectives","operationToken","optionalMany","parseVariableDefinition","parseVariable","parseTypeReference","expectOptionalToken","parseValueLiteral","parseSelection","parseFragment","parseField","nameOrAlias","parseArguments","isConst","parseConstArgument","parseArgument","hasTypeCondition","expectOptionalKeyword","parseFragmentName","typeCondition","parseNamedType","_this$_options","expectKeyword","experimentalFragmentVariables","parseList","parseObject","parseStringLiteral","block","any","_this2","parseObjectField","parseDirective","keywordToken","parseSchemaDefinition","parseScalarTypeDefinition","parseObjectTypeDefinition","parseInterfaceTypeDefinition","parseUnionTypeDefinition","parseEnumTypeDefinition","parseInputObjectTypeDefinition","parseDirectiveDefinition","parseDescription","operationTypes","parseOperationTypeDefinition","interfaces","parseImplementsInterfaces","parseFieldsDefinition","_this$_options2","allowLegacySDLImplementsInterfaces","types","delimitedMany","_this$_options3","allowLegacySDLEmptyFields","parseFieldDefinition","parseArgumentDefs","parseInputValueDef","parseUnionMemberTypes","parseEnumValuesDefinition","parseEnumValueDefinition","parseInputFieldsDefinition","parseSchemaExtension","parseScalarTypeExtension","parseObjectTypeExtension","parseInterfaceTypeExtension","parseUnionTypeExtension","parseEnumTypeExtension","parseInputObjectTypeExtension","repeatable","parseDirectiveLocations","parseDirectiveLocation","_this$_options4","noLocation","getTokenKindDesc","getTokenDesc","atToken","openKind","parseFn","closeKind","delimiterKind","isPunctuatorTokenKind","docCache","fragmentSourceMap","printFragmentWarnings","normalize","string","processFragments","ast","seenKeys","cacheKeyFromLoc","substring","sourceKeySet","cacheKey","parsed","parse","stripLoc","workSet","literals","gql_1","extras","_inheritsLoose","Dialog","Dialog_1","useAssetCount","useViewModeSelection","VIEW_MODES","useViewModeSelection_1","useAssetCount_1","uploadDialogVisibleState","uploadDialogVisibleState_1","UPLOAD_TYPE","recoil_1","visible","uploadType","new","TagSelectBoxAssetCollection","TagSelectBoxAsset","TagSelectBox","TagInspector","PropertyInspector","MetadataView","IptcMetadataInspector","CollectionSelectBox","AssetCollectionInspector","AssetInspector","AssetInspector_1","AssetCollectionInspector_1","IptcMetadataInspector_1","MetadataView_1","PropertyInspector_1","TagInspector_1","TagSelectBox_1","TagSelectBoxAsset_1","TagSelectBoxAssetCollection_1","CollectionSelectBox_1","parseAndCheckHttpResponse","bodyText","parseError","serializeFetchParameter","serialized","print","leave","printDocASTReducer","Name","Document","varDefs","VariableDefinition","argsLine","_ref4","_ref5","InlineFragment","_ref6","_ref7","IntValue","_ref8","FloatValue","_ref9","StringValue","_ref10","BooleanValue","_ref11","NullValue","EnumValue","_ref12","ListValue","_ref13","ObjectValue","_ref14","ObjectField","_ref15","_ref16","NamedType","_ref17","ListType","_ref18","NonNullType","_ref19","SchemaDefinition","addDescription","_ref20","OperationTypeDefinition","_ref21","ScalarTypeDefinition","_ref22","ObjectTypeDefinition","_ref23","FieldDefinition","_ref24","hasMultilineItems","InputValueDefinition","_ref25","InterfaceTypeDefinition","_ref26","UnionTypeDefinition","_ref27","EnumTypeDefinition","_ref28","EnumValueDefinition","_ref29","InputObjectTypeDefinition","_ref30","DirectiveDefinition","_ref31","SchemaExtension","_ref32","ScalarTypeExtension","_ref33","ObjectTypeExtension","_ref34","InterfaceTypeExtension","_ref35","UnionTypeExtension","_ref36","EnumTypeExtension","_ref37","InputObjectTypeExtension","_ref38","maybeArray","_maybeArray$filter$jo","separator","maybeString","isMultiline","fallbackHttpConfig","http","includeQuery","includeExtensions","headers","accept","selectHttpOptionsAndBody","fallbackConfig","configs","credentials","checkFetcher","fetcher","fetch","createSignalIfSupported","AbortController","controller","signal","selectURI","fallbackURI","contextURI","getContext","uri","rewriteURIForGET","chosenURI","queryParams","addQueryParam","encodeURIComponent","serializedVariables","serializedExtensions","preFragment","fragmentStart","substr","queryParamsPrefix","newURI","createHttpLink","linkOptions","useGETForQueries","_b","includeUnusedVariables","requestOptions","linkConfig","fetchOptions","clientAwarenessHeaders","clientAwareness","name_1","contextHeaders","contextConfig","unusedNames_1","_c","_controller","_d","setContext","abort","HttpLink","argsFromFieldSpecifier","spec","defaultDataIdFromObject","keyObject","nullKeyFieldsFn","simpleKeyArgsFn","_args","mergeTrueFn","incoming","mergeObjects","mergeFalseFn","Policies","typePolicies","toBeAdded","supertypeMap","fuzzySubtypes","rootIdsByTypename","rootTypenamesById","usingPossibleTypes","dataIdFromObject","setRootTypename","possibleTypes","addPossibleTypes","addTypePolicies","identify","ROOT_QUERY","policy","getTypePolicy","keyFn","specifierOrId","keyFieldsFnFromSpecifier","queryType","mutationType","subscriptionType","updateTypePolicy","keyFields","setMerge","getFieldPolicy","read","keyArgsFnFromSpecifier","which","rootId","supertype","getSupertypeSet","subtype","RegExp","policy_1","supertypes","inbox","createIfMissing","fieldPolicies","supertypeSet","fragmentMatches","typenameSupertypeSet","workQueue_1","maybeEnqueue_1","needToCheckFuzzySubtypes","regExp","fuzzyString","hasKeyArgs","getStoreFieldName","fieldSpec","specifierOrString","readField","objectOrReference","getFieldValue","readOptions","makeFieldFunctionOptions","getStorage","getMergeFunction","parentTypename","childTypename","runMergeFunction","storage","makeMergeObjectsFunction","policies","toReference","canRead","isReference","fieldNameOrOptions","eType","iType","specifier","computeKeyObject","trie","aliasMap","makeAliasMap","workQueue","responseKey","storeKey","aliases","subsets","strict","prevKey","keyObj","subset","responseName","for","ASSET_COLLECTION_FRAGMENT","assetUpdatedEvent","assetRemovedEvent","assetCreatedEvent","createEvent","createEvent_1","humanFileSize","humanFileSize_1","AssetPreview","selectedAssetForPreviewState","AssetPreview_1","selectedAssetForPreviewState_1","ReactDOM","ApolloCache","getFragmentDoc","recordOptimisticTransaction","transaction","optimisticId","performTransaction","transformDocument","gc","transformForLink","readQuery","returnPartialData","readFragment","writeQuery","write","dataId","writeFragment","Reobserver","shouldFetch","reobserve","newOptions","newNetworkStatus","updateOptions","updatePolling","concast","stop","pollingInfo","timeout","pollInterval","interval","maybeFetch","fetchPolicy","nextFetchPolicy","poll","ObservableQuery","queryManager","queryInfo","onSubscribe","lastError","isDifferentFromLastResult","updateLastResult","lastResult","loading","isTornDown","queryId","generateQueryId","opDef","queryName","removeQuery","getCurrentResult","saveAsLastResult","ready","partial","transform","hasForcedResolvers","diff","getDiff","newResult","lastResultSnapshot","getLastResult","getLastError","resetLastResults","resetQueryStoreErrors","resetErrors","refetch","reobserveOptions","newReobserver","fetchMore","fetchMoreOptions","combinedOptions","qid","notifyOnNetworkStatusChange","observe","fetchQuery","fetchMoreResult","updateQuery","previous","stopQuery","subscribeToMore","startGraphQLSubscription","subscriptionData","setOptions","setVariables","previousResult","broadcastQueries","startPolling","getReobserver","stopPolling","reobserver","assumeImmutableResults","subObserver","_subscription","_observer","defaultSubscriptionObserverErrorCallback","tearDownQuery","shareOptions","setObservableQuery","currentOptions","fetchQueryObservable","ssrMode","hasObservers","formatValue","seenValues","formatObjectValue","previouslySeenValues","customInspectFn","getCustomFn","customValue","formatArray","min","remaining","items","formatObject","getObjectTag","tag","dedentBlockStringValue","rawString","commonIndent","getBlockStringIndentation","_commonIndent","isFirstLine","isEmptyLine","startLine","isBlank","endLine","printBlockString","indentation","preferMultipleLines","isSingleLine","hasLeadingSpace","hasTrailingQuote","hasTrailingSlash","printAsMultipleLines","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","defaultProps","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","propTypes","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","compare","TYPE_STATICS","getStatics","component","isMemo","ForwardRef","render","Memo","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","Notify_1","MediaUiProvider_1","Intl_1","MediaUiTheme_1","NotifyContext","react_1","notificationApi","notice","title","ok","state_1","queries_1","selectedTagId","useQuery","skip","selectedAssetCollectionId","assetCollection","PAGINATION_MAXIMUM_LINKS","ASSETS_PER_PAGE","templateObject_2","clipboard","mutateClipboard","useMutation","inClipboard","assetId","toggleClipboardState","assetIdentity","cachedClipboard","isInClipboard","flushClipboard","similarAssetsModalState","UploadSection","UploadDialog","UploadButton","ReplaceAssetDialog","PreviewSection","NewAssetDialog","FilePreview","AssetReplacementButton","NewAssetDialog_1","ReplaceAssetDialog_1","UploadDialog_1","FilePreview_1","PreviewSection_1","UploadSection_1","AssetReplacementButton_1","UploadButton_1","react_dropzone_1","src_1","hooks_1","helper_1","useStyles","theme","dropzone","display","flexDirection","alignItems","padding","spacing","goldenUnit","borderWidth","borderRadius","borderColor","isDragAccept","isDragActive","isDragReject","colors","success","primary","disabled","borderStyle","backgroundColor","alternatingBackground","color","outline","cursor","userSelect","transition","memo","acceptedFileTypes","files","maxFiles","onSetFiles","translate","Notify","dummyImage","maxFilesToUpload","uploadMaxFileUploadLimit","useDropzone","onDrop","acceptedFiles","spotsLeft","limit","newFiles","file","lastModified","preview","URL","createObjectURL","onDropRejected","rejections","rejection","acc","uploadMaxFileSize","multiple","preventDropOnDocument","getRootProps","getInputProps","className","fileList","marginTop","flexWrap","fileListHeader","flex","marginBottom","fontSize","uploadState","selected","Fragment","fileState","filename","finished","REPLACE_ASSET","UPLOAD_FILE","UPLOAD_FILES","replaceAsset_1","uploadFiles_1","uploadFile_1","canUseDOM","SafeNodeList","SafeHTMLCollection","EE","_interopRequireDefault","SafeHTMLElement","HTMLElement","HTMLCollection","NodeList","react_ui_components_1","propertyGroup","Label","mainBackground","bottom","hasUnpublishedChanges","handleApply","handleDiscard","Button","hoverStyle","onClick","inspector","gridTemplateColumns","gridAutoRows","gridGap","width","LocalState","resolvers","fragmentMatcher","addResolvers","setFragmentMatcher","resolverGroup","setResolvers","getResolvers","runResolvers","remoteResult","onlyRunForcedResolvers","resolveDocument","localResult","getFragmentMatcher","clientQuery","serverQuery","prepareContext","getCacheKey","addExportedVariables","buildRootValueFromCache","exportedVariables","shouldForceResolvers","forceResolvers","rootValue","mainDefinition","definitionOperation","defaultOperationType","execContext","charAt","resolveSelectionSet","resultsToMerge","resolveField","fieldResult","fragmentResult","aliasedFieldName","aliasUsed","defaultResult","resultPromise","resolverType","resolverMap","resolveSubSelectedArray","destructiveMethodCounts","wrapDestructiveCacheMethod","methodName","original","cancelNotifyTimeout","QueryInfo","lastRequestId","stopped","observableQuery","updateWatch","setDiff","oldDiff","notifyTimeout","notify","oq","oqListener","fromOptimisticTransaction","shouldNotify","lastWatch","watch","shouldWrite","lastWrite","dmCount","markResult","allowCacheWrite","shouldWriteResult","errorPolicy","markReady","markError","ignoreErrors","writeWithErrors","QueryManager","queryDeduplication","onBroadcast","localState","fetchCancelFns","transformCache","queryIdCounter","requestIdCounter","mutationIdCounter","inFlightLinkObservables","mutationStore","_info","stopQueryNoBroadcast","cancelPendingFetches","mutation","optimisticResponse","updateQueries","refetchQueries","awaitRefetchQueries","updateWithProxyFn","_e","mutationId","mutationStoreValue","_f","generateMutationId","getVariables","markMutationOptimistic","storeResult","getObservableFromLink","markMutationResult","removeOptimistic","refetchQueryPromises","refetchQuery","queryOptions","cacheWrites_1","updateQueries_1","currentQueryResult","nextQueryResult","mutationResult","queryVariables","getQueryStore","transformed","forLink","cacheEntry_1","defaultVars","watchQuery","generateRequestId","stopQueryInStore","stopQueryInStoreNoBroadcast","clearStore","resetStore","reFetchObservableQueries","includeStandby","observableQueryPromises","getQuery","makeObservable","observablePromise_1","getLocalState","deduplication","inFlightLinkObservables_1","forceFetch","byVariables_1","varJson_1","getResultsFromLink","requestId","hasErrors","aqr","oldNetworkStatus","normalized","fromVariables","fetchQueryByPolicy","readCache","resultsFromCache","fromData","resolved","resultsFromLink","newContext","mergeOptions","defaults","ApolloClient","defaultOptions","resetStoreCallbacks","clearStoreCallbacks","ssrForceFetchDelay","connectToDevTools","__APOLLO_CLIENT__","typeDefs","clientAwarenessName","clientAwarenessVersion","disableNetworkFetches","devToolsHookCb","dataWithOptimisticResults","extract","__actionHookForDevTools","__requestRaw","onResetStore","onClearStore","restore","serializedState","setLocalStateFragmentMatcher","setLink","newLink","Observable","global","AbstractRegistry_1","positional_array_sorter_1","SynchronousRegistry","_registry","indexOfItemWithTheSameKey","findIndex","_getChildrenWrapped","searchKey","unsortedChildren","getChildrenAsObject","getChildren","_getAllWrapped","getAllAsObject","getAllAsList","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","draining","queueIndex","cleanUpNextTick","drainQueue","run","runClearTimeout","marker","Item","noop","nextTick","browser","argv","versions","on","addListener","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","binding","cwd","chdir","umask","originalModule","webpackPolyfill","ReactNativeFile","isExtractableFile","File","Blob","formDataAppendFile","formData","append","SORT_DIRECTION","SORT_BY","sortBy","LastModified","sortDirection","Desc","assetSourceId","asset","pubsub_js_1","topic","event","publish","subscriber","PersistentStateManager","IdFromObjectResolver","CacheFactory","ApolloErrorHandler","IdFromObjectResolver_1","ApolloErrorHandler_1","Cache_1","NEOS_ASSET_SOURCE","VIEW_MODE_SELECTION","SET_VIEW_MODE_SELECTION","ViewModeSelectionQuery_1","assetUsageDetails","clipboardItem","minWidth","height","objectFit","selectAsset","src","thumbnailUrl","updateLocalState","carry","AssetChangeType","changedAssets_1","AssetLastModifiedFragment","useChangedAssetsQuery","lastUpdate","setLastUpdate","changes","setChanges","since","currentServerTime","changedAssets","relevantChanges","change","ASSET_CREATED","CHANGED_ASSETS","SIMILAR_ASSETS","useSimilarAssetsQuery","SimilarAssetsModal","SimilarAssetsToggleButton","SimilarAssetsToggleButton_1","SimilarAssetsModal_1","similarAssetsModalState_1","useSimilarAssets_1","similarAssets_1","similarAssets","components_1","uploadArea","useUploadFiles","uploadFiles","useUploadDialogState","dialogState","closeDialog","setFiles","refetchAssets","uploadPossible","handleUpload","handleSetFiles","isOpen","onRequestClose","thumb","border","half","marginRight","quarter","boxSizing","thumbInner","justifyContent","marginLeft","img","top","zIndex","stateOverlay","content","opacity","extend","stateClassName","Icon","icon","spin","useUploadFile","useUploadDialogState_1","useUploadFile_1","useUploadFiles_1","hooks_2","useReplaceAsset_1","optionSection","option","selectedAsset","replaceAsset","keepOriginalFilename","generateRedirects","replacementOptions","setReplacementOptions","mainType","mediaType","groups","CheckBox","isChecked","onChange","findTabbableDescendants","querySelectorAll","tabbable","tabbableNode","hidesContents","zeroSize","offsetWidth","offsetHeight","innerHTML","getComputedStyle","scrollWidth","scrollHeight","focusable","isTabIndexNotNaN","nodeName","toLowerCase","href","parentElement","tabIndex","isTabIndexNaN","assertNodeList","setElement","useElement","_safeHTMLElement","globalElement","validateElement","hide","appElement","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","return","show","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","removeAttribute","documentNotReadyOrSSRTesting","resetForTesting","_warning2","nodeList","portalOpenInstances","PortalOpenInstances","openInstance","openInstances","deregister","eventType","AssetCollectionTree","SideBarLeft","AssetSourceDescription","AssetSourceList","AssetSourceList_1","AssetSourceDescription_1","SideBarLeft_1","Tree_1","AssetCollectionTree_1","COLLECTION","src_2","src_3","index_1","Property_1","Actions_1","InspectorContainer_1","textArea","featureFlags","setLabel","caption","setCaption","copyrightNotice","setCopyrightNotice","updateAsset","isEditable","localId","TextInput","onEnterKey","TextArea","minRows","expandedRows","assetSource","supportsCollections","supportsTagging","showSimilarAssets","readOnly","media_type_1","currentSelection","overflow","headline","fontWeight","lineHeight","whiteSpace","textOverflow","selectedAssetCollection","selectedTag","selectedInspectorView","mainMediaType","fromString","Headline","assetCount","alignSelf","pagination_1","PaginationItem_1","state_2","pagination","justifySelf","listStyleType","textAlign","ellipsis","currentPage","setCurrentPage","mainView","DEFAULT","numberOfPages","ceil","hasLessPages","hasMorePages","pages","displayRange","setDisplayRange","handlePageClick","page","handlePreviousPageClick","handleNextPageClick","maxLinks","ViewModeSelector","TypeFilter","TopBar","SearchBox","SearchBox_1","TopBar_1","TypeFilter_1","ViewModeSelector_1","IconButton","useApolloClient","OperationData","isMounted","previousOptions","getOptions","storePrevious","unmount","refreshClient","isNew","verifyDocumentType","SubscriptionData","setResult","currentObservable","initialize","currentResult","getLoadingResult","shouldResubscribe","startSubscription","afterExecute","endSubscription","updateCurrentData","updateError","completeSubscription","updateResult","onSubscriptionData","onSubscriptionComplete","MutationData","runMutation","mutationFunctionOptions","onMutationStart","generateNewMutationId","onMutationCompleted","onMutationError","mostRecentMutationId","ignoreResults","onCompleted","isMostRecentMutation","QueryData","onNewData","runLazy","runLazyQuery","lazyOptions","getQueryResult","observableQueryFields","partialRefetch","previousData","obsRefetch","obsFetchMore","obsUpdateQuery","obsStartPolling","obsStopPolling","obsSubscribeToMore","removeQuerySubscription","removeObservable","updateObservableQuery","startQuerySubscription","getExecuteSsrResult","getExecuteResult","executeLazy","fetchData","ssr","lazy","handleErrorOrCompleted","ssrInitiated","renderPromises","ssrDisabled","fetchDisabled","ssrLoading","stale","addQueryPromise","prepareObservableQueryOptions","initializeObservableQuery","getSSRObservable","observableQueryOptions","registerSSRObservable","newObservableQueryOptions","currentSubscription","resubscribeToQuery","andDelete","useBaseQuery","tick","updatedOptions","queryDataRef","queryData","useDeepMemo","memoFn","queryResult","useLazyQuery","mutationDataRef","mutationData","getMutationDataRef","useSubscription","subscriptionDataRef","getSubscriptionDataRef","useReactiveVar","setValue","EntityStore","Root","DELETE","delModifier","INVALIDATE","group","rootIds","objOrRef","objOrIdOrRef","mergeIntoStore","toObject","storeObject","dependOnExistence","merged","storeObjectReconciler","caching","fieldsToDirty_1","__exists","changedFields_1","needToMerge_1","allDeleted_1","sharedDetails_1","fieldValue","evict","evicted","extraRootIds","getRootIdSet","__META","newData","rest_1","ids","findChildRefIds","idsToRemove","root_1","found_1","workSet_1","canTraverse_1","keyMaker","CacheGroup","makeDepKey","resultCaching","seed","storageTrie","sharedLayerGroup","addLayer","layerId","replay","removeLayer","Layer","fromParent","existingObject","incomingObject","existingValue","incomingValue","supportsResultCaching","missingFromInvariant","StoreReader","executeSelectionSet","execSelectionSetImpl","varString","knownResults","executeSubSelectedArray","execSubSelectedArrayImpl","addTypename","diffQueryAgainstStore","execResult","hasMissingFields","missing","isFresh","objectsToMerge","finalResult","getMissing","handleMissing","resultName","wasClientOnly","childResult","StoreWriter","reader","writeToStore","operationDefinition","processSelectionSet","mergeTree","written","incomingFields","resultFieldKey","childTree","getChildMergeTree","processFieldValue","maybeRecycleChildMergeTree","entityRef_1","applyMerges","getStorageArgs","e_1","i_1","getValue_1","eVal","iVal","aVal","emptyMergeTreePool","defaultConfig","InMemoryCache","watches","typenameDocumentCache","txCount","maybeBroadcastWatch","broadcastWatch","optimisticData","watchDep","storeWriter","storeReader","immediate","idToRemove","newOptimisticData","perform","layer","QueryDocumentKeys","BREAK","visitor","visitorKeys","inArray","edits","ancestors","isLeaving","isEdited","_Object$keys2","editOffset","ii","editKey","editValue","_visitorKeys$node$kin","visitFn","getVisitFn","kindVisitor","kindSpecificVisitor","specificVisitor","specificKindVisitor","cmp","cycles","aobj","bobj","isFinite","seenIndex","symbolObservablePonyfill","acceptedFilesArray","fileName","mimeType","baseMimeType","validType","_Modal2","globalRegistry","frontendConfiguration","secondaryEditorsRegistry","useNewMediaSelection","MediaSelectionScreen","createConsumerApi_1","createConsumerApi","readFromConsumerApi_1","SynchronousMetaRegistry","manifest_1","createReadOnlyValue","manifests","exposureMap","api","identifier","bootstrap","SynchronousRegistry_1","SynchronousMetaRegistry_1","AbstractRegistry","SERIAL_VERSION_UID","positionalArraySorter","subject","idKey","e_2","e_3","e_4","e_5","e_6","e_7","_g","positionAccessor","indexMapping","middleKeys","startKeys","endKeys","beforeKeys","afterKeys","positionValue","invalid","startsWith","weight","weightMatch","reference","numberPosition","parseFloat","resultStart","resultMiddle","resultEnd","processedKeys","sortedWeights","dict","asc","weights","reverse","addToResults","e_8","e_9","beforeWeights","beforeWeights_1","beforeWeights_1_1","e_8_1","afterWeights","afterWeights_1","afterWeights_1_1","e_9_1","_h","_j","e_1_1","_k","_l","e_2_1","_m","_o","e_3_1","_p","_q","_r","_s","e_5_1","e_4_1","_t","_u","_w","e_7_1","e_6_1","react_redux_1","apollo_upload_client_1","plow_js_1","neos_ui_decorators_1","neos_ui_redux_store_1","core_1","App_1","schema_graphql_1","schema_graphql_2","schema_graphql_3","mutation_2","apolloClient","packageKey","sourceName","i18nRegistry","initialLeftSideBarHiddenState","initialNodeCreationDialogOpenState","componentDidMount","isLeftSideBarHidden","isNodeCreationDialogOpen","toggleSidebar","componentWillUnmount","getConfig","endpoints","graphql","upload","getApolloClient","createCache","restoreLocalState","constraints","createUploadLink","addFlashMessage","onComplete","containerRef","createRef","Notification","isInNodeCreationDialog","onAssetSelection","selectionMode","assetType","connect","$transform","$get","UI","FlashMessages","LeftSideBar","toggle","neos","PureComponent","reactRedux","hasSymbols","hasSymbol","getSymbol","SymbolIterator","SymbolObservable","SymbolSpecies","getMethod","getSpecies","ctor","isObservable","hostReportError","enqueue","cleanupSubscription","_cleanup","closeSubscription","_queue","notifySubscription","onNotify","flushSubscription","subscriptionObserver","SubscriptionObserver","_subscriber","_this3","_this4","C","hasSeed","_this5","startNext","flatMap","_this6","outer","inner","completeIfDone","closed","_item","_len2","_key2","symbol","_require","_require2","extractFiles","_ref$uri","fetchUri","_ref$isExtractableFil","customIsExtractableFile","CustomFormData","FormData","_ref$formDataAppendFi","customFormDataAppendFile","customFetch","_context$clientAwaren","_selectHttpOptionsAnd","_extractFiles","form","paths","_rewriteURIForGET","addEventListener","runtimeFetch","cleaningUp","defaultIsExtractableFile","addFile","storedPaths","FileList","plow","NeosUiDecorators","NeosUiReduxStore","MediaUiContext","matcher_1","deleteAsset","importAsset","assets","setSelectedMediaType","handleDeleteAsset","confirm","isAssetSelectable","mediaTypes","isMatch","assetSources","handleSelectAsset","includeUsage","assetCollections","searchTerm","assetCollectionId","tagId","mediaTypeFilter","sortOrderState","isLoading","setIsLoading","setInitialLoadComplete","setAssets","offset","mutations_1","createAssetCollection","createTag","proxy","newTag","updatedAssetCollections","tags","events_1","selectedAssetId","setSelectedAsset","assetRemoved","factory","PubSub","messages","lastUid","callSubscriberWithDelayedExceptions","ex","throwException","reThrowException","callSubscriberWithImmediateExceptions","deliverMessage","originalMessage","matchedMessage","immediateExceptions","callSubscriber","hasDirectSubscribersFor","hasKeys","sync","deliver","createDeliveryFunction","deliverNamespaced","messageHasSubscribers","found","publishSync","func","subscribeAll","subscribeOnce","clearAllSubscriptions","clearSubscriptions","countSubscriptions","getSubscriptions","isTopic","descendantTopicExists","isToken","isFunction","deprecate","deleteAssetCollection","setSelectedTagId","deleteTag","setSelectedAssetId","setSelectedInspectorView","setSelectedAssetCollectionId","selectedAssetSourceId","selectedAssetSource","mutateSelectedAssetSourceId","setAssetCollections","assetCollectionIds","collections","setAssetTags","tagIds","useAssetTagsQuery","untagAsset","tagName","updateAssetCollection","updateTag","IntlContext","react_jss_1","jss_1","jss_plugin_cache_1","styleConstants_1","ThemeContext","theming","createTheming","ThemeProvider","useTheme","mediaUiTheme","large","sidebarWidth","scrollbarSize","primaryBlue","contrastBright","contrastNeutral","contrastDark","inactive","generated","deleted","assetBackground","contrastDarkest","captionBackground","moduleBackground","contrastDarker","scrollbarBackground","scrollbarForeground","loadingIndicatorZIndex","paginationZIndex","lightboxZIndex","createUseStyles","w","u","$$typeof","A","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","Lazy","Portal","Profiler","StrictMode","Suspense","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isPortal","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","getDisplayName","Component","cachePlugin","_rule$options","originalStyle","upperFirst","fast","slow","secondaryToolbar","flashMessageContainer","loadingIndicatorContainer","secondaryInspector","secondaryInspectorElevated","dialog","fullScreenClose","drawer","bar","primaryToolbar","checkboxInput","dropdownContents","selectBoxContents","notInlineEditableOverlay","calendarFakeInputMirror","rdtPicker","sideBar","wrapperDropdown","unappliedChangesOverlay","nodeToolBar","small","fonts","headings","family","cssWeight","copy","primaryViolet","primaryVioletHover","primaryBlueHover","contrastBrighter","contrastBrightest","successHover","warnHover","errorHover","uncheckedCheckboxTick","generateCssVarsObject","hasPredicate","camelKey","nestedPredicate","rsAstral","rsCombo","rsFitz","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsSeq","rsSymbol","reUnicode","reHasUnicode","freeGlobal","freeSelf","hasUnicode","stringToArray","unicodeToArray","asciiToArray","objectToString","symbolProto","symbolToString","baseToString","isSymbol","castSlice","baseSlice","createCaseFirst","strSymbols","chr","trailing","dialogRef","section","findDOMNode","firstElementChild","bytes","si","thresh","abs","units","toFixed","resetLocalState","getItem","neos_1","queries_2","writeToCache","viewModeSelection","localStorage","STORAGE_PREFIX","Thumbnails","setItem","mutateViewModeSelection","viewMode","unusedAssetCountLoaded","loadUnusedAssetCount","load","unusedAssetCount","AssetUsageSection_1","assetUsage","usageTable","paddingLeft","paddingRight","textDecoration","setIsOpen","handleRequestClose","usageDetailsGroup","usageSection","usages","metadataSchema","schema","url","rel","usage","toLocaleString","assetUsagesModalOpen","setAssetUsagesModalOpen","showUnusedAssets","unusedAssets","unusedAssetCount_1","UNUSED_ASSET_COUNT","clipboardVisible","margin","setClipboardVisible","initialLoadComplete","toggleClipboard","clipboardActions","onDeleteClipboard","onFlushClipboard","category","errorHandler","retriedSub","retriedResult","ErrorLink","queryAssetUsage","Asset","Tag","AssetCollection","AssetSource","src_4","src_5","src_6","SideBarRight_1","LoadingIndicator_1","BottomBar_1","ErrorBoundary_1","Dialogs_1","gridTemplateRows","gridTemplateAreas","gridColumn","overflowY","gridRight","gridArea","gridLeft","gridMain","gridTop","scrollbarWidth","scrollbarColor","background","paddingTop","paddingBottom","showUploadDialog","showCreateTagDialog","showCreateAssetCollectionDialog","showAssetUsagesModal","showSimilarAssetsModal","BottomBar","SideBarRight","CreateTagDialog","CreateAssetCollectionDialog","ConcurrentChangeMonitor","ConcurrentChangeMonitor_1","useChangedAssetsQuery_1","refetchAsset","ASSET_REPLACED","ASSET_UPDATED","ASSET_REMOVED","debug","similarAssetsModalOpen","setSimilarAssetsModalOpen","SimilarAsset_1","similarAsset","picture","typeIcon","setDialogState","handleClose","revokeObjectURL","uploadFile","useReplaceAsset","setUploadDialogState","react_image_lightbox_1","lightbox","maxWidth","selectedAssetForPreview","setSelectedAssetForPreview","lightBoxContainer","defaultContainer","lightBoxContainerRef","newLightBoxContainer_1","useLightBoxContainer","currentAssetIndex","prevAsset","nextAsset","reactModalStyle","overlay","reactModalProps","parentSelector","wrapperClassName","mainSrc","previewUrl","mainSrcThumbnail","imageTitle","imageCaption","onCloseRequest","prevSrc","prevSrcThumbnail","prevLabel","onMovePrevRequest","nextSrc","nextSrcThumbnail","nextLabel","onMoveNextRequest","_objectSpread","ownKeys","sym","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_arr","_n","_nonIterableRest","_toConsumableArray","_arrayWithoutHoles","arr2","_iterableToArray","_nonIterableSpread","replaceStrings","translated","placeholder","getWindowWidth","innerWidth","KEYS","ReactImageLightbox","_Component","isClosing","animationDisabled","shouldAnimate","zoomLevel","offsetX","offsetY","loadErrorStatus","outerEl","zoomInBtn","zoomOutBtn","closeIfClickInner","handleImageDoubleClick","handleImageMouseWheel","handleKeyInput","handleMouseUp","handleMouseDown","handleMouseMove","handleOuterMousewheel","handleTouchStart","handleTouchMove","handleTouchEnd","handlePointerEvent","handleCaptionMousewheel","handleWindowResize","handleZoomInButtonClick","handleZoomOutButtonClick","requestClose","requestMoveNext","requestMovePrev","isTargetMatchImage","parseMouseEvent","mouseEvent","parseInt","clientX","clientY","parseTouchPointer","touchPointer","parsePointerEvent","pointerEvent","pointerId","getTransform","_ref$x","_ref$y","_ref$zoom","zoom","targetWidth","nextX","scaleFactor","componentWillMount","timeouts","currentAction","eventsSource","pointerList","preventInnerClose","preventInnerCloseTimeout","keyPressed","imageCache","lastKeyDownTime","resizeTimeout","wheelActionTimeout","resetScrollTimeout","scrollX","scrollY","moveStartX","moveStartY","moveStartOffsetX","moveStartOffsetY","swipeStartX","swipeStartY","swipeEndX","swipeEndY","pinchTouchList","pinchDistance","keyCounter","moveRequested","windowContext","getHighestSafeWindowContext","referrer","getOrigin","resize","mouseup","touchend","touchcancel","pointerdown","pointermove","pointerup","pointercancel","loadAllImages","componentWillReceiveProps","nextProps","sourcesChanged","prevSrcDict","nextSrcDict","getSrcTypes","srcType","loaded","shouldComponentUpdate","didUnmount","removeEventListener","tid","_setTimeout","_x","_x2","time","setPreventInnerClose","getBestImageForType","imageSrc","fitSizes","isImageLoaded","getFitSizes","targetHeight","stretch","boxSize","getLightboxRect","maxHeight","imagePadding","getMaxOffsets","currentImageInfo","maxX","minX","maxY","minY","zoomMultiplier","getZoomMultiplier","keyEnding","getBoundingClientRect","innerHeight","_clearTimeout","_x3","changeZoom","enableZoom","nextZoomLevel","imageBaseSize","currentZoomMultiplier","nextZoomMultiplier","boxRect","pointerX","pointerY","currentImageOffsetX","currentImageOffsetY","nextImageRealOffsetX","nextImageRealOffsetY","nextOffsetX","nextOffsetY","maxOffsets","search","stopPropagation","isAnimating","keyCode","currentTime","getTime","keyRepeatLimit","preventDefault","keyRepeatKeyupBonus","_this7","actionDelay","deltaY","deltaX","xThreshold","shouldHandleEvent","filterPointersBySource","addPointer","pointer","removePointer","_this8","multiPointerStart","multiPointerMove","multiPointerEnd","_this9","changedTouches","eventTouch","_this10","touch","decideMoveOrSwipe","handleSwipeStart","handleMoveStart","handleEnd","handlePinchStart","handleMove","handleSwipe","handlePinch","handleMoveEnd","handleSwipeEnd","handlePinchEnd","newOffsetX","newOffsetY","_this11","animationDuration","xDiff","xDiffAbs","yDiffAbs","calculatePinchDistance","sqrt","calculatePinchCenter","oldPointer","newDistance","_this$calculatePinchC","focus","_this$caption$current2","scrollTop","loadImage","_this12","inMemoryImage","Image","imageCrossOrigin","crossOrigin","onerror","errorEvent","onImageLoadError","prevState","onload","onImageLoad","_this13","generateLoadDoneCallback","_this14","closeLightbox","animationOnKeyInput","requestMove","direction","_this15","nextState","_this16","_this$props","clickOutsideToClose","discourageDownloads","toolbarButtons","_onAfterOpen","onAfterOpen","_this$state","transitionStyle","keyEndings","images","addImage","imageClass","transforms","bestImageInfo","imageStyle","hasTrueValue","imageLoadErrorMessage","backgroundImage","onDoubleClick","onWheel","onDragStart","draggable","loadingIcon","modalStyle","contentLabel","animationDirection","onMouseMove","onMouseDown","onTouchStart","onTouchMove","onKeyDown","onKeyUp","button","zoomInLabel","zoomOutLabel","closeLabel","isRequired","bool","number","shape","arrayOf","bodyOpenClassName","portalClassName","_react","_react2","_reactDom2","_propTypes2","_ModalPortal2","ariaAppHider","_interopRequireWildcard","newObj","_safeHTMLElement2","_reactLifecyclesCompat","isReact16","createPortal","getCreatePortal","unstable_renderSubtreeIntoContainer","getParentElement","Modal","removePortal","unmountComponentAtNode","contains","portalRef","portal","renderPortal","defaultStyles","getSnapshotBeforeUpdate","prevProps","prevParent","nextParent","componentDidUpdate","_props","closesAt","closeTimeoutMS","beforeClose","closeWithTimeout","setAppElement","htmlOpenClassName","oneOfType","afterOpen","overlayClassName","ariaHideApp","shouldFocusAfterRender","shouldCloseOnOverlayClick","shouldReturnFocusAfterClose","preventScroll","aria","role","shouldCloseOnEsc","overlayRef","contentRef","overlayElement","contentElement","contentEl","WebkitOverflowScrolling","polyfill","focusManager","_scopeTab2","classList","_portalOpenInstances2","CLASS_NAMES","ariaHiddenInstances","ModalPortal","setOverlayRef","setContentRef","afterClose","getElementsByTagName","returnFocus","teardownScopedFocus","popWithoutFocus","onAfterClose","open","beforeOpen","closeTimer","setupScopedFocus","markForFocusLater","overlayEl","close","closeWithoutTimeout","focusContent","contentHasFocus","handleKeyDown","handleOverlayOnClick","shouldClose","ownerHandlesClose","handleContentOnMouseUp","handleOverlayOnMouseDown","handleContentOnClick","handleContentOnMouseDown","shouldBeClosed","activeElement","buildClassName","additional","classNames","attributesFromObject","moveFromContentToOverlay","_props2","contentStyles","overlayStyles","overlayProps","contentProps","onMouseUp","modal","testId","handleBlur","handleFocus","focusLaterElements","toFocus","modalElement","attachEvent","detachEvent","_tabbable2","needToFocus","scopeTab","shiftKey","checkSafari","userAgent","ExecutionEnvironment","canUseWorkers","Worker","canUseEventListeners","canUseViewport","screen","dumpClassLists","htmlClassList","docBodyClassList","classString","trackClass","classListRef","incrementReference","untrackClass","decrementReference","before","after","instances","bodyTrap","cloneNode","firstChild","lastChild","componentWillUpdate","__reactInternalSnapshotFlag","__reactInternalSnapshot","isReactComponent","foundWillMountName","foundWillReceivePropsName","foundWillUpdateName","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate","newApiName","componentDidUpdatePolyfill","maybeSnapshot","__suppressDeprecationWarning","Presentation_1","assetSourceList","itemSelected","setSelectedAssetSource","iconUri","assetLabel","overflowX","iconWrap","verticalAlign","imgIcon","propertyList","assetSourceDescription","panelHeader","ToggablePanel","closesToBottom","Header","Contents","AssetCollectionTreeNode_1","TagTreeNode_1","AddAssetCollectionButton_1","AddTagButton_1","assetCollectionTree","toolbar","borderTop","tree","selectAssetCollection","selectTag","onClickDelete","Tree","collapsedByDefault","dndTypes_1","collapsed","setCollapsed","handleToggle","handleClick","Node","isCollapsed","isFocused","hasError","nodeDndType","onToggle","hasChildren","plusIcon","setCreateAssetCollectionDialogState","onClickCreate","setCreateTagDialogState","CurrentSelection","CurrentSelection_1","Inspector_1","VariantsInspector_1","tabContent","showVariantsEditor","Tabs","tabs__content","Panel","useAssetVariants_1","Variant_1","variantsContainer","variantItem","variants","variant","assetVariants_1","useAssetVariants","assetVariants","cropInformation_1","ASSET_VARIANTS","CROP_INFORMATION_FRAGMENT","variantContainer","image","backgroundPosition","backgroundSize","infoContainer","variantSizes","presetIdentifier","variantName","_1","setTitle","iptcData","iptcProperties","iptcProperty","propertyName","tagSelectBox","tagSelection","MultiSelectBox","noMatchesFoundLabel","optionValueField","searchOptions","onValuesChange","allTags","selectedTagIds","handleChange","newTags","collectionSelectBox","collectionSelection","assetCollectionsWithLabel","newAssetCollectionIds","collection","collectionsMatchAsset","MediaType","_setSubtypeAndSuffix","parameters","isValid","subtypeFacets","fixes","hasSuffix","_firstSubtypeFacetEquals","isVendor","isPersonal","isExperimental","asString","parameterKeys","that","wrapQuotes","mediaTypeMatcher","parameterSplitter","parameter","keyAndValue","unwrapQuotes","transitionTimingFunction","indicator","animation","LoadingIndicator","Pagination","AssetCount","Pagination_1","AssetCount_1","bottomBar","searchBox","setSearchTerm","searchValue","setSearchValue","handleSearch","SortOrderSelector_1","topBar","sortingState","selectBox","setSortOrderState","hideOptionIcon","handleChangeSortBy","handleSwitchSortDirection","Asc","sortByOptions","SelectBox","onValueChange","typeFilter","setMediaTypeFilter","setShowUnusedAssets","mediaTypeOptions","video","audio","placeholderIcon","viewModeSelector","setViewModeSelection","List","onImportAsset","imported","isInUse","download","listView","borderSpacing","tableHeader","assetIdentities","onSelect","openPreview","MissingAssetActions_1","listViewItem","textColumn","previewColumn","labelColumn","tableLayout","lastModifiedColumn","fileSizeColumn","mediaTypeColumn","actionsColumn","dateFormatOptions","weekday","year","month","day","isSelected","canBeSelected","onSelectItem","LoadingLabel_1","emptyStateWrapper","setAssetIdentities","queriedAssets","queriedUnusedAssets","loadingText","emptyText","loadingLabel","thumbnail","pointerEvents","alignContent","toolBar","thumbnailView","ErrorBoundary","componentDidCatch","reload","CreateTagDialog_1","CreateAssetCollectionDialog_1","formBody","createPossible","handleCreate","setFocus","setSelectedAssetSourceId","createThemeProvider","_React$Component","outerTheme","getTheme","lastTheme","lastOuterTheme","cachedTheme","_theme","renderProvider","createWithTheme","hoc","withTheme","forwardRef","createUseTheme","_createTheming","fnValuesNs","fnRuleNs","functionPlugin","fnValues","fnRule","observablePlugin","style$","_loop","semiWithNl","cssText","colonIndex","templatePlugin","GlobalContainerRule","GlobalPrefixedRule","separatorRegExp","addScope","scope","parts","jssGlobal","handleNestedGlobalContainerRule","handlePrefixedGlobalRule","valueNs","mergeExtend","singleExtend","refRule","mergeRest","jssExtend","parentRegExp","jssNested","getReplaceRef","replaceParentRefs","nestedProp","parentProp","parentSelectors","nestedSelectors","nested","prevOptions","nestingLevel","isNested","isNestedConditional","jssCompose","registerClass","composes","uppercasePattern","msPattern","toHyphenLower","hyphenateStyleName","hName","convertCase","converted","camelCase","hyphenatedProp","px","ms","percent","addCamelCasedVersion","inset","motion","perspective","gap","grid","iterate","innerProp","_innerProp","unit","defaultUnit","camelCasedOptions","propArray","propArrayInObj","propObj","attachment","repeat","duration","timingFunction","delay","iterationCount","fillMode","playState","blur","spread","customPropObj","radius","font","grow","basis","flow","shrink","align","templateColumns","templateRows","templateAreas","template","autoColumns","autoRows","autoFlow","row","rowStart","rowEnd","columnStart","columnEnd","area","rowGap","columnGap","processArray","scheme","mapValuesByProp","objectToArray","isFallback","isInArray","customPropsToStyle","customProps","propName","_styleDetector","appendedValue","styleDetector","baseProp","jssExpand","_arrayLikeToArray","_unsupportedIterableToArray","minLen","js","vendor","isTouch","documentElement","jsCssMap","Moz","O","Webkit","appearence","noPrefill","supportedProperty","colorAdjust","toUpper","camelize","pascalize","textOrientation","writingMode","breakPropsOld","inlineLogicalOld","newProp","unprefixed","prefixed","pascalized","scrollSnap","overscrollBehavior","propMap","order","flex2012","propMap$1","propKeys","prefixCss","propertyDetectors","computed","key$1","el$1","cache$1","transitionProperties","transPropsRegExp","prefixTransitionCallback","p1","p2","prefixedValue","supportedValue","jssVendorPrefixer","prefixStyle","changeProp","supportedProp","changeValue","supportedValue$1","atRule","supportedKeyframes","jssPropsSort","prop0","prop1","shallowEqualObjects","objA","objB","reactPropsRegex","defaultJss","createCss","ruleIndex","getSheet","argsStr","flatArgs","argIndex","innerArgIndex","mergedStyle","labels","styleObject","_cached","cacheValue","JssContext","disableStylesGeneration","MIN_SAFE_INTEGER","getSheetIndex","defaultManagers","getManager","managerId","managers","manager","manageSheet","unmanageSheet","sheetsMeta","getMeta","existingSheet","jss$1","getStyles","dynamicStyles","getSheetOptions","sheetOptions","addMeta","removeDynamicRules","updateDynamicRules","addDynamicRules","initialRuleCount","originalRule","getSheetClasses","dynamicRules","NoRenderer","noTheme","createWithStyles","_options$index","injectTheme","isThemingEnabled","ThemeConsumer","InnerComponent","WithStyles","mergeClassesProp","lastArgs","isSame","sheetClasses","classesProp","mergeClasses","baseClasses","additionalClasses","combinedClasses","createState","jssContext","innerRef","JssContextSubscriber","useEffectOrLayoutEffect","noTheme$1","ThemeContext$1","isFirstMount","_React$useMemo","newSheet","newDynamicRules","initialContext","JssProvider","parentContext","prevContext","parseStyles","staticStyle","dynamicStyle","shouldForwardPropSymbol","getChildProps","shouldForwardProp","isTag","childProps","configureStyled","tagOrComponent","getShouldForwardProp","childShouldForwardProp","finalShouldForwardProp","_options2","hookOptions","createStyledComponent","_parseStyles","Styled","as","propsWithTheme","sc","scd","newProps","COMMON_MIME_TYPES","toFileWithPath","withMimeType","ext","webkitRelativePath","FILES_TO_IGNORE","getInputFiles","evt","isInput","fromList","getDataTransferFiles","dt","toFilePromises","noIgnoredFiles","flatten","webkitGetAsEntry","fromDataTransferItem","isDirectory","fromDirEntry","getAsFile","fwp","fromEntry","fromFileEntry","createReader","readEntries","batch","err_1","fullPath","getInvalidTypeRejectionErr","messageSuffix","getTooLargeRejectionErr","getTooSmallRejectionErr","minSize","TOO_MANY_FILES_REJECTION","fileAccepted","isAcceptable","fileMatchSize","allFilesAccepted","accepted","sizeMatch","isPropagationStopped","cancelBubble","isEvtWithFiles","dataTransfer","onDocumentDragOver","isIe","isEdge","isIeOrEdge","composeEventHandlers","fns","enumerableOnly","symbols","getOwnPropertyDescriptors","_objectWithoutProperties","sourceSymbolKeys","Dropzone","_useDropzone","getFilesFromEvent","fromEvent","noClick","noKeyboard","noDrag","noDragEventsBubbling","onFileDialogCancel","onDragEnter","onDragLeave","onDragOver","onDropAccepted","initialState","isFileDialogActive","draggedFiles","fileRejections","_defaultProps$options","rootRef","inputRef","_useReducer","reducer","_useReducer2","dispatch","openFileDialog","click","onWindowFocus","onKeyDownCb","isEqualNode","onFocusCb","onBlurCb","onClickCb","dragTargetsRef","onDocumentDrop","onDragEnterCb","persist","onDragOverCb","hasFiles","dropEffect","_unused","onDragLeaveCb","targets","targetIdx","onDropCb","_fileAccepted2","acceptError","_fileMatchSize2","sizeError","customErrors","composeHandler","composeKeyboardHandler","composeDragHandler","_ref2$refKey","refKey","onFocus","onBlur","onInputElementClick","_ref3$refKey","inputProps","autoComplete","fileCount","regexpCache","sanitizeArray","input","inputName","makeRegexp","pattern","caseSensitive","negated","escapeStringRegexp","regexp","baseMatcher","patterns","firstMatchOnly","allPatterns","matches","didFit","yes","matcher"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,oBAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC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AAK0rK,GAERU,GACH,MAKH,OAAOxtK,GAGD,SAAS6tK,QAAQhvI,EAAQ0uI,EAAUzsI,GACzC,OAAOwsI,YAAYzuI,EAAQ0uI,EAAUzsI,GAAS,GAGxC,SAAS0zF,QAAQ31F,EAAQ0uI,EAAUzsI,GACzC,OAAOwsI,YAAYzuI,EAAQ0uI,EAAUzsI,GAAS,GAAM/iC,OAAS","file":"Plugin.js","sourcesContent":[" \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 150);\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { visit, } from 'graphql';\nimport { invariant } from 'ts-invariant';\nexport function shouldInclude(_a, variables) {\n var directives = _a.directives;\n if (!directives || !directives.length) {\n return true;\n }\n return getInclusionDirectives(directives).every(function (_a) {\n var directive = _a.directive, ifArgument = _a.ifArgument;\n var evaledValue = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables && variables[ifArgument.value.name.value];\n process.env.NODE_ENV === \"production\" ? invariant(evaledValue !== void 0, 38) : invariant(evaledValue !== void 0, \"Invalid variable referenced in @\" + directive.name.value + \" directive.\");\n }\n else {\n evaledValue = ifArgument.value.value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\nexport function getDirectiveNames(root) {\n var names = [];\n visit(root, {\n Directive: function (node) {\n names.push(node.name.value);\n },\n });\n return names;\n}\nexport function hasDirectives(names, root) {\n return getDirectiveNames(root).some(function (name) { return names.indexOf(name) > -1; });\n}\nexport function hasClientExports(document) {\n return (document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document));\n}\nfunction isInclusionDirective(_a) {\n var value = _a.name.value;\n return value === 'skip' || value === 'include';\n}\nexport function getInclusionDirectives(directives) {\n var result = [];\n if (directives && directives.length) {\n directives.forEach(function (directive) {\n if (!isInclusionDirective(directive))\n return;\n var directiveArguments = directive.arguments;\n var directiveName = directive.name.value;\n process.env.NODE_ENV === \"production\" ? invariant(directiveArguments && directiveArguments.length === 1, 39) : invariant(directiveArguments && directiveArguments.length === 1, \"Incorrect number of arguments for the @\" + directiveName + \" directive.\");\n var ifArgument = directiveArguments[0];\n process.env.NODE_ENV === \"production\" ? invariant(ifArgument.name && ifArgument.name.value === 'if', 40) : invariant(ifArgument.name && ifArgument.name.value === 'if', \"Invalid argument for the @\" + directiveName + \" directive.\");\n var ifValue = ifArgument.value;\n process.env.NODE_ENV === \"production\" ? invariant(ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 41) : invariant(ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), \"Argument for the @\" + directiveName + \" directive must be a variable or a boolean value.\");\n result.push({ directive: directive, ifArgument: ifArgument });\n });\n }\n return result;\n}\n//# sourceMappingURL=directives.js.map","import { __assign, __spreadArrays } from \"tslib\";\nimport { invariant, InvariantError } from 'ts-invariant';\nexport function getFragmentQueryDocument(document, fragmentName) {\n var actualFragmentName = fragmentName;\n var fragments = [];\n document.definitions.forEach(function (definition) {\n if (definition.kind === 'OperationDefinition') {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(42) : new InvariantError(\"Found a \" + definition.operation + \" operation\" + (definition.name ? \" named '\" + definition.name.value + \"'\" : '') + \". \" +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.');\n }\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n if (typeof actualFragmentName === 'undefined') {\n process.env.NODE_ENV === \"production\" ? invariant(fragments.length === 1, 43) : invariant(fragments.length === 1, \"Found \" + fragments.length + \" fragments. `fragmentName` must be provided when there is not exactly 1 fragment.\");\n actualFragmentName = fragments[0].name.value;\n }\n var query = __assign(__assign({}, document), { definitions: __spreadArrays([\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n }\n ], document.definitions) });\n return query;\n}\nexport function createFragmentMap(fragments) {\n if (fragments === void 0) { fragments = []; }\n var symTable = {};\n fragments.forEach(function (fragment) {\n symTable[fragment.name.value] = fragment;\n });\n return symTable;\n}\nexport function getFragmentFromSelection(selection, fragmentMap) {\n switch (selection.kind) {\n case 'InlineFragment':\n return selection;\n case 'FragmentSpread': {\n var fragment = fragmentMap && fragmentMap[selection.name.value];\n process.env.NODE_ENV === \"production\" ? invariant(fragment, 44) : invariant(fragment, \"No fragment named \" + selection.name.value + \".\");\n return fragment;\n }\n default:\n return null;\n }\n}\n//# sourceMappingURL=fragments.js.map","import stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\nimport { getFragmentFromSelection } from \"./fragments.js\";\nexport function makeReference(id) {\n return { __ref: String(id) };\n}\nexport function isReference(obj) {\n return Boolean(obj && typeof obj === 'object' && typeof obj.__ref === 'string');\n}\nfunction isStringValue(value) {\n return value.kind === 'StringValue';\n}\nfunction isBooleanValue(value) {\n return value.kind === 'BooleanValue';\n}\nfunction isIntValue(value) {\n return value.kind === 'IntValue';\n}\nfunction isFloatValue(value) {\n return value.kind === 'FloatValue';\n}\nfunction isVariable(value) {\n return value.kind === 'Variable';\n}\nfunction isObjectValue(value) {\n return value.kind === 'ObjectValue';\n}\nfunction isListValue(value) {\n return value.kind === 'ListValue';\n}\nfunction isEnumValue(value) {\n return value.kind === 'EnumValue';\n}\nfunction isNullValue(value) {\n return value.kind === 'NullValue';\n}\nexport function valueToObjectRepresentation(argObj, name, value, variables) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n }\n else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n }\n else if (isObjectValue(value)) {\n var nestedArgObj_1 = {};\n value.fields.map(function (obj) {\n return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables);\n });\n argObj[name.value] = nestedArgObj_1;\n }\n else if (isVariable(value)) {\n var variableValue = (variables || {})[value.name.value];\n argObj[name.value] = variableValue;\n }\n else if (isListValue(value)) {\n argObj[name.value] = value.values.map(function (listValue) {\n var nestedArgArrayObj = {};\n valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables);\n return nestedArgArrayObj[name.value];\n });\n }\n else if (isEnumValue(value)) {\n argObj[name.value] = value.value;\n }\n else if (isNullValue(value)) {\n argObj[name.value] = null;\n }\n else {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(53) : new InvariantError(\"The inline argument \\\"\" + name.value + \"\\\" of kind \\\"\" + value.kind + \"\\\"\" +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.');\n }\n}\nexport function storeKeyNameFromField(field, variables) {\n var directivesObj = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(function (directive) {\n directivesObj[directive.name.value] = {};\n if (directive.arguments) {\n directive.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables);\n });\n }\n });\n }\n var argObj = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(argObj, name, value, variables);\n });\n }\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\nvar KNOWN_DIRECTIVES = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\nexport function getStoreKeyName(fieldName, args, directives) {\n if (args &&\n directives &&\n directives['connection'] &&\n directives['connection']['key']) {\n if (directives['connection']['filter'] &&\n directives['connection']['filter'].length > 0) {\n var filterKeys = directives['connection']['filter']\n ? directives['connection']['filter']\n : [];\n filterKeys.sort();\n var filteredArgs_1 = {};\n filterKeys.forEach(function (key) {\n filteredArgs_1[key] = args[key];\n });\n return directives['connection']['key'] + \"(\" + JSON.stringify(filteredArgs_1) + \")\";\n }\n else {\n return directives['connection']['key'];\n }\n }\n var completeFieldName = fieldName;\n if (args) {\n var stringifiedArgs = stringify(args);\n completeFieldName += \"(\" + stringifiedArgs + \")\";\n }\n if (directives) {\n Object.keys(directives).forEach(function (key) {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1)\n return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += \"@\" + key + \"(\" + JSON.stringify(directives[key]) + \")\";\n }\n else {\n completeFieldName += \"@\" + key;\n }\n });\n }\n return completeFieldName;\n}\nexport function argumentsObjectFromField(field, variables) {\n if (field.arguments && field.arguments.length) {\n var argObj_1 = {};\n field.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(argObj_1, name, value, variables);\n });\n return argObj_1;\n }\n return null;\n}\nexport function resultKeyNameFromField(field) {\n return field.alias ? field.alias.value : field.name.value;\n}\nexport function getTypenameFromResult(result, selectionSet, fragmentMap) {\n if (typeof result.__typename === 'string') {\n return result.__typename;\n }\n for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {\n var selection = _a[_i];\n if (isField(selection)) {\n if (selection.name.value === '__typename') {\n return result[resultKeyNameFromField(selection)];\n }\n }\n else {\n var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);\n if (typeof typename === 'string') {\n return typename;\n }\n }\n }\n}\nexport function isField(selection) {\n return selection.kind === 'Field';\n}\nexport function isInlineFragment(selection) {\n return selection.kind === 'InlineFragment';\n}\n//# sourceMappingURL=storeUtils.js.map","import { invariant, InvariantError } from 'ts-invariant';\nimport { valueToObjectRepresentation } from \"./storeUtils.js\";\nexport function checkDocument(doc) {\n process.env.NODE_ENV === \"production\" ? invariant(doc && doc.kind === 'Document', 45) : invariant(doc && doc.kind === 'Document', \"Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \\\"gql\\\" tag? http://docs.apollostack.com/apollo-client/core.html#gql\");\n var operations = doc.definitions\n .filter(function (d) { return d.kind !== 'FragmentDefinition'; })\n .map(function (definition) {\n if (definition.kind !== 'OperationDefinition') {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(46) : new InvariantError(\"Schema type definitions not allowed in queries. Found: \\\"\" + definition.kind + \"\\\"\");\n }\n return definition;\n });\n process.env.NODE_ENV === \"production\" ? invariant(operations.length <= 1, 47) : invariant(operations.length <= 1, \"Ambiguous GraphQL document: contains \" + operations.length + \" operations\");\n return doc;\n}\nexport function getOperationDefinition(doc) {\n checkDocument(doc);\n return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0];\n}\nexport function getOperationName(doc) {\n return (doc.definitions\n .filter(function (definition) {\n return definition.kind === 'OperationDefinition' && definition.name;\n })\n .map(function (x) { return x.name.value; })[0] || null);\n}\nexport function getFragmentDefinitions(doc) {\n return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; });\n}\nexport function getQueryDefinition(doc) {\n var queryDef = getOperationDefinition(doc);\n process.env.NODE_ENV === \"production\" ? invariant(queryDef && queryDef.operation === 'query', 48) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');\n return queryDef;\n}\nexport function getFragmentDefinition(doc) {\n process.env.NODE_ENV === \"production\" ? invariant(doc.kind === 'Document', 49) : invariant(doc.kind === 'Document', \"Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \\\"gql\\\" tag? http://docs.apollostack.com/apollo-client/core.html#gql\");\n process.env.NODE_ENV === \"production\" ? invariant(doc.definitions.length <= 1, 50) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');\n var fragmentDef = doc.definitions[0];\n process.env.NODE_ENV === \"production\" ? invariant(fragmentDef.kind === 'FragmentDefinition', 51) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');\n return fragmentDef;\n}\nexport function getMainDefinition(queryDoc) {\n checkDocument(queryDoc);\n var fragmentDefinition;\n for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) {\n var definition = _a[_i];\n if (definition.kind === 'OperationDefinition') {\n var operation = definition.operation;\n if (operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription') {\n return definition;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n fragmentDefinition = definition;\n }\n }\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(52) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.');\n}\nexport function getDefaultValues(definition) {\n var defaultValues = Object.create(null);\n var defs = definition && definition.variableDefinitions;\n if (defs && defs.length) {\n defs.forEach(function (def) {\n if (def.defaultValue) {\n valueToObjectRepresentation(defaultValues, def.variable.name, def.defaultValue);\n }\n });\n }\n return defaultValues;\n}\n//# sourceMappingURL=getFromAST.js.map","export function filterInPlace(array, test, context) {\n var target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n//# sourceMappingURL=filterInPlace.js.map","import { __assign, __spreadArrays } from \"tslib\";\nimport { visit, } from 'graphql';\nimport { invariant } from 'ts-invariant';\nimport { checkDocument, getOperationDefinition, getFragmentDefinition, getFragmentDefinitions, getMainDefinition, } from \"./getFromAST.js\";\nimport { filterInPlace } from \"../common/filterInPlace.js\";\nimport { isField, isInlineFragment } from \"./storeUtils.js\";\nimport { createFragmentMap, } from \"./fragments.js\";\nvar TYPENAME_FIELD = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\nfunction isEmpty(op, fragments) {\n return op.selectionSet.selections.every(function (selection) {\n return selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments);\n });\n}\nfunction nullIfDocIsEmpty(doc) {\n return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))\n ? null\n : doc;\n}\nfunction getDirectiveMatcher(directives) {\n return function directiveMatcher(directive) {\n return directives.some(function (dir) {\n return (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive));\n });\n };\n}\nexport function removeDirectivesFromDocument(directives, doc) {\n var variablesInUse = Object.create(null);\n var variablesToRemove = [];\n var fragmentSpreadsInUse = Object.create(null);\n var fragmentSpreadsToRemove = [];\n var modifiedDoc = nullIfDocIsEmpty(visit(doc, {\n Variable: {\n enter: function (node, _key, parent) {\n if (parent.kind !== 'VariableDefinition') {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n Field: {\n enter: function (node) {\n if (directives && node.directives) {\n var shouldRemoveField = directives.some(function (directive) { return directive.remove; });\n if (shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))) {\n if (node.arguments) {\n node.arguments.forEach(function (arg) {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: arg.value.name.value,\n });\n }\n });\n }\n if (node.selectionSet) {\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n });\n }\n return null;\n }\n }\n },\n },\n FragmentSpread: {\n enter: function (node) {\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n Directive: {\n enter: function (node) {\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }));\n if (modifiedDoc &&\n filterInPlace(variablesToRemove, function (v) { return !!v.name && !variablesInUse[v.name]; }).length) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n if (modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, function (fs) { return !!fs.name && !fragmentSpreadsInUse[fs.name]; })\n .length) {\n modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc);\n }\n return modifiedDoc;\n}\nexport function addTypenameToDocument(doc) {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter: function (node, _key, parent) {\n if (parent &&\n parent.kind === 'OperationDefinition') {\n return;\n }\n var selections = node.selections;\n if (!selections) {\n return;\n }\n var skip = selections.some(function (selection) {\n return (isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0));\n });\n if (skip) {\n return;\n }\n var field = parent;\n if (isField(field) &&\n field.directives &&\n field.directives.some(function (d) { return d.name.value === 'export'; })) {\n return;\n }\n return __assign(__assign({}, node), { selections: __spreadArrays(selections, [TYPENAME_FIELD]) });\n },\n },\n });\n}\naddTypenameToDocument.added = function (field) {\n return field === TYPENAME_FIELD;\n};\nvar connectionRemoveConfig = {\n test: function (directive) {\n var willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (!directive.arguments ||\n !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {\n process.env.NODE_ENV === \"production\" || invariant.warn('Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.');\n }\n }\n return willRemove;\n },\n};\nexport function removeConnectionDirectiveFromDocument(doc) {\n return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc));\n}\nfunction hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) {\n if (nestedCheck === void 0) { nestedCheck = true; }\n return (!!selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(function (selection) {\n return hasDirectivesInSelection(directives, selection, nestedCheck);\n }));\n}\nfunction hasDirectivesInSelection(directives, selection, nestedCheck) {\n if (nestedCheck === void 0) { nestedCheck = true; }\n if (!isField(selection)) {\n return true;\n }\n if (!selection.directives) {\n return false;\n }\n return (selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck)));\n}\nfunction getArgumentMatcher(config) {\n return function argumentMatcher(argument) {\n return config.some(function (aConfig) {\n return argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument)));\n });\n };\n}\nexport function removeArgumentsFromDocument(config, doc) {\n var argMatcher = getArgumentMatcher(config);\n return nullIfDocIsEmpty(visit(doc, {\n OperationDefinition: {\n enter: function (node) {\n return __assign(__assign({}, node), { variableDefinitions: node.variableDefinitions ? node.variableDefinitions.filter(function (varDef) {\n return !config.some(function (arg) { return arg.name === varDef.variable.name.value; });\n }) : [] });\n },\n },\n Field: {\n enter: function (node) {\n var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; });\n if (shouldRemoveField) {\n var argMatchCount_1 = 0;\n if (node.arguments) {\n node.arguments.forEach(function (arg) {\n if (argMatcher(arg)) {\n argMatchCount_1 += 1;\n }\n });\n }\n if (argMatchCount_1 === 1) {\n return null;\n }\n }\n },\n },\n Argument: {\n enter: function (node) {\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }));\n}\nexport function removeFragmentSpreadFromDocument(config, doc) {\n function enter(node) {\n if (config.some(function (def) { return def.name === node.name.value; })) {\n return null;\n }\n }\n return nullIfDocIsEmpty(visit(doc, {\n FragmentSpread: { enter: enter },\n FragmentDefinition: { enter: enter },\n }));\n}\nfunction getAllFragmentSpreadsFromSelectionSet(selectionSet) {\n var allFragments = [];\n selectionSet.selections.forEach(function (selection) {\n if ((isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); });\n }\n else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n return allFragments;\n}\nexport function buildQueryFromSelectionSet(document) {\n var definition = getMainDefinition(document);\n var definitionOperation = definition.operation;\n if (definitionOperation === 'query') {\n return document;\n }\n var modifiedDoc = visit(document, {\n OperationDefinition: {\n enter: function (node) {\n return __assign(__assign({}, node), { operation: 'query' });\n },\n },\n });\n return modifiedDoc;\n}\nexport function removeClientSetsFromDocument(document) {\n checkDocument(document);\n var modifiedDoc = removeDirectivesFromDocument([\n {\n test: function (directive) { return directive.name.value === 'client'; },\n remove: true,\n },\n ], document);\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter: function (node) {\n if (node.selectionSet) {\n var isTypenameOnly = node.selectionSet.selections.every(function (selection) {\n return isField(selection) && selection.name.value === '__typename';\n });\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n return modifiedDoc;\n}\n//# sourceMappingURL=transform.js.map","import { __assign, __spreadArrays } from \"tslib\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function mergeDeep() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n return mergeDeepArray(sources);\n}\nexport function mergeDeepArray(sources) {\n var target = sources[0] || {};\n var count = sources.length;\n if (count > 1) {\n var merger = new DeepMerger();\n for (var i = 1; i < count; ++i) {\n target = merger.merge(target, sources[i]);\n }\n }\n return target;\n}\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object';\n}\nvar defaultReconciler = function (target, source, property) {\n return this.merge(target[property], source[property]);\n};\nvar DeepMerger = (function () {\n function DeepMerger(reconciler) {\n if (reconciler === void 0) { reconciler = defaultReconciler; }\n this.reconciler = reconciler;\n this.isObject = isObject;\n this.pastCopies = new Set();\n }\n DeepMerger.prototype.merge = function (target, source) {\n var _this = this;\n var context = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n context[_i - 2] = arguments[_i];\n }\n if (isObject(source) && isObject(target)) {\n Object.keys(source).forEach(function (sourceKey) {\n if (hasOwnProperty.call(target, sourceKey)) {\n var targetValue = target[sourceKey];\n if (source[sourceKey] !== targetValue) {\n var result = _this.reconciler.apply(_this, __spreadArrays([target, source, sourceKey], context));\n if (result !== targetValue) {\n target = _this.shallowCopyForMerge(target);\n target[sourceKey] = result;\n }\n }\n }\n else {\n target = _this.shallowCopyForMerge(target);\n target[sourceKey] = source[sourceKey];\n }\n });\n return target;\n }\n return source;\n };\n DeepMerger.prototype.shallowCopyForMerge = function (value) {\n if (isObject(value) && !this.pastCopies.has(value)) {\n if (Array.isArray(value)) {\n value = value.slice(0);\n }\n else {\n value = __assign({ __proto__: Object.getPrototypeOf(value) }, value);\n }\n this.pastCopies.add(value);\n }\n return value;\n };\n return DeepMerger;\n}());\nexport { DeepMerger };\n//# sourceMappingURL=mergeDeep.js.map","import Observable from 'zen-observable';\nimport 'symbol-observable';\nvar prototype = Observable.prototype;\nvar fakeObsSymbol = '@@observable';\nif (!prototype[fakeObsSymbol]) {\n prototype[fakeObsSymbol] = function () { return this; };\n}\nexport { Observable };\n//# sourceMappingURL=Observable.js.map","var toString = Object.prototype.toString;\nexport function cloneDeep(value) {\n return cloneDeepHelper(value);\n}\nfunction cloneDeepHelper(val, seen) {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n seen = seen || new Map;\n if (seen.has(val))\n return seen.get(val);\n var copy_1 = val.slice(0);\n seen.set(val, copy_1);\n copy_1.forEach(function (child, i) {\n copy_1[i] = cloneDeepHelper(child, seen);\n });\n return copy_1;\n }\n case \"[object Object]\": {\n seen = seen || new Map;\n if (seen.has(val))\n return seen.get(val);\n var copy_2 = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy_2);\n Object.keys(val).forEach(function (key) {\n copy_2[key] = cloneDeepHelper(val[key], seen);\n });\n return copy_2;\n }\n default:\n return val;\n }\n}\n//# sourceMappingURL=cloneDeep.js.map","import { isDevelopment, isTest } from \"./environment.js\";\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction deepFreeze(value) {\n var workSet = new Set([value]);\n workSet.forEach(function (obj) {\n if (isObject(obj)) {\n if (!Object.isFrozen(obj))\n Object.freeze(obj);\n Object.getOwnPropertyNames(obj).forEach(function (name) {\n if (isObject(obj[name]))\n workSet.add(obj[name]);\n });\n }\n });\n return value;\n}\nexport function maybeDeepFreeze(obj) {\n if (process.env.NODE_ENV !== \"production\" && (isDevelopment() || isTest())) {\n deepFreeze(obj);\n }\n return obj;\n}\n//# sourceMappingURL=maybeDeepFreeze.js.map","export function iterateObserversSafely(observers, method, argument) {\n var observersWithMethod = [];\n observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); });\n observersWithMethod.forEach(function (obs) { return obs[method](argument); });\n}\n//# sourceMappingURL=iteration.js.map","import { Observable } from \"./Observable.js\";\nexport function asyncMap(observable, mapFn, catchFn) {\n return new Observable(function (observer) {\n var next = observer.next, error = observer.error, complete = observer.complete;\n var activeCallbackCount = 0;\n var completed = false;\n var promiseQueue = {\n then: function (callback) {\n return new Promise(function (resolve) { return resolve(callback()); });\n },\n };\n function makeCallback(examiner, delegate) {\n if (examiner) {\n return function (arg) {\n ++activeCallbackCount;\n var both = function () { return examiner(arg); };\n promiseQueue = promiseQueue.then(both, both).then(function (result) {\n --activeCallbackCount;\n next && next.call(observer, result);\n if (completed) {\n handler.complete();\n }\n }, function (error) {\n --activeCallbackCount;\n throw error;\n }).catch(function (caught) {\n error && error.call(observer, caught);\n });\n };\n }\n else {\n return function (arg) { return delegate && delegate.call(observer, arg); };\n }\n }\n var handler = {\n next: makeCallback(mapFn, next),\n error: makeCallback(catchFn, error),\n complete: function () {\n completed = true;\n if (!activeCallbackCount) {\n complete && complete.call(observer);\n }\n },\n };\n var sub = observable.subscribe(handler);\n return function () { return sub.unsubscribe(); };\n });\n}\n//# sourceMappingURL=asyncMap.js.map","import { Observable } from \"./Observable.js\";\nexport function fixObservableSubclass(subclass) {\n function set(key) {\n Object.defineProperty(subclass, key, { value: Observable });\n }\n if (typeof Symbol === \"function\" && Symbol.species) {\n set(Symbol.species);\n }\n set(\"@@species\");\n return subclass;\n}\n//# sourceMappingURL=subclassing.js.map","import { __extends } from \"tslib\";\nimport { Observable } from \"./Observable.js\";\nimport { iterateObserversSafely } from \"./iteration.js\";\nimport { fixObservableSubclass } from \"./subclassing.js\";\nfunction isPromiseLike(value) {\n return value && typeof value.then === \"function\";\n}\nvar Concast = (function (_super) {\n __extends(Concast, _super);\n function Concast(sources) {\n var _this = _super.call(this, function (observer) {\n _this.addObserver(observer);\n return function () { return _this.removeObserver(observer); };\n }) || this;\n _this.observers = new Set();\n _this.addCount = 0;\n _this.promise = new Promise(function (resolve, reject) {\n _this.resolve = resolve;\n _this.reject = reject;\n });\n _this.handlers = {\n next: function (result) {\n if (_this.sub !== null) {\n _this.latest = [\"next\", result];\n iterateObserversSafely(_this.observers, \"next\", result);\n }\n },\n error: function (error) {\n var sub = _this.sub;\n if (sub !== null) {\n if (sub)\n Promise.resolve().then(function () { return sub.unsubscribe(); });\n _this.sub = null;\n _this.latest = [\"error\", error];\n _this.reject(error);\n iterateObserversSafely(_this.observers, \"error\", error);\n }\n },\n complete: function () {\n if (_this.sub !== null) {\n var value = _this.sources.shift();\n if (!value) {\n _this.sub = null;\n if (_this.latest &&\n _this.latest[0] === \"next\") {\n _this.resolve(_this.latest[1]);\n }\n else {\n _this.resolve();\n }\n iterateObserversSafely(_this.observers, \"complete\");\n }\n else if (isPromiseLike(value)) {\n value.then(function (obs) { return _this.sub = obs.subscribe(_this.handlers); });\n }\n else {\n _this.sub = value.subscribe(_this.handlers);\n }\n }\n },\n };\n _this.cancel = function (reason) {\n _this.reject(reason);\n _this.sources = [];\n _this.handlers.complete();\n };\n _this.promise.catch(function (_) { });\n if (typeof sources === \"function\") {\n sources = [new Observable(sources)];\n }\n if (isPromiseLike(sources)) {\n sources.then(function (iterable) { return _this.start(iterable); }, _this.handlers.error);\n }\n else {\n _this.start(sources);\n }\n return _this;\n }\n Concast.prototype.start = function (sources) {\n if (this.sub !== void 0)\n return;\n this.sources = Array.from(sources);\n this.handlers.complete();\n };\n Concast.prototype.deliverLastMessage = function (observer) {\n if (this.latest) {\n var nextOrError = this.latest[0];\n var method = observer[nextOrError];\n if (method) {\n method.call(observer, this.latest[1]);\n }\n if (this.sub === null &&\n nextOrError === \"next\" &&\n observer.complete) {\n observer.complete();\n }\n }\n };\n Concast.prototype.addObserver = function (observer) {\n if (!this.observers.has(observer)) {\n this.deliverLastMessage(observer);\n this.observers.add(observer);\n ++this.addCount;\n }\n };\n Concast.prototype.removeObserver = function (observer, quietly) {\n if (this.observers.delete(observer) &&\n --this.addCount < 1 &&\n !quietly) {\n this.handlers.error(new Error(\"Observable cancelled prematurely\"));\n }\n };\n Concast.prototype.cleanup = function (callback) {\n var _this = this;\n var called = false;\n var once = function () {\n if (!called) {\n called = true;\n _this.observers.delete(observer);\n callback();\n }\n };\n var observer = {\n next: once,\n error: once,\n complete: once,\n };\n var count = this.addCount;\n this.addObserver(observer);\n this.addCount = count;\n };\n return Concast;\n}(Observable));\nexport { Concast };\nfixObservableSubclass(Concast);\n//# sourceMappingURL=Concast.js.map","export function isNonEmptyArray(value) {\n return Array.isArray(value) && value.length > 0;\n}\n//# sourceMappingURL=arrays.js.map","export function graphQLResultHasError(result) {\n return (result.errors && result.errors.length > 0) || false;\n}\n//# sourceMappingURL=errorHandling.js.map","export var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' &&\n navigator.product === 'ReactNative');\n//# sourceMappingURL=canUse.js.map","export function compact() {\n var objects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objects[_i] = arguments[_i];\n }\n var result = Object.create(null);\n objects.forEach(function (obj) {\n if (!obj)\n return;\n Object.keys(obj).forEach(function (key) {\n var value = obj[key];\n if (value !== void 0) {\n result[key] = value;\n }\n });\n });\n return result;\n}\n//# sourceMappingURL=compact.js.map","import { __extends } from 'tslib';\n\nvar genericMessage = \"Invariant Violation\";\r\nvar _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {\r\n obj.__proto__ = proto;\r\n return obj;\r\n} : _a;\r\nvar InvariantError = /** @class */ (function (_super) {\r\n __extends(InvariantError, _super);\r\n function InvariantError(message) {\r\n if (message === void 0) { message = genericMessage; }\r\n var _this = _super.call(this, typeof message === \"number\"\r\n ? genericMessage + \": \" + message + \" (see https://github.com/apollographql/invariant-packages)\"\r\n : message) || this;\r\n _this.framesToPop = 1;\r\n _this.name = genericMessage;\r\n setPrototypeOf(_this, InvariantError.prototype);\r\n return _this;\r\n }\r\n return InvariantError;\r\n}(Error));\r\nfunction invariant(condition, message) {\r\n if (!condition) {\r\n throw new InvariantError(message);\r\n }\r\n}\r\nvar verbosityLevels = [\"log\", \"warn\", \"error\", \"silent\"];\r\nvar verbosityLevel = verbosityLevels.indexOf(\"log\");\r\nfunction wrapConsoleMethod(method) {\r\n return function () {\r\n if (verbosityLevels.indexOf(method) >= verbosityLevel) {\r\n return console[method].apply(console, arguments);\r\n }\r\n };\r\n}\r\n(function (invariant) {\r\n invariant.log = wrapConsoleMethod(\"log\");\r\n invariant.warn = wrapConsoleMethod(\"warn\");\r\n invariant.error = wrapConsoleMethod(\"error\");\r\n})(invariant || (invariant = {}));\r\nfunction setVerbosity(level) {\r\n var old = verbosityLevels[verbosityLevel];\r\n verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));\r\n return old;\r\n}\r\n// Code that uses ts-invariant with rollup-plugin-invariant may want to\r\n// import this process stub to avoid errors evaluating process.env.NODE_ENV.\r\n// However, because most ESM-to-CJS compilers will rewrite the process import\r\n// as tsInvariant.process, which prevents proper replacement by minifiers, we\r\n// also export processStub, so you can import { invariant, processStub } from\r\n// \"ts-invariant\" and assign processStub to a local variable named process.\r\nvar processStub = (typeof process === \"object\" &&\r\n typeof process.env === \"object\") ? process : { env: {} };\r\nvar invariant$1 = invariant;\n\nexport default invariant$1;\nexport { InvariantError, invariant, processStub as process, processStub, setVerbosity };\n//# sourceMappingURL=invariant.esm.js.map\n","export * from \"./core/index.js\";\nexport * from \"./react/index.js\";\n//# sourceMappingURL=index.js.map","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n","import reactDom from 'react-dom';\nimport react from 'react';\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction nullthrows(x, message) {\n if (x != null) {\n return x;\n }\n\n throw new Error(message !== null && message !== void 0 ? message : 'Got unexpected null or undefined');\n}\n\nvar Recoil_nullthrows = nullthrows;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction recoverableViolation(message, projectName, {\n error\n} = {}) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(message, error);\n }\n\n return null;\n}\n\nvar recoverableViolation_1 = recoverableViolation;\n\n// @oss-only\n\n\nvar Recoil_recoverableViolation = recoverableViolation_1;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Utilities for working with built-in Maps and Sets without mutating them.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction setByAddingToSet(set, v) {\n const next = new Set(set);\n next.add(v);\n return next;\n}\n\nfunction setByDeletingFromSet(set, v) {\n const next = new Set(set);\n next.delete(v);\n return next;\n}\n\nfunction mapBySettingInMap(map, k, v) {\n const next = new Map(map);\n next.set(k, v);\n return next;\n}\n\nfunction mapByUpdatingInMap(map, k, updater) {\n const next = new Map(map);\n next.set(k, updater(next.get(k)));\n return next;\n}\n\nfunction mapByDeletingFromMap(map, k) {\n const next = new Map(map);\n next.delete(k);\n return next;\n}\n\nfunction mapByDeletingMultipleFromMap(map, ks) {\n const next = new Map(map);\n ks.forEach(k => next.delete(k));\n return next;\n}\n\nvar Recoil_CopyOnWrite = {\n setByAddingToSet,\n setByDeletingFromSet,\n mapBySettingInMap,\n mapByUpdatingInMap,\n mapByDeletingFromMap,\n mapByDeletingMultipleFromMap\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Creates a new iterable whose output is generated by passing the input\n * iterable's values through the filter function.\n */\n\nfunction* filterIterable(iterable, predicate) {\n // Use generator to create iterable/iterator\n let index = 0;\n\n for (const value of iterable) {\n if (predicate(value, index++)) {\n yield value;\n }\n }\n}\n\nvar Recoil_filterIterable = filterIterable;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst gks = new Map().set('recoil_hamt_2020', true);\n\nfunction Recoil_gkx(gk) {\n var _gks$get;\n\n return (_gks$get = gks.get(gk)) !== null && _gks$get !== void 0 ? _gks$get : false;\n}\n\nRecoil_gkx.setPass = gk => {\n gks.set(gk, true);\n};\n\nRecoil_gkx.setFail = gk => {\n gks.set(gk, false);\n};\n\nvar Recoil_gkx_1 = Recoil_gkx; // @oss-only\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Creates a new iterable whose output is generated by passing the input\n * iterable's values through the mapper function.\n */\n\nfunction mapIterable(iterable, callback) {\n // Use generator to create iterable/iterator\n return function* () {\n let index = 0;\n\n for (const value of iterable) {\n yield callback(value, index++);\n }\n }();\n}\n\nvar Recoil_mapIterable = mapIterable;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction sprintf(format, ...args) {\n let index = 0;\n return format.replace(/%s/g, () => String(args[index++]));\n}\n\nvar sprintf_1 = sprintf;\n\nfunction expectationViolation(format, ...args) {\n if (process.env.NODE_ENV !== \"production\") {\n const message = sprintf_1.call(null, format, ...args);\n const error = new Error(message);\n error.name = 'Expectation Violation';\n console.error(error);\n }\n}\n\nvar expectationViolation_1 = expectationViolation;\n\n// @oss-only\n\n\nvar Recoil_expectationViolation = expectationViolation_1;\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n// eslint-disable-next-line no-unused-vars\nclass AbstractRecoilValue {\n constructor(newKey) {\n _defineProperty(this, \"key\", void 0);\n\n this.key = newKey;\n }\n\n}\n\nclass RecoilState extends AbstractRecoilValue {}\n\nclass RecoilValueReadOnly extends AbstractRecoilValue {}\n\nfunction isRecoilValue(x) {\n return x instanceof RecoilState || x instanceof RecoilValueReadOnly;\n}\n\nvar Recoil_RecoilValue = {\n AbstractRecoilValue,\n RecoilState,\n RecoilValueReadOnly,\n isRecoilValue\n};\n\nvar Recoil_RecoilValue_1 = Recoil_RecoilValue.AbstractRecoilValue;\nvar Recoil_RecoilValue_2 = Recoil_RecoilValue.RecoilState;\nvar Recoil_RecoilValue_3 = Recoil_RecoilValue.RecoilValueReadOnly;\nvar Recoil_RecoilValue_4 = Recoil_RecoilValue.isRecoilValue;\n\nvar Recoil_RecoilValue$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n AbstractRecoilValue: Recoil_RecoilValue_1,\n RecoilState: Recoil_RecoilValue_2,\n RecoilValueReadOnly: Recoil_RecoilValue_3,\n isRecoilValue: Recoil_RecoilValue_4\n});\n\nclass DefaultValue {}\n\nconst DEFAULT_VALUE = new DefaultValue();\n\nclass RecoilValueNotReady extends Error {\n constructor(key) {\n super(`Tried to set the value of Recoil selector ${key} using an updater function, but it is an async selector in a pending or error state; this is not supported.`);\n }\n\n}\n\n// flowlint-next-line unclear-type:off\nconst nodes = new Map(); // flowlint-next-line unclear-type:off\n\nconst recoilValues = new Map();\n/* eslint-disable no-redeclare */\n\nfunction recoilValuesForKeys(keys) {\n return Recoil_mapIterable(keys, key => Recoil_nullthrows(recoilValues.get(key)));\n}\n\nfunction registerNode(node) {\n if (nodes.has(node.key)) {\n const message = `Duplicate atom key \"${node.key}\". This is a FATAL ERROR in\n production. But it is safe to ignore this warning if it occurred because of\n hot module replacement.`; // TODO Need to figure out if there is a standard/open-source equivalent to see if hot module replacement is happening:\n // prettier-ignore\n // @fb-only: if (__DEV__) {\n // @fb-only: const isAcceptingUpdate = require('__debug').isAcceptingUpdate;\n // prettier-ignore\n // @fb-only: if (typeof isAcceptingUpdate !== 'function' || !isAcceptingUpdate()) {\n // @fb-only: expectationViolation(message, 'recoil');\n // @fb-only: }\n // prettier-ignore\n // @fb-only: } else {\n // @fb-only: recoverableViolation(message, 'recoil');\n // @fb-only: }\n\n console.warn(message); // @oss-only\n }\n\n nodes.set(node.key, node);\n const recoilValue = node.set == null ? new Recoil_RecoilValue$1.RecoilValueReadOnly(node.key) : new Recoil_RecoilValue$1.RecoilState(node.key);\n recoilValues.set(node.key, recoilValue);\n return recoilValue;\n}\n/* eslint-enable no-redeclare */\n\n\nclass NodeMissingError extends Error {} // flowlint-next-line unclear-type:off\n\n\nfunction getNode(key) {\n const node = nodes.get(key);\n\n if (node == null) {\n throw new NodeMissingError(`Missing definition for RecoilValue: \"${key}\"\"`);\n }\n\n return node;\n} // flowlint-next-line unclear-type:off\n\n\nfunction getNodeMaybe(key) {\n return nodes.get(key);\n}\n\nconst configDeletionHandlers = new Map();\n\nfunction deleteNodeConfigIfPossible(key) {\n var _node$shouldDeleteCon;\n\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const node = nodes.get(key);\n\n if (node === null || node === void 0 ? void 0 : (_node$shouldDeleteCon = node.shouldDeleteConfigOnRelease) === null || _node$shouldDeleteCon === void 0 ? void 0 : _node$shouldDeleteCon.call(node)) {\n var _getConfigDeletionHan;\n\n nodes.delete(key);\n (_getConfigDeletionHan = getConfigDeletionHandler(key)) === null || _getConfigDeletionHan === void 0 ? void 0 : _getConfigDeletionHan();\n configDeletionHandlers.delete(key);\n }\n}\n\nfunction setConfigDeletionHandler(key, fn) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n if (fn === undefined) {\n configDeletionHandlers.delete(key);\n } else {\n configDeletionHandlers.set(key, fn);\n }\n}\n\nfunction getConfigDeletionHandler(key) {\n return configDeletionHandlers.get(key);\n}\n\nvar Recoil_Node = {\n nodes,\n recoilValues,\n registerNode,\n getNode,\n getNodeMaybe,\n deleteNodeConfigIfPossible,\n setConfigDeletionHandler,\n getConfigDeletionHandler,\n recoilValuesForKeys,\n NodeMissingError,\n DefaultValue,\n DEFAULT_VALUE,\n RecoilValueNotReady\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nclass RetentionZone {}\n\nfunction retentionZone() {\n return new RetentionZone();\n}\n\nvar Recoil_RetentionZone = {\n RetentionZone,\n retentionZone\n};\n\nconst {\n setByAddingToSet: setByAddingToSet$1\n} = Recoil_CopyOnWrite;\n\n\n\n\n\n\n\nconst {\n getNode: getNode$1,\n getNodeMaybe: getNodeMaybe$1,\n recoilValuesForKeys: recoilValuesForKeys$1\n} = Recoil_Node;\n\nconst {\n RetentionZone: RetentionZone$1\n} = Recoil_RetentionZone; // flowlint-next-line unclear-type:off\n\n\nconst emptySet = Object.freeze(new Set());\n\nclass ReadOnlyRecoilValueError extends Error {}\n\nfunction initializeRetentionForNode(store, nodeKey, retainedBy) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return () => undefined;\n }\n\n const {\n nodesRetainedByZone\n } = store.getState().retention;\n\n function addToZone(zone) {\n let set = nodesRetainedByZone.get(zone);\n\n if (!set) {\n nodesRetainedByZone.set(zone, set = new Set());\n }\n\n set.add(nodeKey);\n }\n\n if (retainedBy instanceof RetentionZone$1) {\n addToZone(retainedBy);\n } else if (Array.isArray(retainedBy)) {\n for (const zone of retainedBy) {\n addToZone(zone);\n }\n }\n\n return () => {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const nodesRetainedByZone = store.getState().retention.nodesRetainedByZone;\n\n function deleteFromZone(zone) {\n const set = nodesRetainedByZone.get(zone);\n\n if (set) {\n set.delete(nodeKey);\n }\n\n if (set && set.size === 0) {\n nodesRetainedByZone.delete(zone);\n }\n }\n\n if (retainedBy instanceof RetentionZone$1) {\n deleteFromZone(retainedBy);\n } else if (Array.isArray(retainedBy)) {\n for (const zone of retainedBy) {\n deleteFromZone(zone);\n }\n }\n };\n}\n\nfunction initializeNodeIfNewToStore(store, treeState, key, trigger) {\n const storeState = store.getState();\n\n if (storeState.nodeCleanupFunctions.has(key)) {\n return;\n }\n\n const config = getNode$1(key);\n const retentionCleanup = initializeRetentionForNode(store, key, config.retainedBy);\n const nodeCleanup = config.init(store, treeState, trigger);\n storeState.nodeCleanupFunctions.set(key, () => {\n nodeCleanup();\n retentionCleanup();\n });\n}\n\nfunction cleanUpNode(store, key) {\n var _state$nodeCleanupFun;\n\n const state = store.getState();\n (_state$nodeCleanupFun = state.nodeCleanupFunctions.get(key)) === null || _state$nodeCleanupFun === void 0 ? void 0 : _state$nodeCleanupFun();\n state.nodeCleanupFunctions.delete(key);\n} // Get the current value loadable of a node and update the state.\n// Update dependencies and subscriptions for selectors.\n// Update saved value validation for atoms.\n\n\nfunction getNodeLoadable(store, state, key) {\n initializeNodeIfNewToStore(store, state, key, 'get');\n return getNode$1(key).get(store, state);\n} // Peek at the current value loadable for a node without any evaluation or state change\n\n\nfunction peekNodeLoadable(store, state, key) {\n return getNode$1(key).peek(store, state);\n} // Write value directly to state bypassing the Node interface as the node\n// definitions may not have been loaded yet when processing the initial snapshot.\n\n\nfunction setUnvalidatedAtomValue_DEPRECATED(state, key, newValue) {\n var _node$invalidate;\n\n const node = getNodeMaybe$1(key);\n node === null || node === void 0 ? void 0 : (_node$invalidate = node.invalidate) === null || _node$invalidate === void 0 ? void 0 : _node$invalidate.call(node, state);\n return { ...state,\n atomValues: state.atomValues.clone().delete(key),\n nonvalidatedAtoms: state.nonvalidatedAtoms.clone().set(key, newValue),\n dirtyAtoms: setByAddingToSet$1(state.dirtyAtoms, key)\n };\n} // Return the discovered dependencies and values to be written by setting\n// a node value. (Multiple values may be written due to selectors getting to\n// set upstreams; deps may be discovered because of reads in updater functions.)\n\n\nfunction setNodeValue(store, state, key, newValue) {\n const node = getNode$1(key);\n\n if (node.set == null) {\n throw new ReadOnlyRecoilValueError(`Attempt to set read-only RecoilValue: ${key}`);\n }\n\n const set = node.set; // so flow doesn't lose the above refinement.\n\n initializeNodeIfNewToStore(store, state, key, 'set');\n return set(store, state, newValue);\n}\n\nfunction peekNodeInfo(store, state, key) {\n var _graph$nodeDeps$get, _storeState$nodeToCom, _storeState$nodeToCom2;\n\n const storeState = store.getState();\n const graph = store.getGraph(state.version);\n const type = storeState.knownAtoms.has(key) ? 'atom' : storeState.knownSelectors.has(key) ? 'selector' : undefined;\n const downstreamNodes = Recoil_filterIterable(getDownstreamNodes(store, state, new Set([key])), nodeKey => nodeKey !== key);\n return {\n loadable: peekNodeLoadable(store, state, key),\n isActive: storeState.knownAtoms.has(key) || storeState.knownSelectors.has(key),\n isSet: type === 'selector' ? false : state.atomValues.has(key),\n isModified: state.dirtyAtoms.has(key),\n type,\n // Report current dependencies. If the node hasn't been evaluated, then\n // dependencies may be missing based on the current state.\n deps: recoilValuesForKeys$1((_graph$nodeDeps$get = graph.nodeDeps.get(key)) !== null && _graph$nodeDeps$get !== void 0 ? _graph$nodeDeps$get : []),\n // Reportsall \"current\" subscribers. Evaluating other nodes or\n // previous in-progress async evaluations may introduce new subscribers.\n subscribers: {\n nodes: recoilValuesForKeys$1(downstreamNodes),\n components: Recoil_mapIterable((_storeState$nodeToCom = (_storeState$nodeToCom2 = storeState.nodeToComponentSubscriptions.get(key)) === null || _storeState$nodeToCom2 === void 0 ? void 0 : _storeState$nodeToCom2.values()) !== null && _storeState$nodeToCom !== void 0 ? _storeState$nodeToCom : [], ([name]) => ({\n name\n }))\n }\n };\n} // Find all of the recursively dependent nodes\n\n\nfunction getDownstreamNodes(store, state, keys) {\n const visitedNodes = new Set();\n const visitingNodes = Array.from(keys);\n const graph = store.getGraph(state.version);\n\n for (let key = visitingNodes.pop(); key; key = visitingNodes.pop()) {\n var _graph$nodeToNodeSubs;\n\n visitedNodes.add(key);\n const subscribedNodes = (_graph$nodeToNodeSubs = graph.nodeToNodeSubscriptions.get(key)) !== null && _graph$nodeToNodeSubs !== void 0 ? _graph$nodeToNodeSubs : emptySet;\n\n for (const downstreamNode of subscribedNodes) {\n if (!visitedNodes.has(downstreamNode)) {\n visitingNodes.push(downstreamNode);\n }\n }\n }\n\n return visitedNodes;\n}\n\nvar Recoil_FunctionalCore = {\n getNodeLoadable,\n peekNodeLoadable,\n setNodeValue,\n cleanUpNode,\n setUnvalidatedAtomValue_DEPRECATED,\n peekNodeInfo,\n getDownstreamNodes,\n initializeNodeIfNewToStore\n};\n\nconst {\n getDownstreamNodes: getDownstreamNodes$1,\n getNodeLoadable: getNodeLoadable$1,\n setNodeValue: setNodeValue$1\n} = Recoil_FunctionalCore;\n\nconst {\n getNodeMaybe: getNodeMaybe$2\n} = Recoil_Node;\n\nconst {\n DefaultValue: DefaultValue$1,\n RecoilValueNotReady: RecoilValueNotReady$1\n} = Recoil_Node;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$1,\n RecoilState: RecoilState$1,\n RecoilValueReadOnly: RecoilValueReadOnly$1,\n isRecoilValue: isRecoilValue$1\n} = Recoil_RecoilValue$1;\n\nfunction getRecoilValueAsLoadable(store, {\n key\n}, treeState = store.getState().currentTree) {\n var _storeState$nextTree, _storeState$previousT;\n\n // Reading from an older tree can cause bugs because the dependencies that we\n // discover during the read are lost.\n const storeState = store.getState();\n\n if (!(treeState.version === storeState.currentTree.version || treeState.version === ((_storeState$nextTree = storeState.nextTree) === null || _storeState$nextTree === void 0 ? void 0 : _storeState$nextTree.version) || treeState.version === ((_storeState$previousT = storeState.previousTree) === null || _storeState$previousT === void 0 ? void 0 : _storeState$previousT.version))) {\n Recoil_recoverableViolation('Tried to read from a discarded tree');\n }\n\n const loadable = getNodeLoadable$1(store, treeState, key);\n return loadable;\n}\n\nfunction applyAtomValueWrites(atomValues, writes) {\n const result = atomValues.clone();\n writes.forEach((v, k) => {\n if (v.state === 'hasValue' && v.contents instanceof DefaultValue$1) {\n result.delete(k);\n } else {\n result.set(k, v);\n }\n });\n return result;\n}\n\nfunction valueFromValueOrUpdater(store, state, {\n key\n}, valueOrUpdater) {\n if (typeof valueOrUpdater === 'function') {\n // Updater form: pass in the current value. Throw if the current value\n // is unavailable (namely when updating an async selector that's\n // pending or errored):\n const current = getNodeLoadable$1(store, state, key);\n\n if (current.state === 'loading') {\n throw new RecoilValueNotReady$1(key);\n } else if (current.state === 'hasError') {\n throw current.contents;\n } // T itself may be a function, so our refinement is not sufficient:\n\n\n return valueOrUpdater(current.contents); // flowlint-line unclear-type:off\n } else {\n return valueOrUpdater;\n }\n}\n\nfunction applyAction(store, state, action) {\n if (action.type === 'set') {\n const {\n recoilValue,\n valueOrUpdater\n } = action;\n const newValue = valueFromValueOrUpdater(store, state, recoilValue, valueOrUpdater);\n const writes = setNodeValue$1(store, state, recoilValue.key, newValue);\n\n for (const [key, loadable] of writes.entries()) {\n writeLoadableToTreeState(state, key, loadable);\n }\n } else if (action.type === 'setLoadable') {\n const {\n recoilValue: {\n key\n },\n loadable\n } = action;\n writeLoadableToTreeState(state, key, loadable);\n } else if (action.type === 'markModified') {\n const {\n recoilValue: {\n key\n }\n } = action;\n state.dirtyAtoms.add(key);\n } else if (action.type === 'setUnvalidated') {\n var _node$invalidate;\n\n // Write value directly to state bypassing the Node interface as the node\n // definitions may not have been loaded yet when processing the initial snapshot.\n const {\n recoilValue: {\n key\n },\n unvalidatedValue\n } = action;\n const node = getNodeMaybe$2(key);\n node === null || node === void 0 ? void 0 : (_node$invalidate = node.invalidate) === null || _node$invalidate === void 0 ? void 0 : _node$invalidate.call(node, state);\n state.atomValues.delete(key);\n state.nonvalidatedAtoms.set(key, unvalidatedValue);\n state.dirtyAtoms.add(key);\n } else {\n Recoil_recoverableViolation(`Unknown action ${action.type}`);\n }\n}\n\nfunction writeLoadableToTreeState(state, key, loadable) {\n if (loadable.state === 'hasValue' && loadable.contents instanceof DefaultValue$1) {\n state.atomValues.delete(key);\n } else {\n state.atomValues.set(key, loadable);\n }\n\n state.dirtyAtoms.add(key);\n state.nonvalidatedAtoms.delete(key);\n}\n\nfunction applyActionsToStore(store, actions) {\n store.replaceState(state => {\n const newState = copyTreeState(state);\n\n for (const action of actions) {\n applyAction(store, newState, action);\n }\n\n invalidateDownstreams(store, newState);\n return newState;\n });\n}\n\nfunction queueOrPerformStateUpdate(store, action) {\n if (batchStack.length) {\n const actionsByStore = batchStack[batchStack.length - 1];\n let actions = actionsByStore.get(store);\n\n if (!actions) {\n actionsByStore.set(store, actions = []);\n }\n\n actions.push(action);\n } else {\n applyActionsToStore(store, [action]);\n }\n}\n\nconst batchStack = [];\n\nfunction batchStart() {\n const actionsByStore = new Map();\n batchStack.push(actionsByStore);\n return () => {\n for (const [store, actions] of actionsByStore) {\n applyActionsToStore(store, actions);\n }\n\n const popped = batchStack.pop();\n\n if (popped !== actionsByStore) {\n Recoil_recoverableViolation('Incorrect order of batch popping');\n }\n };\n}\n\nfunction copyTreeState(state) {\n return { ...state,\n atomValues: state.atomValues.clone(),\n nonvalidatedAtoms: state.nonvalidatedAtoms.clone(),\n dirtyAtoms: new Set(state.dirtyAtoms)\n };\n}\n\nfunction invalidateDownstreams(store, state) {\n // Inform any nodes that were changed or downstream of changes so that they\n // can clear out any caches as needed due to the update:\n const downstreams = getDownstreamNodes$1(store, state, state.dirtyAtoms);\n\n for (const key of downstreams) {\n var _getNodeMaybe, _getNodeMaybe$invalid;\n\n (_getNodeMaybe = getNodeMaybe$2(key)) === null || _getNodeMaybe === void 0 ? void 0 : (_getNodeMaybe$invalid = _getNodeMaybe.invalidate) === null || _getNodeMaybe$invalid === void 0 ? void 0 : _getNodeMaybe$invalid.call(_getNodeMaybe, state);\n }\n}\n\nfunction setRecoilValue(store, recoilValue, valueOrUpdater) {\n queueOrPerformStateUpdate(store, {\n type: 'set',\n recoilValue,\n valueOrUpdater\n });\n}\n\nfunction setRecoilValueLoadable(store, recoilValue, loadable) {\n if (loadable instanceof DefaultValue$1) {\n return setRecoilValue(store, recoilValue, loadable);\n }\n\n queueOrPerformStateUpdate(store, {\n type: 'setLoadable',\n recoilValue,\n loadable\n });\n}\n\nfunction markRecoilValueModified(store, recoilValue) {\n queueOrPerformStateUpdate(store, {\n type: 'markModified',\n recoilValue\n });\n}\n\nfunction setUnvalidatedRecoilValue(store, recoilValue, unvalidatedValue) {\n queueOrPerformStateUpdate(store, {\n type: 'setUnvalidated',\n recoilValue,\n unvalidatedValue\n });\n}\n\nlet subscriptionID = 0;\n\nfunction subscribeToRecoilValue(store, {\n key\n}, callback, componentDebugName = null) {\n const subID = subscriptionID++;\n const storeState = store.getState();\n\n if (!storeState.nodeToComponentSubscriptions.has(key)) {\n storeState.nodeToComponentSubscriptions.set(key, new Map());\n }\n\n Recoil_nullthrows(storeState.nodeToComponentSubscriptions.get(key)).set(subID, [componentDebugName !== null && componentDebugName !== void 0 ? componentDebugName : '', callback]);\n return {\n release: () => {\n const storeState = store.getState();\n const subs = storeState.nodeToComponentSubscriptions.get(key);\n\n if (subs === undefined || !subs.has(subID)) {\n Recoil_recoverableViolation(`Subscription missing at release time for atom ${key}. This is a bug in Recoil.`);\n return;\n }\n\n subs.delete(subID);\n\n if (subs.size === 0) {\n storeState.nodeToComponentSubscriptions.delete(key);\n }\n }\n };\n}\n\nvar Recoil_RecoilValueInterface = {\n RecoilValueReadOnly: RecoilValueReadOnly$1,\n AbstractRecoilValue: AbstractRecoilValue$1,\n RecoilState: RecoilState$1,\n getRecoilValueAsLoadable,\n setRecoilValue,\n setRecoilValueLoadable,\n markRecoilValueModified,\n setUnvalidatedRecoilValue,\n subscribeToRecoilValue,\n isRecoilValue: isRecoilValue$1,\n applyAtomValueWrites,\n // TODO Remove export when deprecating initialStoreState_DEPRECATED in RecoilRoot\n batchStart,\n invalidateDownstreams_FOR_TESTING: invalidateDownstreams\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is to export esstiential functions from react-dom\n * for our web build\n */\nconst {\n unstable_batchedUpdates\n} = reactDom;\n\nvar ReactBatchedUpdates = {\n unstable_batchedUpdates\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is to export esstiential functions from react-dom\n * for our web build\n */\n// @fb-only: const {unstable_batchedUpdates} = require('ReactDOMComet');\nconst {\n unstable_batchedUpdates: unstable_batchedUpdates$1\n} = ReactBatchedUpdates; // @oss-only\n\n\nvar Recoil_ReactBatchedUpdates = {\n unstable_batchedUpdates: unstable_batchedUpdates$1\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\nconst {\n batchStart: batchStart$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n unstable_batchedUpdates: unstable_batchedUpdates$2\n} = Recoil_ReactBatchedUpdates;\n\nlet batcher = unstable_batchedUpdates$2; // flowlint-next-line unclear-type:off\n\n/**\n * Sets the provided batcher function as the batcher function used by Recoil.\n *\n * Set the batcher to a custom batcher for your renderer,\n * if you use a renderer other than React DOM or React Native.\n */\nconst setBatcher = newBatcher => {\n batcher = newBatcher;\n};\n/**\n * Returns the current batcher function.\n */\n\n\nconst getBatcher = () => batcher;\n/**\n * Calls the current batcher function and passes the\n * provided callback function.\n */\n\n\nconst batchUpdates = callback => {\n batcher(() => {\n let batchEnd = () => undefined;\n\n try {\n batchEnd = batchStart$1();\n callback();\n } finally {\n batchEnd();\n }\n });\n};\n\nvar Recoil_Batching = {\n getBatcher,\n setBatcher,\n batchUpdates\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction enqueueExecution(s, f) {\n f();\n}\n\nvar Recoil_Queue = {\n enqueueExecution\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a set containing all of the values from the first set that are not\n * present in any of the subsequent sets.\n *\n * Note: this is written procedurally (i.e., without filterSet) for performant\n * use in tight loops.\n */\n\nfunction differenceSets(set, ...setsWithValuesToRemove) {\n const ret = new Set();\n\n FIRST: for (const value of set) {\n for (const otherSet of setsWithValuesToRemove) {\n if (otherSet.has(value)) {\n continue FIRST;\n }\n }\n\n ret.add(value);\n }\n\n return ret;\n}\n\nvar Recoil_differenceSets = differenceSets;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a new Map object with the same keys as the original, but with the\n * values replaced with the output of the given callback function.\n */\n\nfunction mapMap(map, callback) {\n const result = new Map();\n map.forEach((value, key) => {\n result.set(key, callback(value, key));\n });\n return result;\n}\n\nvar Recoil_mapMap = mapMap;\n\nfunction graph() {\n return {\n nodeDeps: new Map(),\n nodeToNodeSubscriptions: new Map()\n };\n}\n\nfunction cloneGraph(graph) {\n return {\n nodeDeps: Recoil_mapMap(graph.nodeDeps, s => new Set(s)),\n nodeToNodeSubscriptions: Recoil_mapMap(graph.nodeToNodeSubscriptions, s => new Set(s))\n };\n} // Note that this overwrites the deps of existing nodes, rather than unioning\n// the new deps with the old deps.\n\n\nfunction mergeDependencyMapIntoGraph(deps, graph, // If olderGraph is given then we will not overwrite changes made to the given\n// graph compared with olderGraph:\nolderGraph) {\n const {\n nodeDeps,\n nodeToNodeSubscriptions\n } = graph;\n deps.forEach((upstreams, downstream) => {\n const existingUpstreams = nodeDeps.get(downstream);\n\n if (existingUpstreams && olderGraph && existingUpstreams !== olderGraph.nodeDeps.get(downstream)) {\n return;\n } // Update nodeDeps:\n\n\n nodeDeps.set(downstream, new Set(upstreams)); // Add new deps to nodeToNodeSubscriptions:\n\n const addedUpstreams = existingUpstreams == null ? upstreams : Recoil_differenceSets(upstreams, existingUpstreams);\n addedUpstreams.forEach(upstream => {\n if (!nodeToNodeSubscriptions.has(upstream)) {\n nodeToNodeSubscriptions.set(upstream, new Set());\n }\n\n const existing = Recoil_nullthrows(nodeToNodeSubscriptions.get(upstream));\n existing.add(downstream);\n }); // Remove removed deps from nodeToNodeSubscriptions:\n\n if (existingUpstreams) {\n const removedUpstreams = Recoil_differenceSets(existingUpstreams, upstreams);\n removedUpstreams.forEach(upstream => {\n if (!nodeToNodeSubscriptions.has(upstream)) {\n return;\n }\n\n const existing = Recoil_nullthrows(nodeToNodeSubscriptions.get(upstream));\n existing.delete(downstream);\n\n if (existing.size === 0) {\n nodeToNodeSubscriptions.delete(upstream);\n }\n });\n }\n });\n}\n\nfunction saveDependencyMapToStore(dependencyMap, store, version) {\n var _storeState$nextTree, _storeState$previousT, _storeState$previousT2, _storeState$previousT3;\n\n const storeState = store.getState();\n\n if (!(version === storeState.currentTree.version || version === ((_storeState$nextTree = storeState.nextTree) === null || _storeState$nextTree === void 0 ? void 0 : _storeState$nextTree.version) || version === ((_storeState$previousT = storeState.previousTree) === null || _storeState$previousT === void 0 ? void 0 : _storeState$previousT.version))) {\n Recoil_recoverableViolation('Tried to save dependencies to a discarded tree');\n } // Merge the dependencies discovered into the store's dependency map\n // for the version that was read:\n\n\n const graph = store.getGraph(version);\n mergeDependencyMapIntoGraph(dependencyMap, graph); // If this version is not the latest version, also write these dependencies\n // into later versions if they don't already have their own:\n\n if (version === ((_storeState$previousT2 = storeState.previousTree) === null || _storeState$previousT2 === void 0 ? void 0 : _storeState$previousT2.version)) {\n const currentGraph = store.getGraph(storeState.currentTree.version);\n mergeDependencyMapIntoGraph(dependencyMap, currentGraph, graph);\n }\n\n if (version === ((_storeState$previousT3 = storeState.previousTree) === null || _storeState$previousT3 === void 0 ? void 0 : _storeState$previousT3.version) || version === storeState.currentTree.version) {\n var _storeState$nextTree2;\n\n const nextVersion = (_storeState$nextTree2 = storeState.nextTree) === null || _storeState$nextTree2 === void 0 ? void 0 : _storeState$nextTree2.version;\n\n if (nextVersion !== undefined) {\n const nextGraph = store.getGraph(nextVersion);\n mergeDependencyMapIntoGraph(dependencyMap, nextGraph, graph);\n }\n }\n}\n\nfunction mergeDepsIntoDependencyMap(from, into) {\n from.forEach((upstreamDeps, downstreamNode) => {\n if (!into.has(downstreamNode)) {\n into.set(downstreamNode, new Set());\n }\n\n const deps = Recoil_nullthrows(into.get(downstreamNode));\n upstreamDeps.forEach(dep => deps.add(dep));\n });\n}\n\nfunction addToDependencyMap(downstream, upstream, dependencyMap) {\n if (!dependencyMap.has(downstream)) {\n dependencyMap.set(downstream, new Set());\n }\n\n Recoil_nullthrows(dependencyMap.get(downstream)).add(upstream);\n}\n\nvar Recoil_Graph = {\n addToDependencyMap,\n cloneGraph,\n graph,\n mergeDepsIntoDependencyMap,\n saveDependencyMapToStore\n};\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar hamt_1 = createCommonjsModule(function (module) {\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n/**\n @fileOverview Hash Array Mapped Trie.\n\n Code based on: https://github.com/exclipy/pdata\n*/\n\n\nvar hamt = {}; // export\n\n/* Configuration\n ******************************************************************************/\n\nvar SIZE = 5;\nvar BUCKET_SIZE = Math.pow(2, SIZE);\nvar MASK = BUCKET_SIZE - 1;\nvar MAX_INDEX_NODE = BUCKET_SIZE / 2;\nvar MIN_ARRAY_NODE = BUCKET_SIZE / 4;\n/*\n ******************************************************************************/\n\nvar nothing = {};\n\nvar constant = function constant(x) {\n return function () {\n return x;\n };\n};\n/**\n Get 32 bit hash of string.\n\n Based on:\n http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery\n*/\n\n\nvar hash = hamt.hash = function (str) {\n var type = typeof str === 'undefined' ? 'undefined' : _typeof(str);\n if (type === 'number') return str;\n if (type !== 'string') str += '';\n var hash = 0;\n\n for (var i = 0, len = str.length; i < len; ++i) {\n var c = str.charCodeAt(i);\n hash = (hash << 5) - hash + c | 0;\n }\n\n return hash;\n};\n/* Bit Ops\n ******************************************************************************/\n\n/**\n Hamming weight.\n\n Taken from: http://jsperf.com/hamming-weight\n*/\n\n\nvar popcount = function popcount(x) {\n x -= x >> 1 & 0x55555555;\n x = (x & 0x33333333) + (x >> 2 & 0x33333333);\n x = x + (x >> 4) & 0x0f0f0f0f;\n x += x >> 8;\n x += x >> 16;\n return x & 0x7f;\n};\n\nvar hashFragment = function hashFragment(shift, h) {\n return h >>> shift & MASK;\n};\n\nvar toBitmap = function toBitmap(x) {\n return 1 << x;\n};\n\nvar fromBitmap = function fromBitmap(bitmap, bit) {\n return popcount(bitmap & bit - 1);\n};\n/* Array Ops\n ******************************************************************************/\n\n/**\n Set a value in an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to change.\n @param v New value\n @param arr Array.\n*/\n\n\nvar arrayUpdate = function arrayUpdate(mutate, at, v, arr) {\n var out = arr;\n\n if (!mutate) {\n var len = arr.length;\n out = new Array(len);\n\n for (var i = 0; i < len; ++i) {\n out[i] = arr[i];\n }\n }\n\n out[at] = v;\n return out;\n};\n/**\n Remove a value from an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to remove.\n @param arr Array.\n*/\n\n\nvar arraySpliceOut = function arraySpliceOut(mutate, at, arr) {\n var newLen = arr.length - 1;\n var i = 0;\n var g = 0;\n var out = arr;\n\n if (mutate) {\n i = g = at;\n } else {\n out = new Array(newLen);\n\n while (i < at) {\n out[g++] = arr[i++];\n }\n }\n\n ++i;\n\n while (i <= newLen) {\n out[g++] = arr[i++];\n }\n\n if (mutate) {\n out.length = newLen;\n }\n\n return out;\n};\n/**\n Insert a value into an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to insert at.\n @param v Value to insert,\n @param arr Array.\n*/\n\n\nvar arraySpliceIn = function arraySpliceIn(mutate, at, v, arr) {\n var len = arr.length;\n\n if (mutate) {\n var _i = len;\n\n while (_i >= at) {\n arr[_i--] = arr[_i];\n }\n\n arr[at] = v;\n return arr;\n }\n\n var i = 0,\n g = 0;\n var out = new Array(len + 1);\n\n while (i < at) {\n out[g++] = arr[i++];\n }\n\n out[at] = v;\n\n while (i < len) {\n out[++g] = arr[i++];\n }\n\n return out;\n};\n/* Node Structures\n ******************************************************************************/\n\n\nvar LEAF = 1;\nvar COLLISION = 2;\nvar INDEX = 3;\nvar ARRAY = 4;\n/**\n Empty node.\n*/\n\nvar empty = {\n __hamt_isEmpty: true\n};\n\nvar isEmptyNode = function isEmptyNode(x) {\n return x === empty || x && x.__hamt_isEmpty;\n};\n/**\n Leaf holding a value.\n\n @member edit Edit of the node.\n @member hash Hash of key.\n @member key Key.\n @member value Value stored.\n*/\n\n\nvar Leaf = function Leaf(edit, hash, key, value) {\n return {\n type: LEAF,\n edit: edit,\n hash: hash,\n key: key,\n value: value,\n _modify: Leaf__modify\n };\n};\n/**\n Leaf holding multiple values with the same hash but different keys.\n\n @member edit Edit of the node.\n @member hash Hash of key.\n @member children Array of collision children node.\n*/\n\n\nvar Collision = function Collision(edit, hash, children) {\n return {\n type: COLLISION,\n edit: edit,\n hash: hash,\n children: children,\n _modify: Collision__modify\n };\n};\n/**\n Internal node with a sparse set of children.\n\n Uses a bitmap and array to pack children.\n\n @member edit Edit of the node.\n @member mask Bitmap that encode the positions of children in the array.\n @member children Array of child nodes.\n*/\n\n\nvar IndexedNode = function IndexedNode(edit, mask, children) {\n return {\n type: INDEX,\n edit: edit,\n mask: mask,\n children: children,\n _modify: IndexedNode__modify\n };\n};\n/**\n Internal node with many children.\n\n @member edit Edit of the node.\n @member size Number of children.\n @member children Array of child nodes.\n*/\n\n\nvar ArrayNode = function ArrayNode(edit, size, children) {\n return {\n type: ARRAY,\n edit: edit,\n size: size,\n children: children,\n _modify: ArrayNode__modify\n };\n};\n/**\n Is `node` a leaf node?\n*/\n\n\nvar isLeaf = function isLeaf(node) {\n return node === empty || node.type === LEAF || node.type === COLLISION;\n};\n/* Internal node operations.\n ******************************************************************************/\n\n/**\n Expand an indexed node into an array node.\n\n @param edit Current edit.\n @param frag Index of added child.\n @param child Added child.\n @param mask Index node mask before child added.\n @param subNodes Index node children before child added.\n*/\n\n\nvar expand = function expand(edit, frag, child, bitmap, subNodes) {\n var arr = [];\n var bit = bitmap;\n var count = 0;\n\n for (var i = 0; bit; ++i) {\n if (bit & 1) arr[i] = subNodes[count++];\n bit >>>= 1;\n }\n\n arr[frag] = child;\n return ArrayNode(edit, count + 1, arr);\n};\n/**\n Collapse an array node into a indexed node.\n\n @param edit Current edit.\n @param count Number of elements in new array.\n @param removed Index of removed element.\n @param elements Array node children before remove.\n*/\n\n\nvar pack = function pack(edit, count, removed, elements) {\n var children = new Array(count - 1);\n var g = 0;\n var bitmap = 0;\n\n for (var i = 0, len = elements.length; i < len; ++i) {\n if (i !== removed) {\n var elem = elements[i];\n\n if (elem && !isEmptyNode(elem)) {\n children[g++] = elem;\n bitmap |= 1 << i;\n }\n }\n }\n\n return IndexedNode(edit, bitmap, children);\n};\n/**\n Merge two leaf nodes.\n\n @param shift Current shift.\n @param h1 Node 1 hash.\n @param n1 Node 1.\n @param h2 Node 2 hash.\n @param n2 Node 2.\n*/\n\n\nvar mergeLeaves = function mergeLeaves(edit, shift, h1, n1, h2, n2) {\n if (h1 === h2) return Collision(edit, h1, [n2, n1]);\n var subH1 = hashFragment(shift, h1);\n var subH2 = hashFragment(shift, h2);\n return IndexedNode(edit, toBitmap(subH1) | toBitmap(subH2), subH1 === subH2 ? [mergeLeaves(edit, shift + SIZE, h1, n1, h2, n2)] : subH1 < subH2 ? [n1, n2] : [n2, n1]);\n};\n/**\n Update an entry in a collision list.\n\n @param mutate Should mutation be used?\n @param edit Current edit.\n @param keyEq Key compare function.\n @param hash Hash of collision.\n @param list Collision list.\n @param f Update function.\n @param k Key to update.\n @param size Size ref.\n*/\n\n\nvar updateCollisionList = function updateCollisionList(mutate, edit, keyEq, h, list, f, k, size) {\n var len = list.length;\n\n for (var i = 0; i < len; ++i) {\n var child = list[i];\n\n if (keyEq(k, child.key)) {\n var value = child.value;\n\n var _newValue = f(value);\n\n if (_newValue === value) return list;\n\n if (_newValue === nothing) {\n --size.value;\n return arraySpliceOut(mutate, i, list);\n }\n\n return arrayUpdate(mutate, i, Leaf(edit, h, k, _newValue), list);\n }\n }\n\n var newValue = f();\n if (newValue === nothing) return list;\n ++size.value;\n return arrayUpdate(mutate, len, Leaf(edit, h, k, newValue), list);\n};\n\nvar canEditNode = function canEditNode(edit, node) {\n return edit === node.edit;\n};\n/* Editing\n ******************************************************************************/\n\n\nvar Leaf__modify = function Leaf__modify(edit, keyEq, shift, f, h, k, size) {\n if (keyEq(k, this.key)) {\n var _v = f(this.value);\n\n if (_v === this.value) return this;else if (_v === nothing) {\n --size.value;\n return empty;\n }\n\n if (canEditNode(edit, this)) {\n this.value = _v;\n return this;\n }\n\n return Leaf(edit, h, k, _v);\n }\n\n var v = f();\n if (v === nothing) return this;\n ++size.value;\n return mergeLeaves(edit, shift, this.hash, this, h, Leaf(edit, h, k, v));\n};\n\nvar Collision__modify = function Collision__modify(edit, keyEq, shift, f, h, k, size) {\n if (h === this.hash) {\n var canEdit = canEditNode(edit, this);\n var list = updateCollisionList(canEdit, edit, keyEq, this.hash, this.children, f, k, size);\n if (list === this.children) return this;\n return list.length > 1 ? Collision(edit, this.hash, list) : list[0]; // collapse single element collision list\n }\n\n var v = f();\n if (v === nothing) return this;\n ++size.value;\n return mergeLeaves(edit, shift, this.hash, this, h, Leaf(edit, h, k, v));\n};\n\nvar IndexedNode__modify = function IndexedNode__modify(edit, keyEq, shift, f, h, k, size) {\n var mask = this.mask;\n var children = this.children;\n var frag = hashFragment(shift, h);\n var bit = toBitmap(frag);\n var indx = fromBitmap(mask, bit);\n var exists = mask & bit;\n var current = exists ? children[indx] : empty;\n\n var child = current._modify(edit, keyEq, shift + SIZE, f, h, k, size);\n\n if (current === child) return this;\n var canEdit = canEditNode(edit, this);\n var bitmap = mask;\n var newChildren = void 0;\n\n if (exists && isEmptyNode(child)) {\n // remove\n bitmap &= ~bit;\n if (!bitmap) return empty;\n if (children.length <= 2 && isLeaf(children[indx ^ 1])) return children[indx ^ 1]; // collapse\n\n newChildren = arraySpliceOut(canEdit, indx, children);\n } else if (!exists && !isEmptyNode(child)) {\n // add\n if (children.length >= MAX_INDEX_NODE) return expand(edit, frag, child, mask, children);\n bitmap |= bit;\n newChildren = arraySpliceIn(canEdit, indx, child, children);\n } else {\n // modify\n newChildren = arrayUpdate(canEdit, indx, child, children);\n }\n\n if (canEdit) {\n this.mask = bitmap;\n this.children = newChildren;\n return this;\n }\n\n return IndexedNode(edit, bitmap, newChildren);\n};\n\nvar ArrayNode__modify = function ArrayNode__modify(edit, keyEq, shift, f, h, k, size) {\n var count = this.size;\n var children = this.children;\n var frag = hashFragment(shift, h);\n var child = children[frag];\n\n var newChild = (child || empty)._modify(edit, keyEq, shift + SIZE, f, h, k, size);\n\n if (child === newChild) return this;\n var canEdit = canEditNode(edit, this);\n var newChildren = void 0;\n\n if (isEmptyNode(child) && !isEmptyNode(newChild)) {\n // add\n ++count;\n newChildren = arrayUpdate(canEdit, frag, newChild, children);\n } else if (!isEmptyNode(child) && isEmptyNode(newChild)) {\n // remove\n --count;\n if (count <= MIN_ARRAY_NODE) return pack(edit, count, frag, children);\n newChildren = arrayUpdate(canEdit, frag, empty, children);\n } else {\n // modify\n newChildren = arrayUpdate(canEdit, frag, newChild, children);\n }\n\n if (canEdit) {\n this.size = count;\n this.children = newChildren;\n return this;\n }\n\n return ArrayNode(edit, count, newChildren);\n};\n\nempty._modify = function (edit, keyEq, shift, f, h, k, size) {\n var v = f();\n if (v === nothing) return empty;\n ++size.value;\n return Leaf(edit, h, k, v);\n};\n/*\n ******************************************************************************/\n\n\nfunction Map(editable, edit, config, root, size) {\n this._editable = editable;\n this._edit = edit;\n this._config = config;\n this._root = root;\n this._size = size;\n}\n\nMap.prototype.setTree = function (newRoot, newSize) {\n if (this._editable) {\n this._root = newRoot;\n this._size = newSize;\n return this;\n }\n\n return newRoot === this._root ? this : new Map(this._editable, this._edit, this._config, newRoot, newSize);\n};\n/* Queries\n ******************************************************************************/\n\n/**\n Lookup the value for `key` in `map` using a custom `hash`.\n\n Returns the value or `alt` if none.\n*/\n\n\nvar tryGetHash = hamt.tryGetHash = function (alt, hash, key, map) {\n var node = map._root;\n var shift = 0;\n var keyEq = map._config.keyEq;\n\n while (true) {\n switch (node.type) {\n case LEAF:\n {\n return keyEq(key, node.key) ? node.value : alt;\n }\n\n case COLLISION:\n {\n if (hash === node.hash) {\n var children = node.children;\n\n for (var i = 0, len = children.length; i < len; ++i) {\n var child = children[i];\n if (keyEq(key, child.key)) return child.value;\n }\n }\n\n return alt;\n }\n\n case INDEX:\n {\n var frag = hashFragment(shift, hash);\n var bit = toBitmap(frag);\n\n if (node.mask & bit) {\n node = node.children[fromBitmap(node.mask, bit)];\n shift += SIZE;\n break;\n }\n\n return alt;\n }\n\n case ARRAY:\n {\n node = node.children[hashFragment(shift, hash)];\n\n if (node) {\n shift += SIZE;\n break;\n }\n\n return alt;\n }\n\n default:\n return alt;\n }\n }\n};\n\nMap.prototype.tryGetHash = function (alt, hash, key) {\n return tryGetHash(alt, hash, key, this);\n};\n/**\n Lookup the value for `key` in `map` using internal hash function.\n\n @see `tryGetHash`\n*/\n\n\nvar tryGet = hamt.tryGet = function (alt, key, map) {\n return tryGetHash(alt, map._config.hash(key), key, map);\n};\n\nMap.prototype.tryGet = function (alt, key) {\n return tryGet(alt, key, this);\n};\n/**\n Lookup the value for `key` in `map` using a custom `hash`.\n\n Returns the value or `undefined` if none.\n*/\n\n\nvar getHash = hamt.getHash = function (hash, key, map) {\n return tryGetHash(undefined, hash, key, map);\n};\n\nMap.prototype.getHash = function (hash, key) {\n return getHash(hash, key, this);\n};\n/**\n Lookup the value for `key` in `map` using internal hash function.\n\n @see `get`\n*/\n\n\nvar get = hamt.get = function (key, map) {\n return tryGetHash(undefined, map._config.hash(key), key, map);\n};\n\nMap.prototype.get = function (key, alt) {\n return tryGet(alt, key, this);\n};\n/**\n Does an entry exist for `key` in `map`? Uses custom `hash`.\n*/\n\n\nvar hasHash = hamt.has = function (hash, key, map) {\n return tryGetHash(nothing, hash, key, map) !== nothing;\n};\n\nMap.prototype.hasHash = function (hash, key) {\n return hasHash(hash, key, this);\n};\n/**\n Does an entry exist for `key` in `map`? Uses internal hash function.\n*/\n\n\nvar has = hamt.has = function (key, map) {\n return hasHash(map._config.hash(key), key, map);\n};\n\nMap.prototype.has = function (key) {\n return has(key, this);\n};\n\nvar defKeyCompare = function defKeyCompare(x, y) {\n return x === y;\n};\n/**\n Create an empty map.\n\n @param config Configuration.\n*/\n\n\nhamt.make = function (config) {\n return new Map(0, 0, {\n keyEq: config && config.keyEq || defKeyCompare,\n hash: config && config.hash || hash\n }, empty, 0);\n};\n/**\n Empty map.\n*/\n\n\nhamt.empty = hamt.make();\n/**\n Does `map` contain any elements?\n*/\n\nvar isEmpty = hamt.isEmpty = function (map) {\n return map && !!isEmptyNode(map._root);\n};\n\nMap.prototype.isEmpty = function () {\n return isEmpty(this);\n};\n/* Updates\n ******************************************************************************/\n\n/**\n Alter the value stored for `key` in `map` using function `f` using\n custom hash.\n\n `f` is invoked with the current value for `k` if it exists,\n or no arguments if no such value exists. `modify` will always either\n update or insert a value into the map.\n\n Returns a map with the modified value. Does not alter `map`.\n*/\n\n\nvar modifyHash = hamt.modifyHash = function (f, hash, key, map) {\n var size = {\n value: map._size\n };\n\n var newRoot = map._root._modify(map._editable ? map._edit : NaN, map._config.keyEq, 0, f, hash, key, size);\n\n return map.setTree(newRoot, size.value);\n};\n\nMap.prototype.modifyHash = function (hash, key, f) {\n return modifyHash(f, hash, key, this);\n};\n/**\n Alter the value stored for `key` in `map` using function `f` using\n internal hash function.\n\n @see `modifyHash`\n*/\n\n\nvar modify = hamt.modify = function (f, key, map) {\n return modifyHash(f, map._config.hash(key), key, map);\n};\n\nMap.prototype.modify = function (key, f) {\n return modify(f, key, this);\n};\n/**\n Store `value` for `key` in `map` using custom `hash`.\n\n Returns a map with the modified value. Does not alter `map`.\n*/\n\n\nvar setHash = hamt.setHash = function (hash, key, value, map) {\n return modifyHash(constant(value), hash, key, map);\n};\n\nMap.prototype.setHash = function (hash, key, value) {\n return setHash(hash, key, value, this);\n};\n/**\n Store `value` for `key` in `map` using internal hash function.\n\n @see `setHash`\n*/\n\n\nvar set = hamt.set = function (key, value, map) {\n return setHash(map._config.hash(key), key, value, map);\n};\n\nMap.prototype.set = function (key, value) {\n return set(key, value, this);\n};\n/**\n Remove the entry for `key` in `map`.\n\n Returns a map with the value removed. Does not alter `map`.\n*/\n\n\nvar del = constant(nothing);\n\nvar removeHash = hamt.removeHash = function (hash, key, map) {\n return modifyHash(del, hash, key, map);\n};\n\nMap.prototype.removeHash = Map.prototype.deleteHash = function (hash, key) {\n return removeHash(hash, key, this);\n};\n/**\n Remove the entry for `key` in `map` using internal hash function.\n\n @see `removeHash`\n*/\n\n\nvar remove = hamt.remove = function (key, map) {\n return removeHash(map._config.hash(key), key, map);\n};\n\nMap.prototype.remove = Map.prototype.delete = function (key) {\n return remove(key, this);\n};\n/* Mutation\n ******************************************************************************/\n\n/**\n Mark `map` as mutable.\n */\n\n\nvar beginMutation = hamt.beginMutation = function (map) {\n return new Map(map._editable + 1, map._edit + 1, map._config, map._root, map._size);\n};\n\nMap.prototype.beginMutation = function () {\n return beginMutation(this);\n};\n/**\n Mark `map` as immutable.\n */\n\n\nvar endMutation = hamt.endMutation = function (map) {\n map._editable = map._editable && map._editable - 1;\n return map;\n};\n\nMap.prototype.endMutation = function () {\n return endMutation(this);\n};\n/**\n Mutate `map` within the context of `f`.\n @param f\n @param map HAMT\n*/\n\n\nvar mutate = hamt.mutate = function (f, map) {\n var transient = beginMutation(map);\n f(transient);\n return endMutation(transient);\n};\n\nMap.prototype.mutate = function (f) {\n return mutate(f, this);\n};\n/* Traversal\n ******************************************************************************/\n\n/**\n Apply a continuation.\n*/\n\n\nvar appk = function appk(k) {\n return k && lazyVisitChildren(k[0], k[1], k[2], k[3], k[4]);\n};\n/**\n Recursively visit all values stored in an array of nodes lazily.\n*/\n\n\nvar lazyVisitChildren = function lazyVisitChildren(len, children, i, f, k) {\n while (i < len) {\n var child = children[i++];\n if (child && !isEmptyNode(child)) return lazyVisit(child, f, [len, children, i, f, k]);\n }\n\n return appk(k);\n};\n/**\n Recursively visit all values stored in `node` lazily.\n*/\n\n\nvar lazyVisit = function lazyVisit(node, f, k) {\n switch (node.type) {\n case LEAF:\n return {\n value: f(node),\n rest: k\n };\n\n case COLLISION:\n case ARRAY:\n case INDEX:\n var children = node.children;\n return lazyVisitChildren(children.length, children, 0, f, k);\n\n default:\n return appk(k);\n }\n};\n\nvar DONE = {\n done: true\n};\n/**\n Javascript iterator over a map.\n*/\n\nfunction MapIterator(v) {\n this.v = v;\n}\n\nMapIterator.prototype.next = function () {\n if (!this.v) return DONE;\n var v0 = this.v;\n this.v = appk(v0.rest);\n return v0;\n};\n\nMapIterator.prototype[Symbol.iterator] = function () {\n return this;\n};\n/**\n Lazily visit each value in map with function `f`.\n*/\n\n\nvar visit = function visit(map, f) {\n return new MapIterator(lazyVisit(map._root, f));\n};\n/**\n Get a Javascsript iterator of `map`.\n\n Iterates over `[key, value]` arrays.\n*/\n\n\nvar buildPairs = function buildPairs(x) {\n return [x.key, x.value];\n};\n\nvar entries = hamt.entries = function (map) {\n return visit(map, buildPairs);\n};\n\nMap.prototype.entries = Map.prototype[Symbol.iterator] = function () {\n return entries(this);\n};\n/**\n Get array of all keys in `map`.\n\n Order is not guaranteed.\n*/\n\n\nvar buildKeys = function buildKeys(x) {\n return x.key;\n};\n\nvar keys = hamt.keys = function (map) {\n return visit(map, buildKeys);\n};\n\nMap.prototype.keys = function () {\n return keys(this);\n};\n/**\n Get array of all values in `map`.\n\n Order is not guaranteed, duplicates are preserved.\n*/\n\n\nvar buildValues = function buildValues(x) {\n return x.value;\n};\n\nvar values = hamt.values = Map.prototype.values = function (map) {\n return visit(map, buildValues);\n};\n\nMap.prototype.values = function () {\n return values(this);\n};\n/* Fold\n ******************************************************************************/\n\n/**\n Visit every entry in the map, aggregating data.\n\n Order of nodes is not guaranteed.\n\n @param f Function mapping accumulated value, value, and key to new value.\n @param z Starting value.\n @param m HAMT\n*/\n\n\nvar fold = hamt.fold = function (f, z, m) {\n var root = m._root;\n if (root.type === LEAF) return f(z, root.value, root.key);\n var toVisit = [root.children];\n var children = void 0;\n\n while (children = toVisit.pop()) {\n for (var i = 0, len = children.length; i < len;) {\n var child = children[i++];\n\n if (child && child.type) {\n if (child.type === LEAF) z = f(z, child.value, child.key);else toVisit.push(child.children);\n }\n }\n }\n\n return z;\n};\n\nMap.prototype.fold = function (f, z) {\n return fold(f, z, this);\n};\n/**\n Visit every entry in the map, aggregating data.\n\n Order of nodes is not guaranteed.\n\n @param f Function invoked with value and key\n @param map HAMT\n*/\n\n\nvar forEach = hamt.forEach = function (f, map) {\n return fold(function (_, value, key) {\n return f(value, key, map);\n }, null, map);\n};\n\nMap.prototype.forEach = function (f) {\n return forEach(f, this);\n};\n/* Aggregate\n ******************************************************************************/\n\n/**\n Get the number of entries in `map`.\n*/\n\n\nvar count = hamt.count = function (map) {\n return map._size;\n};\n\nMap.prototype.count = function () {\n return count(this);\n};\n\nObject.defineProperty(Map.prototype, 'size', {\n get: Map.prototype.count\n});\n/* Export\n ******************************************************************************/\n\nif ( module.exports) {\n module.exports = hamt;\n} else {\n undefined.hamt = hamt;\n}\n});\n\nclass BuiltInMap {\n constructor(existing) {\n _defineProperty(this, \"_map\", void 0);\n\n this._map = new Map(existing === null || existing === void 0 ? void 0 : existing.entries());\n }\n\n keys() {\n return this._map.keys();\n }\n\n entries() {\n return this._map.entries();\n }\n\n get(k) {\n return this._map.get(k);\n }\n\n has(k) {\n return this._map.has(k);\n }\n\n set(k, v) {\n this._map.set(k, v);\n\n return this;\n }\n\n delete(k) {\n this._map.delete(k);\n\n return this;\n }\n\n clone() {\n return persistentMap(this);\n }\n\n toMap() {\n return new Map(this._map);\n }\n\n}\n\nclass HashArrayMappedTrieMap {\n // Because hamt.empty is not a function there is no way to introduce type\n // parameters on it, so empty is typed as HAMTPlusMap.\n // flowlint-next-line unclear-type:off\n constructor(existing) {\n _defineProperty(this, \"_hamt\", hamt_1.empty.beginMutation());\n\n if (existing instanceof HashArrayMappedTrieMap) {\n const h = existing._hamt.endMutation();\n\n existing._hamt = h.beginMutation();\n this._hamt = h.beginMutation();\n } else if (existing) {\n for (const [k, v] of existing.entries()) {\n this._hamt.set(k, v);\n }\n }\n }\n\n keys() {\n return this._hamt.keys();\n }\n\n entries() {\n return this._hamt.entries();\n }\n\n get(k) {\n return this._hamt.get(k);\n }\n\n has(k) {\n return this._hamt.has(k);\n }\n\n set(k, v) {\n this._hamt.set(k, v);\n\n return this;\n }\n\n delete(k) {\n this._hamt.delete(k);\n\n return this;\n }\n\n clone() {\n return persistentMap(this);\n }\n\n toMap() {\n return new Map(this._hamt);\n }\n\n}\n\nfunction persistentMap(existing) {\n if (Recoil_gkx_1('recoil_hamt_2020')) {\n return new HashArrayMappedTrieMap(existing);\n } else {\n return new BuiltInMap(existing);\n }\n}\n\nvar Recoil_PersistentMap = {\n persistentMap\n};\n\nvar Recoil_PersistentMap_1 = Recoil_PersistentMap.persistentMap;\n\nvar Recoil_PersistentMap$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n persistentMap: Recoil_PersistentMap_1\n});\n\nconst {\n graph: graph$1\n} = Recoil_Graph;\n\nconst {\n persistentMap: persistentMap$1\n} = Recoil_PersistentMap$1; // flowlint-next-line unclear-type:off\n\n\nlet nextTreeStateVersion = 0;\n\nconst getNextTreeStateVersion = () => nextTreeStateVersion++;\n\nfunction makeEmptyTreeState() {\n const version = getNextTreeStateVersion();\n return {\n version,\n stateID: version,\n transactionMetadata: {},\n dirtyAtoms: new Set(),\n atomValues: persistentMap$1(),\n nonvalidatedAtoms: persistentMap$1()\n };\n}\n\nfunction makeEmptyStoreState() {\n const currentTree = makeEmptyTreeState();\n return {\n currentTree,\n nextTree: null,\n previousTree: null,\n knownAtoms: new Set(),\n knownSelectors: new Set(),\n transactionSubscriptions: new Map(),\n nodeTransactionSubscriptions: new Map(),\n nodeToComponentSubscriptions: new Map(),\n queuedComponentCallbacks_DEPRECATED: [],\n suspendedComponentResolvers: new Set(),\n graphsByVersion: new Map().set(currentTree.version, graph$1()),\n versionsUsedByComponent: new Map(),\n retention: {\n referenceCounts: new Map(),\n nodesRetainedByZone: new Map(),\n retainablesToCheckForRelease: new Set()\n },\n nodeCleanupFunctions: new Map()\n };\n}\n\nvar Recoil_State = {\n makeEmptyTreeState,\n makeEmptyStoreState,\n getNextTreeStateVersion\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction unionSets(...sets) {\n const result = new Set();\n\n for (const set of sets) {\n for (const value of set) {\n result.add(value);\n }\n }\n\n return result;\n}\n\nvar Recoil_unionSets = unionSets;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * The someSet() method tests whether some elements in the given Set pass the\n * test implemented by the provided function.\n */\n\nfunction someSet(set, callback, context) {\n const iterator = set.entries();\n let current = iterator.next();\n\n while (!current.done) {\n const entry = current.value;\n\n if (callback.call(context, entry[1], entry[0], set)) {\n return true;\n }\n\n current = iterator.next();\n }\n\n return false;\n}\n\nvar Recoil_someSet = someSet;\n\nconst {\n cleanUpNode: cleanUpNode$1\n} = Recoil_FunctionalCore;\n\nconst {\n deleteNodeConfigIfPossible: deleteNodeConfigIfPossible$1,\n getNode: getNode$2\n} = Recoil_Node;\n\nconst {\n RetentionZone: RetentionZone$2\n} = Recoil_RetentionZone;\n\nconst emptySet$1 = new Set();\n\nfunction releaseRetainablesNowOnCurrentTree(store, retainables) {\n const storeState = store.getState();\n const treeState = storeState.currentTree;\n\n if (storeState.nextTree) {\n Recoil_recoverableViolation('releaseNodesNowOnCurrentTree should only be called at the end of a batch');\n return; // leak memory rather than erase something that's about to be used.\n }\n\n const nodes = new Set();\n\n for (const r of retainables) {\n if (r instanceof RetentionZone$2) {\n for (const n of nodesRetainedByZone(storeState, r)) {\n nodes.add(n);\n }\n } else {\n nodes.add(r);\n }\n }\n\n const releasableNodes = findReleasableNodes(store, nodes);\n\n for (const node of releasableNodes) {\n releaseNode(store, treeState, node);\n }\n}\n\nfunction findReleasableNodes(store, searchFromNodes) {\n const storeState = store.getState();\n const treeState = storeState.currentTree;\n const graph = store.getGraph(treeState.version);\n const releasableNodes = new Set(); // mutated to collect answer\n\n const nonReleasableNodes = new Set();\n findReleasableNodesInner(searchFromNodes);\n return releasableNodes;\n\n function findReleasableNodesInner(searchFromNodes) {\n const releasableNodesFoundThisIteration = new Set();\n const downstreams = getDownstreamNodesInTopologicalOrder(store, treeState, searchFromNodes, releasableNodes, // don't descend into these\n nonReleasableNodes // don't descend into these\n ); // Find which of the downstream nodes are releasable and which are not:\n\n for (const node of downstreams) {\n var _storeState$retention;\n\n // Not releasable if configured to be retained forever:\n if (getNode$2(node).retainedBy === 'recoilRoot') {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if retained directly by a component:\n\n\n if (((_storeState$retention = storeState.retention.referenceCounts.get(node)) !== null && _storeState$retention !== void 0 ? _storeState$retention : 0) > 0) {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if retained by a zone:\n\n\n if (zonesThatCouldRetainNode(node).some(z => storeState.retention.referenceCounts.get(z))) {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if it has a non-releasable child (which will already be in\n // nonReleasableNodes because we are going in topological order):\n\n\n const nodeChildren = graph.nodeToNodeSubscriptions.get(node);\n\n if (nodeChildren && Recoil_someSet(nodeChildren, child => nonReleasableNodes.has(child))) {\n nonReleasableNodes.add(node);\n continue;\n }\n\n releasableNodes.add(node);\n releasableNodesFoundThisIteration.add(node);\n } // If we found any releasable nodes, we need to walk UP from those nodes to\n // find whether their parents can now be released as well:\n\n\n const parents = new Set();\n\n for (const node of releasableNodesFoundThisIteration) {\n for (const parent of (_graph$nodeDeps$get = graph.nodeDeps.get(node)) !== null && _graph$nodeDeps$get !== void 0 ? _graph$nodeDeps$get : emptySet$1) {\n var _graph$nodeDeps$get;\n\n if (!releasableNodes.has(parent)) {\n parents.add(parent);\n }\n }\n }\n\n if (parents.size) {\n findReleasableNodesInner(parents);\n }\n }\n} // Children before parents\n\n\nfunction getDownstreamNodesInTopologicalOrder(store, treeState, nodes, // Mutable set is destroyed in place\ndoNotDescendInto1, doNotDescendInto2) {\n const graph = store.getGraph(treeState.version);\n const answer = [];\n const visited = new Set();\n\n while (nodes.size > 0) {\n visit(Recoil_nullthrows(nodes.values().next().value));\n }\n\n return answer;\n\n function visit(node) {\n if (doNotDescendInto1.has(node) || doNotDescendInto2.has(node)) {\n nodes.delete(node);\n return;\n }\n\n if (visited.has(node)) {\n return;\n }\n\n const children = graph.nodeToNodeSubscriptions.get(node);\n\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n\n visited.add(node);\n nodes.delete(node);\n answer.push(node);\n }\n}\n\nfunction releaseNode(store, treeState, node) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n } // Atom effects, in-closure caches, etc.:\n\n\n cleanUpNode$1(store, node); // Delete from store state:\n\n const storeState = store.getState();\n storeState.knownAtoms.delete(node);\n storeState.knownSelectors.delete(node);\n storeState.nodeTransactionSubscriptions.delete(node);\n storeState.retention.referenceCounts.delete(node);\n const zones = zonesThatCouldRetainNode(node);\n\n for (const zone of zones) {\n var _storeState$retention2;\n\n (_storeState$retention2 = storeState.retention.nodesRetainedByZone.get(zone)) === null || _storeState$retention2 === void 0 ? void 0 : _storeState$retention2.delete(node);\n } // Note that we DO NOT delete from nodeToComponentSubscriptions because this\n // already happens when the last component that was retaining the node unmounts,\n // and this could happen either before or after that.\n // Delete from TreeState and dep graph:\n\n\n treeState.atomValues.delete(node);\n treeState.dirtyAtoms.delete(node);\n treeState.nonvalidatedAtoms.delete(node);\n const graph = storeState.graphsByVersion.get(treeState.version);\n\n if (graph) {\n const deps = graph.nodeDeps.get(node);\n\n if (deps !== undefined) {\n graph.nodeDeps.delete(node);\n\n for (const dep of deps) {\n var _graph$nodeToNodeSubs;\n\n (_graph$nodeToNodeSubs = graph.nodeToNodeSubscriptions.get(dep)) === null || _graph$nodeToNodeSubs === void 0 ? void 0 : _graph$nodeToNodeSubs.delete(node);\n }\n } // No need to delete sub's deps as there should be no subs at this point.\n // But an invariant would require deleting nodes in topological order.\n\n\n graph.nodeToNodeSubscriptions.delete(node);\n } // Node config (for family members only as their configs can be recreated, and\n // only if they are not retained within any other Stores):\n\n\n deleteNodeConfigIfPossible$1(node);\n}\n\nfunction nodesRetainedByZone(storeState, zone) {\n var _storeState$retention3;\n\n return (_storeState$retention3 = storeState.retention.nodesRetainedByZone.get(zone)) !== null && _storeState$retention3 !== void 0 ? _storeState$retention3 : emptySet$1;\n}\n\nfunction zonesThatCouldRetainNode(node) {\n const retainedBy = getNode$2(node).retainedBy;\n\n if (retainedBy === undefined || retainedBy === 'components' || retainedBy === 'recoilRoot') {\n return [];\n } else if (retainedBy instanceof RetentionZone$2) {\n return [retainedBy];\n } else {\n return retainedBy; // it's an array of zones\n }\n}\n\nfunction scheduleOrPerformPossibleReleaseOfRetainable(store, retainable) {\n const state = store.getState();\n\n if (state.nextTree) {\n state.retention.retainablesToCheckForRelease.add(retainable);\n } else {\n releaseRetainablesNowOnCurrentTree(store, new Set([retainable]));\n }\n}\n\nfunction updateRetainCount(store, retainable, delta) {\n var _map$get;\n\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const map = store.getState().retention.referenceCounts;\n const newCount = ((_map$get = map.get(retainable)) !== null && _map$get !== void 0 ? _map$get : 0) + delta;\n\n if (newCount === 0) {\n map.delete(retainable);\n scheduleOrPerformPossibleReleaseOfRetainable(store, retainable);\n } else {\n map.set(retainable, newCount);\n }\n}\n\nfunction releaseScheduledRetainablesNow(store) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const state = store.getState();\n releaseRetainablesNowOnCurrentTree(store, state.retention.retainablesToCheckForRelease);\n state.retention.retainablesToCheckForRelease.clear();\n}\n\nfunction retainedByOptionWithDefault(r) {\n // The default will change from 'recoilRoot' to 'components' in the future.\n return r === undefined ? 'recoilRoot' : r;\n}\n\nvar Recoil_Retention = {\n updateRetainCount,\n releaseScheduledRetainablesNow,\n retainedByOptionWithDefault\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Combines multiple Iterables into a single Iterable.\n * Traverses the input Iterables in the order provided and maintains the order\n * of their elements.\n *\n * Example:\n * ```\n * const r = Array.from(concatIterables(['a', 'b'], ['c'], ['d', 'e', 'f']));\n * r == ['a', 'b', 'c', 'd', 'e', 'f'];\n * ```\n */\n\nfunction* concatIterables(iters) {\n for (const iter of iters) {\n for (const val of iter) {\n yield val;\n }\n }\n}\n\nvar Recoil_concatIterables = concatIterables;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst isSSR = typeof window === 'undefined';\nconst isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative'; // eslint-disable-line fb-www/typeof-undefined\n\nvar Recoil_Environment = {\n isSSR,\n isReactNative\n};\n\nconst {\n isSSR: isSSR$1\n} = Recoil_Environment;\n\n\n\n\n\n\n\n\n\nconst {\n batchUpdates: batchUpdates$1\n} = Recoil_Batching;\n\nconst {\n initializeNodeIfNewToStore: initializeNodeIfNewToStore$1,\n peekNodeInfo: peekNodeInfo$1\n} = Recoil_FunctionalCore;\n\nconst {\n graph: graph$2\n} = Recoil_Graph;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$1,\n recoilValues: recoilValues$1,\n recoilValuesForKeys: recoilValuesForKeys$2\n} = Recoil_Node;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$2,\n getRecoilValueAsLoadable: getRecoilValueAsLoadable$1,\n setRecoilValue: setRecoilValue$1,\n setUnvalidatedRecoilValue: setUnvalidatedRecoilValue$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n getNextTreeStateVersion: getNextTreeStateVersion$1,\n makeEmptyStoreState: makeEmptyStoreState$1\n} = Recoil_State; // Opaque at this surface because it's part of the public API from here.\n\n\n// A \"Snapshot\" is \"read-only\" and captures a specific set of values of atoms.\n// However, the data-flow-graph and selector values may evolve as selector\n// evaluation functions are executed and async selectors resolve.\nclass Snapshot {\n constructor(storeState) {\n _defineProperty(this, \"_store\", void 0);\n\n _defineProperty(this, \"_refCount\", 0);\n\n _defineProperty(this, \"getLoadable\", recoilValue => {\n this.checkRefCount_INTERNAL();\n return getRecoilValueAsLoadable$1(this._store, recoilValue);\n });\n\n _defineProperty(this, \"getPromise\", recoilValue => {\n this.checkRefCount_INTERNAL();\n return this.getLoadable(recoilValue).toPromise();\n });\n\n _defineProperty(this, \"getNodes_UNSTABLE\", opt => {\n this.checkRefCount_INTERNAL(); // TODO Deal with modified selectors\n\n if ((opt === null || opt === void 0 ? void 0 : opt.isModified) === true) {\n if ((opt === null || opt === void 0 ? void 0 : opt.isInitialized) === false) {\n return [];\n }\n\n const state = this._store.getState().currentTree;\n\n return recoilValuesForKeys$2(state.dirtyAtoms);\n }\n\n const knownAtoms = this._store.getState().knownAtoms;\n\n const knownSelectors = this._store.getState().knownSelectors;\n\n return (opt === null || opt === void 0 ? void 0 : opt.isInitialized) == null ? recoilValues$1.values() : opt.isInitialized === true ? recoilValuesForKeys$2(Recoil_concatIterables([this._store.getState().knownAtoms, this._store.getState().knownSelectors])) : Recoil_filterIterable(recoilValues$1.values(), ({\n key\n }) => !knownAtoms.has(key) && !knownSelectors.has(key));\n });\n\n _defineProperty(this, \"getInfo_UNSTABLE\", ({\n key\n }) => {\n this.checkRefCount_INTERNAL();\n return peekNodeInfo$1(this._store, this._store.getState().currentTree, key);\n });\n\n _defineProperty(this, \"map\", mapper => {\n this.checkRefCount_INTERNAL();\n const mutableSnapshot = new MutableSnapshot(this);\n mapper(mutableSnapshot); // if removing batchUpdates from `set` add it here\n\n return cloneSnapshot(mutableSnapshot.getStore_INTERNAL());\n });\n\n _defineProperty(this, \"asyncMap\", async mapper => {\n this.checkRefCount_INTERNAL();\n const mutableSnapshot = new MutableSnapshot(this);\n await mapper(mutableSnapshot);\n return cloneSnapshot(mutableSnapshot.getStore_INTERNAL());\n });\n\n this._store = {\n getState: () => storeState,\n replaceState: replacer => {\n storeState.currentTree = replacer(storeState.currentTree); // no batching so nextTree is never active\n },\n getGraph: version => {\n const graphs = storeState.graphsByVersion;\n\n if (graphs.has(version)) {\n return Recoil_nullthrows(graphs.get(version));\n }\n\n const newGraph = graph$2();\n graphs.set(version, newGraph);\n return newGraph;\n },\n subscribeToTransactions: () => ({\n release: () => {}\n }),\n addTransactionMetadata: () => {\n throw new Error('Cannot subscribe to Snapshots');\n }\n }; // Initialize any nodes that are live in the parent store (primarily so that this\n // snapshot gets counted towards the node's live stores count).\n\n for (const nodeKey of this._store.getState().nodeCleanupFunctions.keys()) {\n initializeNodeIfNewToStore$1(this._store, storeState.currentTree, nodeKey, 'get');\n }\n\n this.retain();\n this.autorelease();\n }\n\n retain() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return () => undefined;\n }\n\n this._refCount++;\n let released = false;\n return () => {\n if (!released) {\n released = true;\n this.release();\n }\n };\n }\n\n autorelease() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n if (!isSSR$1) {\n window.setTimeout(() => this.release(), 0);\n }\n }\n\n release() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n this._refCount--;\n\n if (this._refCount === 0) ;\n }\n\n checkRefCount_INTERNAL() {\n if (Recoil_gkx_1('recoil_memory_managament_2020') && this._refCount <= 0) {\n if (process.env.NODE_ENV !== \"production\") {\n Recoil_recoverableViolation('Recoil Snapshots only last for the duration of the callback they are provided to. To keep a Snapshot longer, call its retain() method (and then call release() when you are done with it). This is currently a DEV-only warning but will become a real error soon. Please reach out to Dave McCabe for help fixing this. To temporarily suppress this warning add gk_disable=recoil_memory_managament_2020 to the URL.');\n } // What we will ship later:\n // throw new Error(\n // 'Recoil Snapshots only last for the duration of the callback they are provided to. To keep a Snapshot longer, call its retain() method (and then call release() when you are done with it).',\n // );\n\n }\n }\n\n getStore_INTERNAL() {\n this.checkRefCount_INTERNAL();\n return this._store;\n }\n\n getID() {\n this.checkRefCount_INTERNAL();\n return this.getID_INTERNAL();\n }\n\n getID_INTERNAL() {\n this.checkRefCount_INTERNAL();\n return this._store.getState().currentTree.stateID;\n } // We want to allow the methods to be destructured and used as accessors\n // eslint-disable-next-line fb-www/extra-arrow-initializer\n\n\n}\n\nfunction cloneStoreState(store, treeState, bumpVersion = false) {\n const storeState = store.getState();\n const version = bumpVersion ? getNextTreeStateVersion$1() : treeState.version;\n return {\n currentTree: bumpVersion ? {\n // TODO snapshots shouldn't really have versions because a new version number\n // is always assigned when the snapshot is gone to.\n version,\n stateID: version,\n transactionMetadata: { ...treeState.transactionMetadata\n },\n dirtyAtoms: new Set(treeState.dirtyAtoms),\n atomValues: treeState.atomValues.clone(),\n nonvalidatedAtoms: treeState.nonvalidatedAtoms.clone()\n } : treeState,\n nextTree: null,\n previousTree: null,\n knownAtoms: new Set(storeState.knownAtoms),\n // FIXME here's a copy\n knownSelectors: new Set(storeState.knownSelectors),\n // FIXME here's a copy\n transactionSubscriptions: new Map(),\n nodeTransactionSubscriptions: new Map(),\n nodeToComponentSubscriptions: new Map(),\n queuedComponentCallbacks_DEPRECATED: [],\n suspendedComponentResolvers: new Set(),\n graphsByVersion: new Map().set(version, store.getGraph(treeState.version)),\n versionsUsedByComponent: new Map(),\n retention: {\n referenceCounts: new Map(),\n nodesRetainedByZone: new Map(),\n retainablesToCheckForRelease: new Set()\n },\n nodeCleanupFunctions: new Map()\n };\n} // Factory to build a fresh snapshot\n\n\nfunction freshSnapshot(initializeState) {\n const snapshot = new Snapshot(makeEmptyStoreState$1());\n return initializeState != null ? snapshot.map(initializeState) : snapshot;\n} // Factory to clone a snapahot state\n\n\nfunction cloneSnapshot(store, version = 'current') {\n const storeState = store.getState();\n const treeState = version === 'current' ? storeState.currentTree : Recoil_nullthrows(storeState.previousTree);\n return new Snapshot(cloneStoreState(store, treeState));\n}\n\nclass MutableSnapshot extends Snapshot {\n constructor(snapshot) {\n super(cloneStoreState(snapshot.getStore_INTERNAL(), snapshot.getStore_INTERNAL().getState().currentTree, true));\n\n _defineProperty(this, \"set\", (recoilState, newValueOrUpdater) => {\n this.checkRefCount_INTERNAL(); // This batchUpdates ensures this `set` is applied immediately and you can\n // read the written value after calling `set`. I would like to remove this\n // behavior and only batch in `Snapshot.map`, but this would be a breaking\n // change potentially.\n\n batchUpdates$1(() => {\n setRecoilValue$1(this.getStore_INTERNAL(), recoilState, newValueOrUpdater);\n });\n });\n\n _defineProperty(this, \"reset\", recoilState => {\n this.checkRefCount_INTERNAL(); // See note at `set` about batched updates.\n\n batchUpdates$1(() => setRecoilValue$1(this.getStore_INTERNAL(), recoilState, DEFAULT_VALUE$1));\n });\n\n _defineProperty(this, \"setUnvalidatedAtomValues_DEPRECATED\", values => {\n this.checkRefCount_INTERNAL();\n const store = this.getStore_INTERNAL();\n batchUpdates$1(() => {\n for (const [k, v] of values.entries()) {\n setUnvalidatedRecoilValue$1(store, new AbstractRecoilValue$2(k), v);\n }\n });\n });\n } // We want to allow the methods to be destructured and used as accessors\n // eslint-disable-next-line fb-www/extra-arrow-initializer\n\n\n}\n\nvar Recoil_Snapshot = {\n Snapshot,\n MutableSnapshot,\n freshSnapshot,\n cloneSnapshot\n};\n\nvar Recoil_Snapshot_1 = Recoil_Snapshot.Snapshot;\nvar Recoil_Snapshot_2 = Recoil_Snapshot.MutableSnapshot;\nvar Recoil_Snapshot_3 = Recoil_Snapshot.freshSnapshot;\nvar Recoil_Snapshot_4 = Recoil_Snapshot.cloneSnapshot;\n\nvar Recoil_Snapshot$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Snapshot: Recoil_Snapshot_1,\n MutableSnapshot: Recoil_Snapshot_2,\n freshSnapshot: Recoil_Snapshot_3,\n cloneSnapshot: Recoil_Snapshot_4\n});\n\n// @fb-only: const RecoilusagelogEvent = require('RecoilusagelogEvent');\n// @fb-only: const RecoilUsageLogFalcoEvent = require('RecoilUsageLogFalcoEvent');\n// @fb-only: const URI = require('URI');\n\n\nconst {\n getNextTreeStateVersion: getNextTreeStateVersion$2,\n makeEmptyStoreState: makeEmptyStoreState$2\n} = Recoil_State;\n\n\n\n\n\n // @fb-only: const recoverableViolation = require('../util/Recoil_recoverableViolation');\n\n\n\n\nconst {\n cleanUpNode: cleanUpNode$2,\n getDownstreamNodes: getDownstreamNodes$2,\n setNodeValue: setNodeValue$2,\n setUnvalidatedAtomValue_DEPRECATED: setUnvalidatedAtomValue_DEPRECATED$1\n} = Recoil_FunctionalCore;\n\nconst {\n graph: graph$3\n} = Recoil_Graph;\n\nconst {\n cloneGraph: cloneGraph$1\n} = Recoil_Graph;\n\nconst {\n applyAtomValueWrites: applyAtomValueWrites$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n releaseScheduledRetainablesNow: releaseScheduledRetainablesNow$1\n} = Recoil_Retention;\n\nconst {\n freshSnapshot: freshSnapshot$1\n} = Recoil_Snapshot$1;\n\n\n\nconst {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState\n} = react;\n\nfunction notInAContext() {\n throw new Error('This component must be used inside a component.');\n}\n\nconst defaultStore = Object.freeze({\n getState: notInAContext,\n replaceState: notInAContext,\n getGraph: notInAContext,\n subscribeToTransactions: notInAContext,\n addTransactionMetadata: notInAContext\n});\nlet stateReplacerIsBeingExecuted = false;\n\nfunction startNextTreeIfNeeded(storeState) {\n if (stateReplacerIsBeingExecuted) {\n throw new Error('An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.');\n }\n\n if (storeState.nextTree === null) {\n const version = storeState.currentTree.version;\n const nextVersion = getNextTreeStateVersion$2();\n storeState.nextTree = { ...storeState.currentTree,\n version: nextVersion,\n stateID: nextVersion,\n dirtyAtoms: new Set(),\n transactionMetadata: {}\n };\n storeState.graphsByVersion.set(nextVersion, cloneGraph$1(Recoil_nullthrows(storeState.graphsByVersion.get(version))));\n }\n}\n\nconst AppContext = react.createContext({\n current: defaultStore\n});\n\nconst useStoreRef = () => useContext(AppContext);\n\nconst MutableSourceContext = react.createContext(null); // TODO T2710559282599660\n\nfunction useRecoilMutableSource() {\n const mutableSource = useContext(MutableSourceContext);\n\n if (mutableSource == null) {\n Recoil_expectationViolation('Attempted to use a Recoil hook outside of a . ' + ' must be an ancestor of any component that uses ' + 'Recoil hooks.');\n }\n\n return mutableSource;\n}\n\nfunction sendEndOfBatchNotifications(store) {\n const storeState = store.getState();\n const treeState = storeState.currentTree; // Inform transaction subscribers of the transaction:\n\n const dirtyAtoms = treeState.dirtyAtoms;\n\n if (dirtyAtoms.size) {\n // Execute Node-specific subscribers before global subscribers\n for (const [key, subscriptions] of storeState.nodeTransactionSubscriptions) {\n if (dirtyAtoms.has(key)) {\n for (const [_, subscription] of subscriptions) {\n subscription(store);\n }\n }\n }\n\n for (const [_, subscription] of storeState.transactionSubscriptions) {\n subscription(store);\n } // Components that are subscribed to the dirty atom:\n\n\n const dependentNodes = getDownstreamNodes$2(store, treeState, dirtyAtoms);\n\n for (const key of dependentNodes) {\n const comps = storeState.nodeToComponentSubscriptions.get(key);\n\n if (comps) {\n for (const [_subID, [_debugName, callback]] of comps) {\n callback(treeState);\n }\n }\n } // Wake all suspended components so the right one(s) can try to re-render.\n // We need to wake up components not just when some asynchronous selector\n // resolved, but also when changing synchronous values because this may cause\n // a selector to change from asynchronous to synchronous, in which case there\n // would be no follow-up asynchronous resolution to wake us up.\n // TODO OPTIMIZATION Only wake up related downstream components\n\n\n storeState.suspendedComponentResolvers.forEach(cb => cb());\n } // Special behavior ONLY invoked by useInterface.\n // FIXME delete queuedComponentCallbacks_DEPRECATED when deleting useInterface.\n\n\n storeState.queuedComponentCallbacks_DEPRECATED.forEach(cb => cb(treeState));\n storeState.queuedComponentCallbacks_DEPRECATED.splice(0, storeState.queuedComponentCallbacks_DEPRECATED.length);\n}\n/*\n * The purpose of the Batcher is to observe when React batches end so that\n * Recoil state changes can be batched. Whenever Recoil state changes, we call\n * setState on the batcher. Then we wait for that change to be committed, which\n * signifies the end of the batch. That's when we respond to the Recoil change.\n */\n\n\nfunction Batcher({\n setNotifyBatcherOfChange\n}) {\n const storeRef = useStoreRef();\n const [_, setState] = useState([]);\n setNotifyBatcherOfChange(() => setState({}));\n useEffect(() => {\n // enqueueExecution runs this function immediately; it is only used to\n // manipulate the order of useEffects during tests, since React seems to\n // call useEffect in an unpredictable order sometimes.\n Recoil_Queue.enqueueExecution('Batcher', () => {\n const storeState = storeRef.current.getState();\n const {\n nextTree\n } = storeState; // Ignore commits that are not because of Recoil transactions -- namely,\n // because something above RecoilRoot re-rendered:\n\n if (nextTree === null) {\n return;\n } // nextTree is now committed -- note that copying and reset occurs when\n // a transaction begins, in startNextTreeIfNeeded:\n\n\n storeState.previousTree = storeState.currentTree;\n storeState.currentTree = nextTree;\n storeState.nextTree = null;\n sendEndOfBatchNotifications(storeRef.current);\n const discardedVersion = Recoil_nullthrows(storeState.previousTree).version;\n storeState.graphsByVersion.delete(discardedVersion);\n storeState.previousTree = null;\n\n if (Recoil_gkx_1('recoil_memory_managament_2020')) {\n releaseScheduledRetainablesNow$1(storeRef.current);\n }\n });\n }); // If an asynchronous selector resolves after the Batcher is unmounted,\n // notifyBatcherOfChange will still be called. An error gets thrown whenever\n // setState is called after a component is already unmounted, so this sets\n // notifyBatcherOfChange to be a no-op.\n\n useEffect(() => {\n return () => {\n setNotifyBatcherOfChange(() => {});\n };\n }, [setNotifyBatcherOfChange]);\n return null;\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined' && !window.$recoilDebugStates) {\n window.$recoilDebugStates = [];\n }\n} // When removing this deprecated function, remove stateBySettingRecoilValue\n// which will no longer be needed.\n\n\nfunction initialStoreState_DEPRECATED(store, initializeState) {\n const initial = makeEmptyStoreState$2();\n initializeState({\n // $FlowFixMe[escaped-generic]\n set: (atom, value) => {\n const state = initial.currentTree;\n const writes = setNodeValue$2(store, state, atom.key, value);\n const writtenNodes = new Set(writes.keys());\n const nonvalidatedAtoms = state.nonvalidatedAtoms.clone();\n\n for (const n of writtenNodes) {\n nonvalidatedAtoms.delete(n);\n }\n\n initial.currentTree = { ...state,\n dirtyAtoms: Recoil_unionSets(state.dirtyAtoms, writtenNodes),\n atomValues: applyAtomValueWrites$1(state.atomValues, writes),\n // NB: PLEASE un-export applyAtomValueWrites when deleting this code\n nonvalidatedAtoms\n };\n },\n setUnvalidatedAtomValues: atomValues => {\n // FIXME replace this with a mutative loop\n atomValues.forEach((v, k) => {\n initial.currentTree = setUnvalidatedAtomValue_DEPRECATED$1(initial.currentTree, k, v);\n });\n }\n });\n return initial;\n}\n\nfunction initialStoreState(initializeState) {\n const snapshot = freshSnapshot$1().map(initializeState);\n return snapshot.getStore_INTERNAL().getState();\n}\n\nlet nextID = 0;\n\nfunction RecoilRoot({\n initializeState_DEPRECATED,\n initializeState,\n store_INTERNAL: storeProp,\n // For use with React \"context bridging\"\n children\n}) {\n var _createMutableSource;\n\n // prettier-ignore\n // @fb-only: useEffect(() => {\n // @fb-only: if (gkx('recoil_usage_logging')) {\n // @fb-only: try {\n // @fb-only: RecoilUsageLogFalcoEvent.log(() => ({\n // @fb-only: type: RecoilusagelogEvent.RECOIL_ROOT_MOUNTED,\n // @fb-only: path: URI.getRequestURI().getPath(),\n // @fb-only: }));\n // @fb-only: } catch {\n // @fb-only: recoverableViolation(\n // @fb-only: 'Error when logging Recoil Usage event',\n // @fb-only: 'recoil',\n // @fb-only: );\n // @fb-only: }\n // @fb-only: }\n // @fb-only: }, []);\n let storeState; // eslint-disable-line prefer-const\n\n const getGraph = version => {\n const graphs = storeState.current.graphsByVersion;\n\n if (graphs.has(version)) {\n return Recoil_nullthrows(graphs.get(version));\n }\n\n const newGraph = graph$3();\n graphs.set(version, newGraph);\n return newGraph;\n };\n\n const subscribeToTransactions = (callback, key) => {\n if (key == null) {\n // Global transaction subscriptions\n const {\n transactionSubscriptions\n } = storeRef.current.getState();\n const id = nextID++;\n transactionSubscriptions.set(id, callback);\n return {\n release: () => {\n transactionSubscriptions.delete(id);\n }\n };\n } else {\n // Node-specific transaction subscriptions:\n const {\n nodeTransactionSubscriptions\n } = storeRef.current.getState();\n\n if (!nodeTransactionSubscriptions.has(key)) {\n nodeTransactionSubscriptions.set(key, new Map());\n }\n\n const id = nextID++;\n Recoil_nullthrows(nodeTransactionSubscriptions.get(key)).set(id, callback);\n return {\n release: () => {\n const subs = nodeTransactionSubscriptions.get(key);\n\n if (subs) {\n subs.delete(id);\n\n if (subs.size === 0) {\n nodeTransactionSubscriptions.delete(key);\n }\n }\n }\n };\n }\n };\n\n const addTransactionMetadata = metadata => {\n startNextTreeIfNeeded(storeRef.current.getState());\n\n for (const k of Object.keys(metadata)) {\n Recoil_nullthrows(storeRef.current.getState().nextTree).transactionMetadata[k] = metadata[k];\n }\n };\n\n const replaceState = replacer => {\n const storeState = storeRef.current.getState();\n startNextTreeIfNeeded(storeState); // Use replacer to get the next state:\n\n const nextTree = Recoil_nullthrows(storeState.nextTree);\n let replaced;\n\n try {\n stateReplacerIsBeingExecuted = true;\n replaced = replacer(nextTree);\n } finally {\n stateReplacerIsBeingExecuted = false;\n }\n\n if (replaced === nextTree) {\n return;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined') {\n window.$recoilDebugStates.push(replaced); // TODO this shouldn't happen here because it's not batched\n }\n } // Save changes to nextTree and schedule a React update:\n\n\n storeState.nextTree = replaced;\n Recoil_nullthrows(notifyBatcherOfChange.current)();\n };\n\n const notifyBatcherOfChange = useRef(null);\n const setNotifyBatcherOfChange = useCallback(x => {\n notifyBatcherOfChange.current = x;\n }, [notifyBatcherOfChange]); // FIXME T2710559282599660\n\n const createMutableSource = (_createMutableSource = react.createMutableSource) !== null && _createMutableSource !== void 0 ? _createMutableSource : // flowlint-line unclear-type:off\n react.unstable_createMutableSource; // flowlint-line unclear-type:off\n\n const store = storeProp !== null && storeProp !== void 0 ? storeProp : {\n getState: () => storeState.current,\n replaceState,\n getGraph,\n subscribeToTransactions,\n addTransactionMetadata\n };\n const storeRef = useRef(store);\n storeState = useRef(initializeState_DEPRECATED != null ? initialStoreState_DEPRECATED(store, initializeState_DEPRECATED) : initializeState != null ? initialStoreState(initializeState) : makeEmptyStoreState$2());\n const mutableSource = useMemo(() => createMutableSource ? createMutableSource(storeState, () => storeState.current.currentTree.version) : null, [createMutableSource, storeState]); // Cleanup when the is unmounted\n\n useEffect(() => () => {\n for (const atomKey of storeRef.current.getState().knownAtoms) {\n cleanUpNode$2(storeRef.current, atomKey);\n }\n }, []);\n return /*#__PURE__*/react.createElement(AppContext.Provider, {\n value: storeRef\n }, /*#__PURE__*/react.createElement(MutableSourceContext.Provider, {\n value: mutableSource\n }, /*#__PURE__*/react.createElement(Batcher, {\n setNotifyBatcherOfChange: setNotifyBatcherOfChange\n }), children));\n}\n\nvar Recoil_RecoilRoot_react = {\n useStoreRef,\n useRecoilMutableSource,\n RecoilRoot,\n sendEndOfBatchNotifications_FOR_TESTING: sendEndOfBatchNotifications\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a map containing all of the keys + values from the original map where\n * the given callback returned true.\n */\n\nfunction filterMap(map, callback) {\n const result = new Map();\n\n for (const [key, value] of map) {\n if (callback(value, key)) {\n result.set(key, value);\n }\n }\n\n return result;\n}\n\nvar Recoil_filterMap = filterMap;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a set containing all of the values from the original set where\n * the given callback returned true.\n */\n\nfunction filterSet(set, callback) {\n const result = new Set();\n\n for (const value of set) {\n if (callback(value)) {\n result.add(value);\n }\n }\n\n return result;\n}\n\nvar Recoil_filterSet = filterSet;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n\nvar invariant_1 = invariant;\n\n// @oss-only\n\n\nvar Recoil_invariant = invariant_1;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction mergeMaps(...maps) {\n const result = new Map();\n\n for (let i = 0; i < maps.length; i++) {\n const iterator = maps[i].keys();\n let nextKey;\n\n while (!(nextKey = iterator.next()).done) {\n // $FlowFixMe[incompatible-call] - map/iterator knows nothing about flow types\n result.set(nextKey.value, maps[i].get(nextKey.value));\n }\n }\n /* $FlowFixMe[incompatible-return] (>=0.66.0 site=www,mobile) This comment\n * suppresses an error found when Flow v0.66 was deployed. To see the error\n * delete this comment and run Flow. */\n\n\n return result;\n}\n\nvar Recoil_mergeMaps = mergeMaps;\n\nvar _useMutableSource;\n\n // FIXME T2710559282599660\n\n\nconst useMutableSource = // flowlint-line unclear-type:off\n(_useMutableSource = react.useMutableSource) !== null && _useMutableSource !== void 0 ? _useMutableSource : react.unstable_useMutableSource; // flowlint-line unclear-type:off\n\nfunction mutableSourceExists() {\n return useMutableSource && !(typeof window !== 'undefined' && window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE);\n}\n\nvar Recoil_mutableSource = {\n mutableSourceExists,\n useMutableSource\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction shallowArrayEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0, l = a.length; i < l; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nvar Recoil_shallowArrayEqual = shallowArrayEqual;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * MIT License\n *\n * Copyright (c) 2014-2019 Georg Tavonius\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst UNKNOWN_FUNCTION = '';\n/**\n * This parses the different stack traces and puts them into one format\n * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit)\n */\n\nfunction stackTraceParser(stackString) {\n const lines = stackString.split('\\n');\n return lines.reduce((stack, line) => {\n const parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);\n\n if (parseResult) {\n stack.push(parseResult);\n }\n\n return stack;\n }, []);\n}\n\nconst chromeRe = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRe = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nfunction parseChrome(line) {\n const parts = chromeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n const isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n const submatch = chromeEvalRe.exec(parts[2]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n\n parts[3] = submatch[2]; // line\n\n parts[4] = submatch[3]; // column\n }\n\n return {\n file: !isNative ? parts[2] : null,\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: isNative ? [parts[2]] : [],\n lineNumber: parts[3] ? +parts[3] : null,\n column: parts[4] ? +parts[4] : null\n };\n}\n\nconst winjsRe = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseWinjs(line) {\n const parts = winjsRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nconst geckoRe = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRe = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nfunction parseGecko(line) {\n const parts = geckoRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n const submatch = geckoEvalRe.exec(parts[3]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: parts[2] ? parts[2].split(',') : [],\n lineNumber: parts[4] ? +parts[4] : null,\n column: parts[5] ? +parts[5] : null\n };\n}\n\nconst javaScriptCoreRe = /^\\s*(?:([^@]*)(?:\\((.*?)\\))?@)?(\\S.*?):(\\d+)(?::(\\d+))?\\s*$/i;\n\nfunction parseJSC(line) {\n const parts = javaScriptCoreRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[4],\n column: parts[5] ? +parts[5] : null\n };\n}\n\nconst nodeRe = /^\\s*at (?:((?:\\[object object\\])?[^\\\\/]+(?: \\[as \\S+\\])?) )?\\(?(.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseNode(line) {\n const parts = nodeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nvar Recoil_stackTraceParser = stackTraceParser;\n\nconst {\n useRef: useRef$1\n} = react;\n\nfunction useComponentName() {\n const nameRef = useRef$1();\n\n if (process.env.NODE_ENV !== \"production\") {\n if (Recoil_gkx_1('recoil_infer_component_names')) {\n var _nameRef$current;\n\n if (nameRef.current === undefined) {\n // There is no blessed way to determine the calling React component from\n // within a hook. This hack uses the fact that hooks must start with 'use'\n // and that hooks are either called by React Components or other hooks. It\n // follows therefore, that to find the calling component, you simply need\n // to look down the stack and find the first function which doesn't start\n // with 'use'. We are only enabling this in dev for now, since once the\n // codebase is minified, the naming assumptions no longer hold true.\n const frames = Recoil_stackTraceParser(new Error().stack);\n\n for (const {\n methodName\n } of frames) {\n // I observed cases where the frame was of the form 'Object.useXXX'\n // hence why I'm searching for hooks following a word boundary\n if (!methodName.match(/\\buse[^\\b]+$/)) {\n return nameRef.current = methodName;\n }\n }\n\n nameRef.current = null;\n }\n\n return (_nameRef$current = nameRef.current) !== null && _nameRef$current !== void 0 ? _nameRef$current : '';\n }\n } // @fb-only: return \"\";\n\n\n return ''; // @oss-only\n}\n\nvar Recoil_useComponentName = useComponentName;\n\nconst {\n batchUpdates: batchUpdates$2\n} = Recoil_Batching;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$2,\n getNode: getNode$3,\n nodes: nodes$1\n} = Recoil_Node;\n\nconst {\n useRecoilMutableSource: useRecoilMutableSource$1,\n useStoreRef: useStoreRef$1\n} = Recoil_RecoilRoot_react;\n\nconst {\n isRecoilValue: isRecoilValue$2\n} = Recoil_RecoilValue$1;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$3,\n getRecoilValueAsLoadable: getRecoilValueAsLoadable$2,\n setRecoilValue: setRecoilValue$2,\n setRecoilValueLoadable: setRecoilValueLoadable$1,\n setUnvalidatedRecoilValue: setUnvalidatedRecoilValue$2,\n subscribeToRecoilValue: subscribeToRecoilValue$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n updateRetainCount: updateRetainCount$1\n} = Recoil_Retention;\n\nconst {\n RetentionZone: RetentionZone$3\n} = Recoil_RetentionZone;\n\nconst {\n Snapshot: Snapshot$1,\n cloneSnapshot: cloneSnapshot$1\n} = Recoil_Snapshot$1;\n\nconst {\n setByAddingToSet: setByAddingToSet$2\n} = Recoil_CopyOnWrite;\n\n\n\nconst {\n isSSR: isSSR$2\n} = Recoil_Environment;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n mutableSourceExists: mutableSourceExists$1,\n useMutableSource: useMutableSource$1\n} = Recoil_mutableSource;\n\n\n\n\n\n\n\n\n\nconst {\n useCallback: useCallback$1,\n useEffect: useEffect$1,\n useMemo: useMemo$1,\n useRef: useRef$2,\n useState: useState$1\n} = react; // Components that aren't mounted after suspending for this long will be assumed\n// to be discarded and their resources released.\n\n\nconst SUSPENSE_TIMEOUT_MS = 120000;\n\nfunction handleLoadable(loadable, atom, storeRef) {\n // We can't just throw the promise we are waiting on to Suspense. If the\n // upstream dependencies change it may produce a state in which the component\n // can render, but it would still be suspended on a Promise that may never resolve.\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n const promise = new Promise(resolve => {\n storeRef.current.getState().suspendedComponentResolvers.add(resolve);\n });\n throw promise;\n } else if (loadable.state === 'hasError') {\n throw loadable.contents;\n } else {\n throw new Error(`Invalid value of loadable atom \"${atom.key}\"`);\n }\n}\n\nfunction validateRecoilValue(recoilValue, hookName) {\n if (!isRecoilValue$2(recoilValue)) {\n throw new Error(`Invalid argument to ${hookName}: expected an atom or selector but got ${String(recoilValue)}`);\n }\n}\n\n/**\n * Various things are broken with useRecoilInterface, particularly concurrent mode\n * and memory management. They will not be fixed.\n * */\nfunction useRecoilInterface_DEPRECATED() {\n const storeRef = useStoreRef$1();\n const [_, forceUpdate] = useState$1([]);\n const recoilValuesUsed = useRef$2(new Set());\n recoilValuesUsed.current = new Set(); // Track the RecoilValues used just during this render\n\n const previousSubscriptions = useRef$2(new Set());\n const subscriptions = useRef$2(new Map());\n const unsubscribeFrom = useCallback$1(key => {\n const sub = subscriptions.current.get(key);\n\n if (sub) {\n sub.release();\n subscriptions.current.delete(key);\n }\n }, [subscriptions]);\n const componentName = Recoil_useComponentName();\n useEffect$1(() => {\n const store = storeRef.current;\n\n function updateState(_state, key) {\n if (!subscriptions.current.has(key)) {\n return;\n }\n\n forceUpdate([]);\n }\n\n Recoil_differenceSets(recoilValuesUsed.current, previousSubscriptions.current).forEach(key => {\n if (subscriptions.current.has(key)) {\n Recoil_expectationViolation(`Double subscription to RecoilValue \"${key}\"`);\n return;\n }\n\n const sub = subscribeToRecoilValue$1(store, new AbstractRecoilValue$3(key), state => {\n updateState(state, key);\n }, componentName);\n subscriptions.current.set(key, sub);\n /**\n * Since we're subscribing in an effect we need to update to the latest\n * value of the atom since it may have changed since we rendered. We can\n * go ahead and do that now, unless we're in the middle of a batch --\n * in which case we should do it at the end of the batch, due to the\n * following edge case: Suppose an atom is updated in another useEffect\n * of this same component. Then the following sequence of events occur:\n * 1. Atom is updated and subs fired (but we may not be subscribed\n * yet depending on order of effects, so we miss this) Updated value\n * is now in nextTree, but not currentTree.\n * 2. This effect happens. We subscribe and update.\n * 3. From the update we re-render and read currentTree, with old value.\n * 4. Batcher's effect sets currentTree to nextTree.\n * In this sequence we miss the update. To avoid that, add the update\n * to queuedComponentCallback if a batch is in progress.\n */\n // FIXME delete queuedComponentCallbacks_DEPRECATED when deleting useInterface.\n\n const state = store.getState();\n\n if (state.nextTree) {\n store.getState().queuedComponentCallbacks_DEPRECATED.push(() => {\n updateState(store.getState(), key);\n });\n } else {\n updateState(store.getState(), key);\n }\n });\n Recoil_differenceSets(previousSubscriptions.current, recoilValuesUsed.current).forEach(key => {\n unsubscribeFrom(key);\n });\n previousSubscriptions.current = recoilValuesUsed.current;\n });\n useEffect$1(() => {\n const subs = subscriptions.current;\n return () => subs.forEach((_, key) => unsubscribeFrom(key));\n }, [unsubscribeFrom]);\n return useMemo$1(() => {\n function useSetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useSetRecoilState');\n }\n\n return newValueOrUpdater => {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n };\n }\n\n function useResetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useResetRecoilState');\n }\n\n return () => setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n }\n\n function useRecoilValueLoadable(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n if (!recoilValuesUsed.current.has(recoilValue.key)) {\n recoilValuesUsed.current = setByAddingToSet$2(recoilValuesUsed.current, recoilValue.key);\n } // TODO Restore optimization to memoize lookup\n\n\n return getRecoilValueAsLoadable$2(storeRef.current, recoilValue);\n }\n\n function useRecoilValue(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValue');\n }\n\n const loadable = useRecoilValueLoadable(recoilValue); // $FlowFixMe[escaped-generic]\n\n return handleLoadable(loadable, recoilValue, storeRef);\n }\n\n function useRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilState');\n }\n\n return [useRecoilValue(recoilState), useSetRecoilState(recoilState)];\n }\n\n function useRecoilStateLoadable(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilStateLoadable');\n }\n\n return [useRecoilValueLoadable(recoilState), useSetRecoilState(recoilState)];\n }\n\n return {\n getRecoilValue: useRecoilValue,\n getRecoilValueLoadable: useRecoilValueLoadable,\n getRecoilState: useRecoilState,\n getRecoilStateLoadable: useRecoilStateLoadable,\n getSetRecoilState: useSetRecoilState,\n getResetRecoilState: useResetRecoilState\n };\n }, [recoilValuesUsed, storeRef]);\n}\n\nconst recoilComponentGetRecoilValueCount_FOR_TESTING = {\n current: 0\n};\n\nfunction useRecoilValueLoadable_MUTABLESOURCE(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n const storeRef = useStoreRef$1();\n const getLoadable = useCallback$1(() => {\n const store = storeRef.current;\n const treeState = store.getState().currentTree;\n return getRecoilValueAsLoadable$2(store, recoilValue, treeState);\n }, [storeRef, recoilValue]);\n const getLoadableWithTesting = useCallback$1(() => {\n if (process.env.NODE_ENV !== \"production\") {\n recoilComponentGetRecoilValueCount_FOR_TESTING.current++;\n }\n\n return getLoadable();\n }, [getLoadable]);\n const componentName = Recoil_useComponentName();\n const subscribe = useCallback$1((_storeState, callback) => {\n const store = storeRef.current;\n const subscription = subscribeToRecoilValue$1(store, recoilValue, () => {\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return callback();\n } // Only re-render if the value has changed.\n // This will evaluate the atom/selector now as well as when the\n // component renders, but that may help with prefetching.\n\n\n const newLoadable = getLoadable();\n\n if (!prevLoadableRef.current.is(newLoadable)) {\n callback();\n }\n }, componentName);\n return subscription.release;\n }, [storeRef, recoilValue, componentName, getLoadable]);\n const source = useRecoilMutableSource$1();\n const loadable = useMutableSource$1(source, getLoadableWithTesting, subscribe);\n const prevLoadableRef = useRef$2(loadable);\n useEffect$1(() => {\n prevLoadableRef.current = loadable;\n });\n return loadable;\n}\n\nfunction useRecoilValueLoadable_LEGACY(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n const storeRef = useStoreRef$1();\n const [_, forceUpdate] = useState$1([]);\n const componentName = Recoil_useComponentName();\n useEffect$1(() => {\n const store = storeRef.current;\n const storeState = store.getState();\n const subscription = subscribeToRecoilValue$1(store, recoilValue, _state => {\n var _prevLoadableRef$curr;\n\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return forceUpdate([]);\n }\n\n const newLoadable = getRecoilValueAsLoadable$2(store, recoilValue, store.getState().currentTree);\n\n if (!((_prevLoadableRef$curr = prevLoadableRef.current) === null || _prevLoadableRef$curr === void 0 ? void 0 : _prevLoadableRef$curr.is(newLoadable))) {\n forceUpdate(newLoadable);\n }\n }, componentName);\n /**\n * Since we're subscribing in an effect we need to update to the latest\n * value of the atom since it may have changed since we rendered. We can\n * go ahead and do that now, unless we're in the middle of a batch --\n * in which case we should do it at the end of the batch, due to the\n * following edge case: Suppose an atom is updated in another useEffect\n * of this same component. Then the following sequence of events occur:\n * 1. Atom is updated and subs fired (but we may not be subscribed\n * yet depending on order of effects, so we miss this) Updated value\n * is now in nextTree, but not currentTree.\n * 2. This effect happens. We subscribe and update.\n * 3. From the update we re-render and read currentTree, with old value.\n * 4. Batcher's effect sets currentTree to nextTree.\n * In this sequence we miss the update. To avoid that, add the update\n * to queuedComponentCallback if a batch is in progress.\n */\n\n if (storeState.nextTree) {\n store.getState().queuedComponentCallbacks_DEPRECATED.push(() => {\n prevLoadableRef.current = null;\n forceUpdate([]);\n });\n } else {\n var _prevLoadableRef$curr2;\n\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return forceUpdate([]);\n }\n\n const newLoadable = getRecoilValueAsLoadable$2(store, recoilValue, store.getState().currentTree);\n\n if (!((_prevLoadableRef$curr2 = prevLoadableRef.current) === null || _prevLoadableRef$curr2 === void 0 ? void 0 : _prevLoadableRef$curr2.is(newLoadable))) {\n forceUpdate(newLoadable);\n }\n }\n\n return subscription.release;\n }, [componentName, recoilValue, storeRef]);\n const loadable = getRecoilValueAsLoadable$2(storeRef.current, recoilValue);\n const prevLoadableRef = useRef$2(loadable);\n useEffect$1(() => {\n prevLoadableRef.current = loadable;\n });\n return loadable;\n}\n/**\n Like useRecoilValue(), but either returns the value if available or\n just undefined if not available for any reason, such as pending or error.\n*/\n\n\nfunction useRecoilValueLoadable(recoilValue) {\n if (Recoil_gkx_1('recoil_memory_managament_2020')) {\n // eslint-disable-next-line fb-www/react-hooks\n useRetain(recoilValue);\n }\n\n if (mutableSourceExists$1()) {\n // eslint-disable-next-line fb-www/react-hooks\n return useRecoilValueLoadable_MUTABLESOURCE(recoilValue);\n } else {\n // eslint-disable-next-line fb-www/react-hooks\n return useRecoilValueLoadable_LEGACY(recoilValue);\n }\n}\n/**\n Returns the value represented by the RecoilValue.\n If the value is pending, it will throw a Promise to suspend the component,\n if the value is an error it will throw it for the nearest React error boundary.\n This will also subscribe the component for any updates in the value.\n */\n\n\nfunction useRecoilValue(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValue');\n }\n\n const storeRef = useStoreRef$1();\n const loadable = useRecoilValueLoadable(recoilValue); // $FlowFixMe[escaped-generic]\n\n return handleLoadable(loadable, recoilValue, storeRef);\n}\n/**\n Returns a function that allows the value of a RecoilState to be updated, but does\n not subscribe the component to changes to that RecoilState.\n*/\n\n\nfunction useSetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useSetRecoilState');\n }\n\n const storeRef = useStoreRef$1();\n return useCallback$1(newValueOrUpdater => {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n }, [storeRef, recoilState]);\n}\n/**\n Returns a function that will reset the value of a RecoilState to its default\n*/\n\n\nfunction useResetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useResetRecoilState');\n }\n\n const storeRef = useStoreRef$1();\n return useCallback$1(() => {\n setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n }, [storeRef, recoilState]);\n}\n/**\n Equivalent to useState(). Allows the value of the RecoilState to be read and written.\n Subsequent updates to the RecoilState will cause the component to re-render. If the\n RecoilState is pending, this will suspend the component and initiate the\n retrieval of the value. If evaluating the RecoilState resulted in an error, this will\n throw the error so that the nearest React error boundary can catch it.\n*/\n\n\nfunction useRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilState');\n }\n\n return [useRecoilValue(recoilState), useSetRecoilState(recoilState)];\n}\n/**\n Like useRecoilState(), but does not cause Suspense or React error handling. Returns\n an object that indicates whether the RecoilState is available, pending, or\n unavailable due to an error.\n*/\n\n\nfunction useRecoilStateLoadable(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilStateLoadable');\n }\n\n return [useRecoilValueLoadable(recoilState), useSetRecoilState(recoilState)];\n}\n\nfunction useTransactionSubscription(callback) {\n const storeRef = useStoreRef$1();\n useEffect$1(() => {\n const sub = storeRef.current.subscribeToTransactions(callback);\n return sub.release;\n }, [callback, storeRef]);\n}\n\nfunction externallyVisibleAtomValuesInState(state) {\n const atomValues = state.atomValues.toMap();\n const persistedAtomContentsValues = Recoil_mapMap(Recoil_filterMap(atomValues, (v, k) => {\n const node = getNode$3(k);\n const persistence = node.persistence_UNSTABLE;\n return persistence != null && persistence.type !== 'none' && v.state === 'hasValue';\n }), v => v.contents); // Merge in nonvalidated atoms; we may not have defs for them but they will\n // all have persistence on or they wouldn't be there in the first place.\n\n return Recoil_mergeMaps(state.nonvalidatedAtoms.toMap(), persistedAtomContentsValues);\n}\n\n/**\n Calls the given callback after any atoms have been modified and the consequent\n component re-renders have been committed. This is intended for persisting\n the values of the atoms to storage. The stored values can then be restored\n using the useSetUnvalidatedAtomValues hook.\n\n The callback receives the following info:\n\n atomValues: The current value of every atom that is both persistable (persistence\n type not set to 'none') and whose value is available (not in an\n error or loading state).\n\n previousAtomValues: The value of every persistable and available atom before\n the transaction began.\n\n atomInfo: A map containing the persistence settings for each atom. Every key\n that exists in atomValues will also exist in atomInfo.\n\n modifiedAtoms: The set of atoms that were written to during the transaction.\n\n transactionMetadata: Arbitrary information that was added via the\n useSetUnvalidatedAtomValues hook. Useful for ignoring the useSetUnvalidatedAtomValues\n transaction, to avoid loops.\n*/\nfunction useTransactionObservation_DEPRECATED(callback) {\n useTransactionSubscription(useCallback$1(store => {\n let previousTree = store.getState().previousTree;\n const currentTree = store.getState().currentTree;\n\n if (!previousTree) {\n Recoil_recoverableViolation('Transaction subscribers notified without a previous tree being present -- this is a bug in Recoil');\n previousTree = store.getState().currentTree; // attempt to trundle on\n }\n\n const atomValues = externallyVisibleAtomValuesInState(currentTree);\n const previousAtomValues = externallyVisibleAtomValuesInState(previousTree);\n const atomInfo = Recoil_mapMap(nodes$1, node => {\n var _node$persistence_UNS, _node$persistence_UNS2, _node$persistence_UNS3, _node$persistence_UNS4;\n\n return {\n persistence_UNSTABLE: {\n type: (_node$persistence_UNS = (_node$persistence_UNS2 = node.persistence_UNSTABLE) === null || _node$persistence_UNS2 === void 0 ? void 0 : _node$persistence_UNS2.type) !== null && _node$persistence_UNS !== void 0 ? _node$persistence_UNS : 'none',\n backButton: (_node$persistence_UNS3 = (_node$persistence_UNS4 = node.persistence_UNSTABLE) === null || _node$persistence_UNS4 === void 0 ? void 0 : _node$persistence_UNS4.backButton) !== null && _node$persistence_UNS3 !== void 0 ? _node$persistence_UNS3 : false\n }\n };\n }); // Filter on existance in atomValues so that externally-visible rules\n // are also applied to modified atoms (specifically exclude selectors):\n\n const modifiedAtoms = Recoil_filterSet(currentTree.dirtyAtoms, k => atomValues.has(k) || previousAtomValues.has(k));\n callback({\n atomValues,\n previousAtomValues,\n atomInfo,\n modifiedAtoms,\n transactionMetadata: { ...currentTree.transactionMetadata\n }\n });\n }, [callback]));\n}\n\nfunction useRecoilTransactionObserver(callback) {\n useTransactionSubscription(useCallback$1(store => {\n const snapshot = cloneSnapshot$1(store, 'current');\n const previousSnapshot = cloneSnapshot$1(store, 'previous');\n callback({\n snapshot,\n previousSnapshot\n });\n }, [callback]));\n}\n\nfunction usePrevious(value) {\n const ref = useRef$2();\n useEffect$1(() => {\n ref.current = value;\n });\n return ref.current;\n} // Return a snapshot of the current state and subscribe to all state changes\n\n\nfunction useRecoilSnapshot() {\n const storeRef = useStoreRef$1();\n const [snapshot, setSnapshot] = useState$1(() => cloneSnapshot$1(storeRef.current));\n const previousSnapshot = usePrevious(snapshot);\n const timeoutID = useRef$2();\n useEffect$1(() => {\n if (timeoutID.current && !isSSR$2) {\n window.clearTimeout(timeoutID.current);\n }\n\n return snapshot.retain();\n }, [snapshot]);\n useTransactionSubscription(useCallback$1(store => setSnapshot(cloneSnapshot$1(store)), []));\n\n if (previousSnapshot !== snapshot && !isSSR$2) {\n if (timeoutID.current) {\n previousSnapshot === null || previousSnapshot === void 0 ? void 0 : previousSnapshot.release();\n window.clearTimeout(timeoutID.current);\n }\n\n snapshot.retain();\n timeoutID.current = window.setTimeout(() => {\n snapshot.release();\n timeoutID.current = null;\n }, SUSPENSE_TIMEOUT_MS);\n }\n\n return snapshot;\n}\n\nfunction useGotoRecoilSnapshot() {\n const storeRef = useStoreRef$1();\n return useCallback$1(snapshot => {\n var _storeState$nextTree;\n\n const storeState = storeRef.current.getState();\n const prev = (_storeState$nextTree = storeState.nextTree) !== null && _storeState$nextTree !== void 0 ? _storeState$nextTree : storeState.currentTree;\n const next = snapshot.getStore_INTERNAL().getState().currentTree;\n batchUpdates$2(() => {\n const keysToUpdate = new Set();\n\n for (const keys of [prev.atomValues.keys(), next.atomValues.keys()]) {\n for (const key of keys) {\n var _prev$atomValues$get, _next$atomValues$get;\n\n if (((_prev$atomValues$get = prev.atomValues.get(key)) === null || _prev$atomValues$get === void 0 ? void 0 : _prev$atomValues$get.contents) !== ((_next$atomValues$get = next.atomValues.get(key)) === null || _next$atomValues$get === void 0 ? void 0 : _next$atomValues$get.contents) && getNode$3(key).shouldRestoreFromSnapshots) {\n keysToUpdate.add(key);\n }\n }\n }\n\n keysToUpdate.forEach(key => {\n setRecoilValueLoadable$1(storeRef.current, new AbstractRecoilValue$3(key), next.atomValues.has(key) ? Recoil_nullthrows(next.atomValues.get(key)) : DEFAULT_VALUE$2);\n });\n storeRef.current.replaceState(state => {\n return { ...state,\n stateID: snapshot.getID_INTERNAL()\n };\n });\n });\n }, [storeRef]);\n}\n\nfunction useSetUnvalidatedAtomValues() {\n const storeRef = useStoreRef$1();\n return (values, transactionMetadata = {}) => {\n batchUpdates$2(() => {\n storeRef.current.addTransactionMetadata(transactionMetadata);\n values.forEach((value, key) => setUnvalidatedRecoilValue$2(storeRef.current, new AbstractRecoilValue$3(key), value));\n });\n };\n}\n\nclass Sentinel {}\n\nconst SENTINEL = new Sentinel();\n\nfunction useRecoilCallback(fn, deps) {\n const storeRef = useStoreRef$1();\n const gotoSnapshot = useGotoRecoilSnapshot();\n return useCallback$1((...args) => {\n function set(recoilState, newValueOrUpdater) {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n }\n\n function reset(recoilState) {\n setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n } // Use currentTree for the snapshot to show the currently committed state\n\n\n const snapshot = cloneSnapshot$1(storeRef.current);\n let ret = SENTINEL;\n batchUpdates$2(() => {\n const errMsg = 'useRecoilCallback expects a function that returns a function: ' + 'it accepts a function of the type (RecoilInterface) => T = R ' + 'and returns a callback function T => R, where RecoilInterface is an ' + 'object {snapshot, set, ...} and T and R are the argument and return ' + 'types of the callback you want to create. Please see the docs ' + 'at recoiljs.org for details.';\n\n if (typeof fn !== 'function') {\n throw new Error(errMsg);\n } // flowlint-next-line unclear-type:off\n\n\n const cb = fn({\n set,\n reset,\n snapshot,\n gotoSnapshot\n });\n\n if (typeof cb !== 'function') {\n throw new Error(errMsg);\n }\n\n ret = cb(...args);\n });\n !!(ret instanceof Sentinel) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'batchUpdates should return immediately') : Recoil_invariant(false) : void 0;\n return ret;\n }, deps != null ? [...deps, storeRef] : undefined // eslint-disable-line fb-www/react-hooks-deps\n );\n} // I don't see a way to avoid the any type here because we want to accept readable\n// and writable values with any type parameter, but normally with writable ones\n// RecoilState is not a subtype of RecoilState.\n\n\n// flowlint-line unclear-type:off\nfunction useRetain(toRetain) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n } // eslint-disable-next-line fb-www/react-hooks\n\n\n return useRetain_ACTUAL(toRetain);\n}\n\nfunction useRetain_ACTUAL(toRetain) {\n const array = Array.isArray(toRetain) ? toRetain : [toRetain];\n const retainables = array.map(a => a instanceof RetentionZone$3 ? a : a.key);\n const storeRef = useStoreRef$1();\n useEffect$1(() => {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const store = storeRef.current;\n\n if (timeoutID.current && !isSSR$2) {\n // Already performed a temporary retain on render, simply cancel the release\n // of that temporary retain.\n window.clearTimeout(timeoutID.current);\n timeoutID.current = null;\n } else {\n // Log this since it's not clear that there's any scenario where it should happen.\n Recoil_recoverableViolation('Did not retain recoil value on render, or committed after timeout elapsed. This is fine, but odd.');\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, 1);\n }\n }\n\n return () => {\n for (const r of retainables) {\n updateRetainCount$1(store, r, -1);\n }\n }; // eslint-disable-next-line fb-www/react-hooks-deps\n }, [storeRef, ...retainables]); // We want to retain if the component suspends. This is terrible but the Suspense\n // API affords us no better option. If we suspend and never commit after some\n // seconds, then release. The 'actual' retain/release in the effect above\n // cancels this.\n\n const timeoutID = useRef$2();\n const previousRetainables = usePrevious(retainables);\n\n if (!isSSR$2 && (previousRetainables === undefined || !Recoil_shallowArrayEqual(previousRetainables, retainables))) {\n const store = storeRef.current;\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, 1);\n }\n\n if (previousRetainables) {\n for (const r of previousRetainables) {\n updateRetainCount$1(store, r, -1);\n }\n }\n\n if (timeoutID.current) {\n window.clearTimeout(timeoutID.current);\n }\n\n timeoutID.current = window.setTimeout(() => {\n timeoutID.current = null;\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, -1);\n }\n }, SUSPENSE_TIMEOUT_MS);\n }\n}\n\nvar Recoil_Hooks = {\n recoilComponentGetRecoilValueCount_FOR_TESTING,\n useGotoRecoilSnapshot,\n useRecoilCallback,\n useRecoilInterface: useRecoilInterface_DEPRECATED,\n useRecoilSnapshot,\n useRecoilState,\n useRecoilStateLoadable,\n useRecoilTransactionObserver,\n useRecoilValue,\n useRecoilValueLoadable,\n useRetain,\n useResetRecoilState,\n useSetRecoilState,\n useSetUnvalidatedAtomValues,\n useTransactionObservation_DEPRECATED,\n useTransactionSubscription_DEPRECATED: useTransactionSubscription\n};\n\nconst {\n peekNodeInfo: peekNodeInfo$2\n} = Recoil_FunctionalCore;\n\nconst {\n useStoreRef: useStoreRef$2\n} = Recoil_RecoilRoot_react;\n\nfunction useGetRecoilValueInfo() {\n const storeRef = useStoreRef$2();\n return ({\n key\n }) => peekNodeInfo$2(storeRef.current, storeRef.current.getState().currentTree, key);\n}\n\nvar Recoil_useGetRecoilValueInfo = useGetRecoilValueInfo;\n\nconst {\n RecoilRoot: RecoilRoot$1,\n useStoreRef: useStoreRef$3\n} = Recoil_RecoilRoot_react;\n\n\n\nconst {\n useMemo: useMemo$2\n} = react;\n\nfunction useRecoilBridgeAcrossReactRoots() {\n const store = useStoreRef$3().current;\n return useMemo$2(() => {\n function RecoilBridge({\n children\n }) {\n return /*#__PURE__*/react.createElement(RecoilRoot$1, {\n store_INTERNAL: store\n }, children);\n }\n\n return RecoilBridge;\n }, [store]);\n}\n\nvar Recoil_useRecoilBridgeAcrossReactRoots = useRecoilBridgeAcrossReactRoots;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n// Split declaration and implementation to allow this function to pretend to\n// check for actual instance of Promise instead of something with a `then`\n// method.\n// eslint-disable-next-line no-redeclare\nfunction isPromise(p) {\n return !!p && typeof p.then === 'function';\n}\n\nvar Recoil_isPromise = isPromise;\n\n// TODO Convert Loadable to a Class to allow for runtime type detection.\n// Containing static factories of withValue(), withError(), withPromise(), and all()\n\n\nclass Canceled {}\n\nconst CANCELED = new Canceled();\nconst loadableAccessors = {\n /**\n * if loadable has a value (state === 'hasValue'), return that value.\n * Otherwise, throw the (unwrapped) promise or the error.\n */\n getValue() {\n if (this.state === 'loading') {\n throw this.contents.then(({\n __value\n }) => __value);\n }\n\n if (this.state !== 'hasValue') {\n throw this.contents;\n }\n\n return this.contents;\n },\n\n toPromise() {\n return this.state === 'hasValue' ? Promise.resolve(this.contents) : this.state === 'hasError' ? Promise.reject(this.contents) : this.contents.then(({\n __value\n }) => __value);\n },\n\n valueMaybe() {\n return this.state === 'hasValue' ? this.contents : undefined;\n },\n\n valueOrThrow() {\n if (this.state !== 'hasValue') {\n const error = new Error(`Loadable expected value, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents;\n },\n\n errorMaybe() {\n return this.state === 'hasError' ? this.contents : undefined;\n },\n\n errorOrThrow() {\n if (this.state !== 'hasError') {\n const error = new Error(`Loadable expected error, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents;\n },\n\n promiseMaybe() {\n return this.state === 'loading' ? this.contents.then(({\n __value\n }) => __value) : undefined;\n },\n\n promiseOrThrow() {\n if (this.state !== 'loading') {\n const error = new Error(`Loadable expected promise, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents.then(({\n __value\n }) => __value);\n },\n\n is(other) {\n return other.state === this.state && other.contents === this.contents;\n },\n\n // TODO Unit tests\n // TODO Convert Loadable to a Class to better support chaining\n // by returning a Loadable from a map function\n map(map) {\n if (this.state === 'hasError') {\n return this;\n }\n\n if (this.state === 'hasValue') {\n try {\n const next = map(this.contents); // TODO if next instanceof Loadable, then return next\n\n return Recoil_isPromise(next) ? loadableWithPromise(next) : loadableWithValue(next);\n } catch (e) {\n return Recoil_isPromise(e) ? // If we \"suspended\", then try again.\n // errors and subsequent retries will be handled in 'loading' case\n loadableWithPromise(e.next(() => map(this.contents))) : loadableWithError(e);\n }\n }\n\n if (this.state === 'loading') {\n return loadableWithPromise(this.contents // TODO if map returns a loadable, then return the value or promise or throw the error\n .then(map).catch(e => {\n if (Recoil_isPromise(e)) {\n // we were \"suspended,\" try again\n return e.then(() => map(this.contents));\n }\n\n throw e;\n }));\n }\n\n const error = new Error('Invalid Loadable state'); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n};\n\nfunction loadableWithValue(value) {\n // Build objects this way since Flow doesn't support disjoint unions for class properties\n return Object.freeze({\n state: 'hasValue',\n contents: value,\n ...loadableAccessors\n });\n}\n\nfunction loadableWithError(error) {\n return Object.freeze({\n state: 'hasError',\n contents: error,\n ...loadableAccessors\n });\n}\n\nfunction loadableWithPromise(promise) {\n return Object.freeze({\n state: 'loading',\n contents: promise,\n ...loadableAccessors\n });\n}\n\nfunction loadableLoading() {\n return loadableWithPromise(new Promise(() => {}));\n}\n\nfunction loadableAll(inputs) {\n return inputs.every(i => i.state === 'hasValue') ? loadableWithValue(inputs.map(i => i.contents)) : inputs.some(i => i.state === 'hasError') ? loadableWithError(Recoil_nullthrows(inputs.find(i => i.state === 'hasError'), 'Invalid loadable passed to loadableAll').contents) : loadableWithPromise(Promise.all(inputs.map(i => i.contents)).then(value => ({\n __value: value\n })));\n}\n\nvar Recoil_Loadable = {\n loadableWithValue,\n loadableWithError,\n loadableWithPromise,\n loadableLoading,\n loadableAll,\n Canceled,\n CANCELED\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction isNode(object) {\n var _ownerDocument, _doc$defaultView;\n\n if (typeof window === 'undefined') {\n return false;\n }\n\n const doc = object != null ? (_ownerDocument = object.ownerDocument) !== null && _ownerDocument !== void 0 ? _ownerDocument : object : document;\n const defaultView = (_doc$defaultView = doc.defaultView) !== null && _doc$defaultView !== void 0 ? _doc$defaultView : window;\n return !!(object != null && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));\n}\n\nvar Recoil_isNode = isNode;\n\nconst {\n isReactNative: isReactNative$1,\n isSSR: isSSR$3\n} = Recoil_Environment;\n\n\n\n\n\nfunction shouldNotBeFrozen(value) {\n // Primitives and functions:\n if (value === null || typeof value !== 'object') {\n return true;\n } // React elements:\n\n\n switch (typeof value.$$typeof) {\n case 'symbol':\n return true;\n\n case 'number':\n return true;\n } // Immutable structures:\n\n\n if (value['@@__IMMUTABLE_ITERABLE__@@'] != null || value['@@__IMMUTABLE_KEYED__@@'] != null || value['@@__IMMUTABLE_INDEXED__@@'] != null || value['@@__IMMUTABLE_ORDERED__@@'] != null || value['@@__IMMUTABLE_RECORD__@@'] != null) {\n return true;\n } // DOM nodes:\n\n\n if (Recoil_isNode(value)) {\n return true;\n }\n\n if (Recoil_isPromise(value)) {\n return true;\n }\n\n if (value instanceof Error) {\n return true;\n }\n\n if (ArrayBuffer.isView(value)) {\n return true;\n } // Some environments, just as Jest, don't work with the instanceof check\n\n\n if (!isSSR$3 && !isReactNative$1 && ( // $FlowFixMe(site=recoil) Window does not have a FlowType definition https://github.com/facebook/flow/issues/6709\n value === window || value instanceof Window)) {\n return true;\n }\n\n return false;\n} // Recursively freeze a value to enforce it is read-only.\n// This may also have minimal performance improvements for enumerating\n// objects (based on browser implementations, of course)\n\n\nfunction deepFreezeValue(value) {\n if (typeof value !== 'object' || shouldNotBeFrozen(value)) {\n return;\n }\n\n Object.freeze(value); // Make all properties read-only\n\n for (const key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) {\n const prop = value[key]; // Prevent infinite recurssion for circular references.\n\n if (typeof prop === 'object' && prop != null && !Object.isFrozen(prop)) {\n deepFreezeValue(prop);\n }\n }\n }\n\n Object.seal(value); // This also makes existing properties non-configurable.\n}\n\nvar Recoil_deepFreezeValue = deepFreezeValue;\n\nconst TIME_WARNING_THRESHOLD_MS = 15;\n\nfunction stringify(x, opt, key) {\n // A optimization to avoid the more expensive JSON.stringify() for simple strings\n // This may lose protection for u2028 and u2029, though.\n if (typeof x === 'string' && !x.includes('\"') && !x.includes('\\\\')) {\n return `\"${x}\"`;\n } // Handle primitive types\n\n\n switch (typeof x) {\n case 'undefined':\n return '';\n // JSON.stringify(undefined) returns undefined, but we always want to return a string\n\n case 'boolean':\n return x ? 'true' : 'false';\n\n case 'number':\n case 'symbol':\n // case 'bigint': // BigInt is not supported in www\n return String(x);\n\n case 'string':\n // Add surrounding quotes and escape internal quotes\n return JSON.stringify(x);\n\n case 'function':\n if ((opt === null || opt === void 0 ? void 0 : opt.allowFunctions) !== true) {\n throw new Error('Attempt to serialize function in a Recoil cache key');\n }\n\n return `__FUNCTION(${x.name})__`;\n }\n\n if (x === null) {\n return 'null';\n } // Fallback case for unknown types\n\n\n if (typeof x !== 'object') {\n var _JSON$stringify;\n\n return (_JSON$stringify = JSON.stringify(x)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : '';\n } // Deal with all promises as equivalent for now.\n\n\n if (Recoil_isPromise(x)) {\n return '__PROMISE__';\n } // Arrays handle recursive stringification\n\n\n if (Array.isArray(x)) {\n return `[${x.map((v, i) => stringify(v, opt, i.toString()))}]`;\n } // If an object defines a toJSON() method, then use that to override the\n // serialization. This matches the behavior of JSON.stringify().\n // Pass the key for compatibility.\n // Immutable.js collections define this method to allow us to serialize them.\n\n\n if (typeof x.toJSON === 'function') {\n // flowlint-next-line unclear-type: off\n return stringify(x.toJSON(key), opt, key);\n } // For built-in Maps, sort the keys in a stable order instead of the\n // default insertion order. Support non-string keys.\n\n\n if (x instanceof Map) {\n const obj = {};\n\n for (const [k, v] of x) {\n // Stringify will escape any nested quotes\n obj[typeof k === 'string' ? k : stringify(k, opt)] = v;\n }\n\n return stringify(obj, opt, key);\n } // For built-in Sets, sort the keys in a stable order instead of the\n // default insertion order.\n\n\n if (x instanceof Set) {\n return stringify(Array.from(x).sort((a, b) => stringify(a, opt).localeCompare(stringify(b, opt))), opt, key);\n } // Anything else that is iterable serialize as an Array.\n\n\n if (Symbol !== undefined && x[Symbol.iterator] != null && typeof x[Symbol.iterator] === 'function') {\n // flowlint-next-line unclear-type: off\n return stringify(Array.from(x), opt, key);\n } // For all other Objects, sort the keys in a stable order.\n\n\n return `{${Object.keys(x).filter(key => x[key] !== undefined).sort() // stringify the key to add quotes and escape any nested slashes or quotes.\n .map(key => `${stringify(key, opt)}:${stringify(x[key], opt, key)}`).join(',')}}`;\n} // Utility similar to JSON.stringify() except:\n// * Serialize built-in Sets as an Array\n// * Serialize built-in Maps as an Object. Supports non-string keys.\n// * Serialize other iterables as arrays\n// * Sort the keys of Objects and Maps to have a stable order based on string conversion.\n// This overrides their default insertion order.\n// * Still uses toJSON() of any object to override serialization\n// * Support Symbols (though don't guarantee uniqueness)\n// * We could support BigInt, but Flow doesn't seem to like it.\n// See Recoil_stableStringify-test.js for examples\n\n\nfunction stableStringify(x, opt = {\n allowFunctions: false\n}) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined') {\n const startTime = window.performance ? window.performance.now() : 0;\n const str = stringify(x, opt);\n const endTime = window.performance ? window.performance.now() : 0;\n\n if (endTime - startTime > TIME_WARNING_THRESHOLD_MS) {\n /* eslint-disable fb-www/no-console */\n console.groupCollapsed(`Recoil: Spent ${endTime - startTime}ms computing a cache key`);\n console.warn(x, str);\n console.groupEnd();\n /* eslint-enable fb-www/no-console */\n }\n\n return str;\n }\n }\n\n return stringify(x, opt);\n}\n\nvar Recoil_stableStringify = stableStringify;\n\nclass TreeCache {\n constructor(options) {\n var _options$onHit, _options$onSet, _options$mapNodeValue;\n\n _defineProperty(this, \"_numLeafs\", void 0);\n\n _defineProperty(this, \"_root\", void 0);\n\n _defineProperty(this, \"_onHit\", void 0);\n\n _defineProperty(this, \"_onSet\", void 0);\n\n _defineProperty(this, \"_mapNodeValue\", void 0);\n\n this._numLeafs = 0;\n this._root = null;\n this._onHit = (_options$onHit = options === null || options === void 0 ? void 0 : options.onHit) !== null && _options$onHit !== void 0 ? _options$onHit : () => {};\n this._onSet = (_options$onSet = options === null || options === void 0 ? void 0 : options.onSet) !== null && _options$onSet !== void 0 ? _options$onSet : () => {};\n this._mapNodeValue = (_options$mapNodeValue = options === null || options === void 0 ? void 0 : options.mapNodeValue) !== null && _options$mapNodeValue !== void 0 ? _options$mapNodeValue : val => val;\n }\n\n size() {\n return this._numLeafs;\n } // TODO: nodeCount(): number\n\n\n root() {\n return this._root;\n }\n\n get(getNodeValue, handlers) {\n var _this$getLeafNode;\n\n return (_this$getLeafNode = this.getLeafNode(getNodeValue, handlers)) === null || _this$getLeafNode === void 0 ? void 0 : _this$getLeafNode.value;\n }\n\n getLeafNode(getNodeValue, handlers) {\n return findLeaf(this.root(), nodeKey => this._mapNodeValue(getNodeValue(nodeKey)), {\n onNodeVisit: node => {\n handlers === null || handlers === void 0 ? void 0 : handlers.onNodeVisit(node);\n\n if (node.type === 'leaf') {\n this._onHit(node);\n }\n }\n });\n }\n\n set(route, value, handlers) {\n let leafNode;\n const newRoot = addLeaf(this.root(), route.map(([nodeKey, nodeValue]) => [nodeKey, this._mapNodeValue(nodeValue)]), null, value, null, {\n onNodeVisit: node => {\n handlers === null || handlers === void 0 ? void 0 : handlers.onNodeVisit(node);\n\n if (node.type === 'leaf') {\n leafNode = node;\n }\n }\n });\n\n if (!this.root()) {\n this._root = newRoot;\n }\n\n this._numLeafs++;\n\n this._onSet(Recoil_nullthrows(leafNode));\n }\n\n delete(node) {\n if (!this.root()) {\n return false;\n }\n\n const root = Recoil_nullthrows(this.root());\n const existsInTree = pruneNodeFromTree(root, node, node.parent);\n\n if (!existsInTree) {\n return false;\n }\n\n if (node === root || root.type === 'branch' && !root.branches.size) {\n this._root = null;\n this._numLeafs = 0;\n return true;\n }\n\n this._numLeafs -= countDownstreamLeaves(node);\n return true;\n }\n\n clear() {\n this._numLeafs = 0;\n this._root = null;\n }\n\n}\n\nconst findLeaf = (root, getNodeValue, handlers) => {\n var _handlers$onNodeVisit;\n\n if (root == null) {\n return undefined;\n }\n\n handlers === null || handlers === void 0 ? void 0 : (_handlers$onNodeVisit = handlers.onNodeVisit) === null || _handlers$onNodeVisit === void 0 ? void 0 : _handlers$onNodeVisit.call(handlers, root);\n\n if (root.type === 'leaf') {\n return root;\n }\n\n const nodeValue = getNodeValue(root.nodeKey);\n return findLeaf(root.branches.get(nodeValue), getNodeValue, handlers);\n};\n\nconst addLeaf = (root, route, parent, value, branchKey, handlers) => {\n var _handlers$onNodeVisit2;\n\n let node;\n\n if (root == null) {\n if (route.length === 0) {\n node = {\n type: 'leaf',\n value,\n parent,\n branchKey\n };\n } else {\n const [path, ...rest] = route;\n const [nodeKey, nodeValue] = path;\n node = {\n type: 'branch',\n nodeKey,\n parent,\n branches: new Map(),\n branchKey\n };\n node.branches.set(nodeValue, addLeaf(null, rest, node, value, nodeValue, handlers));\n }\n } else {\n node = root;\n\n if (route.length) {\n const [path, ...rest] = route;\n const [nodeKey, nodeValue] = path;\n !(root.type === 'branch' && root.nodeKey === nodeKey) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Existing cache must have a branch midway through the route with matching node key') : Recoil_invariant(false) : void 0;\n root.branches.set(nodeValue, addLeaf(root.branches.get(nodeValue), rest, root, value, nodeValue, handlers));\n }\n }\n\n handlers === null || handlers === void 0 ? void 0 : (_handlers$onNodeVisit2 = handlers.onNodeVisit) === null || _handlers$onNodeVisit2 === void 0 ? void 0 : _handlers$onNodeVisit2.call(handlers, node);\n return node;\n};\n\nconst pruneNodeFromTree = (root, node, parent) => {\n if (!parent) {\n return root === node;\n }\n\n parent.branches.delete(node.branchKey);\n return pruneUpstreamBranches(root, parent, parent.parent);\n};\n\nconst pruneUpstreamBranches = (root, branchNode, parent) => {\n if (!parent) {\n return root === branchNode;\n }\n\n if (branchNode.branches.size === 0) {\n parent.branches.delete(branchNode.branchKey);\n }\n\n return pruneUpstreamBranches(root, parent, parent.parent);\n};\n\nconst countDownstreamLeaves = node => node.type === 'leaf' ? 1 : Array.from(node.branches.values()).reduce((sum, currNode) => sum + countDownstreamLeaves(currNode), 0);\n\nvar Recoil_TreeCache = {\n TreeCache\n};\n\nvar Recoil_TreeCache_1 = Recoil_TreeCache.TreeCache;\n\nvar Recoil_TreeCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n TreeCache: Recoil_TreeCache_1\n});\n\nclass LRUCache {\n constructor(options) {\n var _options$mapKey;\n\n _defineProperty(this, \"_maxSize\", void 0);\n\n _defineProperty(this, \"_size\", void 0);\n\n _defineProperty(this, \"_head\", void 0);\n\n _defineProperty(this, \"_tail\", void 0);\n\n _defineProperty(this, \"_map\", void 0);\n\n _defineProperty(this, \"_keyMapper\", void 0);\n\n this._maxSize = options.maxSize;\n this._size = 0;\n this._head = null;\n this._tail = null;\n this._map = new Map();\n this._keyMapper = (_options$mapKey = options.mapKey) !== null && _options$mapKey !== void 0 ? _options$mapKey : v => v;\n }\n\n head() {\n return this._head;\n }\n\n tail() {\n return this._tail;\n }\n\n size() {\n return this._size;\n }\n\n maxSize() {\n return this._maxSize;\n }\n\n has(key) {\n return this._map.has(this._keyMapper(key));\n }\n\n get(key) {\n const mappedKey = this._keyMapper(key);\n\n const node = this._map.get(mappedKey);\n\n if (!node) {\n return undefined;\n }\n\n this.set(key, node.value);\n return node.value;\n }\n\n set(key, val) {\n const mappedKey = this._keyMapper(key);\n\n const existingNode = this._map.get(mappedKey);\n\n if (existingNode) {\n this.delete(key);\n }\n\n const head = this.head();\n const node = {\n key,\n right: head,\n left: null,\n value: val\n };\n\n if (head) {\n head.left = node;\n } else {\n this._tail = node;\n }\n\n this._map.set(mappedKey, node);\n\n this._head = node;\n this._size++;\n\n this._maybeDeleteLRU();\n }\n\n _maybeDeleteLRU() {\n if (this.size() > this.maxSize()) {\n this.deleteLru();\n }\n }\n\n deleteLru() {\n const tail = this.tail();\n\n if (tail) {\n this.delete(tail.key);\n }\n }\n\n delete(key) {\n const mappedKey = this._keyMapper(key);\n\n if (!this._size || !this._map.has(mappedKey)) {\n return;\n }\n\n const node = Recoil_nullthrows(this._map.get(mappedKey));\n const right = node.right;\n const left = node.left;\n\n if (right) {\n right.left = node.left;\n }\n\n if (left) {\n left.right = node.right;\n }\n\n if (node === this.head()) {\n this._head = right;\n }\n\n if (node === this.tail()) {\n this._tail = left;\n }\n\n this._map.delete(mappedKey);\n\n this._size--;\n }\n\n clear() {\n this._size = 0;\n this._head = null;\n this._tail = null;\n this._map = new Map();\n }\n\n}\n\nvar Recoil_LRUCache = {\n LRUCache\n};\n\nvar Recoil_LRUCache_1 = Recoil_LRUCache.LRUCache;\n\nvar Recoil_LRUCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n LRUCache: Recoil_LRUCache_1\n});\n\nconst {\n LRUCache: LRUCache$1\n} = Recoil_LRUCache$1;\n\nconst {\n TreeCache: TreeCache$1\n} = Recoil_TreeCache$1;\n\nfunction treeCacheLRU(maxSize, mapNodeValue = v => v) {\n const lruCache = new LRUCache$1({\n maxSize\n });\n const cache = new TreeCache$1({\n mapNodeValue,\n onHit: node => {\n lruCache.set(node, true);\n },\n onSet: node => {\n const lruNode = lruCache.tail();\n lruCache.set(node, true);\n\n if (lruNode && cache.size() > maxSize) {\n cache.delete(lruNode.key);\n }\n }\n });\n return cache;\n}\n\nvar Recoil_treeCacheLRU = treeCacheLRU;\n\nconst {\n TreeCache: TreeCache$2\n} = Recoil_TreeCache$1;\n\n\n\nconst defaultPolicy = {\n equality: 'reference',\n eviction: 'none',\n maxSize: Infinity\n};\n\nfunction treeCacheFromPolicy({\n equality = defaultPolicy.equality,\n eviction = defaultPolicy.eviction,\n maxSize = defaultPolicy.maxSize\n} = defaultPolicy) {\n const valueMapper = getValueMapper(equality);\n const treeCache = getTreeCache(eviction, maxSize, valueMapper);\n return treeCache;\n}\n\nfunction getValueMapper(equality) {\n switch (equality) {\n case 'reference':\n return val => val;\n\n case 'value':\n return val => Recoil_stableStringify(val);\n }\n\n throw new Error(`Unrecognized equality policy ${equality}`);\n}\n\nfunction getTreeCache(eviction, maxSize, mapNodeValue) {\n switch (eviction) {\n case 'none':\n return new TreeCache$2({\n mapNodeValue\n });\n\n case 'lru':\n return Recoil_treeCacheLRU(Recoil_nullthrows(maxSize), mapNodeValue);\n }\n\n throw new Error(`Unrecognized eviction policy ${eviction}`);\n}\n\nvar Recoil_treeCacheFromPolicy = treeCacheFromPolicy;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is a stub for some integration into FB internal stuff\n */\nfunction startPerfBlock(_id) {\n return () => null;\n}\n\nvar Recoil_PerformanceTimings = {\n startPerfBlock\n};\n\nconst {\n CANCELED: CANCELED$1,\n Canceled: Canceled$1,\n loadableWithError: loadableWithError$1,\n loadableWithPromise: loadableWithPromise$1,\n loadableWithValue: loadableWithValue$1\n} = Recoil_Loadable;\n\n\n\nconst {\n getNodeLoadable: getNodeLoadable$2,\n peekNodeLoadable: peekNodeLoadable$1,\n setNodeValue: setNodeValue$3\n} = Recoil_FunctionalCore;\n\nconst {\n saveDependencyMapToStore: saveDependencyMapToStore$1\n} = Recoil_Graph;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$3,\n RecoilValueNotReady: RecoilValueNotReady$2,\n getConfigDeletionHandler: getConfigDeletionHandler$1,\n registerNode: registerNode$1\n} = Recoil_Node;\n\nconst {\n isRecoilValue: isRecoilValue$3\n} = Recoil_RecoilValue$1;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$4\n} = Recoil_RecoilValue$1;\n\nconst {\n setRecoilValueLoadable: setRecoilValueLoadable$2\n} = Recoil_RecoilValueInterface;\n\nconst {\n retainedByOptionWithDefault: retainedByOptionWithDefault$1\n} = Recoil_Retention;\n\n\n\n\n\n\n\n\n\n\n\nconst {\n startPerfBlock: startPerfBlock$1\n} = Recoil_PerformanceTimings;\n\n\n\nconst dependencyStack = []; // for detecting circular dependencies.\n\nconst waitingStores = new Map();\n/* eslint-disable no-redeclare */\n\nconst getNewExecutionId = (() => {\n let executionId = 0;\n return () => executionId++;\n})();\n\nfunction getInitialExecutionInfo() {\n return {\n depValuesDiscoveredSoFarDuringAsyncWork: null,\n latestLoadable: null,\n latestExecutionId: null,\n stateVersion: null\n };\n}\n\nfunction selector(options) {\n const {\n key,\n get,\n cachePolicy_UNSTABLE: cachePolicy\n } = options;\n const set = options.set != null ? options.set : undefined; // flow\n\n const cache = Recoil_treeCacheFromPolicy(cachePolicy !== null && cachePolicy !== void 0 ? cachePolicy : {\n equality: 'reference',\n eviction: 'none'\n });\n const retainedBy = retainedByOptionWithDefault$1(options.retainedBy_UNSTABLE);\n const executionInfoMap = new Map();\n let liveStoresCount = 0;\n\n function selectorIsLive() {\n return !Recoil_gkx_1('recoil_memory_managament_2020') || liveStoresCount > 0;\n }\n\n function getExecutionInfo(store) {\n if (!executionInfoMap.has(store)) {\n executionInfoMap.set(store, getInitialExecutionInfo());\n }\n\n return Recoil_nullthrows(executionInfoMap.get(store));\n }\n\n function selectorInit(store) {\n liveStoresCount++;\n store.getState().knownSelectors.add(key); // FIXME remove knownSelectors?\n\n return () => {\n liveStoresCount--;\n store.getState().knownSelectors.delete(key);\n executionInfoMap.delete(store);\n };\n }\n\n function selectorShouldDeleteConfigOnRelease() {\n return getConfigDeletionHandler$1(key) !== undefined && !selectorIsLive();\n }\n\n function notifyStoreWhenAsyncSettles(store, loadable, executionId) {\n if (loadable.state === 'loading') {\n let stores = waitingStores.get(executionId);\n\n if (stores == null) {\n waitingStores.set(executionId, stores = new Set());\n }\n\n stores.add(store);\n }\n }\n\n function notifyStoresOfSettledAsync(newLoadable, executionId) {\n const stores = waitingStores.get(executionId);\n\n if (stores !== undefined) {\n for (const store of stores) {\n setRecoilValueLoadable$2(store, new AbstractRecoilValue$4(key), newLoadable);\n }\n\n waitingStores.delete(executionId);\n }\n }\n\n function getCachedNodeLoadable(store, state, key) {\n if (state.atomValues.has(key)) {\n return Recoil_nullthrows(state.atomValues.get(key));\n }\n\n const loadable = getNodeLoadable$2(store, state, key);\n const isKeyPointingToSelector = store.getState().knownSelectors.has(key);\n\n if (loadable.state !== 'loading' && isKeyPointingToSelector) {\n state.atomValues.set(key, loadable);\n }\n\n return loadable;\n }\n /**\n * This function attaches a then() and a catch() to a promise that was\n * returned from a selector's get() (either explicitly or implicitly by\n * running a function that uses the \"async\" keyword). If a selector's get()\n * returns a promise, we have two possibilities:\n *\n * 1. The promise will resolve, in which case it will have completely finished\n * executing without any remaining pending dependencies. No more retries\n * are needed and we can proceed with updating the cache and notifying\n * subscribers (if it is the latest execution, otherwise only the cache\n * will be updated and subscriptions will not be fired). This is the case\n * handled by the attached then() handler.\n *\n * 2. The promise will throw because it either has an error or it came across\n * an async dependency that has not yet resolved, in which case we will\n * call wrapDepdencyPromise(), whose responsibility is to handle dependency\n * promises. This case is handled by the attached catch() handler.\n *\n * Both branches will eventually resolve to the final result of the selector\n * (or an error if a real error occurred).\n *\n * The execution will run to completion even if it is stale, and its value\n * will be cached. But stale executions will not update global state or update\n * executionInfo as that is the responsibility of the 'latest' execution.\n *\n * Note this function should not be passed a promise that was thrown--AKA a\n * dependency promise. Dependency promises should be passed to\n * wrapPendingDependencyPromise()).\n */\n\n\n function wrapPendingPromise(store, promise, state, depValues, executionId) {\n return promise.then(value => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n const loadable = loadableWithValue$1(value);\n maybeFreezeValue(value);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n return {\n __value: value,\n __key: key\n };\n }).catch(errorOrPromise => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n if (isLatestExecution(store, executionId)) {\n updateExecutionInfoDepValues(depValues, store, executionId);\n }\n\n if (Recoil_isPromise(errorOrPromise)) {\n return wrapPendingDependencyPromise(store, errorOrPromise, state, depValues, executionId);\n }\n\n const loadable = loadableWithError$1(errorOrPromise);\n maybeFreezeValue(errorOrPromise);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n throw errorOrPromise;\n });\n }\n /**\n * This function attaches a then() and a catch() to a promise that was\n * thrown from a selector's get(). If a selector's get() throws a promise,\n * we have two possibilities:\n *\n * 1. The promise will resolve, meaning one of our selector's dependencies is\n * now available and we should \"retry\" our get() by running it again. This\n * is the case handled by the attached then() handler.\n *\n * 2. The promise will throw because something went wrong with the dependency\n * promise (in other words a real error occurred). This case is handled by\n * the attached catch() handler. If the dependency promise throws, it is\n * _always_ a real error and not another dependency promise (any dependency\n * promises would have been handled upstream).\n *\n * The then() branch will eventually resolve to the final result of the\n * selector (or an error if a real error occurs), and the catch() will always\n * resolve to an error because the dependency promise is a promise that was\n * wrapped upstream, meaning it will only resolve to its real value or to a\n * real error.\n *\n * The execution will run to completion even if it is stale, and its value\n * will be cached. But stale executions will not update global state or update\n * executionInfo as that is the responsibility of the 'latest' execution.\n *\n * Note this function should not be passed a promise that was returned from\n * get(). The intention is that this function is only passed promises that\n * were thrown due to a pending dependency. Promises returned by get() should\n * be passed to wrapPendingPromise() instead.\n */\n\n\n function wrapPendingDependencyPromise(store, promise, state, existingDeps, executionId) {\n return promise.then(resolvedDep => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n if (resolvedDep instanceof Canceled$1) {\n Recoil_recoverableViolation('Selector was released while it had dependencies');\n return CANCELED$1;\n }\n\n const {\n __key: resolvedDepKey,\n __value: depValue\n } = resolvedDep !== null && resolvedDep !== void 0 ? resolvedDep : {};\n /**\n * We need to bypass the selector dep cache if the resolved dep was a\n * user-thrown promise because the selector dep cache will contain the\n * stale values of dependencies, causing an infinite evaluation loop.\n */\n\n let bypassSelectorDepCacheOnReevaluation = true;\n\n if (resolvedDepKey != null) {\n /**\n * Note for async atoms, this means we are changing the atom's value\n * in the store for the given version. This should be alright because\n * the version of state is now stale and a new version will have\n * already been triggered by the atom being resolved (see this logic\n * in Recoil_atom.js)\n */\n state.atomValues.set(resolvedDepKey, loadableWithValue$1(depValue));\n /**\n * We've added the resolved dependency to the selector dep cache, so\n * there's no need to bypass the cache\n */\n\n bypassSelectorDepCacheOnReevaluation = false;\n }\n\n const [loadable, depValues] = evaluateSelectorGetter(store, state, executionId, bypassSelectorDepCacheOnReevaluation);\n\n if (isLatestExecution(store, executionId)) {\n updateExecutionInfoDepValues(depValues, store, executionId);\n }\n\n maybeFreezeLoadableContents(loadable);\n\n if (loadable.state !== 'loading') {\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n }\n\n if (loadable.state === 'hasError') {\n throw loadable.contents;\n }\n\n if (loadable.state === 'hasValue') {\n return {\n __value: loadable.contents,\n __key: key\n };\n }\n /**\n * Returning promise here without wrapping as the wrapepr logic was\n * already done when we called evaluateSelectorGetter() to get this\n * loadable\n */\n\n\n return loadable.contents;\n }).catch(error => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n const loadable = loadableWithError$1(error);\n maybeFreezeValue(error);\n setCache(state, depValuesToDepRoute(existingDeps), loadableWithError$1(error));\n setDepsInStore(store, state, new Set(existingDeps.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n throw error;\n });\n }\n\n function setLoadableInStoreToNotifyDeps(store, loadable, executionId) {\n if (isLatestExecution(store, executionId)) {\n setExecutionInfo(loadable, store);\n notifyStoresOfSettledAsync(loadable, executionId);\n }\n }\n\n function setDepsInStore(store, state, deps, executionId) {\n var _store$getState, _store$getState$curre, _store$getState2, _store$getState2$next;\n\n if (isLatestExecution(store, executionId) || state.version === ((_store$getState = store.getState()) === null || _store$getState === void 0 ? void 0 : (_store$getState$curre = _store$getState.currentTree) === null || _store$getState$curre === void 0 ? void 0 : _store$getState$curre.version) || state.version === ((_store$getState2 = store.getState()) === null || _store$getState2 === void 0 ? void 0 : (_store$getState2$next = _store$getState2.nextTree) === null || _store$getState2$next === void 0 ? void 0 : _store$getState2$next.version)) {\n var _store$getState$nextT, _store$getState3, _store$getState3$next;\n\n saveDependencyMapToStore$1(new Map([[key, deps]]), store, (_store$getState$nextT = (_store$getState3 = store.getState()) === null || _store$getState3 === void 0 ? void 0 : (_store$getState3$next = _store$getState3.nextTree) === null || _store$getState3$next === void 0 ? void 0 : _store$getState3$next.version) !== null && _store$getState$nextT !== void 0 ? _store$getState$nextT : store.getState().currentTree.version);\n }\n }\n\n function setNewDepInStore(store, state, deps, newDepKey, executionId) {\n deps.add(newDepKey);\n setDepsInStore(store, state, deps, executionId);\n }\n\n function evaluateSelectorGetter(store, state, executionId, bypassSelectorDepCache = false) {\n const endPerfBlock = startPerfBlock$1(key); // TODO T63965866: use execution ID here\n\n let result;\n let resultIsError = false;\n let loadable;\n const depValues = new Map();\n /**\n * Starting a fresh set of deps that we'll be using to update state. We're\n * starting a new set versus adding it in existing state deps because\n * the version of state that we update deps for may be a more recent version\n * than the version the selector was called with. This is because the latest\n * execution will update the deps of the current/latest version of state (\n * this is safe to do because the fact that the selector is the latest\n * execution means the deps we discover below are our best guess at the\n * deps for the current/latest state in the store)\n */\n\n const deps = new Set();\n setDepsInStore(store, state, deps, executionId);\n\n function getRecoilValue(recoilValue) {\n const {\n key: depKey\n } = recoilValue;\n setNewDepInStore(store, state, deps, depKey, executionId);\n const depLoadable = bypassSelectorDepCache ? getNodeLoadable$2(store, state, depKey) : getCachedNodeLoadable(store, state, depKey);\n depValues.set(depKey, depLoadable);\n\n if (depLoadable.state === 'hasValue') {\n return depLoadable.contents;\n }\n\n throw depLoadable.contents;\n }\n\n try {\n result = get({\n get: getRecoilValue\n });\n result = isRecoilValue$3(result) ? getRecoilValue(result) : result;\n\n if (Recoil_isPromise(result)) {\n result = wrapPendingPromise(store, // $FlowFixMe[incompatible-call]\n result, state, depValues, executionId).finally(endPerfBlock);\n } else {\n endPerfBlock();\n }\n } catch (errorOrDepPromise) {\n result = errorOrDepPromise;\n\n if (Recoil_isPromise(result)) {\n result = wrapPendingDependencyPromise(store, // $FlowFixMe[incompatible-call]\n result, state, depValues, executionId).finally(endPerfBlock);\n } else {\n resultIsError = true;\n endPerfBlock();\n }\n }\n\n if (resultIsError) {\n loadable = loadableWithError$1(result);\n } else if (Recoil_isPromise(result)) {\n // $FlowFixMe[incompatible-call]\n loadable = loadableWithPromise$1(result);\n } else {\n // $FlowFixMe[incompatible-call]\n loadable = loadableWithValue$1(result);\n }\n\n maybeFreezeLoadableContents(loadable);\n return [loadable, depValues];\n }\n\n function getValFromCacheAndUpdatedDownstreamDeps(store, state) {\n const depsAfterCacheDone = new Set();\n const executionInfo = getExecutionInfo(store);\n const cachedVal = cache.get(nodeKey => {\n !(typeof nodeKey === 'string') ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Cache nodeKey is type string') : Recoil_invariant(false) : void 0;\n const loadable = getCachedNodeLoadable(store, state, nodeKey);\n return loadable.contents;\n }, {\n onNodeVisit: node => {\n if (node.type === 'branch' && node.nodeKey !== key && typeof node.nodeKey === 'string') {\n depsAfterCacheDone.add(node.nodeKey);\n }\n }\n });\n /**\n * Ensure store contains correct dependencies if we hit the cache so that\n * the store deps and cache are in sync for a given state. This is important\n * because store deps are normally updated when new executions are created,\n * but cache hits don't trigger new executions but they still _may_ signifiy\n * a change in deps in the store if the store deps for this state are empty\n * or stale.\n */\n\n if (cachedVal) {\n setDepsInStore(store, state, depsAfterCacheDone, executionInfo.latestExecutionId);\n }\n\n return cachedVal;\n }\n /**\n * FIXME: dep keys should take into account the state of the loadable to\n * prevent the edge case where a loadable with an error and a loadable with\n * an error as a value are treated as the same thing incorrectly. For example\n * these two should be treated differently:\n *\n * selector({key: '', get: () => new Error('hi')});\n * selector({key: '', get () => {throw new Error('hi')}});\n *\n * With current implementation they are treated the same\n */\n\n\n function depValuesToDepRoute(depValues) {\n return Array.from(depValues.entries()).map(([key, valLoadable]) => [key, valLoadable.contents]);\n }\n\n function getValFromRunningNewExecutionAndUpdatedDeps(store, state) {\n const newExecutionId = getNewExecutionId();\n const [loadable, newDepValues] = evaluateSelectorGetter(store, state, newExecutionId);\n setExecutionInfo(loadable, store, newDepValues, newExecutionId, state);\n maybeSetCacheWithLoadable(state, depValuesToDepRoute(newDepValues), loadable);\n notifyStoreWhenAsyncSettles(store, loadable, newExecutionId);\n return loadable;\n }\n /**\n * Given a tree state, this function returns the \"selector result\", which is\n * defined as a size-2 tuple of [DependencyMap, Loadable].\n *\n * The selector's get() function will only be re-evaluated if _both_ of the\n * following statements are true:\n *\n * 1. The current dep values from the given state produced a cache key that\n * was not found in the cache.\n * 2. There is no currently running async execution OR there is an\n * async execution that is running, but after comparing the dep values in\n * the given state with the dep values that the execution has discovered so\n * far we find that at least one dep value has changed, in which case we\n * start a new execution (the previously running execution will continue to\n * run to completion, but only the new execution will be deemed the\n * 'latest' execution, meaning it will be the only execution that will\n * update global state when it is finished. Any non-latest executions will\n * run to completion and update the selector cache but not global state).\n */\n\n\n function getSelectorValAndUpdatedDeps(store, state) {\n const cachedVal = getValFromCacheAndUpdatedDownstreamDeps(store, state);\n\n if (cachedVal != null) {\n setExecutionInfo(cachedVal, store);\n return cachedVal;\n }\n\n const inProgressExecutionInfo = getExecutionInfoOfInProgressExecution(store, state); // FIXME: this won't work with custom caching b/c it uses separate cache\n\n if (inProgressExecutionInfo) {\n const executionInfo = inProgressExecutionInfo;\n notifyStoreWhenAsyncSettles(store, Recoil_nullthrows(executionInfo.latestLoadable), Recoil_nullthrows(executionInfo.latestExecutionId)); // FIXME: check after the fact to see if we made the right choice by waiting\n\n return Recoil_nullthrows(executionInfo.latestLoadable);\n }\n\n return getValFromRunningNewExecutionAndUpdatedDeps(store, state);\n }\n /**\n * Searches execution info across all stores to see if there is an in-progress\n * execution whose dependency values match the values of the requesting store.\n */\n\n\n function getExecutionInfoOfInProgressExecution(store, state) {\n var _Array$from$find;\n\n const [, executionInfo] = (_Array$from$find = Array.from(executionInfoMap.entries()).find(([, executionInfo]) => {\n return executionInfo.latestLoadable != null && executionInfo.latestExecutionId != null && !haveAsyncDepsChanged(store, state);\n })) !== null && _Array$from$find !== void 0 ? _Array$from$find : [];\n return executionInfo;\n }\n\n const mapOfCheckedVersions = new Map();\n\n function haveAsyncDepsChanged(store, state) {\n var _executionInfo$depVal, _mapOfCheckedVersions;\n\n const executionInfo = getExecutionInfo(store);\n const oldDepValues = (_executionInfo$depVal = executionInfo.depValuesDiscoveredSoFarDuringAsyncWork) !== null && _executionInfo$depVal !== void 0 ? _executionInfo$depVal : new Map();\n const cachedDepValuesCheckedForThisVersion = Array(((_mapOfCheckedVersions = mapOfCheckedVersions.get(state.version)) !== null && _mapOfCheckedVersions !== void 0 ? _mapOfCheckedVersions : new Map()).entries());\n const isCachedVersionSame = mapOfCheckedVersions.has(state.version) && cachedDepValuesCheckedForThisVersion.length === oldDepValues.size && cachedDepValuesCheckedForThisVersion.every(([nodeKey, nodeVal]) => {\n return oldDepValues.get(nodeKey) === nodeVal;\n });\n\n if (oldDepValues == null || state.version === executionInfo.stateVersion || isCachedVersionSame) {\n return false;\n }\n\n mapOfCheckedVersions.set(state.version, new Map(oldDepValues));\n return Array.from(oldDepValues).some(([nodeKey, oldVal]) => {\n const loadable = getCachedNodeLoadable(store, state, nodeKey);\n return loadable.contents !== oldVal.contents &&\n /**\n * FIXME: in the condition below we're making the assumption that a\n * dependency that goes from loading to having a value is always because\n * the dependency resolved to that value, so we don't count it as a dep\n * change as the normal retry loop will handle retrying in response to a\n * resolved async dep. This is an incorrect assumption for the edge case\n * where there is an async selector that is loading, and while it is\n * loading one of its dependencies changes, triggering a new execution,\n * and that new execution produces a value synchronously (we don't make\n * that assumption for asynchronous work b/c it's guaranteed that a\n * loadable that goes from 'loading' to 'loading' in a new loadable is\n * a dep change).\n */\n !(oldVal.state === 'loading' && loadable.state !== 'loading');\n });\n }\n /**\n * This function will update the selector's execution info when the selector\n * has either finished running an execution or has started a new execution. If\n * the given loadable is in a 'loading' state, the intention is that a new\n * execution has started. Otherwise, the intention is that an execution has\n * just finished.\n */\n\n\n function setExecutionInfo(loadable, store, depValues, newExecutionId, state) {\n const executionInfo = getExecutionInfo(store);\n\n if (loadable.state === 'loading') {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = depValues;\n executionInfo.latestExecutionId = newExecutionId;\n executionInfo.latestLoadable = loadable;\n executionInfo.stateVersion = state === null || state === void 0 ? void 0 : state.version;\n } else {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = null;\n executionInfo.latestExecutionId = null;\n executionInfo.latestLoadable = null;\n executionInfo.stateVersion = null;\n }\n }\n /**\n * Conditionally updates the cache with a given loadable.\n *\n * We only cache loadables that are not loading because our cache keys are\n * based on dep values, which are in an unfinished state for loadables that\n * have a 'loading' state (new deps may be discovered while the selector\n * runs its async code). We never want to cache partial dependencies b/c it\n * could lead to errors, such as prematurely returning the result based on a\n * partial list of deps-- we need the full list of deps to ensure that we\n * are returning the correct result from cache.\n */\n\n\n function maybeSetCacheWithLoadable(state, depRoute, loadable) {\n if (loadable.state !== 'loading') {\n setCache(state, depRoute, loadable);\n }\n }\n\n function updateExecutionInfoDepValues(depValues, store, executionId) {\n const executionInfo = getExecutionInfo(store);\n\n if (isLatestExecution(store, executionId)) {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = depValues;\n }\n }\n\n function clearExecutionInfo(store, executionId) {\n if (isLatestExecution(store, executionId)) {\n executionInfoMap.delete(store);\n }\n }\n\n function isLatestExecution(store, executionId) {\n const executionInfo = getExecutionInfo(store);\n return executionId === executionInfo.latestExecutionId;\n }\n\n function maybeFreezeLoadableContents(loadable) {\n if (loadable.state !== 'loading') {\n maybeFreezeValue(loadable.contents);\n }\n }\n\n function maybeFreezeValue(val) {\n if (process.env.NODE_ENV !== \"production\") {\n if (Boolean(options.dangerouslyAllowMutability) === false) {\n Recoil_deepFreezeValue(val);\n }\n }\n }\n\n function setCache(state, cacheRoute, loadable) {\n state.atomValues.set(key, loadable);\n cache.set(cacheRoute, loadable);\n }\n\n function detectCircularDependencies(fn) {\n if (dependencyStack.includes(key)) {\n const message = `Recoil selector has circular dependencies: ${dependencyStack.slice(dependencyStack.indexOf(key)).join(' \\u2192 ')}`;\n return loadableWithError$1(new Error(message));\n }\n\n dependencyStack.push(key);\n\n try {\n return fn();\n } finally {\n dependencyStack.pop();\n }\n }\n\n function selectorPeek(store, state) {\n const cacheVal = cache.get(nodeKey => {\n !(typeof nodeKey === 'string') ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Cache nodeKey is type string') : Recoil_invariant(false) : void 0;\n const peek = peekNodeLoadable$1(store, state, nodeKey);\n return peek === null || peek === void 0 ? void 0 : peek.contents;\n });\n return cacheVal;\n }\n\n function selectorGet(store, state) {\n return detectCircularDependencies(() => getSelectorValAndUpdatedDeps(store, state));\n }\n\n function invalidateSelector(state) {\n state.atomValues.delete(key);\n }\n\n if (set != null) {\n function selectorSet(store, state, newValue) {\n let syncSelectorSetFinished = false;\n const writes = new Map();\n\n function getRecoilValue({\n key\n }) {\n if (syncSelectorSetFinished) {\n throw new Error('Recoil: Async selector sets are not currently supported.');\n }\n\n const loadable = getCachedNodeLoadable(store, state, key);\n\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n throw new RecoilValueNotReady$2(key);\n } else {\n throw loadable.contents;\n }\n }\n\n function setRecoilState(recoilState, valueOrUpdater) {\n if (syncSelectorSetFinished) {\n throw new Error('Recoil: Async selector sets are not currently supported.');\n }\n\n const newValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict type S from being a function itself without losing support for opaque types\n // flowlint-next-line unclear-type:off\n valueOrUpdater(getRecoilValue(recoilState)) : valueOrUpdater;\n const upstreamWrites = setNodeValue$3(store, state, recoilState.key, newValue);\n upstreamWrites.forEach((v, k) => writes.set(k, v));\n }\n\n function resetRecoilState(recoilState) {\n setRecoilState(recoilState, DEFAULT_VALUE$3);\n }\n\n const ret = set({\n set: setRecoilState,\n get: getRecoilValue,\n reset: resetRecoilState\n }, newValue); // set should be a void method, but if the user makes it `async`, then it\n // will return a Promise, which we don't currently support.\n\n if (ret !== undefined) {\n throw Recoil_isPromise(ret) ? new Error('Recoil: Async selector sets are not currently supported.') : new Error('Recoil: selector set should be a void function.');\n }\n\n syncSelectorSetFinished = true;\n return writes;\n }\n\n return registerNode$1({\n key,\n peek: selectorPeek,\n get: selectorGet,\n set: selectorSet,\n init: selectorInit,\n invalidate: invalidateSelector,\n shouldDeleteConfigOnRelease: selectorShouldDeleteConfigOnRelease,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false,\n retainedBy\n });\n } else {\n return registerNode$1({\n key,\n peek: selectorPeek,\n get: selectorGet,\n init: selectorInit,\n invalidate: invalidateSelector,\n shouldDeleteConfigOnRelease: selectorShouldDeleteConfigOnRelease,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false,\n retainedBy\n });\n }\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selector = selector;\n\n// @fb-only: const {scopedAtom} = require('Recoil_ScopedAtom');\nconst {\n loadableWithError: loadableWithError$2,\n loadableWithPromise: loadableWithPromise$2,\n loadableWithValue: loadableWithValue$2\n} = Recoil_Loadable;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$4,\n DefaultValue: DefaultValue$2,\n getConfigDeletionHandler: getConfigDeletionHandler$2,\n registerNode: registerNode$2,\n setConfigDeletionHandler: setConfigDeletionHandler$1\n} = Recoil_Node;\n\nconst {\n isRecoilValue: isRecoilValue$4\n} = Recoil_RecoilValue$1;\n\nconst {\n markRecoilValueModified: markRecoilValueModified$1,\n setRecoilValue: setRecoilValue$3,\n setRecoilValueLoadable: setRecoilValueLoadable$3\n} = Recoil_RecoilValueInterface;\n\nconst {\n retainedByOptionWithDefault: retainedByOptionWithDefault$2\n} = Recoil_Retention;\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction baseAtom(options) {\n const {\n key,\n persistence_UNSTABLE: persistence\n } = options;\n const retainedBy = retainedByOptionWithDefault$2(options.retainedBy_UNSTABLE);\n let liveStoresCount = 0;\n let defaultLoadable = Recoil_isPromise(options.default) ? loadableWithPromise$2(options.default.then(value => {\n defaultLoadable = loadableWithValue$2(value); // TODO Temporary disable Flow due to pending selector_NEW refactor\n\n const promiseInfo = {\n __key: key,\n __value: value\n };\n return promiseInfo;\n }).catch(error => {\n defaultLoadable = loadableWithError$2(error);\n throw error;\n })) : loadableWithValue$2(options.default);\n let cachedAnswerForUnvalidatedValue = undefined; // Cleanup handlers for this atom\n // Rely on stable reference equality of the store to use it as a key per \n\n const cleanupEffectsByStore = new Map();\n\n function wrapPendingPromise(store, promise) {\n const wrappedPromise = promise.then(value => {\n var _store$getState$nextT, _state$atomValues$get;\n\n const state = (_store$getState$nextT = store.getState().nextTree) !== null && _store$getState$nextT !== void 0 ? _store$getState$nextT : store.getState().currentTree;\n\n if (((_state$atomValues$get = state.atomValues.get(key)) === null || _state$atomValues$get === void 0 ? void 0 : _state$atomValues$get.contents) === wrappedPromise) {\n setRecoilValue$3(store, node, value);\n }\n\n return {\n __key: key,\n __value: value\n };\n }).catch(error => {\n var _store$getState$nextT2, _state$atomValues$get2;\n\n const state = (_store$getState$nextT2 = store.getState().nextTree) !== null && _store$getState$nextT2 !== void 0 ? _store$getState$nextT2 : store.getState().currentTree;\n\n if (((_state$atomValues$get2 = state.atomValues.get(key)) === null || _state$atomValues$get2 === void 0 ? void 0 : _state$atomValues$get2.contents) === wrappedPromise) {\n setRecoilValueLoadable$3(store, node, loadableWithError$2(error));\n }\n\n throw error;\n });\n return wrappedPromise;\n }\n\n function initAtom(store, initState, trigger) {\n liveStoresCount++;\n const alreadyKnown = store.getState().knownAtoms.has(key);\n store.getState().knownAtoms.add(key); // Setup async defaults to notify subscribers when they resolve\n\n if (defaultLoadable.state === 'loading') {\n const notifyDefaultSubscribers = () => {\n var _store$getState$nextT3;\n\n const state = (_store$getState$nextT3 = store.getState().nextTree) !== null && _store$getState$nextT3 !== void 0 ? _store$getState$nextT3 : store.getState().currentTree;\n\n if (!state.atomValues.has(key)) {\n markRecoilValueModified$1(store, node);\n }\n };\n\n defaultLoadable.contents.then(notifyDefaultSubscribers).catch(notifyDefaultSubscribers);\n } // Run Atom Effects\n // This state is scoped by Store, since this is in the initAtom() closure\n\n\n let initValue = DEFAULT_VALUE$4;\n let pendingSetSelf = null;\n\n if (options.effects_UNSTABLE != null && !alreadyKnown) {\n let duringInit = true;\n\n const setSelf = effect => valueOrUpdater => {\n if (duringInit) {\n const currentValue = initValue instanceof DefaultValue$2 || Recoil_isPromise(initValue) ? defaultLoadable.state === 'hasValue' ? defaultLoadable.contents : DEFAULT_VALUE$4 : initValue;\n initValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict T from being a function without losing support for opaque types\n valueOrUpdater(currentValue) // flowlint-line unclear-type:off\n : valueOrUpdater;\n } else {\n if (Recoil_isPromise(valueOrUpdater)) {\n throw new Error('Setting atoms to async values is not implemented.');\n }\n\n if (typeof valueOrUpdater !== 'function') {\n pendingSetSelf = {\n effect,\n value: valueOrUpdater\n };\n }\n\n setRecoilValue$3(store, node, typeof valueOrUpdater === 'function' ? currentValue => {\n const newValue = // cast to any because we can't restrict T from being a function without losing support for opaque types\n valueOrUpdater(currentValue); // flowlint-line unclear-type:off\n\n pendingSetSelf = {\n effect,\n value: newValue\n };\n return newValue;\n } : valueOrUpdater);\n }\n };\n\n const resetSelf = effect => () => setSelf(effect)(DEFAULT_VALUE$4);\n\n const onSet = effect => handler => {\n store.subscribeToTransactions(currentStore => {\n var _pendingSetSelf3;\n\n // eslint-disable-next-line prefer-const\n let {\n currentTree,\n previousTree\n } = currentStore.getState();\n\n if (!previousTree) {\n Recoil_recoverableViolation('Transaction subscribers notified without a next tree being present -- this is a bug in Recoil');\n previousTree = currentTree; // attempt to trundle on\n }\n\n const newLoadable = currentTree.atomValues.get(key);\n\n if (newLoadable == null || newLoadable.state === 'hasValue') {\n var _previousTree$atomVal, _pendingSetSelf, _pendingSetSelf2;\n\n const newValue = newLoadable != null ? newLoadable.contents : DEFAULT_VALUE$4;\n const oldLoadable = (_previousTree$atomVal = previousTree.atomValues.get(key)) !== null && _previousTree$atomVal !== void 0 ? _previousTree$atomVal : defaultLoadable;\n const oldValue = oldLoadable.state === 'hasValue' ? oldLoadable.contents : DEFAULT_VALUE$4; // TODO This isn't actually valid, use as a placeholder for now.\n // Ignore atom value changes that were set via setSelf() in the same effect.\n // We will still properly call the handler if there was a subsequent\n // set from something other than an atom effect which was batched\n // with the `setSelf()` call. However, we may incorrectly ignore\n // the handler if the subsequent batched call happens to set the\n // atom to the exact same value as the `setSelf()`. But, in that\n // case, it was kind of a noop, so the semantics are debatable..\n\n if (((_pendingSetSelf = pendingSetSelf) === null || _pendingSetSelf === void 0 ? void 0 : _pendingSetSelf.effect) !== effect || ((_pendingSetSelf2 = pendingSetSelf) === null || _pendingSetSelf2 === void 0 ? void 0 : _pendingSetSelf2.value) !== newValue) {\n handler(newValue, oldValue);\n }\n }\n\n if (((_pendingSetSelf3 = pendingSetSelf) === null || _pendingSetSelf3 === void 0 ? void 0 : _pendingSetSelf3.effect) === effect) {\n pendingSetSelf = null;\n }\n }, key);\n };\n\n for (const effect of (_options$effects_UNST = options.effects_UNSTABLE) !== null && _options$effects_UNST !== void 0 ? _options$effects_UNST : []) {\n var _options$effects_UNST;\n\n const cleanup = effect({\n node,\n trigger,\n setSelf: setSelf(effect),\n resetSelf: resetSelf(effect),\n onSet: onSet(effect)\n });\n\n if (cleanup != null) {\n cleanupEffectsByStore.set(store, cleanup);\n }\n }\n\n duringInit = false;\n } // Mutate initial state in place since we know there are no other subscribers\n // since we are the ones initializing on first use.\n\n\n if (!(initValue instanceof DefaultValue$2)) {\n var _store$getState$nextT4;\n\n const initLoadable = Recoil_isPromise(initValue) ? loadableWithPromise$2(wrapPendingPromise(store, initValue)) : loadableWithValue$2(initValue);\n initState.atomValues.set(key, initLoadable); // If there is a pending transaction, then also mutate the next state tree.\n // This could happen if the atom was first initialized in an action that\n // also updated some other atom's state.\n\n (_store$getState$nextT4 = store.getState().nextTree) === null || _store$getState$nextT4 === void 0 ? void 0 : _store$getState$nextT4.atomValues.set(key, initLoadable);\n }\n\n return () => {\n var _cleanupEffectsByStor;\n\n liveStoresCount--;\n (_cleanupEffectsByStor = cleanupEffectsByStore.get(store)) === null || _cleanupEffectsByStor === void 0 ? void 0 : _cleanupEffectsByStor();\n cleanupEffectsByStore.delete(store);\n store.getState().knownAtoms.delete(key); // FIXME remove knownAtoms?\n };\n }\n\n function peekAtom(_store, state) {\n var _ref, _state$atomValues$get3, _cachedAnswerForUnval;\n\n return (_ref = (_state$atomValues$get3 = state.atomValues.get(key)) !== null && _state$atomValues$get3 !== void 0 ? _state$atomValues$get3 : (_cachedAnswerForUnval = cachedAnswerForUnvalidatedValue) === null || _cachedAnswerForUnval === void 0 ? void 0 : _cachedAnswerForUnval[1]) !== null && _ref !== void 0 ? _ref : defaultLoadable;\n }\n\n function getAtom(_store, state) {\n if (state.atomValues.has(key)) {\n // Atom value is stored in state:\n return Recoil_nullthrows(state.atomValues.get(key));\n } else if (state.nonvalidatedAtoms.has(key)) {\n // Atom value is stored but needs validation before use.\n // We might have already validated it and have a cached validated value:\n if (cachedAnswerForUnvalidatedValue != null) {\n return cachedAnswerForUnvalidatedValue;\n }\n\n if (persistence == null) {\n Recoil_expectationViolation(`Tried to restore a persisted value for atom ${key} but it has no persistence settings.`);\n return defaultLoadable;\n }\n\n const nonvalidatedValue = state.nonvalidatedAtoms.get(key);\n const validatorResult = persistence.validator(nonvalidatedValue, DEFAULT_VALUE$4);\n const validatedValueLoadable = validatorResult instanceof DefaultValue$2 ? defaultLoadable : loadableWithValue$2(validatorResult);\n cachedAnswerForUnvalidatedValue = validatedValueLoadable;\n return cachedAnswerForUnvalidatedValue;\n } else {\n return defaultLoadable;\n }\n }\n\n function invalidateAtom() {\n cachedAnswerForUnvalidatedValue = undefined;\n }\n\n function setAtom(_store, state, newValue) {\n // Bail out if we're being set to the existing value, or if we're being\n // reset but have no stored value (validated or unvalidated) to reset from:\n if (state.atomValues.has(key)) {\n const existing = Recoil_nullthrows(state.atomValues.get(key));\n\n if (existing.state === 'hasValue' && newValue === existing.contents) {\n return new Map();\n }\n } else if (!state.nonvalidatedAtoms.has(key) && newValue instanceof DefaultValue$2) {\n return new Map();\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (options.dangerouslyAllowMutability !== true) {\n Recoil_deepFreezeValue(newValue);\n }\n }\n\n cachedAnswerForUnvalidatedValue = undefined; // can be released now if it was previously in use\n\n return new Map().set(key, loadableWithValue$2(newValue));\n }\n\n function shouldDeleteConfigOnReleaseAtom() {\n return getConfigDeletionHandler$2(key) !== undefined && liveStoresCount <= 0;\n }\n\n const node = registerNode$2({\n key,\n peek: peekAtom,\n get: getAtom,\n set: setAtom,\n init: initAtom,\n invalidate: invalidateAtom,\n shouldDeleteConfigOnRelease: shouldDeleteConfigOnReleaseAtom,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n persistence_UNSTABLE: options.persistence_UNSTABLE ? {\n type: options.persistence_UNSTABLE.type,\n backButton: options.persistence_UNSTABLE.backButton\n } : undefined,\n shouldRestoreFromSnapshots: true,\n retainedBy\n });\n return node;\n} // prettier-ignore\n\n\nfunction atom(options) {\n const {\n default: optionsDefault,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n ...restOptions\n } = options;\n\n if (isRecoilValue$4(optionsDefault) // Continue to use atomWithFallback for promise defaults for scoped atoms\n // for now, since scoped atoms don't support async defaults\n // @fb-only: || (isPromise(optionsDefault) && scopeRules_APPEND_ONLY_READ_THE_DOCS)\n ) {\n return atomWithFallback({ ...restOptions,\n default: optionsDefault // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n\n }); // @fb-only: } else if (scopeRules_APPEND_ONLY_READ_THE_DOCS && !isPromise(optionsDefault)) {\n // @fb-only: return scopedAtom({\n // @fb-only: ...restOptions,\n // @fb-only: default: optionsDefault,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: });\n } else {\n return baseAtom({ ...restOptions,\n default: optionsDefault\n });\n }\n}\n\nfunction atomWithFallback(options) {\n const base = atom({ ...options,\n default: DEFAULT_VALUE$4,\n persistence_UNSTABLE: options.persistence_UNSTABLE === undefined ? undefined : { ...options.persistence_UNSTABLE,\n validator: storedValue => storedValue instanceof DefaultValue$2 ? storedValue : Recoil_nullthrows(options.persistence_UNSTABLE).validator(storedValue, DEFAULT_VALUE$4)\n },\n // TODO Hack for now.\n // flowlint-next-line unclear-type: off\n effects_UNSTABLE: options.effects_UNSTABLE\n });\n const sel = Recoil_selector({\n key: `${options.key}__withFallback`,\n get: ({\n get\n }) => {\n const baseValue = get(base);\n return baseValue instanceof DefaultValue$2 ? options.default : baseValue;\n },\n set: ({\n set\n }, newValue) => set(base, newValue),\n dangerouslyAllowMutability: options.dangerouslyAllowMutability\n });\n setConfigDeletionHandler$1(sel.key, getConfigDeletionHandler$2(options.key));\n return sel;\n}\n\nvar Recoil_atom = atom;\n\n/**\n * (c) Facebook, Inc. and its affiliates. Confidential and proprietary.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nclass MapCache {\n constructor(options) {\n var _options$mapKey;\n\n _defineProperty(this, \"_map\", void 0);\n\n _defineProperty(this, \"_keyMapper\", void 0);\n\n this._map = new Map();\n this._keyMapper = (_options$mapKey = options === null || options === void 0 ? void 0 : options.mapKey) !== null && _options$mapKey !== void 0 ? _options$mapKey : v => v;\n }\n\n size() {\n return this._map.size;\n }\n\n has(key) {\n return this._map.has(this._keyMapper(key));\n }\n\n get(key) {\n return this._map.get(this._keyMapper(key));\n }\n\n set(key, val) {\n this._map.set(this._keyMapper(key), val);\n }\n\n delete(key) {\n this._map.delete(this._keyMapper(key));\n }\n\n clear() {\n this._map.clear();\n }\n\n}\n\nvar Recoil_MapCache = {\n MapCache\n};\n\nvar Recoil_MapCache_1 = Recoil_MapCache.MapCache;\n\nvar Recoil_MapCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MapCache: Recoil_MapCache_1\n});\n\nconst {\n LRUCache: LRUCache$2\n} = Recoil_LRUCache$1;\n\nconst {\n MapCache: MapCache$1\n} = Recoil_MapCache$1;\n\nconst defaultPolicy$1 = {\n equality: 'reference',\n eviction: 'none',\n maxSize: Infinity\n};\n\nfunction cacheFromPolicy({\n equality = defaultPolicy$1.equality,\n eviction = defaultPolicy$1.eviction,\n maxSize = defaultPolicy$1.maxSize\n} = defaultPolicy$1) {\n const valueMapper = getValueMapper$1(equality);\n const cache = getCache(eviction, maxSize, valueMapper);\n return cache;\n}\n\nfunction getValueMapper$1(equality) {\n switch (equality) {\n case 'reference':\n return val => val;\n\n case 'value':\n return val => Recoil_stableStringify(val);\n }\n\n throw new Error(`Unrecognized equality policy ${equality}`);\n}\n\nfunction getCache(eviction, maxSize, mapKey) {\n switch (eviction) {\n case 'none':\n return new MapCache$1({\n mapKey\n });\n\n case 'lru':\n return new LRUCache$2({\n mapKey,\n maxSize: Recoil_nullthrows(maxSize)\n });\n }\n\n throw new Error(`Unrecognized eviction policy ${eviction}`);\n}\n\nvar Recoil_cacheFromPolicy = cacheFromPolicy;\n\nconst {\n setConfigDeletionHandler: setConfigDeletionHandler$2\n} = Recoil_Node;\n\n\n\n // Keep in mind the parameter needs to be serializable as a cahche key\n// using Recoil_stableStringify\n\n\n// Add a unique index to each selector in case the cache implementation allows\n// duplicate keys based on equivalent stringified parameters\nlet nextIndex = 0;\n/* eslint-disable no-redeclare */\n\n// Return a function that returns members of a family of selectors of the same type\n// E.g.,\n//\n// const s = selectorFamily(...);\n// s({a: 1}) => a selector\n// s({a: 2}) => a different selector\n//\n// By default, the selectors are distinguished by distinct values of the\n// parameter based on value equality, not reference equality. This allows using\n// object literals or other equivalent objects at callsites to not create\n// duplicate cache entries. This behavior may be overridden with the\n// cacheImplementationForParams option.\nfunction selectorFamily(options) {\n var _options$cachePolicyF;\n\n const selectorCache = Recoil_cacheFromPolicy((_options$cachePolicyF = options.cachePolicyForParams_UNSTABLE) !== null && _options$cachePolicyF !== void 0 ? _options$cachePolicyF : {\n equality: 'value',\n eviction: 'none'\n });\n return params => {\n var _stableStringify;\n\n const cachedSelector = selectorCache.get(params);\n\n if (cachedSelector != null) {\n return cachedSelector;\n }\n\n const myKey = `${options.key}__selectorFamily/${(_stableStringify = Recoil_stableStringify(params, {\n // It is possible to use functions in parameters if the user uses\n // a cache with reference equality thanks to the incrementing index.\n allowFunctions: true\n })) !== null && _stableStringify !== void 0 ? _stableStringify : 'void'}/${nextIndex++}`; // Append index in case values serialize to the same key string\n\n const myGet = callbacks => options.get(params)(callbacks);\n\n const myCachePolicy = options.cachePolicy_UNSTABLE;\n const retainedBy = typeof options.retainedBy_UNSTABLE === 'function' ? options.retainedBy_UNSTABLE(params) : options.retainedBy_UNSTABLE;\n let newSelector;\n\n if (options.set != null) {\n const set = options.set;\n\n const mySet = (callbacks, newValue) => set(params)(callbacks, newValue);\n\n newSelector = Recoil_selector({\n key: myKey,\n get: myGet,\n set: mySet,\n cachePolicy_UNSTABLE: myCachePolicy,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: retainedBy\n });\n } else {\n newSelector = Recoil_selector({\n key: myKey,\n get: myGet,\n cachePolicy_UNSTABLE: myCachePolicy,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: retainedBy\n });\n }\n\n selectorCache.set(params, newSelector);\n setConfigDeletionHandler$2(newSelector.key, () => {\n selectorCache.delete(params);\n });\n return newSelector;\n };\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selectorFamily = selectorFamily;\n\n// @fb-only: const {parameterizedScopedAtomLegacy} = require('Recoil_ScopedAtom');\n\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$5,\n DefaultValue: DefaultValue$3,\n setConfigDeletionHandler: setConfigDeletionHandler$3\n} = Recoil_Node;\n/*\nA function which returns an atom based on the input parameter.\n\nEach unique parameter returns a unique atom. E.g.,\n\n const f = atomFamily(...);\n f({a: 1}) => an atom\n f({a: 2}) => a different atom\n\nThis allows components to persist local, private state using atoms. Each\ninstance of the component may have a different key, which it uses as the\nparameter for a family of atoms; in this way, each component will have\nits own atom not shared by other instances. These state keys may be composed\ninto children's state keys as well.\n*/\n\n\nfunction atomFamily(options) {\n var _options$cachePolicyF;\n\n const atomCache = Recoil_cacheFromPolicy((_options$cachePolicyF = options.cachePolicyForParams_UNSTABLE) !== null && _options$cachePolicyF !== void 0 ? _options$cachePolicyF : {\n equality: 'value',\n eviction: 'none'\n }); // An atom to represent any legacy atoms that we can upgrade to an atomFamily\n\n const legacyAtomOptions = {\n key: options.key,\n // Legacy atoms just used the plain key directly\n default: DEFAULT_VALUE$5,\n persistence_UNSTABLE: options.persistence_UNSTABLE\n };\n let legacyAtom; // prettier-ignore\n // @fb-only: if (\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS\n // @fb-only: ) {\n // @fb-only: legacyAtom = parameterizedScopedAtomLegacy({\n // @fb-only: ...legacyAtomOptions,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS:\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: });\n // @fb-only: } else {\n\n legacyAtom = Recoil_atom(legacyAtomOptions); // @fb-only: }\n // Selector to calculate the default value based on any persisted legacy atoms\n // that were upgraded to a atomFamily\n\n const atomFamilyDefault = Recoil_selectorFamily({\n key: `${options.key}__atomFamily/Default`,\n get: param => ({\n get\n }) => {\n const legacyValue = get(typeof legacyAtom === 'function' ? legacyAtom(param) : legacyAtom); // Atom was upgraded from a non-parameterized atom\n\n if (!(legacyValue instanceof DefaultValue$3)) {\n return legacyValue;\n } // There's no legacy atom value, so use the user-specified default\n\n\n return typeof options.default === 'function' ? // The default was parameterized\n // Flow doesn't know that T isn't a function, so we need to case to any\n options.default(param) // flowlint-line unclear-type:off\n : // Default may be a static value, promise, or RecoilValue\n options.default;\n },\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: options.retainedBy_UNSTABLE\n }); // Simple atomFamily implementation to cache individual atoms based\n // on the parameter value equality.\n\n return params => {\n var _stableStringify;\n\n const cachedAtom = atomCache.get(params);\n\n if (cachedAtom != null) {\n return cachedAtom;\n }\n\n const {\n cachePolicyForParams_UNSTABLE,\n ...atomOptions\n } = options;\n const newAtom = Recoil_atom({ ...atomOptions,\n key: `${options.key}__${(_stableStringify = Recoil_stableStringify(params)) !== null && _stableStringify !== void 0 ? _stableStringify : 'void'}`,\n default: atomFamilyDefault(params),\n retainedBy_UNSTABLE: typeof options.retainedBy_UNSTABLE === 'function' ? options.retainedBy_UNSTABLE(params) : options.retainedBy_UNSTABLE,\n effects_UNSTABLE: typeof options.effects_UNSTABLE === 'function' ? options.effects_UNSTABLE(params) : options.effects_UNSTABLE // prettier-ignore\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS: mapScopeRules(\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: params,\n // @fb-only: ),\n\n });\n atomCache.set(params, newAtom);\n setConfigDeletionHandler$3(newAtom.key, () => {\n atomCache.delete(params);\n });\n return newAtom;\n };\n}\n\nvar Recoil_atomFamily = atomFamily;\n\n// flowlint-next-line unclear-type:off\n\n\nconst constantSelector = Recoil_selectorFamily({\n key: '__constant',\n get: constant => () => constant,\n cachePolicyForParams_UNSTABLE: {\n equality: 'reference'\n }\n}); // Function that returns a selector which always produces the\n// same constant value. It may be called multiple times with the\n// same value, based on reference equality, and will provide the\n// same selector.\n\nfunction constSelector(constant) {\n return constantSelector(constant);\n}\n\nvar Recoil_constSelector = constSelector;\n\n// flowlint-next-line unclear-type:off\n\n\nconst throwingSelector = Recoil_selectorFamily({\n key: '__error',\n get: message => () => {\n throw new Error(message);\n },\n cachePolicyForParams_UNSTABLE: {\n equality: 'reference'\n }\n}); // Function that returns a selector which always throws an error\n// with the provided message.\n\nfunction errorSelector(message) {\n return throwingSelector(message);\n}\n\nvar Recoil_errorSelector = errorSelector;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Wraps another recoil value and prevents writing to it.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction readOnlySelector(atom) {\n // flowlint-next-line unclear-type: off\n return atom;\n}\n\nvar Recoil_readOnlySelector = readOnlySelector;\n\nconst {\n loadableWithError: loadableWithError$3,\n loadableWithPromise: loadableWithPromise$3,\n loadableWithValue: loadableWithValue$3\n} = Recoil_Loadable;\n\n\n\n /////////////////\n// TRUTH TABLE\n/////////////////\n// Dependencies waitForNone waitForAny waitForAll waitForAllSettled\n// [loading, loading] [Promise, Promise] Promise Promise Promise\n// [value, loading] [value, Promise] [value, Promise] Promise Promise\n// [value, value] [value, value] [value, value] [value, value] [value, value]\n//\n// [error, loading] [Error, Promise] [Error, Promise] Error Promise\n// [error, error] [Error, Error] [Error, Error] Error [error, error]\n// [value, error] [value, Error] [value, Error] Error [value, error]\n// Issue parallel requests for all dependencies and return the current\n// status if they have results, have some error, or are still pending.\n\n\nfunction concurrentRequests(getRecoilValue, deps) {\n const results = Array(deps.length).fill(undefined);\n const exceptions = Array(deps.length).fill(undefined);\n\n for (const [i, dep] of deps.entries()) {\n try {\n results[i] = getRecoilValue(dep);\n } catch (e) {\n // exceptions can either be Promises of pending results or real errors\n exceptions[i] = e;\n }\n }\n\n return [results, exceptions];\n}\n\nfunction isError(exp) {\n return exp != null && !Recoil_isPromise(exp);\n}\n\nfunction unwrapDependencies(dependencies) {\n return Array.isArray(dependencies) ? dependencies : Object.getOwnPropertyNames(dependencies).map(key => dependencies[key]);\n}\n\nfunction getValueFromLoadablePromiseResult(result) {\n if (result != null && typeof result === 'object' && result.hasOwnProperty('__value')) {\n return result.__value;\n }\n\n return result;\n}\n\nfunction wrapResults(dependencies, results) {\n return Array.isArray(dependencies) ? results : // Object.getOwnPropertyNames() has consistent key ordering with ES6\n Object.getOwnPropertyNames(dependencies).reduce((out, key, idx) => ({ ...out,\n [key]: results[idx]\n }), {});\n}\n\nfunction wrapLoadables(dependencies, results, exceptions) {\n const output = exceptions.map((exception, idx) => exception == null ? loadableWithValue$3(results[idx]) : Recoil_isPromise(exception) ? loadableWithPromise$3(exception) : loadableWithError$3(exception));\n return wrapResults(dependencies, output);\n}\n\nfunction combineAsyncResultsWithSyncResults(syncResults, asyncResults) {\n return asyncResults.map((result, idx) =>\n /**\n * it's important we use === undefined as opposed to == null, because the\n * resolved value of the async promise could be `null`, in which case we\n * don't want to use syncResults[idx], which would be undefined. If async\n * promise resolves to `undefined`, that's ok because `syncResults[idx]`\n * will also be `undefined`. That's a little hacky, but it works.\n */\n result === undefined ? syncResults[idx] : result);\n} // Selector that requests all dependencies in parallel and immediately returns\n// current results without waiting.\n\n\nconst waitForNone = Recoil_selectorFamily({\n key: '__waitForNone',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // Always return the current status of the results; never block.\n\n return wrapLoadables(dependencies, results, exceptions);\n }\n}); // Selector that requests all dependencies in parallel and waits for at least\n// one to be available before returning results. It will only error if all\n// dependencies have errors.\n\nconst waitForAny = Recoil_selectorFamily({\n key: '__waitForAny',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If any results are available, value or error, return the current status\n\n if (exceptions.some(exp => !Recoil_isPromise(exp))) {\n return wrapLoadables(dependencies, results, exceptions);\n } // Otherwise, return a promise that will resolve when the next result is\n // available, whichever one happens to be next. But, if all pending\n // dependencies end up with errors, then reject the promise.\n\n\n return new Promise(resolve => {\n for (const [i, exp] of exceptions.entries()) {\n if (Recoil_isPromise(exp)) {\n exp.then(result => {\n results[i] = getValueFromLoadablePromiseResult(result);\n exceptions[i] = undefined;\n resolve(wrapLoadables(dependencies, results, exceptions));\n }).catch(error => {\n exceptions[i] = error;\n resolve(wrapLoadables(dependencies, results, exceptions));\n });\n }\n }\n });\n }\n}); // Selector that requests all dependencies in parallel and waits for all to be\n// available before returning a value. It will error if any dependencies error.\n\nconst waitForAll = Recoil_selectorFamily({\n key: '__waitForAll',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If all results are available, return the results\n\n if (exceptions.every(exp => exp == null)) {\n return wrapResults(dependencies, results);\n } // If we have any errors, throw the first error\n\n\n const error = exceptions.find(isError);\n\n if (error != null) {\n throw error;\n } // Otherwise, return a promise that will resolve when all results are available\n\n\n return Promise.all(exceptions).then(exceptionResults => wrapResults(dependencies, combineAsyncResultsWithSyncResults(results, exceptionResults).map(getValueFromLoadablePromiseResult)));\n }\n});\nconst waitForAllSettled = Recoil_selectorFamily({\n key: '__waitForAllSettled',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If all results are available, return the results\n\n if (exceptions.every(exp => !Recoil_isPromise(exp))) {\n return wrapLoadables(dependencies, results, exceptions);\n } // Wait for all results to settle\n\n\n return Promise.all(exceptions.map((exp, i) => Recoil_isPromise(exp) ? exp.then(result => {\n results[i] = getValueFromLoadablePromiseResult(result);\n exceptions[i] = undefined;\n }).catch(error => {\n results[i] = undefined;\n exceptions[i] = error;\n }) : null)) // Then wrap them as loadables\n .then(() => wrapLoadables(dependencies, results, exceptions));\n }\n});\nconst noWait = Recoil_selectorFamily({\n key: '__noWait',\n get: dependency => ({\n get\n }) => {\n try {\n return loadableWithValue$3(get(dependency));\n } catch (exception) {\n return Recoil_isPromise(exception) ? loadableWithPromise$3(exception) : loadableWithError$3(exception);\n }\n }\n});\nvar Recoil_WaitFor = {\n waitForNone,\n waitForAny,\n waitForAll,\n waitForAllSettled,\n noWait\n};\n\nconst {\n batchUpdates: batchUpdates$3,\n setBatcher: setBatcher$1\n} = Recoil_Batching;\n\nconst {\n DefaultValue: DefaultValue$4\n} = Recoil_Node;\n\nconst {\n RecoilRoot: RecoilRoot$2\n} = Recoil_RecoilRoot_react;\n\nconst {\n isRecoilValue: isRecoilValue$5\n} = Recoil_RecoilValue$1;\n\nconst {\n retentionZone: retentionZone$1\n} = Recoil_RetentionZone;\n\nconst {\n freshSnapshot: freshSnapshot$2\n} = Recoil_Snapshot$1;\n\nconst {\n useGotoRecoilSnapshot: useGotoRecoilSnapshot$1,\n useRecoilCallback: useRecoilCallback$1,\n useRecoilSnapshot: useRecoilSnapshot$1,\n useRecoilState: useRecoilState$1,\n useRecoilStateLoadable: useRecoilStateLoadable$1,\n useRecoilTransactionObserver: useRecoilTransactionObserver$1,\n useRecoilValue: useRecoilValue$1,\n useRecoilValueLoadable: useRecoilValueLoadable$1,\n useResetRecoilState: useResetRecoilState$1,\n useRetain: useRetain$1,\n useSetRecoilState: useSetRecoilState$1,\n useSetUnvalidatedAtomValues: useSetUnvalidatedAtomValues$1,\n useTransactionObservation_DEPRECATED: useTransactionObservation_DEPRECATED$1\n} = Recoil_Hooks;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n noWait: noWait$1,\n waitForAll: waitForAll$1,\n waitForAllSettled: waitForAllSettled$1,\n waitForAny: waitForAny$1,\n waitForNone: waitForNone$1\n} = Recoil_WaitFor;\n\nvar Recoil_index = {\n // Types\n DefaultValue: DefaultValue$4,\n // Components\n RecoilRoot: RecoilRoot$2,\n useRecoilBridgeAcrossReactRoots_UNSTABLE: Recoil_useRecoilBridgeAcrossReactRoots,\n // RecoilValues\n atom: Recoil_atom,\n selector: Recoil_selector,\n // Other factories\n retentionZone: retentionZone$1,\n // Convenience RecoilValues\n atomFamily: Recoil_atomFamily,\n selectorFamily: Recoil_selectorFamily,\n constSelector: Recoil_constSelector,\n errorSelector: Recoil_errorSelector,\n readOnlySelector: Recoil_readOnlySelector,\n // Hooks that accept RecoilValues\n useRecoilValue: useRecoilValue$1,\n useRecoilValueLoadable: useRecoilValueLoadable$1,\n useRecoilState: useRecoilState$1,\n useRecoilStateLoadable: useRecoilStateLoadable$1,\n useSetRecoilState: useSetRecoilState$1,\n useResetRecoilState: useResetRecoilState$1,\n useGetRecoilValueInfo_UNSTABLE: Recoil_useGetRecoilValueInfo,\n useRetain: useRetain$1,\n // Hooks for asynchronous Recoil\n useRecoilCallback: useRecoilCallback$1,\n // Hooks for Snapshots\n useGotoRecoilSnapshot: useGotoRecoilSnapshot$1,\n useRecoilSnapshot: useRecoilSnapshot$1,\n useRecoilTransactionObserver_UNSTABLE: useRecoilTransactionObserver$1,\n useTransactionObservation_UNSTABLE: useTransactionObservation_DEPRECATED$1,\n useSetUnvalidatedAtomValues_UNSTABLE: useSetUnvalidatedAtomValues$1,\n // Concurrency Helpers\n noWait: noWait$1,\n waitForNone: waitForNone$1,\n waitForAny: waitForAny$1,\n waitForAll: waitForAll$1,\n waitForAllSettled: waitForAllSettled$1,\n // Other functions\n isRecoilValue: isRecoilValue$5,\n // Batching\n batchUpdates: batchUpdates$3,\n setBatcher: setBatcher$1,\n // Snapshot Utils\n snapshot_UNSTABLE: freshSnapshot$2\n};\nvar Recoil_index_1 = Recoil_index.DefaultValue;\nvar Recoil_index_2 = Recoil_index.RecoilRoot;\nvar Recoil_index_3 = Recoil_index.useRecoilBridgeAcrossReactRoots_UNSTABLE;\nvar Recoil_index_4 = Recoil_index.atom;\nvar Recoil_index_5 = Recoil_index.selector;\nvar Recoil_index_6 = Recoil_index.retentionZone;\nvar Recoil_index_7 = Recoil_index.atomFamily;\nvar Recoil_index_8 = Recoil_index.selectorFamily;\nvar Recoil_index_9 = Recoil_index.constSelector;\nvar Recoil_index_10 = Recoil_index.errorSelector;\nvar Recoil_index_11 = Recoil_index.readOnlySelector;\nvar Recoil_index_12 = Recoil_index.useRecoilValue;\nvar Recoil_index_13 = Recoil_index.useRecoilValueLoadable;\nvar Recoil_index_14 = Recoil_index.useRecoilState;\nvar Recoil_index_15 = Recoil_index.useRecoilStateLoadable;\nvar Recoil_index_16 = Recoil_index.useSetRecoilState;\nvar Recoil_index_17 = Recoil_index.useResetRecoilState;\nvar Recoil_index_18 = Recoil_index.useGetRecoilValueInfo_UNSTABLE;\nvar Recoil_index_19 = Recoil_index.useRetain;\nvar Recoil_index_20 = Recoil_index.useRecoilCallback;\nvar Recoil_index_21 = Recoil_index.useGotoRecoilSnapshot;\nvar Recoil_index_22 = Recoil_index.useRecoilSnapshot;\nvar Recoil_index_23 = Recoil_index.useRecoilTransactionObserver_UNSTABLE;\nvar Recoil_index_24 = Recoil_index.useTransactionObservation_UNSTABLE;\nvar Recoil_index_25 = Recoil_index.useSetUnvalidatedAtomValues_UNSTABLE;\nvar Recoil_index_26 = Recoil_index.noWait;\nvar Recoil_index_27 = Recoil_index.waitForNone;\nvar Recoil_index_28 = Recoil_index.waitForAny;\nvar Recoil_index_29 = Recoil_index.waitForAll;\nvar Recoil_index_30 = Recoil_index.waitForAllSettled;\nvar Recoil_index_31 = Recoil_index.isRecoilValue;\nvar Recoil_index_32 = Recoil_index.batchUpdates;\nvar Recoil_index_33 = Recoil_index.setBatcher;\nvar Recoil_index_34 = Recoil_index.snapshot_UNSTABLE;\n\nexport default Recoil_index;\nexport { Recoil_index_1 as DefaultValue, Recoil_index_2 as RecoilRoot, Recoil_index_4 as atom, Recoil_index_7 as atomFamily, Recoil_index_32 as batchUpdates, Recoil_index_9 as constSelector, Recoil_index_10 as errorSelector, Recoil_index_31 as isRecoilValue, Recoil_index_26 as noWait, Recoil_index_11 as readOnlySelector, Recoil_index_6 as retentionZone, Recoil_index_5 as selector, Recoil_index_8 as selectorFamily, Recoil_index_33 as setBatcher, Recoil_index_34 as snapshot_UNSTABLE, Recoil_index_18 as useGetRecoilValueInfo_UNSTABLE, Recoil_index_21 as useGotoRecoilSnapshot, Recoil_index_3 as useRecoilBridgeAcrossReactRoots_UNSTABLE, Recoil_index_20 as useRecoilCallback, Recoil_index_22 as useRecoilSnapshot, Recoil_index_14 as useRecoilState, Recoil_index_15 as useRecoilStateLoadable, Recoil_index_23 as useRecoilTransactionObserver_UNSTABLE, Recoil_index_12 as useRecoilValue, Recoil_index_13 as useRecoilValueLoadable, Recoil_index_17 as useResetRecoilState, Recoil_index_19 as useRetain, Recoil_index_16 as useSetRecoilState, Recoil_index_25 as useSetUnvalidatedAtomValues_UNSTABLE, Recoil_index_24 as useTransactionObservation_UNSTABLE, Recoil_index_29 as waitForAll, Recoil_index_30 as waitForAllSettled, Recoil_index_28 as waitForAny, Recoil_index_27 as waitForNone };\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useNotify = exports.useMediaUiTheme = exports.useMediaUi = exports.useIntl = exports.createUseMediaUiStyles = exports.NotifyProvider = exports.MediaUiThemeProvider = exports.MediaUiProvider = exports.IntlProvider = exports.Helper = exports.Events = exports.Components = void 0;\nvar provider_1 = require(\"./provider\");\nObject.defineProperty(exports, \"IntlProvider\", { enumerable: true, get: function () { return provider_1.IntlProvider; } });\nObject.defineProperty(exports, \"MediaUiProvider\", { enumerable: true, get: function () { return provider_1.MediaUiProvider; } });\nObject.defineProperty(exports, \"MediaUiThemeProvider\", { enumerable: true, get: function () { return provider_1.MediaUiThemeProvider; } });\nObject.defineProperty(exports, \"NotifyProvider\", { enumerable: true, get: function () { return provider_1.NotifyProvider; } });\nObject.defineProperty(exports, \"createUseMediaUiStyles\", { enumerable: true, get: function () { return provider_1.createUseMediaUiStyles; } });\nObject.defineProperty(exports, \"useIntl\", { enumerable: true, get: function () { return provider_1.useIntl; } });\nObject.defineProperty(exports, \"useMediaUi\", { enumerable: true, get: function () { return provider_1.useMediaUi; } });\nObject.defineProperty(exports, \"useMediaUiTheme\", { enumerable: true, get: function () { return provider_1.useMediaUiTheme; } });\nObject.defineProperty(exports, \"useNotify\", { enumerable: true, get: function () { return provider_1.useNotify; } });\nvar Events = __importStar(require(\"./events\"));\nexports.Events = Events;\nvar Components = __importStar(require(\"./components\"));\nexports.Components = Components;\nvar Helper = __importStar(require(\"./helper\"));\nexports.Helper = Helper;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useUpdateTag = exports.useUpdateAssetCollection = exports.useUpdateAsset = exports.useUntagAsset = exports.useTagsQuery = exports.useSetAssetTags = exports.useSetAssetCollections = exports.useSelectedTag = exports.useSelectedAssetCollection = exports.useSelectedAsset = exports.useSelectTag = exports.useSelectAssetSource = exports.useSelectAssetCollection = exports.useSelectAsset = exports.useImportAsset = exports.useEvent = exports.useDeleteTag = exports.useDeleteAssetCollection = exports.useDeleteAsset = exports.useCreateTag = exports.useCreateAssetCollection = exports.useConfigQuery = exports.useAssetsQuery = exports.useAssetSourcesQuery = exports.useAssetQuery = exports.useAssetCountQuery = exports.useAssetCollectionsQuery = void 0;\nvar useAssetCollectionsQuery_1 = __importDefault(require(\"./useAssetCollectionsQuery\"));\nexports.useAssetCollectionsQuery = useAssetCollectionsQuery_1.default;\nvar useAssetCountQuery_1 = __importDefault(require(\"./useAssetCountQuery\"));\nexports.useAssetCountQuery = useAssetCountQuery_1.default;\nvar useAssetQuery_1 = __importDefault(require(\"./useAssetQuery\"));\nexports.useAssetQuery = useAssetQuery_1.default;\nvar useAssetSourcesQuery_1 = __importDefault(require(\"./useAssetSourcesQuery\"));\nexports.useAssetSourcesQuery = useAssetSourcesQuery_1.default;\nvar useAssetsQuery_1 = __importDefault(require(\"./useAssetsQuery\"));\nexports.useAssetsQuery = useAssetsQuery_1.default;\nvar useConfigQuery_1 = __importDefault(require(\"./useConfigQuery\"));\nexports.useConfigQuery = useConfigQuery_1.default;\nvar useCreateAssetCollection_1 = __importDefault(require(\"./useCreateAssetCollection\"));\nexports.useCreateAssetCollection = useCreateAssetCollection_1.default;\nvar useCreateTag_1 = __importDefault(require(\"./useCreateTag\"));\nexports.useCreateTag = useCreateTag_1.default;\nvar useDeleteAsset_1 = __importDefault(require(\"./useDeleteAsset\"));\nexports.useDeleteAsset = useDeleteAsset_1.default;\nvar useDeleteAssetCollection_1 = __importDefault(require(\"./useDeleteAssetCollection\"));\nexports.useDeleteAssetCollection = useDeleteAssetCollection_1.default;\nvar useDeleteTag_1 = __importDefault(require(\"./useDeleteTag\"));\nexports.useDeleteTag = useDeleteTag_1.default;\nvar useEvent_1 = __importDefault(require(\"./useEvent\"));\nexports.useEvent = useEvent_1.default;\nvar useImportAsset_1 = __importDefault(require(\"./useImportAsset\"));\nexports.useImportAsset = useImportAsset_1.default;\nvar useSelectAsset_1 = __importDefault(require(\"./useSelectAsset\"));\nexports.useSelectAsset = useSelectAsset_1.default;\nvar useSelectAssetCollection_1 = __importDefault(require(\"./useSelectAssetCollection\"));\nexports.useSelectAssetCollection = useSelectAssetCollection_1.default;\nvar useSelectAssetSource_1 = __importDefault(require(\"./useSelectAssetSource\"));\nexports.useSelectAssetSource = useSelectAssetSource_1.default;\nvar useSelectTag_1 = __importDefault(require(\"./useSelectTag\"));\nexports.useSelectTag = useSelectTag_1.default;\nvar useSelectedAsset_1 = __importDefault(require(\"./useSelectedAsset\"));\nexports.useSelectedAsset = useSelectedAsset_1.default;\nvar useSelectedAssetCollection_1 = __importDefault(require(\"./useSelectedAssetCollection\"));\nexports.useSelectedAssetCollection = useSelectedAssetCollection_1.default;\nvar useSelectedTag_1 = __importDefault(require(\"./useSelectedTag\"));\nexports.useSelectedTag = useSelectedTag_1.default;\nvar useSetAssetCollections_1 = __importDefault(require(\"./useSetAssetCollections\"));\nexports.useSetAssetCollections = useSetAssetCollections_1.default;\nvar useSetAssetTags_1 = __importDefault(require(\"./useSetAssetTags\"));\nexports.useSetAssetTags = useSetAssetTags_1.default;\nvar useTagsQuery_1 = __importDefault(require(\"./useTagsQuery\"));\nexports.useTagsQuery = useTagsQuery_1.default;\nvar useUntagAsset_1 = __importDefault(require(\"./useUntagAsset\"));\nexports.useUntagAsset = useUntagAsset_1.default;\nvar useUpdateAsset_1 = __importDefault(require(\"./useUpdateAsset\"));\nexports.useUpdateAsset = useUpdateAsset_1.default;\nvar useUpdateAssetCollection_1 = __importDefault(require(\"./useUpdateAssetCollection\"));\nexports.useUpdateAssetCollection = useUpdateAssetCollection_1.default;\nvar useUpdateTag_1 = __importDefault(require(\"./useUpdateTag\"));\nexports.useUpdateTag = useUpdateTag_1.default;\n","import { isReference, isField, DeepMerger, resultKeyNameFromField, shouldInclude, } from \"../../utilities/index.js\";\nexport var hasOwn = Object.prototype.hasOwnProperty;\nexport function getTypenameFromStoreObject(store, objectOrReference) {\n return isReference(objectOrReference)\n ? store.get(objectOrReference.__ref, \"__typename\")\n : objectOrReference && objectOrReference.__typename;\n}\nexport var TypeOrFieldNameRegExp = /^[_a-z][_0-9a-z]*/i;\nexport function fieldNameFromStoreName(storeFieldName) {\n var match = storeFieldName.match(TypeOrFieldNameRegExp);\n return match ? match[0] : storeFieldName;\n}\nexport function selectionSetMatchesResult(selectionSet, result, variables) {\n if (result && typeof result === \"object\") {\n return Array.isArray(result)\n ? result.every(function (item) { return selectionSetMatchesResult(selectionSet, item, variables); })\n : selectionSet.selections.every(function (field) {\n if (isField(field) && shouldInclude(field, variables)) {\n var key = resultKeyNameFromField(field);\n return hasOwn.call(result, key) &&\n (!field.selectionSet ||\n selectionSetMatchesResult(field.selectionSet, result[key], variables));\n }\n return true;\n });\n }\n return false;\n}\nexport function storeValueIsStoreObject(value) {\n return value !== null &&\n typeof value === \"object\" &&\n !isReference(value) &&\n !Array.isArray(value);\n}\nexport function makeProcessedFieldsMerger() {\n return new DeepMerger;\n}\n//# sourceMappingURL=helpers.js.map","var _a = Object.prototype, toString = _a.toString, hasOwnProperty = _a.hasOwnProperty;\r\nvar fnToStr = Function.prototype.toString;\r\nvar previousComparisons = new Map();\r\n/**\r\n * Performs a deep equality check on two JavaScript values, tolerating cycles.\r\n */\r\nfunction equal(a, b) {\r\n try {\r\n return check(a, b);\r\n }\r\n finally {\r\n previousComparisons.clear();\r\n }\r\n}\r\nfunction check(a, b) {\r\n // If the two values are strictly equal, our job is easy.\r\n if (a === b) {\r\n return true;\r\n }\r\n // Object.prototype.toString returns a representation of the runtime type of\r\n // the given value that is considerably more precise than typeof.\r\n var aTag = toString.call(a);\r\n var bTag = toString.call(b);\r\n // If the runtime types of a and b are different, they could maybe be equal\r\n // under some interpretation of equality, but for simplicity and performance\r\n // we just return false instead.\r\n if (aTag !== bTag) {\r\n return false;\r\n }\r\n switch (aTag) {\r\n case '[object Array]':\r\n // Arrays are a lot like other objects, but we can cheaply compare their\r\n // lengths as a short-cut before comparing their elements.\r\n if (a.length !== b.length)\r\n return false;\r\n // Fall through to object case...\r\n case '[object Object]': {\r\n if (previouslyCompared(a, b))\r\n return true;\r\n var aKeys = definedKeys(a);\r\n var bKeys = definedKeys(b);\r\n // If `a` and `b` have a different number of enumerable keys, they\r\n // must be different.\r\n var keyCount = aKeys.length;\r\n if (keyCount !== bKeys.length)\r\n return false;\r\n // Now make sure they have the same keys.\r\n for (var k = 0; k < keyCount; ++k) {\r\n if (!hasOwnProperty.call(b, aKeys[k])) {\r\n return false;\r\n }\r\n }\r\n // Finally, check deep equality of all child properties.\r\n for (var k = 0; k < keyCount; ++k) {\r\n var key = aKeys[k];\r\n if (!check(a[key], b[key])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n case '[object Error]':\r\n return a.name === b.name && a.message === b.message;\r\n case '[object Number]':\r\n // Handle NaN, which is !== itself.\r\n if (a !== a)\r\n return b !== b;\r\n // Fall through to shared +a === +b case...\r\n case '[object Boolean]':\r\n case '[object Date]':\r\n return +a === +b;\r\n case '[object RegExp]':\r\n case '[object String]':\r\n return a == \"\" + b;\r\n case '[object Map]':\r\n case '[object Set]': {\r\n if (a.size !== b.size)\r\n return false;\r\n if (previouslyCompared(a, b))\r\n return true;\r\n var aIterator = a.entries();\r\n var isMap = aTag === '[object Map]';\r\n while (true) {\r\n var info = aIterator.next();\r\n if (info.done)\r\n break;\r\n // If a instanceof Set, aValue === aKey.\r\n var _a = info.value, aKey = _a[0], aValue = _a[1];\r\n // So this works the same way for both Set and Map.\r\n if (!b.has(aKey)) {\r\n return false;\r\n }\r\n // However, we care about deep equality of values only when dealing\r\n // with Map structures.\r\n if (isMap && !check(aValue, b.get(aKey))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n case '[object AsyncFunction]':\r\n case '[object GeneratorFunction]':\r\n case '[object AsyncGeneratorFunction]':\r\n case '[object Function]': {\r\n var aCode = fnToStr.call(a);\r\n if (aCode !== fnToStr.call(b)) {\r\n return false;\r\n }\r\n // We consider non-native functions equal if they have the same code\r\n // (native functions require === because their code is censored).\r\n // Note that this behavior is not entirely sound, since !== function\r\n // objects with the same code can behave differently depending on\r\n // their closure scope. However, any function can behave differently\r\n // depending on the values of its input arguments (including this)\r\n // and its calling context (including its closure scope), even\r\n // though the function object is === to itself; and it is entirely\r\n // possible for functions that are not === to behave exactly the\r\n // same under all conceivable circumstances. Because none of these\r\n // factors are statically decidable in JavaScript, JS function\r\n // equality is not well-defined. This ambiguity allows us to\r\n // consider the best possible heuristic among various imperfect\r\n // options, and equating non-native functions that have the same\r\n // code has enormous practical benefits, such as when comparing\r\n // functions that are repeatedly passed as fresh function\r\n // expressions within objects that are otherwise deeply equal. Since\r\n // any function created from the same syntactic expression (in the\r\n // same code location) will always stringify to the same code\r\n // according to fnToStr.call, we can reasonably expect these\r\n // repeatedly passed function expressions to have the same code, and\r\n // thus behave \"the same\" (with all the caveats mentioned above),\r\n // even though the runtime function objects are !== to one another.\r\n return !endsWith(aCode, nativeCodeSuffix);\r\n }\r\n }\r\n // Otherwise the values are not equal.\r\n return false;\r\n}\r\nfunction definedKeys(obj) {\r\n // Remember that the second argument to Array.prototype.filter will be\r\n // used as `this` within the callback function.\r\n return Object.keys(obj).filter(isDefinedKey, obj);\r\n}\r\nfunction isDefinedKey(key) {\r\n return this[key] !== void 0;\r\n}\r\nvar nativeCodeSuffix = \"{ [native code] }\";\r\nfunction endsWith(full, suffix) {\r\n var fromIndex = full.length - suffix.length;\r\n return fromIndex >= 0 &&\r\n full.indexOf(suffix, fromIndex) === fromIndex;\r\n}\r\nfunction previouslyCompared(a, b) {\r\n // Though cyclic references can make an object graph appear infinite from the\r\n // perspective of a depth-first traversal, the graph still contains a finite\r\n // number of distinct object references. We use the previousComparisons cache\r\n // to avoid comparing the same pair of object references more than once, which\r\n // guarantees termination (even if we end up comparing every object in one\r\n // graph to every object in the other graph, which is extremely unlikely),\r\n // while still allowing weird isomorphic structures (like rings with different\r\n // lengths) a chance to pass the equality test.\r\n var bSet = previousComparisons.get(a);\r\n if (bSet) {\r\n // Return true here because we can be sure false will be returned somewhere\r\n // else if the objects are not equivalent.\r\n if (bSet.has(b))\r\n return true;\r\n }\r\n else {\r\n previousComparisons.set(a, bSet = new Set);\r\n }\r\n bSet.add(b);\r\n return false;\r\n}\n\nexport default equal;\nexport { equal };\n//# sourceMappingURL=equality.esm.js.map\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export var NetworkStatus;\n(function (NetworkStatus) {\n NetworkStatus[NetworkStatus[\"loading\"] = 1] = \"loading\";\n NetworkStatus[NetworkStatus[\"setVariables\"] = 2] = \"setVariables\";\n NetworkStatus[NetworkStatus[\"fetchMore\"] = 3] = \"fetchMore\";\n NetworkStatus[NetworkStatus[\"refetch\"] = 4] = \"refetch\";\n NetworkStatus[NetworkStatus[\"poll\"] = 6] = \"poll\";\n NetworkStatus[NetworkStatus[\"ready\"] = 7] = \"ready\";\n NetworkStatus[NetworkStatus[\"error\"] = 8] = \"error\";\n})(NetworkStatus || (NetworkStatus = {}));\nexport function isNetworkRequestInFlight(networkStatus) {\n return networkStatus ? networkStatus < 7 : false;\n}\n//# sourceMappingURL=networkStatus.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.selectedTagIdState = exports.selectedSortOrderState = exports.selectedMediaTypeState = exports.selectedInspectorViewState = exports.selectedAssetIdState = exports.selectedAssetCollectionIdState = exports.searchTermState = exports.loadingState = exports.initialLoadCompleteState = exports.currentPageState = void 0;\nvar currentPageState_1 = __importDefault(require(\"./currentPageState\"));\nexports.currentPageState = currentPageState_1.default;\nvar initialLoadComplete_1 = __importDefault(require(\"./initialLoadComplete\"));\nexports.initialLoadCompleteState = initialLoadComplete_1.default;\nvar loadingState_1 = __importDefault(require(\"./loadingState\"));\nexports.loadingState = loadingState_1.default;\nvar searchTermState_1 = __importDefault(require(\"./searchTermState\"));\nexports.searchTermState = searchTermState_1.default;\nvar selectedAssetCollectionIdState_1 = __importDefault(require(\"./selectedAssetCollectionIdState\"));\nexports.selectedAssetCollectionIdState = selectedAssetCollectionIdState_1.default;\nvar selectedAssetIdState_1 = __importDefault(require(\"./selectedAssetIdState\"));\nexports.selectedAssetIdState = selectedAssetIdState_1.default;\nvar selectedInspectorViewState_1 = __importDefault(require(\"./selectedInspectorViewState\"));\nexports.selectedInspectorViewState = selectedInspectorViewState_1.default;\nvar selectedMediaTypeState_1 = __importDefault(require(\"./selectedMediaTypeState\"));\nexports.selectedMediaTypeState = selectedMediaTypeState_1.default;\nvar selectedSortOrderState_1 = __importDefault(require(\"./selectedSortOrderState\"));\nexports.selectedSortOrderState = selectedSortOrderState_1.default;\nvar selectedTagIdState_1 = __importDefault(require(\"./selectedTagIdState\"));\nexports.selectedTagIdState = selectedTagIdState_1.default;\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _extends from '@babel/runtime/helpers/esm/extends';\nimport isInBrowser from 'is-in-browser';\nimport warning from 'tiny-warning';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\n\nvar plainObjectConstrurctor = {}.constructor;\nfunction cloneStyle(style) {\n if (style == null || typeof style !== 'object') return style;\n if (Array.isArray(style)) return style.map(cloneStyle);\n if (style.constructor !== plainObjectConstrurctor) return style;\n var newStyle = {};\n\n for (var name in style) {\n newStyle[name] = cloneStyle(style[name]);\n }\n\n return newStyle;\n}\n\n/**\n * Create a rule instance.\n */\n\nfunction createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}\n\nvar join = function join(value, by) {\n var result = '';\n\n for (var i = 0; i < value.length; i++) {\n // Remove !important from the value, it will be readded later.\n if (value[i] === '!important') break;\n if (result) result += by;\n result += value[i];\n }\n\n return result;\n};\n\n/**\n * Converts array values to string.\n *\n * `margin: [['5px', '10px']]` > `margin: 5px 10px;`\n * `border: ['1px', '2px']` > `border: 1px, 2px;`\n * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`\n * `color: ['red', !important]` > `color: red !important;`\n */\nvar toCssValue = function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n};\n\n/**\n * Indent a string.\n * http://jsperf.com/array-join-vs-for\n */\nfunction indentStr(str, indent) {\n var result = '';\n\n for (var index = 0; index < indent; index++) {\n result += ' ';\n }\n\n return result + str;\n}\n/**\n * Converts a Rule to CSS string.\n */\n\n\nfunction toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}\n\nvar escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\nvar nativeEscape = typeof CSS !== 'undefined' && CSS.escape;\nvar escape = (function (str) {\n return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\\\$1');\n});\n\nvar BaseStyleRule =\n/*#__PURE__*/\nfunction () {\n function BaseStyleRule(key, style, options) {\n this.type = 'style';\n this.key = void 0;\n this.isProcessed = false;\n this.style = void 0;\n this.renderer = void 0;\n this.renderable = void 0;\n this.options = void 0;\n var sheet = options.sheet,\n Renderer = options.Renderer;\n this.key = key;\n this.options = options;\n this.style = style;\n if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer();\n }\n /**\n * Get or set a style property.\n */\n\n\n var _proto = BaseStyleRule.prototype;\n\n _proto.prop = function prop(name, value, options) {\n // It's a getter.\n if (value === undefined) return this.style[name]; // Don't do anything if the value has not changed.\n\n var force = options ? options.force : false;\n if (!force && this.style[name] === value) return this;\n var newValue = value;\n\n if (!options || options.process !== false) {\n newValue = this.options.jss.plugins.onChangeValue(value, name, this);\n }\n\n var isEmpty = newValue == null || newValue === false;\n var isDefined = name in this.style; // Value is empty and wasn't defined before.\n\n if (isEmpty && !isDefined && !force) return this; // We are going to remove this value.\n\n var remove = isEmpty && isDefined;\n if (remove) delete this.style[name];else this.style[name] = newValue; // Renderable is defined if StyleSheet option `link` is true.\n\n if (this.renderable && this.renderer) {\n if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, newValue);\n return this;\n }\n\n var sheet = this.options.sheet;\n\n if (sheet && sheet.attached) {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Rule is not linked. Missing sheet option \"link: true\".') : void 0;\n }\n\n return this;\n };\n\n return BaseStyleRule;\n}();\nvar StyleRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(StyleRule, _BaseStyleRule);\n\n function StyleRule(key, style, options) {\n var _this;\n\n _this = _BaseStyleRule.call(this, key, style, options) || this;\n _this.selectorText = void 0;\n _this.id = void 0;\n _this.renderable = void 0;\n var selector = options.selector,\n scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n\n if (selector) {\n _this.selectorText = selector;\n } else if (scoped !== false) {\n _this.id = generateId(_assertThisInitialized(_assertThisInitialized(_this)), sheet);\n _this.selectorText = \".\" + escape(_this.id);\n }\n\n return _this;\n }\n /**\n * Set selector string.\n * Attention: use this with caution. Most browsers didn't implement\n * selectorText setter, so this may result in rerendering of entire Style Sheet.\n */\n\n\n var _proto2 = StyleRule.prototype;\n\n /**\n * Apply rule to an element inline.\n */\n _proto2.applyTo = function applyTo(renderable) {\n var renderer = this.renderer;\n\n if (renderer) {\n var json = this.toJSON();\n\n for (var prop in json) {\n renderer.setProperty(renderable, prop, json[prop]);\n }\n }\n\n return this;\n }\n /**\n * Returns JSON representation of the rule.\n * Fallbacks are not supported.\n * Useful for inline styles.\n */\n ;\n\n _proto2.toJSON = function toJSON() {\n var json = {};\n\n for (var prop in this.style) {\n var value = this.style[prop];\n if (typeof value !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = toCssValue(value);\n }\n\n return json;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto2.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.selectorText, this.style, opts);\n };\n\n _createClass(StyleRule, [{\n key: \"selector\",\n set: function set(selector) {\n if (selector === this.selectorText) return;\n this.selectorText = selector;\n var renderer = this.renderer,\n renderable = this.renderable;\n if (!renderable || !renderer) return;\n var hasChanged = renderer.setSelector(renderable, selector); // If selector setter is not implemented, rerender the rule.\n\n if (!hasChanged) {\n renderer.replaceRule(renderable, this);\n }\n }\n /**\n * Get selector string.\n */\n ,\n get: function get() {\n return this.selectorText;\n }\n }]);\n\n return StyleRule;\n}(BaseStyleRule);\nvar pluginStyleRule = {\n onCreateRule: function onCreateRule(name, style, options) {\n if (name[0] === '@' || options.parent && options.parent.type === 'keyframes') {\n return null;\n }\n\n return new StyleRule(name, style, options);\n }\n};\n\nvar defaultToStringOptions = {\n indent: 1,\n children: true\n};\nvar atRegExp = /@([\\w-]+)/;\n/**\n * Conditional rule for @media, @supports\n */\n\nvar ConditionalRule =\n/*#__PURE__*/\nfunction () {\n function ConditionalRule(key, styles, options) {\n this.type = 'conditional';\n this.at = void 0;\n this.key = void 0;\n this.query = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n var atMatch = key.match(atRegExp);\n this.at = atMatch ? atMatch[1] : 'unknown'; // Key might contain a unique suffix in case the `name` passed by user was duplicate.\n\n this.query = options.name || \"@\" + this.at;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = ConditionalRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions.indent;\n if (options.children == null) options.children = defaultToStringOptions.children;\n\n if (options.children === false) {\n return this.query + \" {}\";\n }\n\n var children = this.rules.toString(options);\n return children ? this.query + \" {\\n\" + children + \"\\n}\" : '';\n };\n\n return ConditionalRule;\n}();\nvar keyRegExp = /@media|@supports\\s+/;\nvar pluginConditionalRule = {\n onCreateRule: function onCreateRule(key, styles, options) {\n return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;\n }\n};\n\nvar defaultToStringOptions$1 = {\n indent: 1,\n children: true\n};\nvar nameRegExp = /@keyframes\\s+([\\w-]+)/;\n/**\n * Rule for @keyframes\n */\n\nvar KeyframesRule =\n/*#__PURE__*/\nfunction () {\n function KeyframesRule(key, frames, options) {\n this.type = 'keyframes';\n this.at = '@keyframes';\n this.key = void 0;\n this.name = void 0;\n this.id = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n var nameMatch = key.match(nameRegExp);\n\n if (nameMatch && nameMatch[1]) {\n this.name = nameMatch[1];\n } else {\n this.name = 'noname';\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Bad keyframes name \" + key) : void 0;\n }\n\n this.key = this.type + \"-\" + this.name;\n this.options = options;\n var scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n this.id = scoped === false ? this.name : escape(generateId(this, sheet));\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in frames) {\n this.rules.add(name, frames[name], _extends({}, options, {\n parent: this\n }));\n }\n\n this.rules.process();\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = KeyframesRule.prototype;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions$1;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions$1.indent;\n if (options.children == null) options.children = defaultToStringOptions$1.children;\n\n if (options.children === false) {\n return this.at + \" \" + this.id + \" {}\";\n }\n\n var children = this.rules.toString(options);\n if (children) children = \"\\n\" + children + \"\\n\";\n return this.at + \" \" + this.id + \" {\" + children + \"}\";\n };\n\n return KeyframesRule;\n}();\nvar keyRegExp$1 = /@keyframes\\s+/;\nvar refRegExp = /\\$([\\w-]+)/g;\n\nvar findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {\n if (typeof val === 'string') {\n return val.replace(refRegExp, function (match, name) {\n if (name in keyframes) {\n return keyframes[name];\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced keyframes rule \\\"\" + name + \"\\\" is not defined.\") : void 0;\n return match;\n });\n }\n\n return val;\n};\n/**\n * Replace the reference for a animation name.\n */\n\n\nvar replaceRef = function replaceRef(style, prop, keyframes) {\n var value = style[prop];\n var refKeyframe = findReferencedKeyframe(value, keyframes);\n\n if (refKeyframe !== value) {\n style[prop] = refKeyframe;\n }\n};\n\nvar plugin = {\n onCreateRule: function onCreateRule(key, frames, options) {\n return typeof key === 'string' && keyRegExp$1.test(key) ? new KeyframesRule(key, frames, options) : null;\n },\n // Animation name ref replacer.\n onProcessStyle: function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style' || !sheet) return style;\n if ('animation-name' in style) replaceRef(style, 'animation-name', sheet.keyframes);\n if ('animation' in style) replaceRef(style, 'animation', sheet.keyframes);\n return style;\n },\n onChangeValue: function onChangeValue(val, prop, rule) {\n var sheet = rule.options.sheet;\n\n if (!sheet) {\n return val;\n }\n\n switch (prop) {\n case 'animation':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n case 'animation-name':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n default:\n return val;\n }\n }\n};\n\nvar KeyframeRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(KeyframeRule, _BaseStyleRule);\n\n function KeyframeRule() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _BaseStyleRule.call.apply(_BaseStyleRule, [this].concat(args)) || this;\n _this.renderable = void 0;\n return _this;\n }\n\n var _proto = KeyframeRule.prototype;\n\n /**\n * Generates a CSS string.\n */\n _proto.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.key, this.style, opts);\n };\n\n return KeyframeRule;\n}(BaseStyleRule);\nvar pluginKeyframeRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n if (options.parent && options.parent.type === 'keyframes') {\n return new KeyframeRule(key, style, options);\n }\n\n return null;\n }\n};\n\nvar FontFaceRule =\n/*#__PURE__*/\nfunction () {\n function FontFaceRule(key, style, options) {\n this.type = 'font-face';\n this.at = '@font-face';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = FontFaceRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.style)) {\n var str = '';\n\n for (var index = 0; index < this.style.length; index++) {\n str += toCss(this.at, this.style[index]);\n if (this.style[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return toCss(this.at, this.style, options);\n };\n\n return FontFaceRule;\n}();\nvar keyRegExp$2 = /@font-face/;\nvar pluginFontFaceRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return keyRegExp$2.test(key) ? new FontFaceRule(key, style, options) : null;\n }\n};\n\nvar ViewportRule =\n/*#__PURE__*/\nfunction () {\n function ViewportRule(key, style, options) {\n this.type = 'viewport';\n this.at = '@viewport';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = ViewportRule.prototype;\n\n _proto.toString = function toString(options) {\n return toCss(this.key, this.style, options);\n };\n\n return ViewportRule;\n}();\nvar pluginViewportRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return key === '@viewport' || key === '@-ms-viewport' ? new ViewportRule(key, style, options) : null;\n }\n};\n\nvar SimpleRule =\n/*#__PURE__*/\nfunction () {\n function SimpleRule(key, value, options) {\n this.type = 'simple';\n this.key = void 0;\n this.value = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.value = value;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n // eslint-disable-next-line no-unused-vars\n\n\n var _proto = SimpleRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.value)) {\n var str = '';\n\n for (var index = 0; index < this.value.length; index++) {\n str += this.key + \" \" + this.value[index] + \";\";\n if (this.value[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return this.key + \" \" + this.value + \";\";\n };\n\n return SimpleRule;\n}();\nvar keysMap = {\n '@charset': true,\n '@import': true,\n '@namespace': true\n};\nvar pluginSimpleRule = {\n onCreateRule: function onCreateRule(key, value, options) {\n return key in keysMap ? new SimpleRule(key, value, options) : null;\n }\n};\n\nvar plugins = [pluginStyleRule, pluginConditionalRule, plugin, pluginKeyframeRule, pluginFontFaceRule, pluginViewportRule, pluginSimpleRule];\n\nvar defaultUpdateOptions = {\n process: true\n};\nvar forceUpdateOptions = {\n force: true,\n process: true\n /**\n * Contains rules objects and allows adding/removing etc.\n * Is used for e.g. by `StyleSheet` or `ConditionalRule`.\n */\n\n};\n\nvar RuleList =\n/*#__PURE__*/\nfunction () {\n // Rules registry for access by .get() method.\n // It contains the same rule registered by name and by selector.\n // Original styles object.\n // Used to ensure correct rules order.\n function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }\n /**\n * Create and register rule.\n *\n * Will not render after Style Sheet was rendered the first time.\n */\n\n\n var _proto = RuleList.prototype;\n\n _proto.add = function add(name, decl, ruleOptions) {\n var _this$options = this.options,\n parent = _this$options.parent,\n sheet = _this$options.sheet,\n jss = _this$options.jss,\n Renderer = _this$options.Renderer,\n generateId = _this$options.generateId,\n scoped = _this$options.scoped;\n\n var options = _extends({\n classes: this.classes,\n parent: parent,\n sheet: sheet,\n jss: jss,\n Renderer: Renderer,\n generateId: generateId,\n scoped: scoped,\n name: name,\n keyframes: this.keyframes,\n selector: undefined\n }, ruleOptions); // When user uses .createStyleSheet(), duplicate names are not possible, but\n // `sheet.addRule()` opens the door for any duplicate rule name. When this happens\n // we need to make the key unique within this RuleList instance scope.\n\n\n var key = name;\n\n if (name in this.raw) {\n key = name + \"-d\" + this.counter++;\n } // We need to save the original decl before creating the rule\n // because cache plugin needs to use it as a key to return a cached rule.\n\n\n this.raw[key] = decl;\n\n if (key in this.classes) {\n // E.g. rules inside of @media container\n options.selector = \".\" + escape(this.classes[key]);\n }\n\n var rule = createRule(key, decl, options);\n if (!rule) return null;\n this.register(rule);\n var index = options.index === undefined ? this.index.length : options.index;\n this.index.splice(index, 0, rule);\n return rule;\n }\n /**\n * Get a rule.\n */\n ;\n\n _proto.get = function get(name) {\n return this.map[name];\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.remove = function remove(rule) {\n this.unregister(rule);\n delete this.raw[rule.key];\n this.index.splice(this.index.indexOf(rule), 1);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.index.indexOf(rule);\n }\n /**\n * Run `onProcessRule()` plugins on every rule.\n */\n ;\n\n _proto.process = function process() {\n var plugins = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop\n // we end up with very hard-to-track-down side effects.\n\n this.index.slice(0).forEach(plugins.onProcessRule, plugins);\n }\n /**\n * Register a rule in `.map`, `.classes` and `.keyframes` maps.\n */\n ;\n\n _proto.register = function register(rule) {\n this.map[rule.key] = rule;\n\n if (rule instanceof StyleRule) {\n this.map[rule.selector] = rule;\n if (rule.id) this.classes[rule.key] = rule.id;\n } else if (rule instanceof KeyframesRule && this.keyframes) {\n this.keyframes[rule.name] = rule.id;\n }\n }\n /**\n * Unregister a rule.\n */\n ;\n\n _proto.unregister = function unregister(rule) {\n delete this.map[rule.key];\n\n if (rule instanceof StyleRule) {\n delete this.map[rule.selector];\n delete this.classes[rule.key];\n } else if (rule instanceof KeyframesRule) {\n delete this.keyframes[rule.name];\n }\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var name;\n var data;\n var options;\n\n if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {\n name = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe[invalid-tuple-index]\n\n data = arguments.length <= 1 ? undefined : arguments[1]; // $FlowFixMe[invalid-tuple-index]\n\n options = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n data = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe[invalid-tuple-index]\n\n options = arguments.length <= 1 ? undefined : arguments[1];\n name = null;\n }\n\n if (name) {\n this.updateOne(this.map[name], data, options);\n } else {\n for (var index = 0; index < this.index.length; index++) {\n this.updateOne(this.index[index], data, options);\n }\n }\n }\n /**\n * Execute plugins, update rule props.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n if (options === void 0) {\n options = defaultUpdateOptions;\n }\n\n var _this$options2 = this.options,\n plugins = _this$options2.jss.plugins,\n sheet = _this$options2.sheet; // It is a rules container like for e.g. ConditionalRule.\n\n if (rule.rules instanceof RuleList) {\n rule.rules.update(data, options);\n return;\n }\n\n var styleRule = rule;\n var style = styleRule.style;\n plugins.onUpdate(data, rule, sheet, options); // We rely on a new `style` ref in case it was mutated during onUpdate hook.\n\n if (options.process && style && style !== styleRule.style) {\n // We need to run the plugins in case new `style` relies on syntax plugins.\n plugins.onProcessStyle(styleRule.style, styleRule, sheet); // Update and add props.\n\n for (var prop in styleRule.style) {\n var nextValue = styleRule.style[prop];\n var prevValue = style[prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (nextValue !== prevValue) {\n styleRule.prop(prop, nextValue, forceUpdateOptions);\n }\n } // Remove props.\n\n\n for (var _prop in style) {\n var _nextValue = styleRule.style[_prop];\n var _prevValue = style[_prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (_nextValue == null && _nextValue !== _prevValue) {\n styleRule.prop(_prop, null, forceUpdateOptions);\n }\n }\n }\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n var str = '';\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n\n for (var index = 0; index < this.index.length; index++) {\n var rule = this.index[index];\n var css = rule.toString(options); // No need to render an empty rule.\n\n if (!css && !link) continue;\n if (str) str += '\\n';\n str += css;\n }\n\n return str;\n };\n\n return RuleList;\n}();\n\nvar StyleSheet =\n/*#__PURE__*/\nfunction () {\n function StyleSheet(styles, options) {\n this.options = void 0;\n this.deployed = void 0;\n this.attached = void 0;\n this.rules = void 0;\n this.renderer = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.queue = void 0;\n this.attached = false;\n this.deployed = false;\n this.classes = {};\n this.keyframes = {};\n this.options = _extends({}, options, {\n sheet: this,\n parent: this,\n classes: this.classes,\n keyframes: this.keyframes\n });\n\n if (options.Renderer) {\n this.renderer = new options.Renderer(this);\n }\n\n this.rules = new RuleList(this.options);\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Attach renderable to the render tree.\n */\n\n\n var _proto = StyleSheet.prototype;\n\n _proto.attach = function attach() {\n if (this.attached) return this;\n if (this.renderer) this.renderer.attach();\n this.attached = true; // Order is important, because we can't use insertRule API if style element is not attached.\n\n if (!this.deployed) this.deploy();\n return this;\n }\n /**\n * Remove renderable from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.attached) return this;\n if (this.renderer) this.renderer.detach();\n this.attached = false;\n return this;\n }\n /**\n * Add a rule to the current stylesheet.\n * Will insert a rule also after the stylesheet has been rendered first time.\n */\n ;\n\n _proto.addRule = function addRule(name, decl, options) {\n var queue = this.queue; // Plugins can create rules.\n // In order to preserve the right order, we need to queue all `.addRule` calls,\n // which happen after the first `rules.add()` call.\n\n if (this.attached && !queue) this.queue = [];\n var rule = this.rules.add(name, decl, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n\n if (this.attached) {\n if (!this.deployed) return rule; // Don't insert rule directly if there is no stringified version yet.\n // It will be inserted all together when .attach is called.\n\n if (queue) queue.push(rule);else {\n this.insertRule(rule);\n\n if (this.queue) {\n this.queue.forEach(this.insertRule, this);\n this.queue = undefined;\n }\n }\n return rule;\n } // We can't add rules to a detached style node.\n // We will redeploy the sheet once user will attach it.\n\n\n this.deployed = false;\n return rule;\n }\n /**\n * Insert rule into the StyleSheet\n */\n ;\n\n _proto.insertRule = function insertRule(rule) {\n if (this.renderer) {\n this.renderer.insertRule(rule);\n }\n }\n /**\n * Create and add rules.\n * Will render also after Style Sheet was rendered the first time.\n */\n ;\n\n _proto.addRules = function addRules(styles, options) {\n var added = [];\n\n for (var name in styles) {\n var rule = this.addRule(name, styles[name], options);\n if (rule) added.push(rule);\n }\n\n return added;\n }\n /**\n * Get a rule by name.\n */\n ;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Delete a rule by name.\n * Returns `true`: if rule has been deleted from the DOM.\n */\n ;\n\n _proto.deleteRule = function deleteRule(name) {\n var rule = typeof name === 'object' ? name : this.rules.get(name);\n\n if (!rule || // Style sheet was created without link: true and attached, in this case we\n // won't be able to remove the CSS rule from the DOM.\n this.attached && !rule.renderable) {\n return false;\n }\n\n this.rules.remove(rule);\n\n if (this.attached && rule.renderable && this.renderer) {\n return this.renderer.deleteRule(rule.renderable);\n }\n\n return true;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Deploy pure CSS string to a renderable.\n */\n ;\n\n _proto.deploy = function deploy() {\n if (this.renderer) this.renderer.deploy();\n this.deployed = true;\n return this;\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var _this$rules;\n\n (_this$rules = this.rules).update.apply(_this$rules, arguments);\n\n return this;\n }\n /**\n * Updates a single rule.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n this.rules.updateOne(rule, data, options);\n return this;\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n return this.rules.toString(options);\n };\n\n return StyleSheet;\n}();\n\nvar PluginsRegistry =\n/*#__PURE__*/\nfunction () {\n function PluginsRegistry() {\n this.plugins = {\n internal: [],\n external: []\n };\n this.registry = void 0;\n }\n\n var _proto = PluginsRegistry.prototype;\n\n /**\n * Call `onCreateRule` hooks and return an object if returned by a hook.\n */\n _proto.onCreateRule = function onCreateRule(name, decl, options) {\n for (var i = 0; i < this.registry.onCreateRule.length; i++) {\n var rule = this.registry.onCreateRule[i](name, decl, options);\n if (rule) return rule;\n }\n\n return null;\n }\n /**\n * Call `onProcessRule` hooks.\n */\n ;\n\n _proto.onProcessRule = function onProcessRule(rule) {\n if (rule.isProcessed) return;\n var sheet = rule.options.sheet;\n\n for (var i = 0; i < this.registry.onProcessRule.length; i++) {\n this.registry.onProcessRule[i](rule, sheet);\n }\n\n if (rule.style) this.onProcessStyle(rule.style, rule, sheet);\n rule.isProcessed = true;\n }\n /**\n * Call `onProcessStyle` hooks.\n */\n ;\n\n _proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {\n for (var i = 0; i < this.registry.onProcessStyle.length; i++) {\n // $FlowFixMe[prop-missing]\n rule.style = this.registry.onProcessStyle[i](rule.style, rule, sheet);\n }\n }\n /**\n * Call `onProcessSheet` hooks.\n */\n ;\n\n _proto.onProcessSheet = function onProcessSheet(sheet) {\n for (var i = 0; i < this.registry.onProcessSheet.length; i++) {\n this.registry.onProcessSheet[i](sheet);\n }\n }\n /**\n * Call `onUpdate` hooks.\n */\n ;\n\n _proto.onUpdate = function onUpdate(data, rule, sheet, options) {\n for (var i = 0; i < this.registry.onUpdate.length; i++) {\n this.registry.onUpdate[i](data, rule, sheet, options);\n }\n }\n /**\n * Call `onChangeValue` hooks.\n */\n ;\n\n _proto.onChangeValue = function onChangeValue(value, prop, rule) {\n var processedValue = value;\n\n for (var i = 0; i < this.registry.onChangeValue.length; i++) {\n processedValue = this.registry.onChangeValue[i](processedValue, prop, rule);\n }\n\n return processedValue;\n }\n /**\n * Register a plugin.\n */\n ;\n\n _proto.use = function use(newPlugin, options) {\n if (options === void 0) {\n options = {\n queue: 'external'\n };\n }\n\n var plugins = this.plugins[options.queue]; // Avoids applying same plugin twice, at least based on ref.\n\n if (plugins.indexOf(newPlugin) !== -1) {\n return;\n }\n\n plugins.push(newPlugin);\n this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {\n for (var name in plugin) {\n if (name in registry) {\n registry[name].push(plugin[name]);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown hook \\\"\" + name + \"\\\".\") : void 0;\n }\n }\n\n return registry;\n }, {\n onCreateRule: [],\n onProcessRule: [],\n onProcessStyle: [],\n onProcessSheet: [],\n onChangeValue: [],\n onUpdate: []\n });\n };\n\n return PluginsRegistry;\n}();\n\n/**\n * Sheets registry to access them all at one place.\n */\nvar SheetsRegistry =\n/*#__PURE__*/\nfunction () {\n function SheetsRegistry() {\n this.registry = [];\n }\n\n var _proto = SheetsRegistry.prototype;\n\n /**\n * Register a Style Sheet.\n */\n _proto.add = function add(sheet) {\n var registry = this.registry;\n var index = sheet.options.index;\n if (registry.indexOf(sheet) !== -1) return;\n\n if (registry.length === 0 || index >= this.index) {\n registry.push(sheet);\n return;\n } // Find a position.\n\n\n for (var i = 0; i < registry.length; i++) {\n if (registry[i].options.index > index) {\n registry.splice(i, 0, sheet);\n return;\n }\n }\n }\n /**\n * Reset the registry.\n */\n ;\n\n _proto.reset = function reset() {\n this.registry = [];\n }\n /**\n * Remove a Style Sheet.\n */\n ;\n\n _proto.remove = function remove(sheet) {\n var index = this.registry.indexOf(sheet);\n this.registry.splice(index, 1);\n }\n /**\n * Convert all attached sheets to a CSS string.\n */\n ;\n\n _proto.toString = function toString(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n attached = _ref.attached,\n options = _objectWithoutPropertiesLoose(_ref, [\"attached\"]);\n\n var css = '';\n\n for (var i = 0; i < this.registry.length; i++) {\n var sheet = this.registry[i];\n\n if (attached != null && sheet.attached !== attached) {\n continue;\n }\n\n if (css) css += '\\n';\n css += sheet.toString(options);\n }\n\n return css;\n };\n\n _createClass(SheetsRegistry, [{\n key: \"index\",\n\n /**\n * Current highest index number.\n */\n get: function get() {\n return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index;\n }\n }]);\n\n return SheetsRegistry;\n}();\n\n/**\n * This is a global sheets registry. Only DomRenderer will add sheets to it.\n * On the server one should use an own SheetsRegistry instance and add the\n * sheets to it, because you need to make sure to create a new registry for\n * each request in order to not leak sheets across requests.\n */\n\nvar registry = new SheetsRegistry();\n\n/* eslint-disable */\n\n/**\n * Now that `globalThis` is available on most platforms\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility)\n * we check for `globalThis` first. `globalThis` is necessary for jss\n * to run in Agoric's secure version of JavaScript (SES). Under SES,\n * `globalThis` exists, but `window`, `self`, and `Function('return\n * this')()` are all undefined for security reasons.\n *\n * https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n */\nvar globalThis$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' && window.Math === Math ? window : typeof self !== 'undefined' && self.Math === Math ? self : Function('return this')();\n\nvar ns = '2f1acc6c3a606b082e5eef5e54414ffb';\nif (globalThis$1[ns] == null) globalThis$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify\n// the current version with just one short number and use it for classes generation\n// we use a counter. Also it is more accurate, because user can manually reevaluate\n// the module.\n\nvar moduleId = globalThis$1[ns]++;\n\nvar maxRules = 1e10;\n\n/**\n * Returns a function which generates unique class names based on counters.\n * When new generator function is created, rule counter is reseted.\n * We need to reset the rule counter for SSR for each request.\n */\nvar createGenerateId = function createGenerateId(options) {\n if (options === void 0) {\n options = {};\n }\n\n var ruleCounter = 0;\n return function (rule, sheet) {\n ruleCounter += 1;\n\n if (ruleCounter > maxRules) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] You might have a memory leak. Rule counter is at \" + ruleCounter + \".\") : void 0;\n }\n\n var jssId = '';\n var prefix = '';\n\n if (sheet) {\n if (sheet.options.classNamePrefix) {\n prefix = sheet.options.classNamePrefix;\n }\n\n if (sheet.options.jss.id != null) {\n jssId = String(sheet.options.jss.id);\n }\n }\n\n if (options.minify) {\n // Using \"c\" because a number can't be the first char in a class name.\n return \"\" + (prefix || 'c') + moduleId + jssId + ruleCounter;\n }\n\n return prefix + rule.key + \"-\" + moduleId + (jssId ? \"-\" + jssId : '') + \"-\" + ruleCounter;\n };\n};\n\n/**\n * Cache the value from the first time a function is called.\n */\nvar memoize = function memoize(fn) {\n var value;\n return function () {\n if (!value) value = fn();\n return value;\n };\n};\n\n/**\n * Get a style property value.\n */\nvar getPropertyValue = function getPropertyValue(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n return cssRule.attributeStyleMap.get(prop);\n }\n\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n};\n\n/**\n * Set a style property.\n */\nvar setProperty = function setProperty(cssRule, prop, value) {\n try {\n var cssValue = value;\n\n if (Array.isArray(value)) {\n cssValue = toCssValue(value, true);\n\n if (value[value.length - 1] === '!important') {\n cssRule.style.setProperty(prop, cssValue, 'important');\n return true;\n }\n } // Support CSSTOM.\n\n\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.set(prop, cssValue);\n } else {\n cssRule.style.setProperty(prop, cssValue);\n }\n } catch (err) {\n // IE may throw if property is unknown.\n return false;\n }\n\n return true;\n};\n\n/**\n * Remove a style property.\n */\nvar removeProperty = function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") : void 0;\n }\n};\n\n/**\n * Set the selector.\n */\nvar setSelector = function setSelector(cssRule, selectorText) {\n cssRule.selectorText = selectorText; // Return false if setter was not successful.\n // Currently works in chrome only.\n\n return cssRule.selectorText === selectorText;\n};\n/**\n * Gets the `head` element upon the first call and caches it.\n * We assume it can't be null.\n */\n\n\nvar getHead = memoize(function () {\n return document.querySelector('head');\n});\n/**\n * Find attached sheet with an index higher than the passed one.\n */\n\nfunction findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find attached sheet with the highest index.\n */\n\n\nfunction findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find a comment with \"jss\" inside.\n */\n\n\nfunction findCommentNode(text) {\n var head = getHead();\n\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n\n return null;\n}\n\n/**\n * Find a node before which we can insert the sheet.\n */\nfunction findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}\n/**\n * Insert style element into the DOM.\n */\n\n\nfunction insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}\n/**\n * Read jss nonce setting from the page if the user has set it.\n */\n\n\nvar getNonce = memoize(function () {\n var node = document.querySelector('meta[property=\"csp-nonce\"]');\n return node ? node.getAttribute('content') : null;\n});\n\nvar _insertRule = function insertRule(container, rule, index) {\n try {\n if ('insertRule' in container) {\n var c = container;\n c.insertRule(rule, index);\n } // Keyframes rule.\n else if ('appendRule' in container) {\n var _c = container;\n\n _c.appendRule(rule);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] \" + err.message) : void 0;\n return false;\n }\n\n return container.cssRules[index];\n};\n\nvar getValidRuleInsertionIndex = function getValidRuleInsertionIndex(container, index) {\n var maxIndex = container.cssRules.length; // In case previous insertion fails, passed index might be wrong\n\n if (index === undefined || index > maxIndex) {\n // eslint-disable-next-line no-param-reassign\n return maxIndex;\n }\n\n return index;\n};\n\nvar createStyle = function createStyle() {\n var el = document.createElement('style'); // Without it, IE will have a broken source order specificity if we\n // insert rules after we insert the style tag.\n // It seems to kick-off the source order specificity algorithm.\n\n el.textContent = '\\n';\n return el;\n};\n\nvar DomRenderer =\n/*#__PURE__*/\nfunction () {\n // HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696\n // Will be empty if link: true option is not set, because\n // it is only for use together with insertRule API.\n function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = [];\n // There is no sheet when the renderer is used from a standalone StyleRule.\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }\n /**\n * Insert style element into render tree.\n */\n\n\n var _proto = DomRenderer.prototype;\n\n _proto.attach = function attach() {\n // In the case the element node is external and it is already in the DOM.\n if (this.element.parentNode || !this.sheet) return;\n insertStyle(this.element, this.sheet.options); // When rules are inserted using `insertRule` API, after `sheet.detach().attach()`\n // most browsers create a new CSSStyleSheet, except of all IEs.\n\n var deployed = Boolean(this.sheet && this.sheet.deployed);\n\n if (this.hasInsertedRules && deployed) {\n this.hasInsertedRules = false;\n this.deploy();\n }\n }\n /**\n * Remove style element from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.sheet) return;\n var parentNode = this.element.parentNode;\n if (parentNode) parentNode.removeChild(this.element); // In the most browsers, rules inserted using insertRule() API will be lost when style element is removed.\n // Though IE will keep them and we need a consistent behavior.\n\n if (this.sheet.options.link) {\n this.cssRules = [];\n this.element.textContent = '\\n';\n }\n }\n /**\n * Inject CSS string into element.\n */\n ;\n\n _proto.deploy = function deploy() {\n var sheet = this.sheet;\n if (!sheet) return;\n\n if (sheet.options.link) {\n this.insertRules(sheet.rules);\n return;\n }\n\n this.element.textContent = \"\\n\" + sheet.toString() + \"\\n\";\n }\n /**\n * Insert RuleList into an element.\n */\n ;\n\n _proto.insertRules = function insertRules(rules, nativeParent) {\n for (var i = 0; i < rules.index.length; i++) {\n this.insertRule(rules.index[i], i, nativeParent);\n }\n }\n /**\n * Insert a rule into element.\n */\n ;\n\n _proto.insertRule = function insertRule(rule, index, nativeParent) {\n if (nativeParent === void 0) {\n nativeParent = this.element.sheet;\n }\n\n if (rule.rules) {\n var parent = rule;\n var latestNativeParent = nativeParent;\n\n if (rule.type === 'conditional' || rule.type === 'keyframes') {\n var _insertionIndex = getValidRuleInsertionIndex(nativeParent, index); // We need to render the container without children first.\n\n\n latestNativeParent = _insertRule(nativeParent, parent.toString({\n children: false\n }), _insertionIndex);\n\n if (latestNativeParent === false) {\n return false;\n }\n\n this.refCssRule(rule, _insertionIndex, latestNativeParent);\n }\n\n this.insertRules(parent.rules, latestNativeParent);\n return latestNativeParent;\n }\n\n var ruleStr = rule.toString();\n if (!ruleStr) return false;\n var insertionIndex = getValidRuleInsertionIndex(nativeParent, index);\n\n var nativeRule = _insertRule(nativeParent, ruleStr, insertionIndex);\n\n if (nativeRule === false) {\n return false;\n }\n\n this.hasInsertedRules = true;\n this.refCssRule(rule, insertionIndex, nativeRule);\n return nativeRule;\n };\n\n _proto.refCssRule = function refCssRule(rule, index, cssRule) {\n rule.renderable = cssRule; // We only want to reference the top level rules, deleteRule API doesn't support removing nested rules\n // like rules inside media queries or keyframes\n\n if (rule.options.parent instanceof StyleSheet) {\n this.cssRules[index] = cssRule;\n }\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.deleteRule = function deleteRule(cssRule) {\n var sheet = this.element.sheet;\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return true;\n }\n /**\n * Get index of a CSS Rule.\n */\n ;\n\n _proto.indexOf = function indexOf(cssRule) {\n return this.cssRules.indexOf(cssRule);\n }\n /**\n * Generate a new CSS rule and replace the existing one.\n *\n * Only used for some old browsers because they can't set a selector.\n */\n ;\n\n _proto.replaceRule = function replaceRule(cssRule, rule) {\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n this.element.sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return this.insertRule(rule, index);\n }\n /**\n * Get all rules elements.\n */\n ;\n\n _proto.getRules = function getRules() {\n return this.element.sheet.cssRules;\n };\n\n return DomRenderer;\n}();\n\nvar instanceCounter = 0;\n\nvar Jss =\n/*#__PURE__*/\nfunction () {\n function Jss(options) {\n this.id = instanceCounter++;\n this.version = \"10.6.0\";\n this.plugins = new PluginsRegistry();\n this.options = {\n id: {\n minify: false\n },\n createGenerateId: createGenerateId,\n Renderer: isInBrowser ? DomRenderer : null,\n plugins: []\n };\n this.generateId = createGenerateId({\n minify: false\n });\n\n for (var i = 0; i < plugins.length; i++) {\n this.plugins.use(plugins[i], {\n queue: 'internal'\n });\n }\n\n this.setup(options);\n }\n /**\n * Prepares various options, applies plugins.\n * Should not be used twice on the same instance, because there is no plugins\n * deduplication logic.\n */\n\n\n var _proto = Jss.prototype;\n\n _proto.setup = function setup(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.createGenerateId) {\n this.options.createGenerateId = options.createGenerateId;\n }\n\n if (options.id) {\n this.options.id = _extends({}, this.options.id, options.id);\n }\n\n if (options.createGenerateId || options.id) {\n this.generateId = this.options.createGenerateId(this.options.id);\n }\n\n if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint;\n\n if ('Renderer' in options) {\n this.options.Renderer = options.Renderer;\n } // eslint-disable-next-line prefer-spread\n\n\n if (options.plugins) this.use.apply(this, options.plugins);\n return this;\n }\n /**\n * Create a Style Sheet.\n */\n ;\n\n _proto.createStyleSheet = function createStyleSheet(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n index = _options.index;\n\n if (typeof index !== 'number') {\n index = registry.index === 0 ? 0 : registry.index + 1;\n }\n\n var sheet = new StyleSheet(styles, _extends({}, options, {\n jss: this,\n generateId: options.generateId || this.generateId,\n insertionPoint: this.options.insertionPoint,\n Renderer: this.options.Renderer,\n index: index\n }));\n this.plugins.onProcessSheet(sheet);\n return sheet;\n }\n /**\n * Detach the Style Sheet and remove it from the registry.\n */\n ;\n\n _proto.removeStyleSheet = function removeStyleSheet(sheet) {\n sheet.detach();\n registry.remove(sheet);\n return this;\n }\n /**\n * Create a rule without a Style Sheet.\n * [Deprecated] will be removed in the next major version.\n */\n ;\n\n _proto.createRule = function createRule$1(name, style, options) {\n if (style === void 0) {\n style = {};\n }\n\n if (options === void 0) {\n options = {};\n }\n\n // Enable rule without name for inline styles.\n if (typeof name === 'object') {\n // $FlowFixMe[incompatible-call]\n return this.createRule(undefined, name, style);\n } // $FlowFixMe[incompatible-type]\n\n\n var ruleOptions = _extends({}, options, {\n name: name,\n jss: this,\n Renderer: this.options.Renderer\n });\n\n if (!ruleOptions.generateId) ruleOptions.generateId = this.generateId;\n if (!ruleOptions.classes) ruleOptions.classes = {};\n if (!ruleOptions.keyframes) ruleOptions.keyframes = {};\n\n var rule = createRule(name, style, ruleOptions);\n\n if (rule) this.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Register plugin. Passed function will be invoked with a rule instance.\n */\n ;\n\n _proto.use = function use() {\n var _this = this;\n\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n plugins.forEach(function (plugin) {\n _this.plugins.use(plugin);\n });\n return this;\n };\n\n return Jss;\n}();\n\n/**\n * Extracts a styles object with only props that contain function values.\n */\nfunction getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}\n\n/**\n * SheetsManager is like a WeakMap which is designed to count StyleSheet\n * instances and attach/detach automatically.\n */\nvar SheetsManager =\n/*#__PURE__*/\nfunction () {\n function SheetsManager() {\n this.length = 0;\n this.sheets = new WeakMap();\n }\n\n var _proto = SheetsManager.prototype;\n\n _proto.get = function get(key) {\n var entry = this.sheets.get(key);\n return entry && entry.sheet;\n };\n\n _proto.add = function add(key, sheet) {\n if (this.sheets.has(key)) return;\n this.length++;\n this.sheets.set(key, {\n sheet: sheet,\n refs: 0\n });\n };\n\n _proto.manage = function manage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs === 0) {\n entry.sheet.attach();\n }\n\n entry.refs++;\n return entry.sheet;\n }\n\n warning(false, \"[JSS] SheetsManager: can't find sheet to manage\");\n return undefined;\n };\n\n _proto.unmanage = function unmanage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs > 0) {\n entry.refs--;\n if (entry.refs === 0) entry.sheet.detach();\n }\n } else {\n warning(false, \"SheetsManager: can't find sheet to unmanage\");\n }\n };\n\n _createClass(SheetsManager, [{\n key: \"size\",\n get: function get() {\n return this.length;\n }\n }]);\n\n return SheetsManager;\n}();\n\n/**\n * A better abstraction over CSS.\n *\n * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present\n * @website https://github.com/cssinjs/jss\n * @license MIT\n */\n\n/**\n * Export a constant indicating if this browser has CSSTOM support.\n * https://developers.google.com/web/updates/2018/03/cssom\n */\nvar hasCSSTOMSupport = typeof CSS === 'object' && CSS != null && 'number' in CSS;\n/**\n * Creates a new instance of Jss.\n */\n\nvar create = function create(options) {\n return new Jss(options);\n};\n/**\n * A global Jss instance.\n */\n\nvar jss = create();\n\nexport default jss;\nexport { RuleList, SheetsManager, SheetsRegistry, create, createGenerateId, createRule, getDynamicStyles, hasCSSTOMSupport, registry as sheets, toCssValue };\n","import invariant from \"./invariant.mjs\";\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\n/**\n * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`\n */\n\nexport default function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n}\n","export default function invariant(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message != null ? message : 'Unexpected invariant triggered.');\n }\n}\n","import defineInspect from \"../jsutils/defineInspect.mjs\";\n\n/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport var Location = /*#__PURE__*/function () {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n function Location(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n var _proto = Location.prototype;\n\n _proto.toJSON = function toJSON() {\n return {\n start: this.start,\n end: this.end\n };\n };\n\n return Location;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Location);\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport var Token = /*#__PURE__*/function () {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }\n\n var _proto2 = Token.prototype;\n\n _proto2.toJSON = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n };\n\n return Token;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Token);\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n return maybeNode != null && typeof maybeNode.kind === 'string';\n}\n/**\n * The list of all possible AST node types.\n */\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TAGS = exports.TAG = exports.SET_SELECTED_ASSET_SOURCE_ID = exports.SELECTED_ASSET_SOURCE_ID = exports.CONFIG = exports.ASSET_SOURCES = exports.ASSET_COUNT = exports.ASSET_COLLECTIONS = exports.ASSET_COLLECTION = exports.ASSETS = exports.ASSET = void 0;\nvar asset_1 = __importDefault(require(\"./asset\"));\nexports.ASSET = asset_1.default;\nvar assets_1 = __importDefault(require(\"./assets\"));\nexports.ASSETS = assets_1.default;\nvar assetCollection_1 = __importDefault(require(\"./assetCollection\"));\nexports.ASSET_COLLECTION = assetCollection_1.default;\nvar assetCollections_1 = __importDefault(require(\"./assetCollections\"));\nexports.ASSET_COLLECTIONS = assetCollections_1.default;\nvar assetCount_1 = __importDefault(require(\"./assetCount\"));\nexports.ASSET_COUNT = assetCount_1.default;\nvar assetSources_1 = __importDefault(require(\"./assetSources\"));\nexports.ASSET_SOURCES = assetSources_1.default;\nvar config_1 = __importDefault(require(\"./config\"));\nexports.CONFIG = config_1.default;\nvar tag_1 = __importDefault(require(\"./tag\"));\nexports.TAG = tag_1.default;\nvar tags_1 = __importDefault(require(\"./tags\"));\nexports.TAGS = tags_1.default;\nvar selectedAssetSource_1 = require(\"./selectedAssetSource\");\nObject.defineProperty(exports, \"SELECTED_ASSET_SOURCE_ID\", { enumerable: true, get: function () { return selectedAssetSource_1.SELECTED_ASSET_SOURCE_ID; } });\nObject.defineProperty(exports, \"SET_SELECTED_ASSET_SOURCE_ID\", { enumerable: true, get: function () { return selectedAssetSource_1.SET_SELECTED_ASSET_SOURCE_ID; } });\n","// A [trie](https://en.wikipedia.org/wiki/Trie) data structure that holds\r\n// object keys weakly, yet can also hold non-object keys, unlike the\r\n// native `WeakMap`.\r\n// If no makeData function is supplied, the looked-up data will be an empty,\r\n// null-prototype Object.\r\nvar defaultMakeData = function () { return Object.create(null); };\r\n// Useful for processing arguments objects as well as arrays.\r\nvar _a = Array.prototype, forEach = _a.forEach, slice = _a.slice;\r\nvar Trie = /** @class */ (function () {\r\n function Trie(weakness, makeData) {\r\n if (weakness === void 0) { weakness = true; }\r\n if (makeData === void 0) { makeData = defaultMakeData; }\r\n this.weakness = weakness;\r\n this.makeData = makeData;\r\n }\r\n Trie.prototype.lookup = function () {\r\n var array = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n array[_i] = arguments[_i];\r\n }\r\n return this.lookupArray(array);\r\n };\r\n Trie.prototype.lookupArray = function (array) {\r\n var node = this;\r\n forEach.call(array, function (key) { return node = node.getChildTrie(key); });\r\n return node.data || (node.data = this.makeData(slice.call(array)));\r\n };\r\n Trie.prototype.getChildTrie = function (key) {\r\n var map = this.weakness && isObjRef(key)\r\n ? this.weak || (this.weak = new WeakMap())\r\n : this.strong || (this.strong = new Map());\r\n var child = map.get(key);\r\n if (!child)\r\n map.set(key, child = new Trie(this.weakness, this.makeData));\r\n return child;\r\n };\r\n return Trie;\r\n}());\r\nfunction isObjRef(value) {\r\n switch (typeof value) {\r\n case \"object\":\r\n if (value === null)\r\n break;\r\n // Fall through to return true...\r\n case \"function\":\r\n return true;\r\n }\r\n return false;\r\n}\n\nexport { Trie };\n//# sourceMappingURL=trie.esm.js.map\n","import { Trie } from '@wry/trie';\nexport { Trie as KeyTrie } from '@wry/trie';\nimport { Slot } from '@wry/context';\nexport { asyncFromGen, bind as bindContext, noContext, setTimeout } from '@wry/context';\n\nfunction defaultDispose() { }\r\nvar Cache = /** @class */ (function () {\r\n function Cache(max, dispose) {\r\n if (max === void 0) { max = Infinity; }\r\n if (dispose === void 0) { dispose = defaultDispose; }\r\n this.max = max;\r\n this.dispose = dispose;\r\n this.map = new Map();\r\n this.newest = null;\r\n this.oldest = null;\r\n }\r\n Cache.prototype.has = function (key) {\r\n return this.map.has(key);\r\n };\r\n Cache.prototype.get = function (key) {\r\n var node = this.getNode(key);\r\n return node && node.value;\r\n };\r\n Cache.prototype.getNode = function (key) {\r\n var node = this.map.get(key);\r\n if (node && node !== this.newest) {\r\n var older = node.older, newer = node.newer;\r\n if (newer) {\r\n newer.older = older;\r\n }\r\n if (older) {\r\n older.newer = newer;\r\n }\r\n node.older = this.newest;\r\n node.older.newer = node;\r\n node.newer = null;\r\n this.newest = node;\r\n if (node === this.oldest) {\r\n this.oldest = newer;\r\n }\r\n }\r\n return node;\r\n };\r\n Cache.prototype.set = function (key, value) {\r\n var node = this.getNode(key);\r\n if (node) {\r\n return node.value = value;\r\n }\r\n node = {\r\n key: key,\r\n value: value,\r\n newer: null,\r\n older: this.newest\r\n };\r\n if (this.newest) {\r\n this.newest.newer = node;\r\n }\r\n this.newest = node;\r\n this.oldest = this.oldest || node;\r\n this.map.set(key, node);\r\n return node.value;\r\n };\r\n Cache.prototype.clean = function () {\r\n while (this.oldest && this.map.size > this.max) {\r\n this.delete(this.oldest.key);\r\n }\r\n };\r\n Cache.prototype.delete = function (key) {\r\n var node = this.map.get(key);\r\n if (node) {\r\n if (node === this.newest) {\r\n this.newest = node.older;\r\n }\r\n if (node === this.oldest) {\r\n this.oldest = node.newer;\r\n }\r\n if (node.newer) {\r\n node.newer.older = node.older;\r\n }\r\n if (node.older) {\r\n node.older.newer = node.newer;\r\n }\r\n this.map.delete(key);\r\n this.dispose(node.value, key);\r\n return true;\r\n }\r\n return false;\r\n };\r\n return Cache;\r\n}());\n\nvar parentEntrySlot = new Slot();\n\nfunction maybeUnsubscribe(entryOrDep) {\r\n var unsubscribe = entryOrDep.unsubscribe;\r\n if (typeof unsubscribe === \"function\") {\r\n entryOrDep.unsubscribe = void 0;\r\n unsubscribe();\r\n }\r\n}\n\nvar emptySetPool = [];\r\nvar POOL_TARGET_SIZE = 100;\r\n// Since this package might be used browsers, we should avoid using the\r\n// Node built-in assert module.\r\nfunction assert(condition, optionalMessage) {\r\n if (!condition) {\r\n throw new Error(optionalMessage || \"assertion failure\");\r\n }\r\n}\r\nfunction valueIs(a, b) {\r\n var len = a.length;\r\n return (\r\n // Unknown values are not equal to each other.\r\n len > 0 &&\r\n // Both values must be ordinary (or both exceptional) to be equal.\r\n len === b.length &&\r\n // The underlying value or exception must be the same.\r\n a[len - 1] === b[len - 1]);\r\n}\r\nfunction valueGet(value) {\r\n switch (value.length) {\r\n case 0: throw new Error(\"unknown value\");\r\n case 1: return value[0];\r\n case 2: throw value[1];\r\n }\r\n}\r\nfunction valueCopy(value) {\r\n return value.slice(0);\r\n}\r\nvar Entry = /** @class */ (function () {\r\n function Entry(fn) {\r\n this.fn = fn;\r\n this.parents = new Set();\r\n this.childValues = new Map();\r\n // When this Entry has children that are dirty, this property becomes\r\n // a Set containing other Entry objects, borrowed from emptySetPool.\r\n // When the set becomes empty, it gets recycled back to emptySetPool.\r\n this.dirtyChildren = null;\r\n this.dirty = true;\r\n this.recomputing = false;\r\n this.value = [];\r\n this.deps = null;\r\n ++Entry.count;\r\n }\r\n Entry.prototype.peek = function () {\r\n if (this.value.length === 1 && !mightBeDirty(this)) {\r\n return this.value[0];\r\n }\r\n };\r\n // This is the most important method of the Entry API, because it\r\n // determines whether the cached this.value can be returned immediately,\r\n // or must be recomputed. The overall performance of the caching system\r\n // depends on the truth of the following observations: (1) this.dirty is\r\n // usually false, (2) this.dirtyChildren is usually null/empty, and thus\r\n // (3) valueGet(this.value) is usually returned without recomputation.\r\n Entry.prototype.recompute = function (args) {\r\n assert(!this.recomputing, \"already recomputing\");\r\n rememberParent(this);\r\n return mightBeDirty(this)\r\n ? reallyRecompute(this, args)\r\n : valueGet(this.value);\r\n };\r\n Entry.prototype.setDirty = function () {\r\n if (this.dirty)\r\n return;\r\n this.dirty = true;\r\n this.value.length = 0;\r\n reportDirty(this);\r\n forgetChildren(this);\r\n // We can go ahead and unsubscribe here, since any further dirty\r\n // notifications we receive will be redundant, and unsubscribing may\r\n // free up some resources, e.g. file watchers.\r\n maybeUnsubscribe(this);\r\n };\r\n Entry.prototype.dispose = function () {\r\n var _this = this;\r\n forgetChildren(this);\r\n maybeUnsubscribe(this);\r\n // Because this entry has been kicked out of the cache (in index.js),\r\n // we've lost the ability to find out if/when this entry becomes dirty,\r\n // whether that happens through a subscription, because of a direct call\r\n // to entry.setDirty(), or because one of its children becomes dirty.\r\n // Because of this loss of future information, we have to assume the\r\n // worst (that this entry might have become dirty very soon), so we must\r\n // immediately mark this entry's parents as dirty. Normally we could\r\n // just call entry.setDirty() rather than calling parent.setDirty() for\r\n // each parent, but that would leave this entry in parent.childValues\r\n // and parent.dirtyChildren, which would prevent the child from being\r\n // truly forgotten.\r\n this.parents.forEach(function (parent) {\r\n parent.setDirty();\r\n forgetChild(parent, _this);\r\n });\r\n };\r\n Entry.prototype.dependOn = function (dep) {\r\n dep.add(this);\r\n if (!this.deps) {\r\n this.deps = emptySetPool.pop() || new Set();\r\n }\r\n this.deps.add(dep);\r\n };\r\n Entry.prototype.forgetDeps = function () {\r\n var _this = this;\r\n if (this.deps) {\r\n this.deps.forEach(function (dep) { return dep.delete(_this); });\r\n this.deps.clear();\r\n emptySetPool.push(this.deps);\r\n this.deps = null;\r\n }\r\n };\r\n Entry.count = 0;\r\n return Entry;\r\n}());\r\nfunction rememberParent(child) {\r\n var parent = parentEntrySlot.getValue();\r\n if (parent) {\r\n child.parents.add(parent);\r\n if (!parent.childValues.has(child)) {\r\n parent.childValues.set(child, []);\r\n }\r\n if (mightBeDirty(child)) {\r\n reportDirtyChild(parent, child);\r\n }\r\n else {\r\n reportCleanChild(parent, child);\r\n }\r\n return parent;\r\n }\r\n}\r\nfunction reallyRecompute(entry, args) {\r\n forgetChildren(entry);\r\n // Set entry as the parent entry while calling recomputeNewValue(entry).\r\n parentEntrySlot.withValue(entry, recomputeNewValue, [entry, args]);\r\n if (maybeSubscribe(entry, args)) {\r\n // If we successfully recomputed entry.value and did not fail to\r\n // (re)subscribe, then this Entry is no longer explicitly dirty.\r\n setClean(entry);\r\n }\r\n return valueGet(entry.value);\r\n}\r\nfunction recomputeNewValue(entry, args) {\r\n entry.recomputing = true;\r\n // Set entry.value as unknown.\r\n entry.value.length = 0;\r\n try {\r\n // If entry.fn succeeds, entry.value will become a normal Value.\r\n entry.value[0] = entry.fn.apply(null, args);\r\n }\r\n catch (e) {\r\n // If entry.fn throws, entry.value will become exceptional.\r\n entry.value[1] = e;\r\n }\r\n // Either way, this line is always reached.\r\n entry.recomputing = false;\r\n}\r\nfunction mightBeDirty(entry) {\r\n return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size);\r\n}\r\nfunction setClean(entry) {\r\n entry.dirty = false;\r\n if (mightBeDirty(entry)) {\r\n // This Entry may still have dirty children, in which case we can't\r\n // let our parents know we're clean just yet.\r\n return;\r\n }\r\n reportClean(entry);\r\n}\r\nfunction reportDirty(child) {\r\n child.parents.forEach(function (parent) { return reportDirtyChild(parent, child); });\r\n}\r\nfunction reportClean(child) {\r\n child.parents.forEach(function (parent) { return reportCleanChild(parent, child); });\r\n}\r\n// Let a parent Entry know that one of its children may be dirty.\r\nfunction reportDirtyChild(parent, child) {\r\n // Must have called rememberParent(child) before calling\r\n // reportDirtyChild(parent, child).\r\n assert(parent.childValues.has(child));\r\n assert(mightBeDirty(child));\r\n if (!parent.dirtyChildren) {\r\n parent.dirtyChildren = emptySetPool.pop() || new Set;\r\n }\r\n else if (parent.dirtyChildren.has(child)) {\r\n // If we already know this child is dirty, then we must have already\r\n // informed our own parents that we are dirty, so we can terminate\r\n // the recursion early.\r\n return;\r\n }\r\n parent.dirtyChildren.add(child);\r\n reportDirty(parent);\r\n}\r\n// Let a parent Entry know that one of its children is no longer dirty.\r\nfunction reportCleanChild(parent, child) {\r\n // Must have called rememberChild(child) before calling\r\n // reportCleanChild(parent, child).\r\n assert(parent.childValues.has(child));\r\n assert(!mightBeDirty(child));\r\n var childValue = parent.childValues.get(child);\r\n if (childValue.length === 0) {\r\n parent.childValues.set(child, valueCopy(child.value));\r\n }\r\n else if (!valueIs(childValue, child.value)) {\r\n parent.setDirty();\r\n }\r\n removeDirtyChild(parent, child);\r\n if (mightBeDirty(parent)) {\r\n return;\r\n }\r\n reportClean(parent);\r\n}\r\nfunction removeDirtyChild(parent, child) {\r\n var dc = parent.dirtyChildren;\r\n if (dc) {\r\n dc.delete(child);\r\n if (dc.size === 0) {\r\n if (emptySetPool.length < POOL_TARGET_SIZE) {\r\n emptySetPool.push(dc);\r\n }\r\n parent.dirtyChildren = null;\r\n }\r\n }\r\n}\r\n// Removes all children from this entry and returns an array of the\r\n// removed children.\r\nfunction forgetChildren(parent) {\r\n if (parent.childValues.size > 0) {\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n });\r\n }\r\n // Remove this parent Entry from any sets to which it was added by the\r\n // addToSet method.\r\n parent.forgetDeps();\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n}\r\nfunction forgetChild(parent, child) {\r\n child.parents.delete(parent);\r\n parent.childValues.delete(child);\r\n removeDirtyChild(parent, child);\r\n}\r\nfunction maybeSubscribe(entry, args) {\r\n if (typeof entry.subscribe === \"function\") {\r\n try {\r\n maybeUnsubscribe(entry); // Prevent double subscriptions.\r\n entry.unsubscribe = entry.subscribe.apply(null, args);\r\n }\r\n catch (e) {\r\n // If this Entry has a subscribe function and it threw an exception\r\n // (or an unsubscribe function it previously returned now throws),\r\n // return false to indicate that we were not able to subscribe (or\r\n // unsubscribe), and this Entry should remain dirty.\r\n entry.setDirty();\r\n return false;\r\n }\r\n }\r\n // Returning true indicates either that there was no entry.subscribe\r\n // function or that it succeeded.\r\n return true;\r\n}\n\nfunction dep(options) {\r\n var depsByKey = new Map();\r\n var subscribe = options && options.subscribe;\r\n function depend(key) {\r\n var parent = parentEntrySlot.getValue();\r\n if (parent) {\r\n var dep_1 = depsByKey.get(key);\r\n if (!dep_1) {\r\n depsByKey.set(key, dep_1 = new Set);\r\n }\r\n parent.dependOn(dep_1);\r\n if (typeof subscribe === \"function\") {\r\n maybeUnsubscribe(dep_1);\r\n dep_1.unsubscribe = subscribe(key);\r\n }\r\n }\r\n }\r\n depend.dirty = function dirty(key) {\r\n var dep = depsByKey.get(key);\r\n if (dep) {\r\n dep.forEach(function (entry) { return entry.setDirty(); });\r\n depsByKey.delete(key);\r\n maybeUnsubscribe(dep);\r\n }\r\n };\r\n return depend;\r\n}\n\n// The defaultMakeCacheKey function is remarkably powerful, because it gives\r\n// a unique object for any shallow-identical list of arguments. If you need\r\n// to implement a custom makeCacheKey function, you may find it helpful to\r\n// delegate the final work to defaultMakeCacheKey, which is why we export it\r\n// here. However, you may want to avoid defaultMakeCacheKey if your runtime\r\n// does not support WeakMap, or you have the ability to return a string key.\r\n// In those cases, just write your own custom makeCacheKey functions.\r\nvar keyTrie = new Trie(typeof WeakMap === \"function\");\r\nfunction defaultMakeCacheKey() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return keyTrie.lookupArray(args);\r\n}\r\nvar caches = new Set();\r\nfunction wrap(originalFunction, options) {\r\n if (options === void 0) { options = Object.create(null); }\r\n var cache = new Cache(options.max || Math.pow(2, 16), function (entry) { return entry.dispose(); });\r\n var keyArgs = options.keyArgs;\r\n var makeCacheKey = options.makeCacheKey || defaultMakeCacheKey;\r\n function optimistic() {\r\n var key = makeCacheKey.apply(null, keyArgs ? keyArgs.apply(null, arguments) : arguments);\r\n if (key === void 0) {\r\n return originalFunction.apply(null, arguments);\r\n }\r\n var entry = cache.get(key);\r\n if (!entry) {\r\n cache.set(key, entry = new Entry(originalFunction));\r\n entry.subscribe = options.subscribe;\r\n }\r\n var value = entry.recompute(Array.prototype.slice.call(arguments));\r\n // Move this entry to the front of the least-recently used queue,\r\n // since we just finished computing its value.\r\n cache.set(key, entry);\r\n caches.add(cache);\r\n // Clean up any excess entries in the cache, but only if there is no\r\n // active parent entry, meaning we're not in the middle of a larger\r\n // computation that might be flummoxed by the cleaning.\r\n if (!parentEntrySlot.hasValue()) {\r\n caches.forEach(function (cache) { return cache.clean(); });\r\n caches.clear();\r\n }\r\n return value;\r\n }\r\n function lookup() {\r\n var key = makeCacheKey.apply(null, arguments);\r\n if (key !== void 0) {\r\n return cache.get(key);\r\n }\r\n }\r\n optimistic.dirty = function () {\r\n var entry = lookup.apply(null, arguments);\r\n if (entry) {\r\n entry.setDirty();\r\n }\r\n };\r\n optimistic.peek = function () {\r\n var entry = lookup.apply(null, arguments);\r\n if (entry) {\r\n return entry.peek();\r\n }\r\n };\r\n optimistic.forget = function () {\r\n var key = makeCacheKey.apply(null, arguments);\r\n return key !== void 0 && cache.delete(key);\r\n };\r\n return optimistic;\r\n}\n\nexport { defaultMakeCacheKey, dep, wrap };\n//# sourceMappingURL=bundle.esm.js.map\n","import { Observable } from \"../../utilities/index.js\";\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\n//# sourceMappingURL=fromError.js.map","import { invariant } from 'ts-invariant';\nexport function toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Promise Wrapper does not support multiple results from Observable\");\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n//# sourceMappingURL=toPromise.js.map","import { Observable } from \"../../utilities/index.js\";\nexport function fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n//# sourceMappingURL=fromPromise.js.map","export var throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\n//# sourceMappingURL=throwServerError.js.map","import { InvariantError } from 'ts-invariant';\nexport function validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(26) : new InvariantError(\"illegal argument: \" + key);\n }\n }\n return operation;\n}\n//# sourceMappingURL=validateOperation.js.map","import { __assign } from \"tslib\";\nexport function createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign(__assign({}, context), next(context));\n }\n else {\n context = __assign(__assign({}, context), next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map","import { getOperationName } from \"../../utilities/index.js\";\nexport function transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n return transformedOperation;\n}\n//# sourceMappingURL=transformOperation.js.map","export { empty } from \"./empty.js\";\nexport { from } from \"./from.js\";\nexport { split } from \"./split.js\";\nexport { concat } from \"./concat.js\";\nexport { execute } from \"./execute.js\";\nexport { ApolloLink } from \"./ApolloLink.js\";\nexport * from \"./types.js\";\n//# sourceMappingURL=index.js.map","import { __extends } from \"tslib\";\nimport { isNonEmptyArray } from \"../utilities/index.js\";\nexport function isApolloError(err) {\n return err.hasOwnProperty('graphQLErrors');\n}\nvar generateErrorMessage = function (err) {\n var message = '';\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach(function (graphQLError) {\n var errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += errorMessage + \"\\n\";\n });\n }\n if (err.networkError) {\n message += err.networkError.message + \"\\n\";\n }\n message = message.replace(/\\n$/, '');\n return message;\n};\nvar ApolloError = (function (_super) {\n __extends(ApolloError, _super);\n function ApolloError(_a) {\n var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;\n var _this = _super.call(this, errorMessage) || this;\n _this.graphQLErrors = graphQLErrors || [];\n _this.networkError = networkError || null;\n _this.message = errorMessage || generateErrorMessage(_this);\n _this.extraInfo = extraInfo;\n _this.__proto__ = ApolloError.prototype;\n return _this;\n }\n return ApolloError;\n}(Error));\nexport { ApolloError };\n//# sourceMappingURL=index.js.map","import React from 'react';\nimport { canUseWeakMap } from \"../../utilities/index.js\";\nvar cache = new (canUseWeakMap ? WeakMap : Map)();\nexport function getApolloContext() {\n var context = cache.get(React.createContext);\n if (!context) {\n context = React.createContext({});\n context.displayName = 'ApolloContext';\n cache.set(React.createContext, context);\n }\n return context;\n}\nexport { getApolloContext as resetApolloContext };\n//# sourceMappingURL=ApolloContext.js.map","import React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from \"./ApolloContext.js\";\nexport var ApolloConsumer = function (props) {\n var ApolloContext = getApolloContext();\n return React.createElement(ApolloContext.Consumer, null, function (context) {\n process.env.NODE_ENV === \"production\" ? invariant(context && context.client, 27) : invariant(context && context.client, 'Could not find \"client\" in the context of ApolloConsumer. ' +\n 'Wrap the root component in an .');\n return props.children(context.client);\n });\n};\n//# sourceMappingURL=ApolloConsumer.js.map","import React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from \"./ApolloContext.js\";\nexport var ApolloProvider = function (_a) {\n var client = _a.client, children = _a.children;\n var ApolloContext = getApolloContext();\n return React.createElement(ApolloContext.Consumer, null, function (context) {\n if (context === void 0) { context = {}; }\n if (client && context.client !== client) {\n context = Object.assign({}, context, { client: client });\n }\n process.env.NODE_ENV === \"production\" ? invariant(context.client, 28) : invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.');\n return (React.createElement(ApolloContext.Provider, { value: context }, children));\n });\n};\n//# sourceMappingURL=ApolloProvider.js.map","import { invariant } from 'ts-invariant';\nexport var DocumentType;\n(function (DocumentType) {\n DocumentType[DocumentType[\"Query\"] = 0] = \"Query\";\n DocumentType[DocumentType[\"Mutation\"] = 1] = \"Mutation\";\n DocumentType[DocumentType[\"Subscription\"] = 2] = \"Subscription\";\n})(DocumentType || (DocumentType = {}));\nvar cache = new Map();\nexport function operationName(type) {\n var name;\n switch (type) {\n case DocumentType.Query:\n name = 'Query';\n break;\n case DocumentType.Mutation:\n name = 'Mutation';\n break;\n case DocumentType.Subscription:\n name = 'Subscription';\n break;\n }\n return name;\n}\nexport function parser(document) {\n var cached = cache.get(document);\n if (cached)\n return cached;\n var variables, type, name;\n process.env.NODE_ENV === \"production\" ? invariant(!!document && !!document.kind, 34) : invariant(!!document && !!document.kind, \"Argument of \" + document + \" passed to parser was not a valid GraphQL \" +\n \"DocumentNode. You may need to use 'graphql-tag' or another method \" +\n \"to convert your operation into a document\");\n var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; });\n var queries = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'query';\n });\n var mutations = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'mutation';\n });\n var subscriptions = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'subscription';\n });\n process.env.NODE_ENV === \"production\" ? invariant(!fragments.length ||\n (queries.length || mutations.length || subscriptions.length), 35) : invariant(!fragments.length ||\n (queries.length || mutations.length || subscriptions.length), \"Passing only a fragment to 'graphql' is not yet supported. \" +\n \"You must include a query, subscription or mutation as well\");\n process.env.NODE_ENV === \"production\" ? invariant(queries.length + mutations.length + subscriptions.length <= 1, 36) : invariant(queries.length + mutations.length + subscriptions.length <= 1, \"react-apollo only supports a query, subscription, or a mutation per HOC. \" +\n (document + \" had \" + queries.length + \" queries, \" + subscriptions.length + \" \") +\n (\"subscriptions and \" + mutations.length + \" mutations. \") +\n \"You can use 'compose' to join multiple operation types to a component\");\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length)\n type = DocumentType.Subscription;\n var definitions = queries.length\n ? queries\n : mutations.length\n ? mutations\n : subscriptions;\n process.env.NODE_ENV === \"production\" ? invariant(definitions.length === 1, 37) : invariant(definitions.length === 1, \"react-apollo only supports one definition per HOC. \" + document + \" had \" +\n (definitions.length + \" definitions. \") +\n \"You can use 'compose' to join multiple operation types to a component\");\n var definition = definitions[0];\n variables = definition.variableDefinitions || [];\n if (definition.name && definition.name.kind === 'Name') {\n name = definition.name.value;\n }\n else {\n name = 'data';\n }\n var payload = { name: name, type: type, variables: variables };\n cache.set(document, payload);\n return payload;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UPDATE_TAG = exports.UPDATE_ASSET_COLLECTION = exports.UPDATE_ASSET = exports.UNTAG_ASSET = exports.TAG_ASSET = exports.SET_ASSET_TAGS = exports.SET_ASSET_COLLECTIONS = exports.IMPORT_ASSET = exports.DELETE_TAG = exports.DELETE_ASSET_COLLECTION = exports.DELETE_ASSET = exports.CREATE_TAG = exports.CREATE_ASSET_COLLECTION = void 0;\nvar createAssetCollection_1 = __importDefault(require(\"./createAssetCollection\"));\nexports.CREATE_ASSET_COLLECTION = createAssetCollection_1.default;\nvar createTag_1 = __importDefault(require(\"./createTag\"));\nexports.CREATE_TAG = createTag_1.default;\nvar deleteAsset_1 = __importDefault(require(\"./deleteAsset\"));\nexports.DELETE_ASSET = deleteAsset_1.default;\nvar deleteAssetCollection_1 = __importDefault(require(\"./deleteAssetCollection\"));\nexports.DELETE_ASSET_COLLECTION = deleteAssetCollection_1.default;\nvar deleteTag_1 = __importDefault(require(\"./deleteTag\"));\nexports.DELETE_TAG = deleteTag_1.default;\nvar importAsset_1 = __importDefault(require(\"./importAsset\"));\nexports.IMPORT_ASSET = importAsset_1.default;\nvar setAssetCollections_1 = __importDefault(require(\"./setAssetCollections\"));\nexports.SET_ASSET_COLLECTIONS = setAssetCollections_1.default;\nvar setAssetTags_1 = __importDefault(require(\"./setAssetTags\"));\nexports.SET_ASSET_TAGS = setAssetTags_1.default;\nvar tagAsset_1 = __importDefault(require(\"./tagAsset\"));\nexports.TAG_ASSET = tagAsset_1.default;\nvar untagAsset_1 = __importDefault(require(\"./untagAsset\"));\nexports.UNTAG_ASSET = untagAsset_1.default;\nvar updateAsset_1 = __importDefault(require(\"./updateAsset\"));\nexports.UPDATE_ASSET = updateAsset_1.default;\nvar updateAssetCollection_1 = __importDefault(require(\"./updateAssetCollection\"));\nexports.UPDATE_ASSET_COLLECTION = updateAssetCollection_1.default;\nvar updateTag_1 = __importDefault(require(\"./updateTag\"));\nexports.UPDATE_TAG = updateTag_1.default;\n","import { __extends } from \"tslib\";\nimport { InvariantError, invariant } from 'ts-invariant';\nimport { Observable } from \"../../utilities/index.js\";\nimport { validateOperation, createOperation, transformOperation, } from \"../utils/index.js\";\nfunction passthrough(op, forward) {\n return (forward ? forward(op) : Observable.of());\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nvar LinkError = (function (_super) {\n __extends(LinkError, _super);\n function LinkError(message, link) {\n var _this = _super.call(this, message) || this;\n _this.link = link;\n return _this;\n }\n return LinkError;\n}(Error));\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.empty = function () {\n return new ApolloLink(function () { return Observable.of(); });\n };\n ApolloLink.from = function (links) {\n if (links.length === 0)\n return ApolloLink.empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n };\n ApolloLink.split = function (test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n };\n ApolloLink.execute = function (link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n };\n ApolloLink.concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n process.env.NODE_ENV === \"production\" || invariant.warn(new LinkError(\"You are calling concat on a terminating link, which will have no effect\", firstLink));\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n };\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return ApolloLink.concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(21) : new InvariantError('request is not implemented');\n };\n ApolloLink.prototype.onError = function (error, observer) {\n if (observer && observer.error) {\n observer.error(error);\n return false;\n }\n throw error;\n };\n ApolloLink.prototype.setOnError = function (fn) {\n this.onError = fn;\n return this;\n };\n return ApolloLink;\n}());\nexport { ApolloLink };\n//# sourceMappingURL=ApolloLink.js.map","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ASSET_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nvar assetSource_1 = require(\"./assetSource\");\nvar iptcProperty_1 = require(\"./iptcProperty\");\nvar file_1 = require(\"./file\");\nvar tag_1 = require(\"./tag\");\n// TODO: Somehow extend `isInClipboard` from clipboard feature package\nexports.ASSET_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment AssetProps on Asset {\\n id\\n localId\\n assetSource {\\n ...AssetSourceProps\\n }\\n imported\\n label\\n caption\\n filename\\n tags {\\n ...TagProps\\n }\\n collections {\\n id\\n title\\n }\\n copyrightNotice\\n lastModified\\n iptcProperties {\\n ...IptcPropertyProps\\n }\\n width\\n height\\n file {\\n ...FileProps\\n }\\n thumbnailUrl\\n previewUrl\\n isInClipboard @client\\n isInUse @include(if: $includeUsage)\\n }\\n \", \"\\n \", \"\\n \", \"\\n \", \"\\n\"], [\"\\n fragment AssetProps on Asset {\\n id\\n localId\\n assetSource {\\n ...AssetSourceProps\\n }\\n imported\\n label\\n caption\\n filename\\n tags {\\n ...TagProps\\n }\\n collections {\\n id\\n title\\n }\\n copyrightNotice\\n lastModified\\n iptcProperties {\\n ...IptcPropertyProps\\n }\\n width\\n height\\n file {\\n ...FileProps\\n }\\n thumbnailUrl\\n previewUrl\\n isInClipboard @client\\n isInUse @include(if: $includeUsage)\\n }\\n \", \"\\n \", \"\\n \", \"\\n \", \"\\n\"])), assetSource_1.ASSET_SOURCE_FRAGMENT, iptcProperty_1.IPTC_PROPERTY_FRAGMENT, file_1.FILE_FRAGMENT, tag_1.TAG_FRAGMENT);\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PropertyListItem = exports.PropertyList = exports.IconLabel = exports.Column = exports.AssetLabel = void 0;\nvar AssetLabel_1 = __importDefault(require(\"./AssetLabel\"));\nexports.AssetLabel = AssetLabel_1.default;\nvar Column_1 = __importDefault(require(\"./Column\"));\nexports.Column = Column_1.default;\nvar IconLabel_1 = __importDefault(require(\"./IconLabel\"));\nexports.IconLabel = IconLabel_1.default;\nvar PropertyList_1 = __importDefault(require(\"./PropertyList\"));\nexports.PropertyList = PropertyList_1.default;\nvar PropertyListItem_1 = __importDefault(require(\"./PropertyListItem\"));\nexports.PropertyListItem = PropertyListItem_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MainViewState = exports.mainViewState = exports.createTagDialogState = exports.createAssetCollectionDialogState = void 0;\nvar createAssetCollectionDialogState_1 = __importDefault(require(\"./createAssetCollectionDialogState\"));\nexports.createAssetCollectionDialogState = createAssetCollectionDialogState_1.default;\nvar createTagDialogState_1 = __importDefault(require(\"./createTagDialogState\"));\nexports.createTagDialogState = createTagDialogState_1.default;\nvar mainViewState_1 = require(\"./mainViewState\");\nObject.defineProperty(exports, \"mainViewState\", { enumerable: true, get: function () { return mainViewState_1.mainViewState; } });\nObject.defineProperty(exports, \"MainViewState\", { enumerable: true, get: function () { return mainViewState_1.MainViewState; } });\n","var isProduction = process.env.NODE_ENV === 'production';\nfunction warning(condition, message) {\n if (!isProduction) {\n if (condition) {\n return;\n }\n\n var text = \"Warning: \" + message;\n\n if (typeof console !== 'undefined') {\n console.warn(text);\n }\n\n try {\n throw Error(text);\n } catch (x) {}\n }\n}\n\nexport default warning;\n","export { ApolloClient, mergeOptions, } from \"./ApolloClient.js\";\nexport { ObservableQuery, } from \"./ObservableQuery.js\";\nexport { NetworkStatus } from \"./networkStatus.js\";\nexport * from \"./types.js\";\nexport { isApolloError, ApolloError } from \"../errors/index.js\";\nexport { Cache, ApolloCache, InMemoryCache, MissingFieldError, defaultDataIdFromObject, makeVar, } from \"../cache/index.js\";\nexport * from \"../cache/inmemory/types.js\";\nexport * from \"../link/core/index.js\";\nexport * from \"../link/http/index.js\";\nexport { fromError, toPromise, fromPromise, throwServerError, } from \"../link/utils/index.js\";\nexport { Observable, isReference, makeReference, } from \"../utilities/index.js\";\nimport { setVerbosity } from \"ts-invariant\";\nexport { setVerbosity as setLogVerbosity };\nsetVerbosity(\"log\");\nimport gql from 'graphql-tag';\nexport var resetCaches = gql.resetCaches, disableFragmentWarnings = gql.disableFragmentWarnings, enableExperimentalFragmentVariables = gql.enableExperimentalFragmentVariables, disableExperimentalFragmentVariables = gql.disableExperimentalFragmentVariables;\nexport { gql };\n//# sourceMappingURL=index.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nfunction readFromConsumerApi(key) {\n return function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][\"@\" + key]) {\n return (_a = window['@Neos:HostPluginAPI'])[\"@\" + key].apply(_a, tslib_1.__spread(args));\n }\n throw new Error(\"You are trying to read from a consumer api that hasn't been initialized yet!\");\n };\n}\nexports[\"default\"] = readFromConsumerApi;\n//# sourceMappingURL=readFromConsumerApi.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useClipboard = exports.clipboardVisibleState = exports.buildResolvers = exports.ClipboardWatcher = exports.ClipboardItem = exports.ClipboardActions = exports.ClipboardToggle = exports.CLIPBOARD = exports.TOGGLE_CLIPBOARD_STATE = void 0;\nvar clipboardVisibleState_1 = __importDefault(require(\"./state/clipboardVisibleState\"));\nexports.clipboardVisibleState = clipboardVisibleState_1.default;\nvar ClipboardQuery_1 = require(\"./queries/ClipboardQuery\");\nObject.defineProperty(exports, \"CLIPBOARD\", { enumerable: true, get: function () { return ClipboardQuery_1.CLIPBOARD; } });\nObject.defineProperty(exports, \"TOGGLE_CLIPBOARD_STATE\", { enumerable: true, get: function () { return ClipboardQuery_1.TOGGLE_CLIPBOARD_STATE; } });\nvar useClipboard_1 = __importDefault(require(\"./hooks/useClipboard\"));\nexports.useClipboard = useClipboard_1.default;\nvar ClipboardToggle_1 = __importDefault(require(\"./components/ClipboardToggle\"));\nexports.ClipboardToggle = ClipboardToggle_1.default;\nvar ClipboardItem_1 = __importDefault(require(\"./components/ClipboardItem\"));\nexports.ClipboardItem = ClipboardItem_1.default;\nvar ClipboardActions_1 = __importDefault(require(\"./components/ClipboardActions\"));\nexports.ClipboardActions = ClipboardActions_1.default;\nvar ClipboardWatcher_1 = __importDefault(require(\"./components/ClipboardWatcher\"));\nexports.ClipboardWatcher = ClipboardWatcher_1.default;\nvar mutation_1 = __importDefault(require(\"./resolvers/mutation\"));\nexports.buildResolvers = mutation_1.default;\n","export { ApolloCache } from \"./core/cache.js\";\nexport { Cache } from \"./core/types/Cache.js\";\nexport { MissingFieldError } from \"./core/types/common.js\";\nexport { isReference, makeReference, } from \"../utilities/index.js\";\nexport { InMemoryCache, } from \"./inmemory/inMemoryCache.js\";\nexport { makeVar, cacheSlot, } from \"./inmemory/reactiveVars.js\";\nexport { defaultDataIdFromObject, } from \"./inmemory/policies.js\";\nexport * from \"./inmemory/types.js\";\n//# sourceMappingURL=index.js.map","// This currentContext variable will only be used if the makeSlotClass\r\n// function is called, which happens only if this is the first copy of the\r\n// @wry/context package to be imported.\r\nvar currentContext = null;\r\n// This unique internal object is used to denote the absence of a value\r\n// for a given Slot, and is never exposed to outside code.\r\nvar MISSING_VALUE = {};\r\nvar idCounter = 1;\r\n// Although we can't do anything about the cost of duplicated code from\r\n// accidentally bundling multiple copies of the @wry/context package, we can\r\n// avoid creating the Slot class more than once using makeSlotClass.\r\nvar makeSlotClass = function () { return /** @class */ (function () {\r\n function Slot() {\r\n // If you have a Slot object, you can find out its slot.id, but you cannot\r\n // guess the slot.id of a Slot you don't have access to, thanks to the\r\n // randomized suffix.\r\n this.id = [\r\n \"slot\",\r\n idCounter++,\r\n Date.now(),\r\n Math.random().toString(36).slice(2),\r\n ].join(\":\");\r\n }\r\n Slot.prototype.hasValue = function () {\r\n for (var context_1 = currentContext; context_1; context_1 = context_1.parent) {\r\n // We use the Slot object iself as a key to its value, which means the\r\n // value cannot be obtained without a reference to the Slot object.\r\n if (this.id in context_1.slots) {\r\n var value = context_1.slots[this.id];\r\n if (value === MISSING_VALUE)\r\n break;\r\n if (context_1 !== currentContext) {\r\n // Cache the value in currentContext.slots so the next lookup will\r\n // be faster. This caching is safe because the tree of contexts and\r\n // the values of the slots are logically immutable.\r\n currentContext.slots[this.id] = value;\r\n }\r\n return true;\r\n }\r\n }\r\n if (currentContext) {\r\n // If a value was not found for this Slot, it's never going to be found\r\n // no matter how many times we look it up, so we might as well cache\r\n // the absence of the value, too.\r\n currentContext.slots[this.id] = MISSING_VALUE;\r\n }\r\n return false;\r\n };\r\n Slot.prototype.getValue = function () {\r\n if (this.hasValue()) {\r\n return currentContext.slots[this.id];\r\n }\r\n };\r\n Slot.prototype.withValue = function (value, callback, \r\n // Given the prevalence of arrow functions, specifying arguments is likely\r\n // to be much more common than specifying `this`, hence this ordering:\r\n args, thisArg) {\r\n var _a;\r\n var slots = (_a = {\r\n __proto__: null\r\n },\r\n _a[this.id] = value,\r\n _a);\r\n var parent = currentContext;\r\n currentContext = { parent: parent, slots: slots };\r\n try {\r\n // Function.prototype.apply allows the arguments array argument to be\r\n // omitted or undefined, so args! is fine here.\r\n return callback.apply(thisArg, args);\r\n }\r\n finally {\r\n currentContext = parent;\r\n }\r\n };\r\n // Capture the current context and wrap a callback function so that it\r\n // reestablishes the captured context when called.\r\n Slot.bind = function (callback) {\r\n var context = currentContext;\r\n return function () {\r\n var saved = currentContext;\r\n try {\r\n currentContext = context;\r\n return callback.apply(this, arguments);\r\n }\r\n finally {\r\n currentContext = saved;\r\n }\r\n };\r\n };\r\n // Immediately run a callback function without any captured context.\r\n Slot.noContext = function (callback, \r\n // Given the prevalence of arrow functions, specifying arguments is likely\r\n // to be much more common than specifying `this`, hence this ordering:\r\n args, thisArg) {\r\n if (currentContext) {\r\n var saved = currentContext;\r\n try {\r\n currentContext = null;\r\n // Function.prototype.apply allows the arguments array argument to be\r\n // omitted or undefined, so args! is fine here.\r\n return callback.apply(thisArg, args);\r\n }\r\n finally {\r\n currentContext = saved;\r\n }\r\n }\r\n else {\r\n return callback.apply(thisArg, args);\r\n }\r\n };\r\n return Slot;\r\n}()); };\r\n// We store a single global implementation of the Slot class as a permanent\r\n// non-enumerable symbol property of the Array constructor. This obfuscation\r\n// does nothing to prevent access to the Slot class, but at least it ensures\r\n// the implementation (i.e. currentContext) cannot be tampered with, and all\r\n// copies of the @wry/context package (hopefully just one) will share the\r\n// same Slot implementation. Since the first copy of the @wry/context package\r\n// to be imported wins, this technique imposes a very high cost for any\r\n// future breaking changes to the Slot class.\r\nvar globalKey = \"@wry/context:Slot\";\r\nvar host = Array;\r\nvar Slot = host[globalKey] || function () {\r\n var Slot = makeSlotClass();\r\n try {\r\n Object.defineProperty(host, globalKey, {\r\n value: host[globalKey] = Slot,\r\n enumerable: false,\r\n writable: false,\r\n configurable: false,\r\n });\r\n }\r\n finally {\r\n return Slot;\r\n }\r\n}();\n\nvar bind = Slot.bind, noContext = Slot.noContext;\r\nfunction setTimeoutWithContext(callback, delay) {\r\n return setTimeout(bind(callback), delay);\r\n}\r\n// Turn any generator function into an async function (using yield instead\r\n// of await), with context automatically preserved across yields.\r\nfunction asyncFromGen(genFn) {\r\n return function () {\r\n var gen = genFn.apply(this, arguments);\r\n var boundNext = bind(gen.next);\r\n var boundThrow = bind(gen.throw);\r\n return new Promise(function (resolve, reject) {\r\n function invoke(method, argument) {\r\n try {\r\n var result = method.call(gen, argument);\r\n }\r\n catch (error) {\r\n return reject(error);\r\n }\r\n var next = result.done ? resolve : invokeNext;\r\n if (isPromiseLike(result.value)) {\r\n result.value.then(next, result.done ? reject : invokeThrow);\r\n }\r\n else {\r\n next(result.value);\r\n }\r\n }\r\n var invokeNext = function (value) { return invoke(boundNext, value); };\r\n var invokeThrow = function (error) { return invoke(boundThrow, error); };\r\n invokeNext();\r\n });\r\n };\r\n}\r\nfunction isPromiseLike(value) {\r\n return value && typeof value.then === \"function\";\r\n}\r\n// If you use the fibers npm package to implement coroutines in Node.js,\r\n// you should call this function at least once to ensure context management\r\n// remains coherent across any yields.\r\nvar wrappedFibers = [];\r\nfunction wrapYieldingFiberMethods(Fiber) {\r\n // There can be only one implementation of Fiber per process, so this array\r\n // should never grow longer than one element.\r\n if (wrappedFibers.indexOf(Fiber) < 0) {\r\n var wrap = function (obj, method) {\r\n var fn = obj[method];\r\n obj[method] = function () {\r\n return noContext(fn, arguments, this);\r\n };\r\n };\r\n // These methods can yield, according to\r\n // https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100\r\n wrap(Fiber, \"yield\");\r\n wrap(Fiber.prototype, \"run\");\r\n wrap(Fiber.prototype, \"throwInto\");\r\n wrappedFibers.push(Fiber);\r\n }\r\n return Fiber;\r\n}\n\nexport { Slot, asyncFromGen, bind, noContext, setTimeoutWithContext as setTimeout, wrapYieldingFiberMethods };\n//# sourceMappingURL=context.esm.js.map\n","import { dep } from \"optimism\";\nimport { Slot } from \"@wry/context\";\nexport var cacheSlot = new Slot();\nfunction consumeAndIterate(set, callback) {\n if (set.size) {\n var items_1 = [];\n set.forEach(function (item) { return items_1.push(item); });\n set.clear();\n items_1.forEach(callback);\n }\n}\nvar cacheInfoMap = new WeakMap();\nfunction getCacheInfo(cache) {\n var info = cacheInfoMap.get(cache);\n if (!info) {\n cacheInfoMap.set(cache, info = {\n vars: new Set,\n dep: dep(),\n });\n }\n return info;\n}\nexport function forgetCache(cache) {\n getCacheInfo(cache).vars.forEach(function (rv) { return rv.forgetCache(cache); });\n}\nexport function recallCache(cache) {\n getCacheInfo(cache).vars.forEach(function (rv) { return rv.attachCache(cache); });\n}\nexport function makeVar(value) {\n var caches = new Set();\n var listeners = new Set();\n var rv = function (newValue) {\n if (arguments.length > 0) {\n if (value !== newValue) {\n value = newValue;\n caches.forEach(function (cache) {\n getCacheInfo(cache).dep.dirty(rv);\n broadcast(cache);\n });\n consumeAndIterate(listeners, function (listener) { return listener(value); });\n }\n }\n else {\n var cache = cacheSlot.getValue();\n if (cache) {\n attach(cache);\n getCacheInfo(cache).dep(rv);\n }\n }\n return value;\n };\n rv.onNextChange = function (listener) {\n listeners.add(listener);\n return function () {\n listeners.delete(listener);\n };\n };\n var attach = rv.attachCache = function (cache) {\n caches.add(cache);\n getCacheInfo(cache).vars.add(rv);\n return rv;\n };\n rv.forgetCache = function (cache) { return caches.delete(cache); };\n return rv;\n}\nfunction broadcast(cache) {\n if (cache.broadcastWatches) {\n cache.broadcastWatches();\n }\n}\n//# sourceMappingURL=reactiveVars.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexport var isBrowser = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\" && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === 'object' && document.nodeType === 9;\n\nexport default isBrowser;\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TAG_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.TAG_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment TagProps on Tag {\\n id\\n label\\n }\\n\"], [\"\\n fragment TagProps on Tag {\\n id\\n label\\n }\\n\"])));\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useUnusedAssetCountQuery = exports.useUnusedAssetsQuery = exports.useAssetUsagesQuery = exports.showUnusedAssetsState = exports.assetUsageDetailsModalState = exports.UsageDetailsMetadataType = exports.USAGE_DETAILS_GROUP_FRAGMENT = exports.UNUSED_ASSETS = exports.AssetUsagesToggleButton = exports.AssetUsagesModal = exports.ASSET_USAGE_DETAILS = void 0;\nvar assetUsages_1 = __importDefault(require(\"./queries/assetUsages\"));\nexports.ASSET_USAGE_DETAILS = assetUsages_1.default;\nvar unusedAssets_1 = __importDefault(require(\"./queries/unusedAssets\"));\nexports.UNUSED_ASSETS = unusedAssets_1.default;\nvar usageDetailsGroupFragment_1 = __importDefault(require(\"./fragments/usageDetailsGroupFragment\"));\nexports.USAGE_DETAILS_GROUP_FRAGMENT = usageDetailsGroupFragment_1.default;\nvar UsageDetails_1 = require(\"./interfaces/UsageDetails\");\nObject.defineProperty(exports, \"UsageDetailsMetadataType\", { enumerable: true, get: function () { return UsageDetails_1.UsageDetailsMetadataType; } });\nvar AssetUsagesModal_1 = __importDefault(require(\"./components/AssetUsagesModal\"));\nexports.AssetUsagesModal = AssetUsagesModal_1.default;\nvar AssetUsagesToggleButton_1 = __importDefault(require(\"./components/AssetUsagesToggleButton\"));\nexports.AssetUsagesToggleButton = AssetUsagesToggleButton_1.default;\nvar assetUsageDetailsModalState_1 = __importDefault(require(\"./state/assetUsageDetailsModalState\"));\nexports.assetUsageDetailsModalState = assetUsageDetailsModalState_1.default;\nvar showUnusedAssetsState_1 = __importDefault(require(\"./state/showUnusedAssetsState\"));\nexports.showUnusedAssetsState = showUnusedAssetsState_1.default;\nvar useAssetUsages_1 = __importDefault(require(\"./hooks/useAssetUsages\"));\nexports.useAssetUsagesQuery = useAssetUsages_1.default;\nvar useUnusedAssetsQuery_1 = __importDefault(require(\"./hooks/useUnusedAssetsQuery\"));\nexports.useUnusedAssetsQuery = useUnusedAssetsQuery_1.default;\nvar useUnusedAssetCountQuery_1 = __importDefault(require(\"./queries/useUnusedAssetCountQuery\"));\nexports.useUnusedAssetCountQuery = useUnusedAssetCountQuery_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Main = exports.AssetActions = exports.ListViewItem = exports.ListView = exports.Thumbnail = exports.ThumbnailView = void 0;\nvar AssetActions_1 = __importDefault(require(\"./AssetActions\"));\nexports.AssetActions = AssetActions_1.default;\nvar ListView_1 = __importDefault(require(\"./ListView\"));\nexports.ListView = ListView_1.default;\nvar ListViewItem_1 = __importDefault(require(\"./ListViewItem\"));\nexports.ListViewItem = ListViewItem_1.default;\nvar Main_1 = __importDefault(require(\"./Main\"));\nexports.Main = Main_1.default;\nvar Thumbnail_1 = __importDefault(require(\"./Thumbnail\"));\nexports.Thumbnail = Thumbnail_1.default;\nvar ThumbnailView_1 = __importDefault(require(\"./ThumbnailView\"));\nexports.ThumbnailView = ThumbnailView_1.default;\n","var MissingFieldError = (function () {\n function MissingFieldError(message, path, query, clientOnly, variables) {\n this.message = message;\n this.path = path;\n this.query = query;\n this.clientOnly = clientOnly;\n this.variables = variables;\n }\n return MissingFieldError;\n}());\nexport { MissingFieldError };\n//# sourceMappingURL=common.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport default function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}\n","// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nexport var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';\n","/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}\n","import { getLocation } from \"./location.mjs\";\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printLocation(location) {\n return printSourceLocation(location.source, getLocation(location.source, location.start));\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {\n var prefix = _ref2[0];\n return prefix.length;\n }));\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction leftPad(len, str) {\n return whitespace(len - str.length) + str;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// FIXME:\n// flowlint uninitialized-instance-property:off\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport { getLocation } from \"../language/location.mjs\";\nimport { printLocation, printSourceLocation } from \"../language/printLocation.mjs\";\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport var GraphQLError = /*#__PURE__*/function (_Error) {\n _inherits(GraphQLError, _Error);\n\n var _super = _createSuper(GraphQLError);\n\n /**\n * A message describing the Error for debugging purposes.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n *\n * Note: should be treated as readonly, despite invariant usage.\n */\n\n /**\n * An array of { line, column } locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {\n var _locations2, _source2, _positions2, _extensions2;\n\n var _this;\n\n _classCallCheck(this, GraphQLError);\n\n _this = _super.call(this, message); // Compute list of blame nodes.\n\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var _nodes$0$loc;\n\n _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return getLocation(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(getLocation(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions;\n\n if (_extensions == null && originalError != null) {\n var originalExtensions = originalError.extensions;\n\n if (isObjectLike(originalExtensions)) {\n _extensions = originalExtensions;\n }\n }\n\n Object.defineProperties(_assertThisInitialized(_this), {\n name: {\n value: 'GraphQLError'\n },\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: _locations != null\n },\n path: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path !== null && path !== void 0 ? path : undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: path != null\n },\n nodes: {\n value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined\n },\n source: {\n value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined\n },\n positions: {\n value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: _extensions != null\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError !== null && originalError !== void 0 && originalError.stack) {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n return _possibleConstructorReturn(_this);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);\n } else {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n\n return _this;\n }\n\n _createClass(GraphQLError, [{\n key: \"toString\",\n value: function toString() {\n return printError(this);\n } // FIXME: workaround to not break chai comparisons, should be remove in v16\n // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n }, {\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Object';\n }\n }]);\n\n return GraphQLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\n\nexport function printError(error) {\n var output = error.message;\n\n if (error.nodes) {\n for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) {\n var node = _error$nodes2[_i2];\n\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (error.source && error.locations) {\n for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) {\n var location = _error$locations2[_i4];\n output += '\\n\\n' + printSourceLocation(error.source, location);\n }\n }\n\n return output;\n}\n","import { GraphQLError } from \"./GraphQLError.mjs\";\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(\"Syntax Error: \".concat(description), undefined, source, [position]);\n}\n","/**\n * The set of allowed kind values for AST nodes.\n */\nexport var Kind = Object.freeze({\n // Name\n NAME: 'Name',\n // Document\n DOCUMENT: 'Document',\n OPERATION_DEFINITION: 'OperationDefinition',\n VARIABLE_DEFINITION: 'VariableDefinition',\n SELECTION_SET: 'SelectionSet',\n FIELD: 'Field',\n ARGUMENT: 'Argument',\n // Fragments\n FRAGMENT_SPREAD: 'FragmentSpread',\n INLINE_FRAGMENT: 'InlineFragment',\n FRAGMENT_DEFINITION: 'FragmentDefinition',\n // Values\n VARIABLE: 'Variable',\n INT: 'IntValue',\n FLOAT: 'FloatValue',\n STRING: 'StringValue',\n BOOLEAN: 'BooleanValue',\n NULL: 'NullValue',\n ENUM: 'EnumValue',\n LIST: 'ListValue',\n OBJECT: 'ObjectValue',\n OBJECT_FIELD: 'ObjectField',\n // Directives\n DIRECTIVE: 'Directive',\n // Types\n NAMED_TYPE: 'NamedType',\n LIST_TYPE: 'ListType',\n NON_NULL_TYPE: 'NonNullType',\n // Type System Definitions\n SCHEMA_DEFINITION: 'SchemaDefinition',\n OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',\n // Type Definitions\n SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',\n OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',\n FIELD_DEFINITION: 'FieldDefinition',\n INPUT_VALUE_DEFINITION: 'InputValueDefinition',\n INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',\n UNION_TYPE_DEFINITION: 'UnionTypeDefinition',\n ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',\n ENUM_VALUE_DEFINITION: 'EnumValueDefinition',\n INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',\n // Directive Definitions\n DIRECTIVE_DEFINITION: 'DirectiveDefinition',\n // Type System Extensions\n SCHEMA_EXTENSION: 'SchemaExtension',\n // Type Extensions\n SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',\n OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',\n INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',\n UNION_TYPE_EXTENSION: 'UnionTypeExtension',\n ENUM_TYPE_EXTENSION: 'EnumTypeExtension',\n INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'\n});\n/**\n * The enum type representing the possible kind values of AST nodes.\n */\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport var TokenKind = Object.freeze({\n SOF: '',\n EOF: '',\n BANG: '!',\n DOLLAR: '$',\n AMP: '&',\n PAREN_L: '(',\n PAREN_R: ')',\n SPREAD: '...',\n COLON: ':',\n EQUALS: '=',\n AT: '@',\n BRACKET_L: '[',\n BRACKET_R: ']',\n BRACE_L: '{',\n PIPE: '|',\n BRACE_R: '}',\n NAME: 'Name',\n INT: 'Int',\n FLOAT: 'Float',\n STRING: 'String',\n BLOCK_STRING: 'BlockString',\n COMMENT: 'Comment'\n});\n/**\n * The enum type representing the token kinds values.\n */\n","export default function devAssert(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */\n// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n// See: https://webpack.js.org/guides/production/\nexport default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n// eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n} : // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (value) {\n var valueClass = value.constructor;\n var className = constructor.name;\n\n if (className && valueClass && valueClass.name === className) {\n throw new Error(\"Cannot use \".concat(className, \" \\\"\").concat(value, \"\\\" from another module or realm.\\n\\nEnsure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory. If different versions of \\\"graphql\\\" are the dependencies of other\\nrelied on modules, use \\\"resolutions\\\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \\\"graphql\\\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.\"));\n }\n }\n\n return false;\n};\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport var Source = /*#__PURE__*/function () {\n function Source(body) {\n var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';\n var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n line: 1,\n column: 1\n };\n typeof body === 'string' || devAssert(0, \"Body must be a string. Received: \".concat(inspect(body), \".\"));\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');\n this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n\n _createClass(Source, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Source';\n }\n }]);\n\n return Source;\n}();\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","/**\n * The set of allowed directive location values.\n */\nexport var DirectiveLocation = Object.freeze({\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n});\n/**\n * The enum type representing the directive location values.\n */\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Token } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"./blockString.mjs\";\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport var Lexer = /*#__PURE__*/function () {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n\n var _proto = Lexer.prototype;\n\n _proto.advance = function advance() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n ;\n\n _proto.lookahead = function lookahead() {\n var token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n var _token$next;\n\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n };\n\n return Lexer;\n}();\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;\n}\n\nfunction printCharCode(code) {\n return (// NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n \"\\\"\\\\u\".concat(('00' + code.toString(16).toUpperCase()).slice(-4), \"\\\"\")\n );\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\n\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // \n\n case 9: // \\t\n\n case 32: // \n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}\n/**\n * Report a message that an unexpected character was encountered.\n */\n\n\nfunction unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?';\n }\n\n return \"Cannot parse the unexpected character \".concat(printCharCode(code), \".\");\n}\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\n\n\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\n\n\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++position);\n\n if (code >= 48 && code <= 57) {\n throw syntaxError(source, position, \"Invalid number, unexpected digit after 0: \".concat(printCharCode(code), \".\"));\n }\n } else {\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n code = body.charCodeAt(++position);\n\n if (code === 43 || code === 45) {\n // + -\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n\n if (code === 46 || isNameStart(code)) {\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n }\n\n return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));\n}\n/**\n * Returns the new position in the source after reading digits.\n */\n\n\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\n return position;\n }\n\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n}\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\n\n\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += body.slice(chunkStart, position);\n return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n ++position;\n\n if (code === 92) {\n // \\\n value += body.slice(chunkStart, position - 1);\n code = body.charCodeAt(position);\n\n switch (code) {\n case 34:\n value += '\"';\n break;\n\n case 47:\n value += '/';\n break;\n\n case 92:\n value += '\\\\';\n break;\n\n case 98:\n value += '\\b';\n break;\n\n case 102:\n value += '\\f';\n break;\n\n case 110:\n value += '\\n';\n break;\n\n case 114:\n value += '\\r';\n break;\n\n case 116:\n value += '\\t';\n break;\n\n case 117:\n {\n // uXXXX\n var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));\n\n if (charCode < 0) {\n var invalidSequence = body.slice(position + 1, position + 5);\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\u\".concat(invalidSequence, \".\"));\n }\n\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n }\n\n default:\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\\".concat(String.fromCharCode(code), \".\"));\n }\n\n ++position;\n chunkStart = position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\n\n\nfunction readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Converts four hexadecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\n\n\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\n\n\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\n\n\nfunction readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z\n\n\nfunction isNameStart(code) {\n return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;\n}\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Kind } from \"./kinds.mjs\";\nimport { Location } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { Source, isSource } from \"./source.mjs\";\nimport { DirectiveLocation } from \"./directiveLocation.mjs\";\nimport { Lexer, isPunctuatorTokenKind } from \"./lexer.mjs\";\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n var parser = new Parser(source, options);\n return parser.parseDocument();\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport var Parser = /*#__PURE__*/function () {\n function Parser(source, options) {\n var sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n\n var _proto = Parser.prototype;\n\n _proto.parseName = function parseName() {\n var token = this.expectToken(TokenKind.NAME);\n return {\n kind: Kind.NAME,\n value: token.value,\n loc: this.loc(token)\n };\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n ;\n\n _proto.parseDocument = function parseDocument() {\n var start = this._lexer.token;\n return {\n kind: Kind.DOCUMENT,\n definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),\n loc: this.loc(start)\n };\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\n ;\n\n _proto.parseDefinition = function parseDefinition() {\n if (this.peek(TokenKind.NAME)) {\n switch (this._lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return this.parseTypeSystemDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n } else if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } else if (this.peekDescription()) {\n return this.parseTypeSystemDefinition();\n }\n\n throw this.unexpected();\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n ;\n\n _proto.parseOperationDefinition = function parseOperationDefinition() {\n var start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n var operation = this.parseOperationType();\n var name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * OperationType : one of query mutation subscription\n */\n ;\n\n _proto.parseOperationType = function parseOperationType() {\n var operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return 'query';\n\n case 'mutation':\n return 'mutation';\n\n case 'subscription':\n return 'subscription';\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n ;\n\n _proto.parseVariableDefinitions = function parseVariableDefinitions() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseVariableDefinition = function parseVariableDefinition() {\n var start = this._lexer.token;\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,\n directives: this.parseDirectives(true),\n loc: this.loc(start)\n };\n }\n /**\n * Variable : $ Name\n */\n ;\n\n _proto.parseVariable = function parseVariable() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n }\n /**\n * SelectionSet : { Selection+ }\n */\n ;\n\n _proto.parseSelectionSet = function parseSelectionSet() {\n var start = this._lexer.token;\n return {\n kind: Kind.SELECTION_SET,\n selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n ;\n\n _proto.parseSelection = function parseSelection() {\n return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n ;\n\n _proto.parseField = function parseField() {\n var start = this._lexer.token;\n var nameOrAlias = this.parseName();\n var alias;\n var name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: Kind.FIELD,\n alias: alias,\n name: name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,\n loc: this.loc(start)\n };\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n ;\n\n _proto.parseArguments = function parseArguments(isConst) {\n var item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseArgument = function parseArgument() {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.ARGUMENT,\n name: name,\n value: this.parseValueLiteral(false),\n loc: this.loc(start)\n };\n };\n\n _proto.parseConstArgument = function parseConstArgument() {\n var start = this._lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: this.parseName(),\n value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n ;\n\n _proto.parseFragment = function parseFragment() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n var hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n ;\n\n _proto.parseFragmentDefinition = function parseFragmentDefinition() {\n var _this$_options;\n\n var start = this._lexer.token;\n this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentName : Name but not `on`\n */\n ;\n\n _proto.parseFragmentName = function parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n ;\n\n _proto.parseValueLiteral = function parseValueLiteral(isConst) {\n var token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this._lexer.advance();\n\n return {\n kind: Kind.INT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.FLOAT:\n this._lexer.advance();\n\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this._lexer.advance();\n\n switch (token.value) {\n case 'true':\n return {\n kind: Kind.BOOLEAN,\n value: true,\n loc: this.loc(token)\n };\n\n case 'false':\n return {\n kind: Kind.BOOLEAN,\n value: false,\n loc: this.loc(token)\n };\n\n case 'null':\n return {\n kind: Kind.NULL,\n loc: this.loc(token)\n };\n\n default:\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: this.loc(token)\n };\n }\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return this.parseVariable();\n }\n\n break;\n }\n\n throw this.unexpected();\n };\n\n _proto.parseStringLiteral = function parseStringLiteral() {\n var token = this._lexer.token;\n\n this._lexer.advance();\n\n return {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n loc: this.loc(token)\n };\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n ;\n\n _proto.parseList = function parseList(isConst) {\n var _this = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this.parseValueLiteral(isConst);\n };\n\n return {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\n ;\n\n _proto.parseObject = function parseObject(isConst) {\n var _this2 = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this2.parseObjectField(isConst);\n };\n\n return {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseObjectField = function parseObjectField(isConst) {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.OBJECT_FIELD,\n name: name,\n value: this.parseValueLiteral(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n ;\n\n _proto.parseDirectives = function parseDirectives(isConst) {\n var directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n /**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\n ;\n\n _proto.parseDirective = function parseDirective(isConst) {\n var start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n ;\n\n _proto.parseTypeReference = function parseTypeReference() {\n var start = this._lexer.token;\n var type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n type = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = {\n kind: Kind.LIST_TYPE,\n type: type,\n loc: this.loc(start)\n };\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return {\n kind: Kind.NON_NULL_TYPE,\n type: type,\n loc: this.loc(start)\n };\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n ;\n\n _proto.parseNamedType = function parseNamedType() {\n var start = this._lexer.token;\n return {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Type Definition section.\n\n /**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n }\n\n throw this.unexpected(keywordToken);\n };\n\n _proto.peekDescription = function peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n ;\n\n _proto.parseDescription = function parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n */\n ;\n\n _proto.parseSchemaDefinition = function parseSchemaDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n return {\n kind: Kind.SCHEMA_DEFINITION,\n description: description,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n ;\n\n _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {\n var start = this._lexer.token;\n var operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n var type = this.parseNamedType();\n return {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n ;\n\n _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n ;\n\n _proto.parseImplementsInterfaces = function parseImplementsInterfaces() {\n var _this$_options2;\n\n if (!this.expectOptionalKeyword('implements')) {\n return [];\n }\n\n if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {\n var types = []; // Optional leading ampersand\n\n this.expectOptionalToken(TokenKind.AMP);\n\n do {\n types.push(this.parseNamedType());\n } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));\n\n return types;\n }\n\n return this.delimitedMany(TokenKind.AMP, this.parseNamedType);\n }\n /**\n * FieldsDefinition : { FieldDefinition+ }\n */\n ;\n\n _proto.parseFieldsDefinition = function parseFieldsDefinition() {\n var _this$_options3;\n\n // Legacy support for the SDL?\n if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {\n this._lexer.advance();\n\n this._lexer.advance();\n\n return [];\n }\n\n return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n ;\n\n _proto.parseFieldDefinition = function parseFieldDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n ;\n\n _proto.parseArgumentDefs = function parseArgumentDefs() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseInputValueDef = function parseInputValueDef() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseValueLiteral(true);\n }\n\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n ;\n\n _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n return {\n kind: Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n ;\n\n _proto.parseUnionMemberTypes = function parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n ;\n\n _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n return {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\n ;\n\n _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\n ;\n\n _proto.parseEnumValueDefinition = function parseEnumValueDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n ;\n\n _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n return {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\n ;\n\n _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemExtension = function parseTypeSystemExtension() {\n var keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n */\n ;\n\n _proto.parseSchemaExtension = function parseSchemaExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCHEMA_EXTENSION,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n ;\n\n _proto.parseScalarTypeExtension = function parseScalarTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n ;\n\n _proto.parseObjectTypeExtension = function parseObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n ;\n\n _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n ;\n\n _proto.parseUnionTypeExtension = function parseUnionTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n ;\n\n _proto.parseEnumTypeExtension = function parseEnumTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n ;\n\n _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n */\n ;\n\n _proto.parseDirectiveDefinition = function parseDirectiveDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n var repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n var locations = this.parseDirectiveLocations();\n return {\n kind: Kind.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n repeatable: repeatable,\n locations: locations,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n ;\n\n _proto.parseDirectiveLocations = function parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n ;\n\n _proto.parseDirectiveLocation = function parseDirectiveLocation() {\n var start = this._lexer.token;\n var name = this.parseName();\n\n if (DirectiveLocation[name.value] !== undefined) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a location object, used to identify the place in the source that created a given parsed object.\n */\n ;\n\n _proto.loc = function loc(startToken) {\n var _this$_options4;\n\n if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {\n return new Location(startToken, this._lexer.lastToken, this._lexer.source);\n }\n }\n /**\n * Determines if the next token is of a given kind\n */\n ;\n\n _proto.peek = function peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectToken = function expectToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n throw syntaxError(this._lexer.source, token.start, \"Expected \".concat(getTokenKindDesc(kind), \", found \").concat(getTokenDesc(token), \".\"));\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and return undefined.\n */\n ;\n\n _proto.expectOptionalToken = function expectOptionalToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n return undefined;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectKeyword = function expectKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n } else {\n throw syntaxError(this._lexer.source, token.start, \"Expected \\\"\".concat(value, \"\\\", found \").concat(getTokenDesc(token), \".\"));\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n ;\n\n _proto.expectOptionalKeyword = function expectOptionalKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n ;\n\n _proto.unexpected = function unexpected(atToken) {\n var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(this._lexer.source, token.start, \"Unexpected \".concat(getTokenDesc(token), \".\"));\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.any = function any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.many = function many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n ;\n\n _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n };\n\n return Parser;\n}();\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n var value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? \" \\\"\".concat(value, \"\\\"\") : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? \"\\\"\".concat(kind, \"\\\"\") : kind;\n}\n","import { __assign } from \"tslib\";\nimport { parse } from 'graphql';\nvar docCache = new Map();\nvar fragmentSourceMap = new Map();\nvar printFragmentWarnings = true;\nvar experimentalFragmentVariables = false;\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\nfunction processFragments(ast) {\n var seenKeys = new Set();\n var definitions = [];\n ast.definitions.forEach(function (fragmentDefinition) {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n var sourceKeySet = fragmentSourceMap.get(fragmentName);\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n }\n else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n sourceKeySet.add(sourceKey);\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n }\n else {\n definitions.push(fragmentDefinition);\n }\n });\n return __assign(__assign({}, ast), { definitions: definitions });\n}\nfunction stripLoc(doc) {\n var workSet = new Set(doc.definitions);\n workSet.forEach(function (node) {\n if (node.loc)\n delete node.loc;\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n var loc = doc.loc;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n return doc;\n}\nfunction parseDocument(source) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n var parsed = parse(source, {\n experimentalFragmentVariables: experimentalFragmentVariables\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(cacheKey, stripLoc(processFragments(parsed)));\n }\n return docCache.get(cacheKey);\n}\nexport function gql(literals) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof literals === 'string') {\n literals = [literals];\n }\n var result = literals[0];\n args.forEach(function (arg, i) {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n }\n else {\n result += arg;\n }\n result += literals[i + 1];\n });\n return parseDocument(result);\n}\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\nvar extras = {\n gql: gql,\n resetCaches: resetCaches,\n disableFragmentWarnings: disableFragmentWarnings,\n enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables: disableExperimentalFragmentVariables\n};\n(function (gql_1) {\n gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;\n})(gql || (gql = {}));\ngql[\"default\"] = gql;\nexport default gql;\n//# sourceMappingURL=index.js.map","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Dialog = void 0;\nvar Dialog_1 = require(\"./Dialog\");\nObject.defineProperty(exports, \"Dialog\", { enumerable: true, get: function () { return Dialog_1.Dialog; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useAssetCount = exports.useViewModeSelection = exports.VIEW_MODES = void 0;\nvar useViewModeSelection_1 = __importStar(require(\"./useViewModeSelection\"));\nexports.useViewModeSelection = useViewModeSelection_1.default;\nObject.defineProperty(exports, \"VIEW_MODES\", { enumerable: true, get: function () { return useViewModeSelection_1.VIEW_MODES; } });\nvar useAssetCount_1 = __importDefault(require(\"./useAssetCount\"));\nexports.useAssetCount = useAssetCount_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uploadDialogVisibleState = void 0;\nvar uploadDialogVisibleState_1 = __importDefault(require(\"./uploadDialogVisibleState\"));\nexports.uploadDialogVisibleState = uploadDialogVisibleState_1.default;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UPLOAD_TYPE = void 0;\nvar recoil_1 = require(\"recoil\");\nvar UPLOAD_TYPE;\n(function (UPLOAD_TYPE) {\n UPLOAD_TYPE[\"new\"] = \"new\";\n UPLOAD_TYPE[\"update\"] = \"update\";\n})(UPLOAD_TYPE = exports.UPLOAD_TYPE || (exports.UPLOAD_TYPE = {}));\nvar uploadDialogVisibleState = recoil_1.atom({\n key: 'uploadDialogState',\n default: {\n visible: false,\n uploadType: UPLOAD_TYPE.new,\n },\n});\nexports.default = uploadDialogVisibleState;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TagSelectBoxAssetCollection = exports.TagSelectBoxAsset = exports.TagSelectBox = exports.TagInspector = exports.PropertyInspector = exports.MetadataView = exports.IptcMetadataInspector = exports.CollectionSelectBox = exports.AssetCollectionInspector = exports.AssetInspector = void 0;\nvar AssetInspector_1 = __importDefault(require(\"./AssetInspector\"));\nexports.AssetInspector = AssetInspector_1.default;\nvar AssetCollectionInspector_1 = __importDefault(require(\"./AssetCollectionInspector\"));\nexports.AssetCollectionInspector = AssetCollectionInspector_1.default;\nvar IptcMetadataInspector_1 = __importDefault(require(\"./IptcMetadataInspector\"));\nexports.IptcMetadataInspector = IptcMetadataInspector_1.default;\nvar MetadataView_1 = __importDefault(require(\"./MetadataView\"));\nexports.MetadataView = MetadataView_1.default;\nvar PropertyInspector_1 = __importDefault(require(\"./PropertyInspector\"));\nexports.PropertyInspector = PropertyInspector_1.default;\nvar TagInspector_1 = __importDefault(require(\"./TagInspector\"));\nexports.TagInspector = TagInspector_1.default;\nvar TagSelectBox_1 = __importDefault(require(\"./TagSelectBox\"));\nexports.TagSelectBox = TagSelectBox_1.default;\nvar TagSelectBoxAsset_1 = __importDefault(require(\"./TagSelectBoxAsset\"));\nexports.TagSelectBoxAsset = TagSelectBoxAsset_1.default;\nvar TagSelectBoxAssetCollection_1 = __importDefault(require(\"./TagSelectBoxAssetCollection\"));\nexports.TagSelectBoxAssetCollection = TagSelectBoxAssetCollection_1.default;\nvar CollectionSelectBox_1 = __importDefault(require(\"./CollectionSelectBox\"));\nexports.CollectionSelectBox = CollectionSelectBox_1.default;\n","import { throwServerError } from \"../utils/index.js\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function parseAndCheckHttpResponse(operations) {\n return function (response) { return response\n .text()\n .then(function (bodyText) {\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n var parseError = err;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n throw parseError;\n }\n })\n .then(function (result) {\n if (response.status >= 300) {\n throwServerError(response, result, \"Response not successful: Received status code \" + response.status);\n }\n if (!Array.isArray(result) &&\n !hasOwnProperty.call(result, 'data') &&\n !hasOwnProperty.call(result, 'errors')) {\n throwServerError(response, result, \"Server response was missing for query '\" + (Array.isArray(operations)\n ? operations.map(function (op) { return op.operationName; })\n : operations.operationName) + \"'.\");\n }\n return result;\n }); };\n}\n//# sourceMappingURL=parseAndCheckHttpResponse.js.map","import { InvariantError } from 'ts-invariant';\nexport var serializeFetchParameter = function (p, label) {\n var serialized;\n try {\n serialized = JSON.stringify(p);\n }\n catch (e) {\n var parseError = process.env.NODE_ENV === \"production\" ? new InvariantError(23) : new InvariantError(\"Network request failed. \" + label + \" is not serializable: \" + e.message);\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n//# sourceMappingURL=serializeFetchParameter.js.map","import { visit } from \"./visitor.mjs\";\nimport { printBlockString } from \"./blockString.mjs\";\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n}\nvar MAX_LINE_LENGTH = 80; // TODO: provide better type coverage in future\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n // Document\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue,\n directives = _ref.directives;\n return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));\n },\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n var prefix = wrap('', alias, ': ') + name;\n var argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n // Fragments\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (// Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n \"fragment \".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), \" \") + \"on \".concat(typeCondition, \" \").concat(wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n // Value\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description' ? '' : ' ') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return value ? 'true' : 'false';\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n // Directive\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n // Type\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n // Type System Definitions\n SchemaDefinition: addDescription(function (_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n }),\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n ScalarTypeDefinition: addDescription(function (_ref22) {\n var name = _ref22.name,\n directives = _ref22.directives;\n return join(['scalar', name, join(directives, ' ')], ' ');\n }),\n ObjectTypeDefinition: addDescription(function (_ref23) {\n var name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n FieldDefinition: addDescription(function (_ref24) {\n var name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' '));\n }),\n InputValueDefinition: addDescription(function (_ref25) {\n var name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');\n }),\n InterfaceTypeDefinition: addDescription(function (_ref26) {\n var name = _ref26.name,\n interfaces = _ref26.interfaces,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n UnionTypeDefinition: addDescription(function (_ref27) {\n var name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n }),\n EnumTypeDefinition: addDescription(function (_ref28) {\n var name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join(['enum', name, join(directives, ' '), block(values)], ' ');\n }),\n EnumValueDefinition: addDescription(function (_ref29) {\n var name = _ref29.name,\n directives = _ref29.directives;\n return join([name, join(directives, ' ')], ' ');\n }),\n InputObjectTypeDefinition: addDescription(function (_ref30) {\n var name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join(['input', name, join(directives, ' '), block(fields)], ' ');\n }),\n DirectiveDefinition: addDescription(function (_ref31) {\n var name = _ref31.name,\n args = _ref31.arguments,\n repeatable = _ref31.repeatable,\n locations = _ref31.locations;\n return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ');\n }),\n SchemaExtension: function SchemaExtension(_ref32) {\n var directives = _ref32.directives,\n operationTypes = _ref32.operationTypes;\n return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n ScalarTypeExtension: function ScalarTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n ObjectTypeExtension: function ObjectTypeExtension(_ref34) {\n var name = _ref34.name,\n interfaces = _ref34.interfaces,\n directives = _ref34.directives,\n fields = _ref34.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {\n var name = _ref35.name,\n interfaces = _ref35.interfaces,\n directives = _ref35.directives,\n fields = _ref35.fields;\n return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n UnionTypeExtension: function UnionTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n types = _ref36.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n EnumTypeExtension: function EnumTypeExtension(_ref37) {\n var name = _ref37.name,\n directives = _ref37.directives,\n values = _ref37.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {\n var name = _ref38.name,\n directives = _ref38.directives,\n fields = _ref38.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n }\n};\n\nfunction addDescription(cb) {\n return function (node) {\n return join([node.description, cb(node)], '\\n');\n };\n}\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\n\nfunction join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\n\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\n\nfunction wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction isMultiline(str) {\n return str.indexOf('\\n') !== -1;\n}\n\nfunction hasMultilineItems(maybeArray) {\n return maybeArray != null && maybeArray.some(isMultiline);\n}\n","import { __assign } from \"tslib\";\nimport { print } from 'graphql';\nvar defaultHttpOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\nvar defaultHeaders = {\n accept: '*/*',\n 'content-type': 'application/json',\n};\nvar defaultOptions = {\n method: 'POST',\n};\nexport var fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\nexport var selectHttpOptionsAndBody = function (operation, fallbackConfig) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n var options = __assign(__assign({}, fallbackConfig.options), { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials });\n var http = fallbackConfig.http || {};\n configs.forEach(function (config) {\n options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), config.headers) });\n if (config.credentials)\n options.credentials = config.credentials;\n http = __assign(__assign({}, http), config.http);\n });\n var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;\n var body = { operationName: operationName, variables: variables };\n if (http.includeExtensions)\n body.extensions = extensions;\n if (http.includeQuery)\n body.query = print(query);\n return {\n options: options,\n body: body,\n };\n};\n//# sourceMappingURL=selectHttpOptionsAndBody.js.map","import { InvariantError } from 'ts-invariant';\nexport var checkFetcher = function (fetcher) {\n if (!fetcher && typeof fetch === 'undefined') {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(22) : new InvariantError(\"\\n\\\"fetch\\\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\\n\\nimport fetch from 'cross-fetch';\\nimport { ApolloClient, HttpLink } from '@apollo/client';\\nconst client = new ApolloClient({\\n link: new HttpLink({ uri: '/graphql', fetch })\\n});\\n \");\n }\n};\n//# sourceMappingURL=checkFetcher.js.map","export var createSignalIfSupported = function () {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n var controller = new AbortController();\n var signal = controller.signal;\n return { controller: controller, signal: signal };\n};\n//# sourceMappingURL=createSignalIfSupported.js.map","export var selectURI = function (operation, fallbackURI) {\n var context = operation.getContext();\n var contextURI = context.uri;\n if (contextURI) {\n return contextURI;\n }\n else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n }\n else {\n return fallbackURI || '/graphql';\n }\n};\n//# sourceMappingURL=selectURI.js.map","import { serializeFetchParameter } from \"./serializeFetchParameter.js\";\nexport function rewriteURIForGET(chosenURI, body) {\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}\n//# sourceMappingURL=rewriteURIForGET.js.map","import { __assign, __rest } from \"tslib\";\nimport { visit } from 'graphql';\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nimport { serializeFetchParameter } from \"./serializeFetchParameter.js\";\nimport { selectURI } from \"./selectURI.js\";\nimport { parseAndCheckHttpResponse } from \"./parseAndCheckHttpResponse.js\";\nimport { checkFetcher } from \"./checkFetcher.js\";\nimport { selectHttpOptionsAndBody, fallbackHttpConfig } from \"./selectHttpOptionsAndBody.js\";\nimport { createSignalIfSupported } from \"./createSignalIfSupported.js\";\nimport { rewriteURIForGET } from \"./rewriteURIForGET.js\";\nimport { fromError } from \"../utils/index.js\";\nexport var createHttpLink = function (linkOptions) {\n if (linkOptions === void 0) { linkOptions = {}; }\n var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, _b = linkOptions.includeUnusedVariables, includeUnusedVariables = _b === void 0 ? false : _b, requestOptions = __rest(linkOptions, [\"uri\", \"fetch\", \"includeExtensions\", \"useGETForQueries\", \"includeUnusedVariables\"]);\n checkFetcher(fetcher);\n if (!fetcher) {\n fetcher = fetch;\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n return new ApolloLink(function (operation) {\n var chosenURI = selectURI(operation, uri);\n var context = operation.getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextHeaders = __assign(__assign({}, clientAwarenessHeaders), context.headers);\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n var _b = selectHttpOptionsAndBody(operation, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;\n if (body.variables && !includeUnusedVariables) {\n var unusedNames_1 = new Set(Object.keys(body.variables));\n visit(operation.query, {\n Variable: function (node, _key, parent) {\n if (parent && parent.kind !== 'VariableDefinition') {\n unusedNames_1.delete(node.name.value);\n }\n },\n });\n if (unusedNames_1.size) {\n body.variables = __assign({}, body.variables);\n unusedNames_1.forEach(function (name) {\n delete body.variables[name];\n });\n }\n }\n var controller;\n if (!options.signal) {\n var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n var definitionIsMutation = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)) {\n options.method = 'GET';\n }\n if (options.method === 'GET') {\n var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError;\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n }\n else {\n try {\n options.body = serializeFetchParameter(body, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n }\n return new Observable(function (observer) {\n fetcher(chosenURI, options)\n .then(function (response) {\n operation.setContext({ response: response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n });\n};\n//# sourceMappingURL=createHttpLink.js.map","import { __extends } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { createHttpLink } from \"./createHttpLink.js\";\nvar HttpLink = (function (_super) {\n __extends(HttpLink, _super);\n function HttpLink(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, createHttpLink(options).request) || this;\n _this.options = options;\n return _this;\n }\n return HttpLink;\n}(ApolloLink));\nexport { HttpLink };\n//# sourceMappingURL=HttpLink.js.map","import { __assign, __rest } from \"tslib\";\nimport { KeyTrie } from 'optimism';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { getFragmentFromSelection, isField, getTypenameFromResult, storeKeyNameFromField, argumentsObjectFromField, isReference, getStoreKeyName, canUseWeakMap, compact, } from \"../../utilities/index.js\";\nimport { hasOwn, fieldNameFromStoreName, storeValueIsStoreObject, selectionSetMatchesResult, TypeOrFieldNameRegExp, } from \"./helpers.js\";\nimport { cacheSlot } from \"./reactiveVars.js\";\nfunction argsFromFieldSpecifier(spec) {\n return spec.args !== void 0 ? spec.args :\n spec.field ? argumentsObjectFromField(spec.field, spec.variables) : null;\n}\nexport var defaultDataIdFromObject = function (_a, context) {\n var __typename = _a.__typename, id = _a.id, _id = _a._id;\n if (typeof __typename === \"string\") {\n if (context) {\n context.keyObject =\n id !== void 0 ? { id: id } :\n _id !== void 0 ? { _id: _id } :\n void 0;\n }\n if (id === void 0)\n id = _id;\n if (id !== void 0) {\n return __typename + \":\" + ((typeof id === \"number\" ||\n typeof id === \"string\") ? id : JSON.stringify(id));\n }\n }\n};\nvar nullKeyFieldsFn = function () { return void 0; };\nvar simpleKeyArgsFn = function (_args, context) { return context.fieldName; };\nvar mergeTrueFn = function (existing, incoming, _a) {\n var mergeObjects = _a.mergeObjects;\n return mergeObjects(existing, incoming);\n};\nvar mergeFalseFn = function (_, incoming) { return incoming; };\nvar Policies = (function () {\n function Policies(config) {\n this.config = config;\n this.typePolicies = Object.create(null);\n this.toBeAdded = Object.create(null);\n this.supertypeMap = new Map();\n this.fuzzySubtypes = new Map();\n this.rootIdsByTypename = Object.create(null);\n this.rootTypenamesById = Object.create(null);\n this.usingPossibleTypes = false;\n this.config = __assign({ dataIdFromObject: defaultDataIdFromObject }, config);\n this.cache = this.config.cache;\n this.setRootTypename(\"Query\");\n this.setRootTypename(\"Mutation\");\n this.setRootTypename(\"Subscription\");\n if (config.possibleTypes) {\n this.addPossibleTypes(config.possibleTypes);\n }\n if (config.typePolicies) {\n this.addTypePolicies(config.typePolicies);\n }\n }\n Policies.prototype.identify = function (object, selectionSet, fragmentMap) {\n var typename = selectionSet && fragmentMap\n ? getTypenameFromResult(object, selectionSet, fragmentMap)\n : object.__typename;\n if (typename === this.rootTypenamesById.ROOT_QUERY) {\n return [\"ROOT_QUERY\"];\n }\n var context = {\n typename: typename,\n selectionSet: selectionSet,\n fragmentMap: fragmentMap,\n };\n var id;\n var policy = typename && this.getTypePolicy(typename);\n var keyFn = policy && policy.keyFn || this.config.dataIdFromObject;\n while (keyFn) {\n var specifierOrId = keyFn(object, context);\n if (Array.isArray(specifierOrId)) {\n keyFn = keyFieldsFnFromSpecifier(specifierOrId);\n }\n else {\n id = specifierOrId;\n break;\n }\n }\n id = id ? String(id) : void 0;\n return context.keyObject ? [id, context.keyObject] : [id];\n };\n Policies.prototype.addTypePolicies = function (typePolicies) {\n var _this = this;\n Object.keys(typePolicies).forEach(function (typename) {\n var _a = typePolicies[typename], queryType = _a.queryType, mutationType = _a.mutationType, subscriptionType = _a.subscriptionType, incoming = __rest(_a, [\"queryType\", \"mutationType\", \"subscriptionType\"]);\n if (queryType)\n _this.setRootTypename(\"Query\", typename);\n if (mutationType)\n _this.setRootTypename(\"Mutation\", typename);\n if (subscriptionType)\n _this.setRootTypename(\"Subscription\", typename);\n if (hasOwn.call(_this.toBeAdded, typename)) {\n _this.toBeAdded[typename].push(incoming);\n }\n else {\n _this.toBeAdded[typename] = [incoming];\n }\n });\n };\n Policies.prototype.updateTypePolicy = function (typename, incoming) {\n var _this = this;\n var existing = this.getTypePolicy(typename);\n var keyFields = incoming.keyFields, fields = incoming.fields;\n function setMerge(existing, merge) {\n existing.merge =\n typeof merge === \"function\" ? merge :\n merge === true ? mergeTrueFn :\n merge === false ? mergeFalseFn :\n existing.merge;\n }\n setMerge(existing, incoming.merge);\n existing.keyFn =\n keyFields === false ? nullKeyFieldsFn :\n Array.isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) :\n typeof keyFields === \"function\" ? keyFields :\n existing.keyFn;\n if (fields) {\n Object.keys(fields).forEach(function (fieldName) {\n var existing = _this.getFieldPolicy(typename, fieldName, true);\n var incoming = fields[fieldName];\n if (typeof incoming === \"function\") {\n existing.read = incoming;\n }\n else {\n var keyArgs = incoming.keyArgs, read = incoming.read, merge = incoming.merge;\n existing.keyFn =\n keyArgs === false ? simpleKeyArgsFn :\n Array.isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs) :\n typeof keyArgs === \"function\" ? keyArgs :\n existing.keyFn;\n if (typeof read === \"function\") {\n existing.read = read;\n }\n setMerge(existing, merge);\n }\n if (existing.read && existing.merge) {\n existing.keyFn = existing.keyFn || simpleKeyArgsFn;\n }\n });\n }\n };\n Policies.prototype.setRootTypename = function (which, typename) {\n if (typename === void 0) { typename = which; }\n var rootId = \"ROOT_\" + which.toUpperCase();\n var old = this.rootTypenamesById[rootId];\n if (typename !== old) {\n process.env.NODE_ENV === \"production\" ? invariant(!old || old === which, 1) : invariant(!old || old === which, \"Cannot change root \" + which + \" __typename more than once\");\n if (old)\n delete this.rootIdsByTypename[old];\n this.rootIdsByTypename[typename] = rootId;\n this.rootTypenamesById[rootId] = typename;\n }\n };\n Policies.prototype.addPossibleTypes = function (possibleTypes) {\n var _this = this;\n this.usingPossibleTypes = true;\n Object.keys(possibleTypes).forEach(function (supertype) {\n _this.getSupertypeSet(supertype, true);\n possibleTypes[supertype].forEach(function (subtype) {\n _this.getSupertypeSet(subtype, true).add(supertype);\n var match = subtype.match(TypeOrFieldNameRegExp);\n if (!match || match[0] !== subtype) {\n _this.fuzzySubtypes.set(subtype, new RegExp(subtype));\n }\n });\n });\n };\n Policies.prototype.getTypePolicy = function (typename) {\n var _this = this;\n if (!hasOwn.call(this.typePolicies, typename)) {\n var policy_1 = this.typePolicies[typename] = Object.create(null);\n policy_1.fields = Object.create(null);\n var supertypes = this.supertypeMap.get(typename);\n if (supertypes && supertypes.size) {\n supertypes.forEach(function (supertype) {\n var _a = _this.getTypePolicy(supertype), fields = _a.fields, rest = __rest(_a, [\"fields\"]);\n Object.assign(policy_1, rest);\n Object.assign(policy_1.fields, fields);\n });\n }\n }\n var inbox = this.toBeAdded[typename];\n if (inbox && inbox.length) {\n this.updateTypePolicy(typename, compact.apply(void 0, inbox.splice(0)));\n }\n return this.typePolicies[typename];\n };\n Policies.prototype.getFieldPolicy = function (typename, fieldName, createIfMissing) {\n if (typename) {\n var fieldPolicies = this.getTypePolicy(typename).fields;\n return fieldPolicies[fieldName] || (createIfMissing && (fieldPolicies[fieldName] = Object.create(null)));\n }\n };\n Policies.prototype.getSupertypeSet = function (subtype, createIfMissing) {\n var supertypeSet = this.supertypeMap.get(subtype);\n if (!supertypeSet && createIfMissing) {\n this.supertypeMap.set(subtype, supertypeSet = new Set());\n }\n return supertypeSet;\n };\n Policies.prototype.fragmentMatches = function (fragment, typename, result, variables) {\n var _this = this;\n if (!fragment.typeCondition)\n return true;\n if (!typename)\n return false;\n var supertype = fragment.typeCondition.name.value;\n if (typename === supertype)\n return true;\n if (this.usingPossibleTypes &&\n this.supertypeMap.has(supertype)) {\n var typenameSupertypeSet = this.getSupertypeSet(typename, true);\n var workQueue_1 = [typenameSupertypeSet];\n var maybeEnqueue_1 = function (subtype) {\n var supertypeSet = _this.getSupertypeSet(subtype, false);\n if (supertypeSet &&\n supertypeSet.size &&\n workQueue_1.indexOf(supertypeSet) < 0) {\n workQueue_1.push(supertypeSet);\n }\n };\n var needToCheckFuzzySubtypes = !!(result && this.fuzzySubtypes.size);\n var checkingFuzzySubtypes = false;\n for (var i = 0; i < workQueue_1.length; ++i) {\n var supertypeSet = workQueue_1[i];\n if (supertypeSet.has(supertype)) {\n if (!typenameSupertypeSet.has(supertype)) {\n if (checkingFuzzySubtypes) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Inferring subtype \" + typename + \" of supertype \" + supertype);\n }\n typenameSupertypeSet.add(supertype);\n }\n return true;\n }\n supertypeSet.forEach(maybeEnqueue_1);\n if (needToCheckFuzzySubtypes &&\n i === workQueue_1.length - 1 &&\n selectionSetMatchesResult(fragment.selectionSet, result, variables)) {\n needToCheckFuzzySubtypes = false;\n checkingFuzzySubtypes = true;\n this.fuzzySubtypes.forEach(function (regExp, fuzzyString) {\n var match = typename.match(regExp);\n if (match && match[0] === typename) {\n maybeEnqueue_1(fuzzyString);\n }\n });\n }\n }\n }\n return false;\n };\n Policies.prototype.hasKeyArgs = function (typename, fieldName) {\n var policy = this.getFieldPolicy(typename, fieldName, false);\n return !!(policy && policy.keyFn);\n };\n Policies.prototype.getStoreFieldName = function (fieldSpec) {\n var typename = fieldSpec.typename, fieldName = fieldSpec.fieldName;\n var policy = this.getFieldPolicy(typename, fieldName, false);\n var storeFieldName;\n var keyFn = policy && policy.keyFn;\n if (keyFn && typename) {\n var context = {\n typename: typename,\n fieldName: fieldName,\n field: fieldSpec.field || null,\n variables: fieldSpec.variables,\n };\n var args = argsFromFieldSpecifier(fieldSpec);\n while (keyFn) {\n var specifierOrString = keyFn(args, context);\n if (Array.isArray(specifierOrString)) {\n keyFn = keyArgsFnFromSpecifier(specifierOrString);\n }\n else {\n storeFieldName = specifierOrString || fieldName;\n break;\n }\n }\n }\n if (storeFieldName === void 0) {\n storeFieldName = fieldSpec.field\n ? storeKeyNameFromField(fieldSpec.field, fieldSpec.variables)\n : getStoreKeyName(fieldName, argsFromFieldSpecifier(fieldSpec));\n }\n if (storeFieldName === false) {\n return fieldName;\n }\n return fieldName === fieldNameFromStoreName(storeFieldName)\n ? storeFieldName\n : fieldName + \":\" + storeFieldName;\n };\n Policies.prototype.readField = function (options, context) {\n var objectOrReference = options.from;\n if (!objectOrReference)\n return;\n var nameOrField = options.field || options.fieldName;\n if (!nameOrField)\n return;\n if (options.typename === void 0) {\n var typename = context.store.getFieldValue(objectOrReference, \"__typename\");\n if (typename)\n options.typename = typename;\n }\n var storeFieldName = this.getStoreFieldName(options);\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var existing = context.store.getFieldValue(objectOrReference, storeFieldName);\n var policy = this.getFieldPolicy(options.typename, fieldName, false);\n var read = policy && policy.read;\n if (read) {\n var readOptions = makeFieldFunctionOptions(this, objectOrReference, options, context, context.store.getStorage(isReference(objectOrReference)\n ? objectOrReference.__ref\n : objectOrReference, storeFieldName));\n return cacheSlot.withValue(this.cache, read, [existing, readOptions]);\n }\n return existing;\n };\n Policies.prototype.getMergeFunction = function (parentTypename, fieldName, childTypename) {\n var policy = this.getFieldPolicy(parentTypename, fieldName, false);\n var merge = policy && policy.merge;\n if (!merge && childTypename) {\n policy = this.getTypePolicy(childTypename);\n merge = policy && policy.merge;\n }\n return merge;\n };\n Policies.prototype.runMergeFunction = function (existing, incoming, _a, context, storage) {\n var field = _a.field, typename = _a.typename, merge = _a.merge;\n if (merge === mergeTrueFn) {\n return makeMergeObjectsFunction(context.store.getFieldValue)(existing, incoming);\n }\n if (merge === mergeFalseFn) {\n return incoming;\n }\n return merge(existing, incoming, makeFieldFunctionOptions(this, void 0, { typename: typename, fieldName: field.name.value, field: field, variables: context.variables }, context, storage || Object.create(null)));\n };\n return Policies;\n}());\nexport { Policies };\nfunction makeFieldFunctionOptions(policies, objectOrReference, fieldSpec, context, storage) {\n var storeFieldName = policies.getStoreFieldName(fieldSpec);\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var variables = fieldSpec.variables || context.variables;\n var _a = context.store, getFieldValue = _a.getFieldValue, toReference = _a.toReference, canRead = _a.canRead;\n return {\n args: argsFromFieldSpecifier(fieldSpec),\n field: fieldSpec.field || null,\n fieldName: fieldName,\n storeFieldName: storeFieldName,\n variables: variables,\n isReference: isReference,\n toReference: toReference,\n storage: storage,\n cache: policies.cache,\n canRead: canRead,\n readField: function (fieldNameOrOptions, from) {\n var options = typeof fieldNameOrOptions === \"string\" ? {\n fieldName: fieldNameOrOptions,\n from: from,\n } : __assign({}, fieldNameOrOptions);\n if (void 0 === options.from) {\n options.from = objectOrReference;\n }\n if (void 0 === options.variables) {\n options.variables = variables;\n }\n return policies.readField(options, context);\n },\n mergeObjects: makeMergeObjectsFunction(getFieldValue),\n };\n}\nfunction makeMergeObjectsFunction(getFieldValue) {\n return function mergeObjects(existing, incoming) {\n if (Array.isArray(existing) || Array.isArray(incoming)) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(2) : new InvariantError(\"Cannot automatically merge arrays\");\n }\n if (existing && typeof existing === \"object\" &&\n incoming && typeof incoming === \"object\") {\n var eType = getFieldValue(existing, \"__typename\");\n var iType = getFieldValue(incoming, \"__typename\");\n var typesDiffer = eType && iType && eType !== iType;\n if (typesDiffer ||\n !storeValueIsStoreObject(existing) ||\n !storeValueIsStoreObject(incoming)) {\n return incoming;\n }\n return __assign(__assign({}, existing), incoming);\n }\n return incoming;\n };\n}\nfunction keyArgsFnFromSpecifier(specifier) {\n return function (args, context) {\n return args ? context.fieldName + \":\" + JSON.stringify(computeKeyObject(args, specifier, false)) : context.fieldName;\n };\n}\nfunction keyFieldsFnFromSpecifier(specifier) {\n var trie = new KeyTrie(canUseWeakMap);\n return function (object, context) {\n var aliasMap;\n if (context.selectionSet && context.fragmentMap) {\n var info = trie.lookupArray([\n context.selectionSet,\n context.fragmentMap,\n ]);\n aliasMap = info.aliasMap || (info.aliasMap = makeAliasMap(context.selectionSet, context.fragmentMap));\n }\n var keyObject = context.keyObject =\n computeKeyObject(object, specifier, true, aliasMap);\n return context.typename + \":\" + JSON.stringify(keyObject);\n };\n}\nfunction makeAliasMap(selectionSet, fragmentMap) {\n var map = Object.create(null);\n var workQueue = new Set([selectionSet]);\n workQueue.forEach(function (selectionSet) {\n selectionSet.selections.forEach(function (selection) {\n if (isField(selection)) {\n if (selection.alias) {\n var responseKey = selection.alias.value;\n var storeKey = selection.name.value;\n if (storeKey !== responseKey) {\n var aliases = map.aliases || (map.aliases = Object.create(null));\n aliases[storeKey] = responseKey;\n }\n }\n if (selection.selectionSet) {\n var subsets = map.subsets || (map.subsets = Object.create(null));\n subsets[selection.name.value] =\n makeAliasMap(selection.selectionSet, fragmentMap);\n }\n }\n else {\n var fragment = getFragmentFromSelection(selection, fragmentMap);\n if (fragment) {\n workQueue.add(fragment.selectionSet);\n }\n }\n });\n });\n return map;\n}\nfunction computeKeyObject(response, specifier, strict, aliasMap) {\n var keyObj = Object.create(null);\n var prevKey;\n specifier.forEach(function (s) {\n if (Array.isArray(s)) {\n if (typeof prevKey === \"string\") {\n var subsets = aliasMap && aliasMap.subsets;\n var subset = subsets && subsets[prevKey];\n keyObj[prevKey] = computeKeyObject(response[prevKey], s, strict, subset);\n }\n }\n else {\n var aliases = aliasMap && aliasMap.aliases;\n var responseName = aliases && aliases[s] || s;\n if (hasOwn.call(response, responseName)) {\n keyObj[prevKey = s] = response[responseName];\n }\n else {\n process.env.NODE_ENV === \"production\" ? invariant(!strict, 3) : invariant(!strict, \"Missing field '\" + responseName + \"' while computing key fields\");\n prevKey = void 0;\n }\n }\n });\n return keyObj;\n}\n//# sourceMappingURL=policies.js.map","// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nvar nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;\nexport default nodejsCustomInspectSymbol;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ASSET_COLLECTION_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"./tag\");\nexports.ASSET_COLLECTION_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment AssetCollectionProps on AssetCollection {\\n id\\n title\\n tags {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n fragment AssetCollectionProps on AssetCollection {\\n id\\n title\\n tags {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assetUpdatedEvent = exports.assetRemovedEvent = exports.assetCreatedEvent = exports.createEvent = void 0;\nvar asset_1 = require(\"./asset\");\nObject.defineProperty(exports, \"assetCreatedEvent\", { enumerable: true, get: function () { return asset_1.assetCreatedEvent; } });\nObject.defineProperty(exports, \"assetUpdatedEvent\", { enumerable: true, get: function () { return asset_1.assetUpdatedEvent; } });\nObject.defineProperty(exports, \"assetRemovedEvent\", { enumerable: true, get: function () { return asset_1.assetRemovedEvent; } });\nvar createEvent_1 = require(\"./createEvent\");\nObject.defineProperty(exports, \"createEvent\", { enumerable: true, get: function () { return createEvent_1.createEvent; } });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.humanFileSize = void 0;\nvar humanFileSize_1 = __importDefault(require(\"./humanFileSize\"));\nexports.humanFileSize = humanFileSize_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetPreview = exports.selectedAssetForPreviewState = void 0;\nvar AssetPreview_1 = __importDefault(require(\"./components/AssetPreview\"));\nexports.AssetPreview = AssetPreview_1.default;\nvar selectedAssetForPreviewState_1 = __importDefault(require(\"./state/selectedAssetForPreviewState\"));\nexports.selectedAssetForPreviewState = selectedAssetForPreviewState_1.default;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().ReactDOM;\n","import { wrap } from 'optimism';\nimport { getFragmentQueryDocument, } from \"../../utilities/index.js\";\nvar ApolloCache = (function () {\n function ApolloCache() {\n this.getFragmentDoc = wrap(getFragmentQueryDocument);\n }\n ApolloCache.prototype.recordOptimisticTransaction = function (transaction, optimisticId) {\n this.performTransaction(transaction, optimisticId);\n };\n ApolloCache.prototype.transformDocument = function (document) {\n return document;\n };\n ApolloCache.prototype.identify = function (object) {\n return;\n };\n ApolloCache.prototype.gc = function () {\n return [];\n };\n ApolloCache.prototype.modify = function (options) {\n return false;\n };\n ApolloCache.prototype.transformForLink = function (document) {\n return document;\n };\n ApolloCache.prototype.readQuery = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = !!options.optimistic; }\n return this.read({\n rootId: options.id || 'ROOT_QUERY',\n query: options.query,\n variables: options.variables,\n returnPartialData: options.returnPartialData,\n optimistic: optimistic,\n });\n };\n ApolloCache.prototype.readFragment = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = !!options.optimistic; }\n return this.read({\n query: this.getFragmentDoc(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n returnPartialData: options.returnPartialData,\n optimistic: optimistic,\n });\n };\n ApolloCache.prototype.writeQuery = function (options) {\n return this.write({\n dataId: options.id || 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n broadcast: options.broadcast,\n });\n };\n ApolloCache.prototype.writeFragment = function (options) {\n return this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: this.getFragmentDoc(options.fragment, options.fragmentName),\n broadcast: options.broadcast,\n });\n };\n return ApolloCache;\n}());\nexport { ApolloCache };\n//# sourceMappingURL=cache.js.map","import { NetworkStatus } from \"./networkStatus.js\";\nimport { compact } from \"../utilities/index.js\";\nimport { invariant } from 'ts-invariant';\nvar Reobserver = (function () {\n function Reobserver(observer, options, fetch, shouldFetch) {\n this.observer = observer;\n this.options = options;\n this.fetch = fetch;\n this.shouldFetch = shouldFetch;\n }\n Reobserver.prototype.reobserve = function (newOptions, newNetworkStatus) {\n if (newOptions) {\n this.updateOptions(newOptions);\n }\n else {\n this.updatePolling();\n }\n var concast = this.fetch(this.options, newNetworkStatus);\n if (this.concast) {\n this.concast.removeObserver(this.observer, true);\n }\n concast.addObserver(this.observer);\n return (this.concast = concast).promise;\n };\n Reobserver.prototype.updateOptions = function (newOptions) {\n Object.assign(this.options, compact(newOptions));\n this.updatePolling();\n return this;\n };\n Reobserver.prototype.stop = function () {\n if (this.concast) {\n this.concast.removeObserver(this.observer);\n delete this.concast;\n }\n if (this.pollingInfo) {\n clearTimeout(this.pollingInfo.timeout);\n this.options.pollInterval = 0;\n this.updatePolling();\n }\n };\n Reobserver.prototype.updatePolling = function () {\n var _this = this;\n var _a = this, pollingInfo = _a.pollingInfo, pollInterval = _a.options.pollInterval;\n if (!pollInterval) {\n if (pollingInfo) {\n clearTimeout(pollingInfo.timeout);\n delete this.pollingInfo;\n }\n return;\n }\n if (pollingInfo &&\n pollingInfo.interval === pollInterval) {\n return;\n }\n process.env.NODE_ENV === \"production\" ? invariant(pollInterval, 20) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.');\n if (this.shouldFetch === false) {\n return;\n }\n var info = pollingInfo || (this.pollingInfo = {});\n info.interval = pollInterval;\n var maybeFetch = function () {\n if (_this.pollingInfo) {\n if (_this.shouldFetch && _this.shouldFetch()) {\n _this.reobserve({\n fetchPolicy: \"network-only\",\n nextFetchPolicy: _this.options.fetchPolicy || \"cache-first\",\n }, NetworkStatus.poll).then(poll, poll);\n }\n else {\n poll();\n }\n }\n ;\n };\n var poll = function () {\n var info = _this.pollingInfo;\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n poll();\n };\n return Reobserver;\n}());\nexport { Reobserver };\n//# sourceMappingURL=Reobserver.js.map","import { __assign, __extends } from \"tslib\";\nimport { invariant } from 'ts-invariant';\nimport { equal } from '@wry/equality';\nimport { NetworkStatus, isNetworkRequestInFlight } from \"./networkStatus.js\";\nimport { cloneDeep, getOperationDefinition, Observable, iterateObserversSafely, isNonEmptyArray, fixObservableSubclass, } from \"../utilities/index.js\";\nimport { Reobserver } from \"./Reobserver.js\";\nvar warnedAboutUpdateQuery = false;\nvar ObservableQuery = (function (_super) {\n __extends(ObservableQuery, _super);\n function ObservableQuery(_a) {\n var queryManager = _a.queryManager, queryInfo = _a.queryInfo, options = _a.options;\n var _this = _super.call(this, function (observer) {\n return _this.onSubscribe(observer);\n }) || this;\n _this.observers = new Set();\n _this.subscriptions = new Set();\n _this.observer = {\n next: function (result) {\n if (_this.lastError || _this.isDifferentFromLastResult(result)) {\n _this.updateLastResult(result);\n iterateObserversSafely(_this.observers, 'next', result);\n }\n },\n error: function (error) {\n _this.updateLastResult(__assign(__assign({}, _this.lastResult), { error: error, errors: error.graphQLErrors, networkStatus: NetworkStatus.error, loading: false }));\n iterateObserversSafely(_this.observers, 'error', _this.lastError = error);\n },\n };\n _this.isTornDown = false;\n _this.options = options;\n _this.queryId = queryManager.generateQueryId();\n var opDef = getOperationDefinition(options.query);\n _this.queryName = opDef && opDef.name && opDef.name.value;\n _this.queryManager = queryManager;\n _this.queryInfo = queryInfo;\n return _this;\n }\n Object.defineProperty(ObservableQuery.prototype, \"variables\", {\n get: function () {\n return this.options.variables;\n },\n enumerable: false,\n configurable: true\n });\n ObservableQuery.prototype.result = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var observer = {\n next: function (result) {\n resolve(result);\n _this.observers.delete(observer);\n if (!_this.observers.size) {\n _this.queryManager.removeQuery(_this.queryId);\n }\n setTimeout(function () {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n var subscription = _this.subscribe(observer);\n });\n };\n ObservableQuery.prototype.getCurrentResult = function (saveAsLastResult) {\n if (saveAsLastResult === void 0) { saveAsLastResult = true; }\n var lastResult = this.lastResult;\n var networkStatus = this.queryInfo.networkStatus ||\n (lastResult && lastResult.networkStatus) ||\n NetworkStatus.ready;\n var result = __assign(__assign({}, lastResult), { loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus });\n if (this.isTornDown) {\n return result;\n }\n var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? 'cache-first' : _a;\n if (fetchPolicy === 'no-cache' ||\n fetchPolicy === 'network-only') {\n delete result.partial;\n }\n else if (!result.data ||\n !this.queryManager.transform(this.options.query).hasForcedResolvers) {\n var diff = this.queryInfo.getDiff();\n result.data = (diff.complete ||\n this.options.returnPartialData) ? diff.result : void 0;\n if (diff.complete) {\n if (result.networkStatus === NetworkStatus.loading &&\n (fetchPolicy === 'cache-first' ||\n fetchPolicy === 'cache-only')) {\n result.networkStatus = NetworkStatus.ready;\n result.loading = false;\n }\n delete result.partial;\n }\n else {\n result.partial = true;\n }\n }\n if (saveAsLastResult) {\n this.updateLastResult(result);\n }\n return result;\n };\n ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) {\n return !equal(this.lastResultSnapshot, newResult);\n };\n ObservableQuery.prototype.getLastResult = function () {\n return this.lastResult;\n };\n ObservableQuery.prototype.getLastError = function () {\n return this.lastError;\n };\n ObservableQuery.prototype.resetLastResults = function () {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n };\n ObservableQuery.prototype.resetQueryStoreErrors = function () {\n this.queryManager.resetErrors(this.queryId);\n };\n ObservableQuery.prototype.refetch = function (variables) {\n var reobserveOptions = {\n pollInterval: 0,\n };\n var fetchPolicy = this.options.fetchPolicy;\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n reobserveOptions.fetchPolicy = 'network-only';\n reobserveOptions.nextFetchPolicy = fetchPolicy || \"cache-first\";\n }\n if (variables && !equal(this.options.variables, variables)) {\n reobserveOptions.variables = this.options.variables = __assign(__assign({}, this.options.variables), variables);\n }\n return this.newReobserver(false).reobserve(reobserveOptions, NetworkStatus.refetch);\n };\n ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) {\n var _this = this;\n var combinedOptions = __assign(__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign(__assign(__assign({}, this.options), fetchMoreOptions), { variables: __assign(__assign({}, this.options.variables), fetchMoreOptions.variables) }))), { fetchPolicy: \"no-cache\" });\n var qid = this.queryManager.generateQueryId();\n if (combinedOptions.notifyOnNetworkStatusChange) {\n this.queryInfo.networkStatus = NetworkStatus.fetchMore;\n this.observe();\n }\n return this.queryManager.fetchQuery(qid, combinedOptions, NetworkStatus.fetchMore).then(function (fetchMoreResult) {\n var data = fetchMoreResult.data;\n var updateQuery = fetchMoreOptions.updateQuery;\n if (updateQuery) {\n if (process.env.NODE_ENV !== \"production\" &&\n !warnedAboutUpdateQuery) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"The updateQuery callback for fetchMore is deprecated, and will be removed\\nin the next major version of Apollo Client.\\n\\nPlease convert updateQuery functions to field policies with appropriate\\nread and merge functions, or use/adapt a helper function (such as\\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\\n@apollo/client/utilities.\\n\\nThe field policy system handles pagination more effectively than a\\nhand-written updateQuery function, and you only need to define the policy\\nonce, rather than every time you call fetchMore.\");\n warnedAboutUpdateQuery = true;\n }\n _this.updateQuery(function (previous) { return updateQuery(previous, {\n fetchMoreResult: data,\n variables: combinedOptions.variables,\n }); });\n }\n else {\n _this.queryManager.cache.writeQuery({\n query: combinedOptions.query,\n variables: combinedOptions.variables,\n data: data,\n });\n }\n return fetchMoreResult;\n }).finally(function () {\n _this.queryManager.stopQuery(qid);\n _this.reobserve();\n });\n };\n ObservableQuery.prototype.subscribeToMore = function (options) {\n var _this = this;\n var subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n context: options.context,\n })\n .subscribe({\n next: function (subscriptionData) {\n var updateQuery = options.updateQuery;\n if (updateQuery) {\n _this.updateQuery(function (previous, _a) {\n var variables = _a.variables;\n return updateQuery(previous, {\n subscriptionData: subscriptionData,\n variables: variables,\n });\n });\n }\n },\n error: function (err) {\n if (options.onError) {\n options.onError(err);\n return;\n }\n process.env.NODE_ENV === \"production\" || invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n this.subscriptions.add(subscription);\n return function () {\n if (_this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n };\n ObservableQuery.prototype.setOptions = function (newOptions) {\n return this.reobserve(newOptions);\n };\n ObservableQuery.prototype.setVariables = function (variables) {\n if (equal(this.variables, variables)) {\n return this.observers.size\n ? this.result()\n : Promise.resolve();\n }\n this.options.variables = variables;\n if (!this.observers.size) {\n return Promise.resolve();\n }\n var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? 'cache-first' : _a;\n var reobserveOptions = {\n fetchPolicy: fetchPolicy,\n variables: variables,\n };\n if (fetchPolicy !== 'cache-first' &&\n fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'network-only') {\n reobserveOptions.fetchPolicy = 'cache-and-network';\n reobserveOptions.nextFetchPolicy = fetchPolicy;\n }\n return this.reobserve(reobserveOptions, NetworkStatus.setVariables);\n };\n ObservableQuery.prototype.updateQuery = function (mapFn) {\n var _a;\n var queryManager = this.queryManager;\n var result = queryManager.cache.diff({\n query: this.options.query,\n variables: this.variables,\n previousResult: (_a = this.lastResult) === null || _a === void 0 ? void 0 : _a.data,\n returnPartialData: true,\n optimistic: false,\n }).result;\n var newResult = mapFn(result, {\n variables: this.variables,\n });\n if (newResult) {\n queryManager.cache.writeQuery({\n query: this.options.query,\n data: newResult,\n variables: this.variables,\n });\n queryManager.broadcastQueries();\n }\n };\n ObservableQuery.prototype.startPolling = function (pollInterval) {\n this.getReobserver().updateOptions({ pollInterval: pollInterval });\n };\n ObservableQuery.prototype.stopPolling = function () {\n if (this.reobserver) {\n this.reobserver.updateOptions({ pollInterval: 0 });\n }\n };\n ObservableQuery.prototype.updateLastResult = function (newResult) {\n var previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n if (!isNonEmptyArray(newResult.errors)) {\n delete this.lastError;\n }\n return previousResult;\n };\n ObservableQuery.prototype.onSubscribe = function (observer) {\n var _this = this;\n if (observer === this.observer) {\n return function () { };\n }\n try {\n var subObserver = observer._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n }\n catch (_a) { }\n var first = !this.observers.size;\n this.observers.add(observer);\n if (this.lastError) {\n observer.error && observer.error(this.lastError);\n }\n else if (this.lastResult) {\n observer.next && observer.next(this.lastResult);\n }\n if (first) {\n this.reobserve().catch(function (_) {\n });\n }\n return function () {\n if (_this.observers.delete(observer) && !_this.observers.size) {\n _this.tearDownQuery();\n }\n };\n };\n ObservableQuery.prototype.getReobserver = function () {\n return this.reobserver || (this.reobserver = this.newReobserver(true));\n };\n ObservableQuery.prototype.newReobserver = function (shareOptions) {\n var _this = this;\n var _a = this, queryManager = _a.queryManager, queryId = _a.queryId;\n queryManager.setObservableQuery(this);\n return new Reobserver(this.observer, shareOptions ? this.options : __assign({}, this.options), function (currentOptions, newNetworkStatus) {\n queryManager.setObservableQuery(_this);\n return queryManager.fetchQueryObservable(queryId, currentOptions, newNetworkStatus);\n }, !queryManager.ssrMode && (function () { return !isNetworkRequestInFlight(_this.queryInfo.networkStatus); }));\n };\n ObservableQuery.prototype.reobserve = function (newOptions, newNetworkStatus) {\n this.isTornDown = false;\n return this.getReobserver().reobserve(newOptions, newNetworkStatus);\n };\n ObservableQuery.prototype.observe = function () {\n this.observer.next(this.getCurrentResult(false));\n };\n ObservableQuery.prototype.hasObservers = function () {\n return this.observers.size > 0;\n };\n ObservableQuery.prototype.tearDownQuery = function () {\n if (this.isTornDown)\n return;\n if (this.reobserver) {\n this.reobserver.stop();\n delete this.reobserver;\n }\n this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });\n this.subscriptions.clear();\n this.queryManager.stopQuery(this.queryId);\n this.observers.clear();\n this.isTornDown = true;\n };\n return ObservableQuery;\n}(Observable));\nexport { ObservableQuery };\nfixObservableSubclass(ObservableQuery);\nfunction defaultSubscriptionObserverErrorCallback(error) {\n process.env.NODE_ENV === \"production\" || invariant.error('Unhandled error', error.message, error.stack);\n}\n//# sourceMappingURL=ObservableQuery.js.map","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable flowtype/no-weak-types */\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\nvar MAX_ARRAY_LENGTH = 10;\nvar MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport default function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (_typeof(value)) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? \"[function \".concat(value.name, \"]\") : '[function]';\n\n case 'object':\n if (value === null) {\n return 'null';\n }\n\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (previouslySeenValues.indexOf(value) !== -1) {\n return '[Circular]';\n }\n\n var seenValues = [].concat(previouslySeenValues, [value]);\n var customInspectFn = getCustomFn(value);\n\n if (customInspectFn !== undefined) {\n var customValue = customInspectFn.call(value); // check for infinite recursion\n\n if (customValue !== value) {\n return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction formatObject(object, seenValues) {\n var keys = Object.keys(object);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n var properties = keys.map(function (key) {\n var value = formatValue(object[key], seenValues);\n return key + ': ' + value;\n });\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n var len = Math.min(MAX_ARRAY_LENGTH, array.length);\n var remaining = array.length - len;\n var items = [];\n\n for (var i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(\"... \".concat(remaining, \" more items\"));\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getCustomFn(object) {\n var customInspectFn = object[String(nodejsCustomInspectSymbol)];\n\n if (typeof customInspectFn === 'function') {\n return customInspectFn;\n }\n\n if (typeof object.inspect === 'function') {\n return object.inspect;\n }\n}\n\nfunction getObjectTag(object) {\n var tag = Object.prototype.toString.call(object).replace(/^\\[object /, '').replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n var name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = getBlockStringIndentation(rawString);\n\n if (commonIndent !== 0) {\n for (var i = 1; i < lines.length; i++) {\n lines[i] = lines[i].slice(commonIndent);\n }\n } // Remove leading and trailing blank lines.\n\n\n var startLine = 0;\n\n while (startLine < lines.length && isBlank(lines[startLine])) {\n ++startLine;\n }\n\n var endLine = lines.length;\n\n while (endLine > startLine && isBlank(lines[endLine - 1])) {\n --endLine;\n } // Return a string of the lines joined with U+000A.\n\n\n return lines.slice(startLine, endLine).join('\\n');\n}\n\nfunction isBlank(str) {\n for (var i = 0; i < str.length; ++i) {\n if (str[i] !== ' ' && str[i] !== '\\t') {\n return false;\n }\n }\n\n return true;\n}\n/**\n * @internal\n */\n\n\nexport function getBlockStringIndentation(value) {\n var _commonIndent;\n\n var isFirstLine = true;\n var isEmptyLine = true;\n var indent = 0;\n var commonIndent = null;\n\n for (var i = 0; i < value.length; ++i) {\n switch (value.charCodeAt(i)) {\n case 13:\n // \\r\n if (value.charCodeAt(i + 1) === 10) {\n ++i; // skip \\r\\n as one symbol\n }\n\n // falls through\n\n case 10:\n // \\n\n isFirstLine = false;\n isEmptyLine = true;\n indent = 0;\n break;\n\n case 9: // \\t\n\n case 32:\n // \n ++indent;\n break;\n\n default:\n if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n }\n\n isEmptyLine = false;\n }\n }\n\n return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value) {\n var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isSingleLine = value.indexOf('\\n') === -1;\n var hasLeadingSpace = value[0] === ' ' || value[0] === '\\t';\n var hasTrailingQuote = value[value.length - 1] === '\"';\n var hasTrailingSlash = value[value.length - 1] === '\\\\';\n var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;\n var result = ''; // Format a multi-line block quote to account for leading space.\n\n if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {\n result += '\\n' + indentation;\n }\n\n result += indentation ? value.replace(/\\n/g, '\\n' + indentation) : value;\n\n if (printAsMultipleLines) {\n result += '\\n';\n }\n\n return '\"\"\"' + result.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"';\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useNotify = exports.useMediaUiTheme = exports.useMediaUi = exports.useIntl = exports.createUseMediaUiStyles = exports.NotifyProvider = exports.MediaUiThemeProvider = exports.MediaUiProvider = exports.IntlProvider = void 0;\nvar Notify_1 = require(\"./Notify\");\nObject.defineProperty(exports, \"NotifyProvider\", { enumerable: true, get: function () { return Notify_1.NotifyProvider; } });\nObject.defineProperty(exports, \"useNotify\", { enumerable: true, get: function () { return Notify_1.useNotify; } });\nvar MediaUiProvider_1 = require(\"./MediaUiProvider\");\nObject.defineProperty(exports, \"MediaUiProvider\", { enumerable: true, get: function () { return MediaUiProvider_1.MediaUiProvider; } });\nObject.defineProperty(exports, \"useMediaUi\", { enumerable: true, get: function () { return MediaUiProvider_1.useMediaUi; } });\nvar Intl_1 = require(\"./Intl\");\nObject.defineProperty(exports, \"IntlProvider\", { enumerable: true, get: function () { return Intl_1.IntlProvider; } });\nObject.defineProperty(exports, \"useIntl\", { enumerable: true, get: function () { return Intl_1.useIntl; } });\nvar MediaUiTheme_1 = require(\"./MediaUiTheme\");\nObject.defineProperty(exports, \"MediaUiThemeProvider\", { enumerable: true, get: function () { return MediaUiTheme_1.MediaUiThemeProvider; } });\nObject.defineProperty(exports, \"useMediaUiTheme\", { enumerable: true, get: function () { return MediaUiTheme_1.useMediaUiTheme; } });\nObject.defineProperty(exports, \"createUseMediaUiStyles\", { enumerable: true, get: function () { return MediaUiTheme_1.createUseMediaUiStyles; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NotifyProvider = exports.useNotify = exports.NotifyContext = void 0;\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nexports.NotifyContext = react_1.createContext(null);\nexports.useNotify = function () { return react_1.useContext(exports.NotifyContext); };\nfunction NotifyProvider(_a) {\n var children = _a.children, notificationApi = _a.notificationApi;\n var error = function (title, message) {\n if (message === void 0) { message = ''; }\n return notificationApi['error'](title, message);\n };\n var warning = function (title, message) {\n if (message === void 0) { message = ''; }\n return notificationApi['warning'](title, message);\n };\n var ok = function (title) { return notificationApi['ok'](title); };\n var info = function (title) { return notificationApi['info'](title); };\n var notice = function (title) { return notificationApi['notice'](title); };\n return React.createElement(exports.NotifyContext.Provider, { value: { notice: notice, error: error, ok: ok, info: info, warning: warning } }, children);\n}\nexports.NotifyProvider = NotifyProvider;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar useSelectedTag = function () {\n var selectedTagId = recoil_1.useRecoilValue(state_1.selectedTagIdState);\n var data = client_1.useQuery(queries_1.TAG, {\n variables: { id: selectedTagId },\n skip: !selectedTagId,\n }).data;\n return (data === null || data === void 0 ? void 0 : data.tag) || null;\n};\nexports.default = useSelectedTag;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedInspectorViewState = recoil_1.atom({\n key: 'selectedInspectorViewState',\n default: null,\n});\nexports.default = selectedInspectorViewState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar useSelectedAssetCollection = function () {\n var selectedAssetCollectionId = recoil_1.useRecoilValue(state_1.selectedAssetCollectionIdState);\n var data = client_1.useQuery(queries_1.ASSET_COLLECTION, {\n variables: { id: selectedAssetCollectionId },\n skip: !selectedAssetCollectionId,\n }).data;\n return (data === null || data === void 0 ? void 0 : data.assetCollection) || null;\n};\nexports.default = useSelectedAssetCollection;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PAGINATION_MAXIMUM_LINKS = exports.ASSETS_PER_PAGE = void 0;\n// TODO: Make configurable via Settings\nexports.ASSETS_PER_PAGE = 20;\nexports.PAGINATION_MAXIMUM_LINKS = 5;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar assetUsageDetailsModalState = recoil_1.atom({\n key: 'assetUsageDetailsModalState',\n default: false,\n});\nexports.default = assetUsageDetailsModalState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar clipboardVisibleState = recoil_1.atom({\n key: 'clipboardState',\n default: false,\n});\nexports.default = clipboardVisibleState;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TOGGLE_CLIPBOARD_STATE = exports.CLIPBOARD = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.CLIPBOARD = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query Clipboard {\\n clipboard @client(always: true)\\n }\\n\"], [\"\\n query Clipboard {\\n clipboard @client(always: true)\\n }\\n\"])));\nexports.TOGGLE_CLIPBOARD_STATE = client_1.gql(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n mutation ToggleClipboardState($assetId: AssetId, $assetSourceId: AssetSourceId, $force: Boolean) {\\n toggleClipboardState(assetId: $assetId, assetSourceId: $assetSourceId, force: $force) @client\\n }\\n\"], [\"\\n mutation ToggleClipboardState($assetId: AssetId, $assetSourceId: AssetSourceId, $force: Boolean) {\\n toggleClipboardState(assetId: $assetId, assetSourceId: $assetSourceId, force: $force) @client\\n }\\n\"])));\nvar templateObject_1, templateObject_2;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar ClipboardQuery_1 = require(\"../queries/ClipboardQuery\");\nfunction useClipboard() {\n var clipboard = client_1.useQuery(ClipboardQuery_1.CLIPBOARD).data.clipboard;\n var mutateClipboard = client_1.useMutation(ClipboardQuery_1.TOGGLE_CLIPBOARD_STATE)[0];\n var inClipboard = react_1.useCallback(function (_a) {\n var assetId = _a.assetId;\n return {}.hasOwnProperty.call(clipboard, assetId);\n }, [clipboard]);\n var toggleClipboardState = react_1.useCallback(function (assetIdentity, force) {\n return mutateClipboard({\n variables: __assign(__assign({}, assetIdentity), { force: force }),\n update: function (cache) {\n var cachedClipboard = cache.readQuery({\n query: ClipboardQuery_1.CLIPBOARD,\n }).clipboard;\n cache.writeFragment({\n id: cache.identify({ __typename: 'Asset', id: assetIdentity.assetId }),\n fragment: client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment UpdatedAsset on Asset {\\n isInClipboard\\n }\\n \"], [\"\\n fragment UpdatedAsset on Asset {\\n isInClipboard\\n }\\n \"]))),\n data: {\n isInClipboard: {}.hasOwnProperty.call(cachedClipboard, assetIdentity.assetId),\n },\n });\n },\n });\n }, [mutateClipboard]);\n var flushClipboard = react_1.useCallback(function () {\n Object.values(clipboard).map(function (assetIdentity) {\n toggleClipboardState(assetIdentity, false);\n });\n }, [clipboard, toggleClipboardState]);\n return { clipboard: clipboard !== null && clipboard !== void 0 ? clipboard : {}, inClipboard: inClipboard, toggleClipboardState: toggleClipboardState, flushClipboard: flushClipboard };\n}\nexports.default = useClipboard;\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar similarAssetsModalState = recoil_1.atom({\n key: 'similarAssetsModalState',\n default: false,\n});\nexports.default = similarAssetsModalState;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UploadSection = exports.UploadDialog = exports.UploadButton = exports.ReplaceAssetDialog = exports.PreviewSection = exports.NewAssetDialog = exports.FilePreview = exports.AssetReplacementButton = void 0;\nvar NewAssetDialog_1 = __importDefault(require(\"./Dialogs/NewAssetDialog\"));\nexports.NewAssetDialog = NewAssetDialog_1.default;\nvar ReplaceAssetDialog_1 = __importDefault(require(\"./Dialogs/ReplaceAssetDialog\"));\nexports.ReplaceAssetDialog = ReplaceAssetDialog_1.default;\nvar UploadDialog_1 = __importDefault(require(\"./Dialogs/UploadDialog\"));\nexports.UploadDialog = UploadDialog_1.default;\nvar FilePreview_1 = __importDefault(require(\"./FilePreview\"));\nexports.FilePreview = FilePreview_1.default;\nvar PreviewSection_1 = __importDefault(require(\"./PreviewSection\"));\nexports.PreviewSection = PreviewSection_1.default;\nvar UploadSection_1 = __importDefault(require(\"./UploadSection\"));\nexports.UploadSection = UploadSection_1.default;\nvar AssetReplacementButton_1 = __importDefault(require(\"./AssetReplacementButton\"));\nexports.AssetReplacementButton = AssetReplacementButton_1.default;\nvar UploadButton_1 = __importDefault(require(\"./UploadButton\"));\nexports.UploadButton = UploadButton_1.default;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_dropzone_1 = require(\"react-dropzone\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar helper_1 = require(\"@media-ui/core/src/helper\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n dropzone: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n padding: theme.spacing.goldenUnit,\n borderWidth: 2,\n borderRadius: 2,\n borderColor: function (_a) {\n var isDragAccept = _a.isDragAccept, isDragActive = _a.isDragActive, isDragReject = _a.isDragReject;\n if (isDragAccept)\n return theme.colors.success;\n if (isDragReject)\n return theme.colors.error;\n if (isDragActive)\n return theme.colors.primary;\n return theme.colors.disabled;\n },\n borderStyle: 'dashed',\n backgroundColor: theme.colors.alternatingBackground,\n color: theme.colors.text,\n outline: 'none',\n cursor: 'pointer',\n userSelect: 'none',\n transition: 'border .24s ease-in-out',\n },\n}); });\nvar UploadSection = function (_a) {\n var acceptedFileTypes = _a.acceptedFileTypes, files = _a.files, loading = _a.loading, maxFiles = _a.maxFiles, onSetFiles = _a.onSetFiles;\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var dummyImage = src_1.useMediaUi().dummyImage;\n var config = hooks_1.useConfigQuery().config;\n var maxFilesToUpload = maxFiles\n ? Math.min(maxFiles, config === null || config === void 0 ? void 0 : config.uploadMaxFileUploadLimit)\n : (config === null || config === void 0 ? void 0 : config.uploadMaxFileUploadLimit) || 1;\n var _b = react_dropzone_1.useDropzone({\n onDrop: function (acceptedFiles) {\n if (acceptedFiles.length === 0)\n return;\n var spotsLeft = maxFilesToUpload - files.length;\n if (acceptedFiles.length > spotsLeft) {\n Notify.error(translate('uploadDialog.warning.maxFiles', \"You can only upload a maximum of {limit} files. {rejected} File(s) rejected\", {\n limit: maxFilesToUpload,\n rejected: acceptedFiles.length - spotsLeft,\n }));\n }\n if (spotsLeft === 0) {\n return;\n }\n var newAcceptedFiles = acceptedFiles.length < spotsLeft ? acceptedFiles : acceptedFiles.slice(0, spotsLeft);\n var newFiles = newAcceptedFiles.map(function (file) {\n // Generate a unique id for the file to prevent errors with duplicate file names\n file.id = file.name + \"-\" + file.size + \"-\" + file.lastModified;\n if (file.type.indexOf('image') === 0) {\n file.preview = URL.createObjectURL(file);\n }\n else {\n // TODO: Find better preview visualisation\n file.preview = dummyImage;\n }\n return file;\n });\n onSetFiles(files.concat(newFiles));\n },\n disabled: loading,\n onDropRejected: function (rejections) {\n rejections.forEach(function (rejection) {\n Notify.warning(translate('uploadDialog.warning.fileRejected', \"The given file cannot be uploaded.\"), rejection.errors.reduce(function (acc, error) { return acc + \" \" + error.message; }, ''));\n });\n },\n maxSize: (config === null || config === void 0 ? void 0 : config.uploadMaxFileSize) || 0,\n maxFiles: maxFilesToUpload,\n multiple: maxFilesToUpload > 1,\n preventDropOnDocument: true,\n accept: acceptedFileTypes,\n }), getRootProps = _b.getRootProps, getInputProps = _b.getInputProps, isDragAccept = _b.isDragAccept, isDragActive = _b.isDragActive, isDragReject = _b.isDragReject;\n var classes = useStyles({ isDragAccept: isDragAccept, isDragActive: isDragActive, isDragReject: isDragReject });\n return (React.createElement(\"section\", null,\n React.createElement(\"div\", __assign({}, getRootProps({ className: classes.dropzone })),\n React.createElement(\"input\", __assign({}, getInputProps())),\n React.createElement(\"p\", null, translate('uploadDialog.dropzone.caption', \"Drag 'n' drop some files here, or click to select files\")),\n (config === null || config === void 0 ? void 0 : config.uploadMaxFileSize) > 0 && (React.createElement(\"p\", null, translate('uploadDialog.maxFileSize', 'Maximum file size is {size} and file limit is {limit}', {\n size: helper_1.humanFileSize(config.uploadMaxFileSize),\n limit: maxFilesToUpload,\n })))),\n loading && React.createElement(\"p\", null, translate('uploadDialog.label.uploading', 'Uploading…'))));\n};\nexports.default = React.memo(UploadSection);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar FilePreview_1 = __importDefault(require(\"./FilePreview\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n fileList: {\n marginTop: theme.spacing.full,\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n fileListHeader: {\n flex: '1 1 100%',\n marginBottom: theme.spacing.full,\n fontSize: theme.fontSize,\n },\n}); });\nvar PreviewSection = function (_a) {\n var files = _a.files, loading = _a.loading, uploadState = _a.uploadState;\n var translate = src_1.useIntl().translate;\n var classes = useStyles();\n // FIXME: Mapping the uploadState to the files name is not the best solution as the same filename might be used multiple times\n return (React.createElement(\"aside\", { className: classes.fileList },\n files.selected.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h4\", { className: classes.fileListHeader }, translate('uploadDialog.fileList.header', 'Selected files')),\n files.selected.map(function (file) { return (React.createElement(FilePreview_1.default, { file: file, loading: loading, fileState: uploadState.find(function (result) { return result.filename === file.name; }), key: file.id })); }))),\n files.rejected.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h4\", { className: classes.fileListHeader }, translate('uploadDialog.fileList.uploadedHeader', 'Failed uploads')),\n files.rejected.map(function (file) { return (React.createElement(FilePreview_1.default, { file: file, fileState: uploadState.find(function (result) { return result.filename === file.name; }), key: file.id })); }))),\n files.finished.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h4\", { className: classes.fileListHeader }, translate('uploadDialog.fileList.uploadedHeader', 'Successful uploads')),\n files.finished.map(function (file) { return (React.createElement(FilePreview_1.default, { file: file, fileState: uploadState.find(function (result) { return result.filename === file.name; }), key: file.id })); })))));\n};\nexports.default = React.memo(PreviewSection);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.REPLACE_ASSET = exports.UPLOAD_FILE = exports.UPLOAD_FILES = void 0;\nvar replaceAsset_1 = __importDefault(require(\"./replaceAsset\"));\nexports.REPLACE_ASSET = replaceAsset_1.default;\nvar uploadFiles_1 = __importDefault(require(\"./uploadFiles\"));\nexports.UPLOAD_FILES = uploadFiles_1.default;\nvar uploadFile_1 = __importDefault(require(\"./uploadFile\"));\nexports.UPLOAD_FILE = uploadFile_1.default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;\n\nvar _exenv = require(\"exenv\");\n\nvar _exenv2 = _interopRequireDefault(_exenv);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar EE = _exenv2.default;\n\nvar SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};\n\nvar SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};\n\nvar SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};\n\nvar canUseDOM = exports.canUseDOM = EE.canUseDOM;\n\nexports.default = SafeHTMLElement;","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles({\n propertyGroup: {},\n});\nvar Property = function (_a) {\n var children = _a.children, label = _a.label;\n var classes = useStyles();\n return (React.createElement(\"div\", { className: classes.propertyGroup },\n React.createElement(react_ui_components_1.Label, null, label),\n children));\n};\nexports.default = Property;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n actions: {\n display: 'flex',\n position: 'sticky',\n backgroundColor: theme.colors.mainBackground,\n bottom: 0,\n '& > *': {\n flex: 1,\n },\n },\n}); });\nvar Actions = function (_a) {\n var hasUnpublishedChanges = _a.hasUnpublishedChanges, handleApply = _a.handleApply, handleDiscard = _a.handleDiscard;\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n return (React.createElement(\"div\", { className: classes.actions },\n React.createElement(react_ui_components_1.Button, { disabled: !hasUnpublishedChanges, size: \"regular\", style: \"lighter\", hoverStyle: \"brand\", onClick: handleDiscard }, translate('inspector.actions.discard', 'Discard')),\n React.createElement(react_ui_components_1.Button, { disabled: !hasUnpublishedChanges, size: \"regular\", style: \"success\", hoverStyle: \"success\", onClick: handleApply }, translate('inspector.actions.apply', 'Apply'))));\n};\nexports.default = Actions;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n inspector: {\n display: 'grid',\n gridTemplateColumns: 'minmax(0, 1fr)',\n gridAutoRows: 'auto',\n gridGap: theme.spacing.full,\n '& input, & textarea': {\n width: '100%',\n },\n },\n}); });\nvar InspectorContainer = function (_a) {\n var children = _a.children;\n var classes = useStyles();\n return React.createElement(\"div\", { className: classes.inspector }, children);\n};\nexports.default = InspectorContainer;\n","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { visit, BREAK, } from 'graphql';\nimport { invariant } from 'ts-invariant';\nimport { argumentsObjectFromField, buildQueryFromSelectionSet, createFragmentMap, getFragmentDefinitions, getMainDefinition, hasDirectives, isField, isInlineFragment, mergeDeep, mergeDeepArray, removeClientSetsFromDocument, resultKeyNameFromField, shouldInclude, } from \"../utilities/index.js\";\nimport { cacheSlot } from \"../cache/index.js\";\nvar LocalState = (function () {\n function LocalState(_a) {\n var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher;\n this.cache = cache;\n if (client) {\n this.client = client;\n }\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n LocalState.prototype.addResolvers = function (resolvers) {\n var _this = this;\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(function (resolverGroup) {\n _this.resolvers = mergeDeep(_this.resolvers, resolverGroup);\n });\n }\n else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n };\n LocalState.prototype.setResolvers = function (resolvers) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n };\n LocalState.prototype.getResolvers = function () {\n return this.resolvers || {};\n };\n LocalState.prototype.runResolvers = function (_a) {\n var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b;\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_c) {\n if (document) {\n return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign(__assign({}, remoteResult), { data: localResult.result })); })];\n }\n return [2, remoteResult];\n });\n });\n };\n LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n };\n LocalState.prototype.getFragmentMatcher = function () {\n return this.fragmentMatcher;\n };\n LocalState.prototype.clientQuery = function (document) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n }\n return null;\n };\n LocalState.prototype.serverQuery = function (document) {\n return removeClientSetsFromDocument(document);\n };\n LocalState.prototype.prepareContext = function (context) {\n var cache = this.cache;\n return __assign(__assign({}, context), { cache: cache,\n getCacheKey: function (obj) {\n return cache.identify(obj);\n } });\n };\n LocalState.prototype.addExportedVariables = function (document, variables, context) {\n if (variables === void 0) { variables = {}; }\n if (context === void 0) { context = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (document) {\n return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (__assign(__assign({}, variables), data.exportedVariables)); })];\n }\n return [2, __assign({}, variables)];\n });\n });\n };\n LocalState.prototype.shouldForceResolvers = function (document) {\n var forceResolvers = false;\n visit(document, {\n Directive: {\n enter: function (node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(function (arg) {\n return arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true;\n });\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n };\n LocalState.prototype.buildRootValueFromCache = function (document, variables) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables: variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n };\n LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) {\n if (context === void 0) { context = {}; }\n if (variables === void 0) { variables = {}; }\n if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; }\n if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; }\n return __awaiter(this, void 0, void 0, function () {\n var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext;\n return __generator(this, function (_b) {\n mainDefinition = getMainDefinition(document);\n fragments = getFragmentDefinitions(document);\n fragmentMap = createFragmentMap(fragments);\n definitionOperation = mainDefinition\n .operation;\n defaultOperationType = definitionOperation\n ? definitionOperation.charAt(0).toUpperCase() +\n definitionOperation.slice(1)\n : 'Query';\n _a = this, cache = _a.cache, client = _a.client;\n execContext = {\n fragmentMap: fragmentMap,\n context: __assign(__assign({}, context), { cache: cache,\n client: client }),\n variables: variables,\n fragmentMatcher: fragmentMatcher,\n defaultOperationType: defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers: onlyRunForcedResolvers,\n };\n return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { return ({\n result: result,\n exportedVariables: execContext.exportedVariables,\n }); })];\n });\n });\n };\n LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) {\n return __awaiter(this, void 0, void 0, function () {\n var fragmentMap, context, variables, resultsToMerge, execute;\n var _this = this;\n return __generator(this, function (_a) {\n fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables;\n resultsToMerge = [rootValue];\n execute = function (selection) { return __awaiter(_this, void 0, void 0, function () {\n var fragment, typeCondition;\n return __generator(this, function (_a) {\n if (!shouldInclude(selection, variables)) {\n return [2];\n }\n if (isField(selection)) {\n return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) {\n var _a;\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push((_a = {},\n _a[resultKeyNameFromField(selection)] = fieldResult,\n _a));\n }\n })];\n }\n if (isInlineFragment(selection)) {\n fragment = selection;\n }\n else {\n fragment = fragmentMap[selection.name.value];\n process.env.NODE_ENV === \"production\" ? invariant(fragment, 11) : invariant(fragment, \"No fragment named \" + selection.name.value);\n }\n if (fragment && fragment.typeCondition) {\n typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) {\n resultsToMerge.push(fragmentResult);\n })];\n }\n }\n return [2];\n });\n }); };\n return [2, Promise.all(selectionSet.selections.map(execute)).then(function () {\n return mergeDeepArray(resultsToMerge);\n })];\n });\n });\n };\n LocalState.prototype.resolveField = function (field, rootValue, execContext) {\n return __awaiter(this, void 0, void 0, function () {\n var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve;\n var _this = this;\n return __generator(this, function (_a) {\n variables = execContext.variables;\n fieldName = field.name.value;\n aliasedFieldName = resultKeyNameFromField(field);\n aliasUsed = fieldName !== aliasedFieldName;\n defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n resultPromise = Promise.resolve(defaultResult);\n if (!execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)) {\n resolverType = rootValue.__typename || execContext.defaultOperationType;\n resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(cacheSlot.withValue(this.cache, resolve, [\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field: field, fragmentMap: execContext.fragmentMap },\n ]));\n }\n }\n }\n return [2, resultPromise.then(function (result) {\n if (result === void 0) { result = defaultResult; }\n if (field.directives) {\n field.directives.forEach(function (directive) {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(function (arg) {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n if (!field.selectionSet) {\n return result;\n }\n if (result == null) {\n return result;\n }\n if (Array.isArray(result)) {\n return _this.resolveSubSelectedArray(field, result, execContext);\n }\n if (field.selectionSet) {\n return _this.resolveSelectionSet(field.selectionSet, result, execContext);\n }\n })];\n });\n });\n };\n LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) {\n var _this = this;\n return Promise.all(result.map(function (item) {\n if (item === null) {\n return null;\n }\n if (Array.isArray(item)) {\n return _this.resolveSubSelectedArray(field, item, execContext);\n }\n if (field.selectionSet) {\n return _this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }));\n };\n return LocalState;\n}());\nexport { LocalState };\n//# sourceMappingURL=LocalState.js.map","import { equal } from \"@wry/equality\";\nimport { isNonEmptyArray, graphQLResultHasError, canUseWeakMap, } from \"../utilities/index.js\";\nimport { NetworkStatus, isNetworkRequestInFlight, } from \"./networkStatus.js\";\nvar destructiveMethodCounts = new (canUseWeakMap ? WeakMap : Map)();\nfunction wrapDestructiveCacheMethod(cache, methodName) {\n var original = cache[methodName];\n if (typeof original === \"function\") {\n cache[methodName] = function () {\n destructiveMethodCounts.set(cache, (destructiveMethodCounts.get(cache) + 1) % 1e15);\n return original.apply(this, arguments);\n };\n }\n}\nfunction cancelNotifyTimeout(info) {\n if (info[\"notifyTimeout\"]) {\n clearTimeout(info[\"notifyTimeout\"]);\n info[\"notifyTimeout\"] = void 0;\n }\n}\nvar QueryInfo = (function () {\n function QueryInfo(cache) {\n this.cache = cache;\n this.listeners = new Set();\n this.document = null;\n this.lastRequestId = 1;\n this.subscriptions = new Set();\n this.stopped = false;\n this.dirty = false;\n this.diff = null;\n this.observableQuery = null;\n if (!destructiveMethodCounts.has(cache)) {\n destructiveMethodCounts.set(cache, 0);\n wrapDestructiveCacheMethod(cache, \"evict\");\n wrapDestructiveCacheMethod(cache, \"modify\");\n wrapDestructiveCacheMethod(cache, \"reset\");\n }\n }\n QueryInfo.prototype.init = function (query) {\n var networkStatus = query.networkStatus || NetworkStatus.loading;\n if (this.variables &&\n this.networkStatus !== NetworkStatus.loading &&\n !equal(this.variables, query.variables)) {\n networkStatus = NetworkStatus.setVariables;\n }\n if (!equal(query.variables, this.variables)) {\n this.diff = null;\n }\n Object.assign(this, {\n document: query.document,\n variables: query.variables,\n networkError: null,\n graphQLErrors: this.graphQLErrors || [],\n networkStatus: networkStatus,\n });\n if (query.observableQuery) {\n this.setObservableQuery(query.observableQuery);\n }\n if (query.lastRequestId) {\n this.lastRequestId = query.lastRequestId;\n }\n return this;\n };\n QueryInfo.prototype.reset = function () {\n cancelNotifyTimeout(this);\n this.diff = null;\n this.dirty = false;\n };\n QueryInfo.prototype.getDiff = function (variables) {\n if (variables === void 0) { variables = this.variables; }\n if (this.diff && equal(variables, this.variables)) {\n return this.diff;\n }\n this.updateWatch(this.variables = variables);\n return this.diff = this.cache.diff({\n query: this.document,\n variables: variables,\n returnPartialData: true,\n optimistic: true,\n });\n };\n QueryInfo.prototype.setDiff = function (diff) {\n var _this = this;\n var oldDiff = this.diff;\n this.diff = diff;\n if (!this.dirty &&\n (diff && diff.result) !== (oldDiff && oldDiff.result)) {\n this.dirty = true;\n if (!this.notifyTimeout) {\n this.notifyTimeout = setTimeout(function () { return _this.notify(); }, 0);\n }\n }\n };\n QueryInfo.prototype.setObservableQuery = function (oq) {\n var _this = this;\n if (oq === this.observableQuery)\n return;\n if (this.oqListener) {\n this.listeners.delete(this.oqListener);\n }\n this.observableQuery = oq;\n if (oq) {\n oq[\"queryInfo\"] = this;\n this.listeners.add(this.oqListener = function () {\n if (_this.getDiff().fromOptimisticTransaction) {\n oq[\"observe\"]();\n }\n else {\n oq.reobserve();\n }\n });\n }\n else {\n delete this.oqListener;\n }\n };\n QueryInfo.prototype.notify = function () {\n var _this = this;\n cancelNotifyTimeout(this);\n if (this.shouldNotify()) {\n this.listeners.forEach(function (listener) { return listener(_this); });\n }\n this.dirty = false;\n };\n QueryInfo.prototype.shouldNotify = function () {\n if (!this.dirty || !this.listeners.size) {\n return false;\n }\n if (isNetworkRequestInFlight(this.networkStatus) &&\n this.observableQuery) {\n var fetchPolicy = this.observableQuery.options.fetchPolicy;\n if (fetchPolicy !== \"cache-only\" &&\n fetchPolicy !== \"cache-and-network\") {\n return false;\n }\n }\n return true;\n };\n QueryInfo.prototype.stop = function () {\n if (!this.stopped) {\n this.stopped = true;\n this.reset();\n this.cancel();\n delete this.cancel;\n this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });\n var oq = this.observableQuery;\n if (oq)\n oq.stopPolling();\n }\n };\n QueryInfo.prototype.cancel = function () { };\n QueryInfo.prototype.updateWatch = function (variables) {\n var _this = this;\n if (variables === void 0) { variables = this.variables; }\n var oq = this.observableQuery;\n if (oq && oq.options.fetchPolicy === \"no-cache\") {\n return;\n }\n if (!this.lastWatch ||\n this.lastWatch.query !== this.document ||\n !equal(variables, this.lastWatch.variables)) {\n this.cancel();\n this.cancel = this.cache.watch(this.lastWatch = {\n query: this.document,\n variables: variables,\n optimistic: true,\n callback: function (diff) { return _this.setDiff(diff); },\n });\n }\n };\n QueryInfo.prototype.shouldWrite = function (result, variables) {\n var lastWrite = this.lastWrite;\n return !(lastWrite &&\n lastWrite.dmCount === destructiveMethodCounts.get(this.cache) &&\n equal(variables, lastWrite.variables) &&\n equal(result.data, lastWrite.result.data));\n };\n QueryInfo.prototype.markResult = function (result, options, allowCacheWrite) {\n var _this = this;\n this.graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n this.reset();\n if (options.fetchPolicy === 'no-cache') {\n this.diff = { result: result.data, complete: true };\n }\n else if (!this.stopped && allowCacheWrite) {\n if (shouldWriteResult(result, options.errorPolicy)) {\n this.cache.performTransaction(function (cache) {\n if (_this.shouldWrite(result, options.variables)) {\n cache.writeQuery({\n query: _this.document,\n data: result.data,\n variables: options.variables,\n });\n _this.lastWrite = {\n result: result,\n variables: options.variables,\n dmCount: destructiveMethodCounts.get(_this.cache),\n };\n }\n else {\n if (_this.diff && _this.diff.complete) {\n result.data = _this.diff.result;\n return;\n }\n }\n var diff = cache.diff({\n query: _this.document,\n variables: options.variables,\n returnPartialData: true,\n optimistic: true,\n });\n if (!_this.stopped) {\n _this.updateWatch(options.variables);\n }\n _this.diff = diff;\n if (diff.complete) {\n result.data = diff.result;\n }\n });\n }\n else {\n this.lastWrite = void 0;\n }\n }\n };\n QueryInfo.prototype.markReady = function () {\n this.networkError = null;\n return this.networkStatus = NetworkStatus.ready;\n };\n QueryInfo.prototype.markError = function (error) {\n this.networkStatus = NetworkStatus.error;\n this.lastWrite = void 0;\n this.reset();\n if (error.graphQLErrors) {\n this.graphQLErrors = error.graphQLErrors;\n }\n if (error.networkError) {\n this.networkError = error.networkError;\n }\n return error;\n };\n return QueryInfo;\n}());\nexport { QueryInfo };\nexport function shouldWriteResult(result, errorPolicy) {\n if (errorPolicy === void 0) { errorPolicy = \"none\"; }\n var ignoreErrors = errorPolicy === \"ignore\" ||\n errorPolicy === \"all\";\n var writeWithErrors = !graphQLResultHasError(result);\n if (!writeWithErrors && ignoreErrors && result.data) {\n writeWithErrors = true;\n }\n return writeWithErrors;\n}\n//# sourceMappingURL=QueryInfo.js.map","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { equal } from '@wry/equality';\nimport { execute } from \"../link/core/index.js\";\nimport { getDefaultValues, getOperationDefinition, getOperationName, hasClientExports, graphQLResultHasError, removeConnectionDirectiveFromDocument, canUseWeakMap, Observable, asyncMap, isNonEmptyArray, Concast, } from \"../utilities/index.js\";\nimport { ApolloError, isApolloError } from \"../errors/index.js\";\nimport { ObservableQuery } from \"./ObservableQuery.js\";\nimport { NetworkStatus, isNetworkRequestInFlight } from \"./networkStatus.js\";\nimport { LocalState } from \"./LocalState.js\";\nimport { QueryInfo, shouldWriteResult } from \"./QueryInfo.js\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar QueryManager = (function () {\n function QueryManager(_a) {\n var cache = _a.cache, link = _a.link, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, onBroadcast = _a.onBroadcast, _c = _a.ssrMode, ssrMode = _c === void 0 ? false : _c, _d = _a.clientAwareness, clientAwareness = _d === void 0 ? {} : _d, localState = _a.localState, assumeImmutableResults = _a.assumeImmutableResults;\n this.clientAwareness = {};\n this.queries = new Map();\n this.fetchCancelFns = new Map();\n this.transformCache = new (canUseWeakMap ? WeakMap : Map)();\n this.queryIdCounter = 1;\n this.requestIdCounter = 1;\n this.mutationIdCounter = 1;\n this.inFlightLinkObservables = new Map();\n this.cache = cache;\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: cache });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n if ((this.onBroadcast = onBroadcast)) {\n this.mutationStore = Object.create(null);\n }\n }\n QueryManager.prototype.stop = function () {\n var _this = this;\n this.queries.forEach(function (_info, queryId) {\n _this.stopQueryNoBroadcast(queryId);\n });\n this.cancelPendingFetches(process.env.NODE_ENV === \"production\" ? new InvariantError(12) : new InvariantError('QueryManager stopped while query was in flight'));\n };\n QueryManager.prototype.cancelPendingFetches = function (error) {\n this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });\n this.fetchCancelFns.clear();\n };\n QueryManager.prototype.mutate = function (_a) {\n var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueries = _a.updateQueries, _b = _a.refetchQueries, refetchQueries = _b === void 0 ? [] : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, updateWithProxyFn = _a.update, _d = _a.errorPolicy, errorPolicy = _d === void 0 ? 'none' : _d, fetchPolicy = _a.fetchPolicy, _e = _a.context, context = _e === void 0 ? {} : _e;\n return __awaiter(this, void 0, void 0, function () {\n var mutationId, mutationStoreValue, self;\n return __generator(this, function (_f) {\n switch (_f.label) {\n case 0:\n process.env.NODE_ENV === \"production\" ? invariant(mutation, 13) : invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.');\n process.env.NODE_ENV === \"production\" ? invariant(!fetchPolicy || fetchPolicy === 'no-cache', 14) : invariant(!fetchPolicy || fetchPolicy === 'no-cache', \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\");\n mutationId = this.generateMutationId();\n mutation = this.transform(mutation).document;\n variables = this.getVariables(mutation, variables);\n if (!this.transform(mutation).hasClientExports) return [3, 2];\n return [4, this.localState.addExportedVariables(mutation, variables, context)];\n case 1:\n variables = _f.sent();\n _f.label = 2;\n case 2:\n mutationStoreValue = this.mutationStore &&\n (this.mutationStore[mutationId] = {\n mutation: mutation,\n variables: variables,\n loading: true,\n error: null,\n });\n if (optimisticResponse) {\n this.markMutationOptimistic(optimisticResponse, {\n mutationId: mutationId,\n document: mutation,\n variables: variables,\n errorPolicy: errorPolicy,\n updateQueries: updateQueries,\n update: updateWithProxyFn,\n });\n }\n this.broadcastQueries();\n self = this;\n return [2, new Promise(function (resolve, reject) {\n var storeResult;\n var error;\n self.getObservableFromLink(mutation, __assign(__assign({}, context), { optimisticResponse: optimisticResponse }), variables, false).subscribe({\n next: function (result) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n if (mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = null;\n }\n if (fetchPolicy !== 'no-cache') {\n try {\n self.markMutationResult({\n mutationId: mutationId,\n result: result,\n document: mutation,\n variables: variables,\n errorPolicy: errorPolicy,\n updateQueries: updateQueries,\n update: updateWithProxyFn,\n });\n }\n catch (e) {\n error = new ApolloError({\n networkError: e,\n });\n return;\n }\n }\n storeResult = result;\n },\n error: function (err) {\n if (mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = err;\n }\n if (optimisticResponse) {\n self.cache.removeOptimistic(mutationId);\n }\n self.broadcastQueries();\n reject(new ApolloError({\n networkError: err,\n }));\n },\n complete: function () {\n if (error && mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = error;\n }\n if (optimisticResponse) {\n self.cache.removeOptimistic(mutationId);\n }\n self.broadcastQueries();\n if (error) {\n reject(error);\n return;\n }\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult);\n }\n var refetchQueryPromises = [];\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(function (refetchQuery) {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(function (_a) {\n var observableQuery = _a.observableQuery;\n if (observableQuery &&\n observableQuery.hasObservers() &&\n observableQuery.queryName === refetchQuery) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n }\n else {\n var queryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () {\n if (errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)) {\n delete storeResult.errors;\n }\n resolve(storeResult);\n }, reject);\n },\n });\n })];\n }\n });\n });\n };\n QueryManager.prototype.markMutationResult = function (mutation, cache) {\n var _this = this;\n if (cache === void 0) { cache = this.cache; }\n if (shouldWriteResult(mutation.result, mutation.errorPolicy)) {\n var cacheWrites_1 = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n var updateQueries_1 = mutation.updateQueries;\n if (updateQueries_1) {\n this.queries.forEach(function (_a, queryId) {\n var observableQuery = _a.observableQuery;\n var queryName = observableQuery && observableQuery.queryName;\n if (!queryName || !hasOwnProperty.call(updateQueries_1, queryName)) {\n return;\n }\n var updater = updateQueries_1[queryName];\n var _b = _this.queries.get(queryId), document = _b.document, variables = _b.variables;\n var _c = cache.diff({\n query: document,\n variables: variables,\n returnPartialData: true,\n optimistic: false,\n }), currentQueryResult = _c.result, complete = _c.complete;\n if (complete && currentQueryResult) {\n var nextQueryResult = updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: document && getOperationName(document) || void 0,\n queryVariables: variables,\n });\n if (nextQueryResult) {\n cacheWrites_1.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n });\n }\n cache.performTransaction(function (c) {\n cacheWrites_1.forEach(function (write) { return c.write(write); });\n var update = mutation.update;\n if (update) {\n update(c, mutation.result);\n }\n }, null);\n }\n };\n QueryManager.prototype.markMutationOptimistic = function (optimisticResponse, mutation) {\n var _this = this;\n var data = typeof optimisticResponse === \"function\"\n ? optimisticResponse(mutation.variables)\n : optimisticResponse;\n return this.cache.recordOptimisticTransaction(function (cache) {\n try {\n _this.markMutationResult(__assign(__assign({}, mutation), { result: { data: data } }), cache);\n }\n catch (error) {\n process.env.NODE_ENV === \"production\" || invariant.error(error);\n }\n }, mutation.mutationId);\n };\n QueryManager.prototype.fetchQuery = function (queryId, options, networkStatus) {\n return this.fetchQueryObservable(queryId, options, networkStatus).promise;\n };\n QueryManager.prototype.getQueryStore = function () {\n var store = Object.create(null);\n this.queries.forEach(function (info, queryId) {\n store[queryId] = {\n variables: info.variables,\n networkStatus: info.networkStatus,\n networkError: info.networkError,\n graphQLErrors: info.graphQLErrors,\n };\n });\n return store;\n };\n QueryManager.prototype.resetErrors = function (queryId) {\n var queryInfo = this.queries.get(queryId);\n if (queryInfo) {\n queryInfo.networkError = undefined;\n queryInfo.graphQLErrors = [];\n }\n };\n QueryManager.prototype.transform = function (document) {\n var transformCache = this.transformCache;\n if (!transformCache.has(document)) {\n var transformed = this.cache.transformDocument(document);\n var forLink = removeConnectionDirectiveFromDocument(this.cache.transformForLink(transformed));\n var clientQuery = this.localState.clientQuery(transformed);\n var serverQuery = forLink && this.localState.serverQuery(forLink);\n var cacheEntry_1 = {\n document: transformed,\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery: clientQuery,\n serverQuery: serverQuery,\n defaultVars: getDefaultValues(getOperationDefinition(transformed)),\n };\n var add = function (doc) {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry_1);\n }\n };\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n return transformCache.get(document);\n };\n QueryManager.prototype.getVariables = function (document, variables) {\n return __assign(__assign({}, this.transform(document).defaultVars), variables);\n };\n QueryManager.prototype.watchQuery = function (options) {\n options = __assign(__assign({}, options), { variables: this.getVariables(options.query, options.variables) });\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n var queryInfo = new QueryInfo(this.cache);\n var observable = new ObservableQuery({\n queryManager: this,\n queryInfo: queryInfo,\n options: options,\n });\n this.queries.set(observable.queryId, queryInfo);\n queryInfo.init({\n document: options.query,\n observableQuery: observable,\n variables: options.variables,\n });\n return observable;\n };\n QueryManager.prototype.query = function (options) {\n var _this = this;\n process.env.NODE_ENV === \"production\" ? invariant(options.query, 15) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.');\n process.env.NODE_ENV === \"production\" ? invariant(options.query.kind === 'Document', 16) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a \"gql\" tag.');\n process.env.NODE_ENV === \"production\" ? invariant(!options.returnPartialData, 17) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.');\n process.env.NODE_ENV === \"production\" ? invariant(!options.pollInterval, 18) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.');\n var queryId = this.generateQueryId();\n return this.fetchQuery(queryId, options).finally(function () { return _this.stopQuery(queryId); });\n };\n QueryManager.prototype.generateQueryId = function () {\n return String(this.queryIdCounter++);\n };\n QueryManager.prototype.generateRequestId = function () {\n return this.requestIdCounter++;\n };\n QueryManager.prototype.generateMutationId = function () {\n return String(this.mutationIdCounter++);\n };\n QueryManager.prototype.stopQueryInStore = function (queryId) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n };\n QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) {\n var queryInfo = this.queries.get(queryId);\n if (queryInfo)\n queryInfo.stop();\n };\n QueryManager.prototype.clearStore = function () {\n this.cancelPendingFetches(process.env.NODE_ENV === \"production\" ? new InvariantError(19) : new InvariantError('Store reset while query was in flight (not completed in link chain)'));\n this.queries.forEach(function (queryInfo) {\n if (queryInfo.observableQuery) {\n queryInfo.networkStatus = NetworkStatus.loading;\n }\n else {\n queryInfo.stop();\n }\n });\n if (this.mutationStore) {\n this.mutationStore = Object.create(null);\n }\n return this.cache.reset();\n };\n QueryManager.prototype.resetStore = function () {\n var _this = this;\n return this.clearStore().then(function () {\n return _this.reFetchObservableQueries();\n });\n };\n QueryManager.prototype.reFetchObservableQueries = function (includeStandby) {\n var _this = this;\n if (includeStandby === void 0) { includeStandby = false; }\n var observableQueryPromises = [];\n this.queries.forEach(function (_a, queryId) {\n var observableQuery = _a.observableQuery;\n if (observableQuery && observableQuery.hasObservers()) {\n var fetchPolicy = observableQuery.options.fetchPolicy;\n observableQuery.resetLastResults();\n if (fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n _this.getQuery(queryId).setDiff(null);\n }\n });\n this.broadcastQueries();\n return Promise.all(observableQueryPromises);\n };\n QueryManager.prototype.setObservableQuery = function (observableQuery) {\n this.getQuery(observableQuery.queryId).setObservableQuery(observableQuery);\n };\n QueryManager.prototype.startGraphQLSubscription = function (_a) {\n var _this = this;\n var query = _a.query, fetchPolicy = _a.fetchPolicy, errorPolicy = _a.errorPolicy, variables = _a.variables, _b = _a.context, context = _b === void 0 ? {} : _b;\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n var makeObservable = function (variables) {\n return _this.getObservableFromLink(query, context, variables, false).map(function (result) {\n if (fetchPolicy !== 'no-cache') {\n if (shouldWriteResult(result, errorPolicy)) {\n _this.cache.write({\n query: query,\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n variables: variables,\n });\n }\n _this.broadcastQueries();\n }\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n return result;\n });\n };\n if (this.transform(query).hasClientExports) {\n var observablePromise_1 = this.localState.addExportedVariables(query, variables, context).then(makeObservable);\n return new Observable(function (observer) {\n var sub = null;\n observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error);\n return function () { return sub && sub.unsubscribe(); };\n });\n }\n return makeObservable(variables);\n };\n QueryManager.prototype.stopQuery = function (queryId) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n };\n QueryManager.prototype.stopQueryNoBroadcast = function (queryId) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n };\n QueryManager.prototype.removeQuery = function (queryId) {\n this.fetchCancelFns.delete(queryId);\n this.getQuery(queryId).stop();\n this.queries.delete(queryId);\n };\n QueryManager.prototype.broadcastQueries = function () {\n if (this.onBroadcast)\n this.onBroadcast();\n this.queries.forEach(function (info) { return info.notify(); });\n };\n QueryManager.prototype.getLocalState = function () {\n return this.localState;\n };\n QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) {\n var _this = this;\n var _a;\n if (deduplication === void 0) { deduplication = (_a = context === null || context === void 0 ? void 0 : context.queryDeduplication) !== null && _a !== void 0 ? _a : this.queryDeduplication; }\n var observable;\n var serverQuery = this.transform(query).serverQuery;\n if (serverQuery) {\n var _b = this, inFlightLinkObservables_1 = _b.inFlightLinkObservables, link = _b.link;\n var operation = {\n query: serverQuery,\n variables: variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext(__assign(__assign({}, context), { forceFetch: !deduplication })),\n };\n context = operation.context;\n if (deduplication) {\n var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map();\n inFlightLinkObservables_1.set(serverQuery, byVariables_1);\n var varJson_1 = JSON.stringify(variables);\n observable = byVariables_1.get(varJson_1);\n if (!observable) {\n var concast = new Concast([\n execute(link, operation)\n ]);\n byVariables_1.set(varJson_1, observable = concast);\n concast.cleanup(function () {\n if (byVariables_1.delete(varJson_1) &&\n byVariables_1.size < 1) {\n inFlightLinkObservables_1.delete(serverQuery);\n }\n });\n }\n }\n else {\n observable = new Concast([\n execute(link, operation)\n ]);\n }\n }\n else {\n observable = new Concast([\n Observable.of({ data: {} })\n ]);\n context = this.prepareContext(context);\n }\n var clientQuery = this.transform(query).clientQuery;\n if (clientQuery) {\n observable = asyncMap(observable, function (result) {\n return _this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context: context,\n variables: variables,\n });\n });\n }\n return observable;\n };\n QueryManager.prototype.getResultsFromLink = function (queryInfo, allowCacheWrite, options) {\n var requestId = queryInfo.lastRequestId = this.generateRequestId();\n return asyncMap(this.getObservableFromLink(queryInfo.document, options.context, options.variables), function (result) {\n var hasErrors = isNonEmptyArray(result.errors);\n if (requestId >= queryInfo.lastRequestId) {\n if (hasErrors && options.errorPolicy === \"none\") {\n throw queryInfo.markError(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n queryInfo.markResult(result, options, allowCacheWrite);\n queryInfo.markReady();\n }\n var aqr = {\n data: result.data,\n loading: false,\n networkStatus: queryInfo.networkStatus || NetworkStatus.ready,\n };\n if (hasErrors && options.errorPolicy !== \"ignore\") {\n aqr.errors = result.errors;\n }\n return aqr;\n }, function (networkError) {\n var error = isApolloError(networkError)\n ? networkError\n : new ApolloError({ networkError: networkError });\n if (requestId >= queryInfo.lastRequestId) {\n queryInfo.markError(error);\n }\n throw error;\n });\n };\n QueryManager.prototype.fetchQueryObservable = function (queryId, options, networkStatus) {\n var _this = this;\n if (networkStatus === void 0) { networkStatus = NetworkStatus.loading; }\n var query = this.transform(options.query).document;\n var variables = this.getVariables(query, options.variables);\n var queryInfo = this.getQuery(queryId);\n var oldNetworkStatus = queryInfo.networkStatus;\n var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? \"cache-first\" : _a, _b = options.errorPolicy, errorPolicy = _b === void 0 ? \"none\" : _b, _c = options.returnPartialData, returnPartialData = _c === void 0 ? false : _c, _d = options.notifyOnNetworkStatusChange, notifyOnNetworkStatusChange = _d === void 0 ? false : _d, _e = options.context, context = _e === void 0 ? {} : _e;\n var mightUseNetwork = fetchPolicy === \"cache-first\" ||\n fetchPolicy === \"cache-and-network\" ||\n fetchPolicy === \"network-only\" ||\n fetchPolicy === \"no-cache\";\n if (mightUseNetwork &&\n notifyOnNetworkStatusChange &&\n typeof oldNetworkStatus === \"number\" &&\n oldNetworkStatus !== networkStatus &&\n isNetworkRequestInFlight(networkStatus)) {\n if (fetchPolicy !== \"cache-first\") {\n fetchPolicy = \"cache-and-network\";\n }\n returnPartialData = true;\n }\n var normalized = Object.assign({}, options, {\n query: query,\n variables: variables,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n returnPartialData: returnPartialData,\n notifyOnNetworkStatusChange: notifyOnNetworkStatusChange,\n context: context,\n });\n var fromVariables = function (variables) {\n normalized.variables = variables;\n return _this.fetchQueryByPolicy(queryInfo, normalized, networkStatus);\n };\n this.fetchCancelFns.set(queryId, function (reason) {\n Promise.resolve().then(function () { return concast.cancel(reason); });\n });\n var concast = new Concast(this.transform(normalized.query).hasClientExports\n ? this.localState.addExportedVariables(normalized.query, normalized.variables, normalized.context).then(fromVariables)\n : fromVariables(normalized.variables));\n concast.cleanup(function () {\n _this.fetchCancelFns.delete(queryId);\n var nextFetchPolicy = options.nextFetchPolicy;\n if (nextFetchPolicy) {\n options.nextFetchPolicy = void 0;\n options.fetchPolicy = typeof nextFetchPolicy === \"function\"\n ? nextFetchPolicy.call(options, options.fetchPolicy || \"cache-first\")\n : nextFetchPolicy;\n }\n });\n return concast;\n };\n QueryManager.prototype.fetchQueryByPolicy = function (queryInfo, options, networkStatus) {\n var _this = this;\n var query = options.query, variables = options.variables, fetchPolicy = options.fetchPolicy, errorPolicy = options.errorPolicy, returnPartialData = options.returnPartialData, context = options.context;\n queryInfo.init({\n document: query,\n variables: variables,\n networkStatus: networkStatus,\n });\n var readCache = function () { return queryInfo.getDiff(variables); };\n var resultsFromCache = function (diff, networkStatus) {\n if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || NetworkStatus.loading; }\n var data = diff.result;\n if (process.env.NODE_ENV !== 'production' &&\n isNonEmptyArray(diff.missing) &&\n !equal(data, {}) &&\n !returnPartialData) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Missing cache result fields: \" + diff.missing.map(function (m) { return m.path.join('.'); }).join(', '), diff.missing);\n }\n var fromData = function (data) { return Observable.of(__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); };\n if (_this.transform(query).hasForcedResolvers) {\n return _this.localState.runResolvers({\n document: query,\n remoteResult: { data: data },\n context: context,\n variables: variables,\n onlyRunForcedResolvers: true,\n }).then(function (resolved) { return fromData(resolved.data); });\n }\n return fromData(data);\n };\n var resultsFromLink = function (allowCacheWrite) {\n return _this.getResultsFromLink(queryInfo, allowCacheWrite, {\n variables: variables,\n context: context,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n });\n };\n switch (fetchPolicy) {\n default:\n case \"cache-first\": {\n var diff = readCache();\n if (diff.complete) {\n return [\n resultsFromCache(diff, queryInfo.markReady()),\n ];\n }\n if (returnPartialData) {\n return [\n resultsFromCache(diff),\n resultsFromLink(true),\n ];\n }\n return [\n resultsFromLink(true),\n ];\n }\n case \"cache-and-network\": {\n var diff = readCache();\n if (diff.complete || returnPartialData) {\n return [\n resultsFromCache(diff),\n resultsFromLink(true),\n ];\n }\n return [\n resultsFromLink(true),\n ];\n }\n case \"cache-only\":\n return [\n resultsFromCache(readCache(), queryInfo.markReady()),\n ];\n case \"network-only\":\n return [resultsFromLink(true)];\n case \"no-cache\":\n return [resultsFromLink(false)];\n case \"standby\":\n return [];\n }\n };\n QueryManager.prototype.getQuery = function (queryId) {\n if (queryId && !this.queries.has(queryId)) {\n this.queries.set(queryId, new QueryInfo(this.cache));\n }\n return this.queries.get(queryId);\n };\n QueryManager.prototype.prepareContext = function (context) {\n if (context === void 0) { context = {}; }\n var newContext = this.localState.prepareContext(context);\n return __assign(__assign({}, newContext), { clientAwareness: this.clientAwareness });\n };\n return QueryManager;\n}());\nexport { QueryManager };\n//# sourceMappingURL=QueryManager.js.map","import { __assign } from \"tslib\";\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { ApolloLink, execute } from \"../link/core/index.js\";\nimport { compact } from \"../utilities/index.js\";\nimport { version } from \"../version.js\";\nimport { HttpLink } from \"../link/http/index.js\";\nimport { QueryManager } from \"./QueryManager.js\";\nimport { LocalState, } from \"./LocalState.js\";\nvar hasSuggestedDevtools = false;\nexport function mergeOptions(defaults, options) {\n return compact(defaults, options, options.variables && {\n variables: __assign(__assign({}, defaults.variables), options.variables),\n });\n}\nvar ApolloClient = (function () {\n function ApolloClient(options) {\n var _this = this;\n this.defaultOptions = {};\n this.resetStoreCallbacks = [];\n this.clearStoreCallbacks = [];\n var uri = options.uri, credentials = options.credentials, headers = options.headers, cache = options.cache, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, _c = options.connectToDevTools, connectToDevTools = _c === void 0 ? typeof window === 'object' &&\n !window.__APOLLO_CLIENT__ &&\n process.env.NODE_ENV !== 'production' : _c, _d = options.queryDeduplication, queryDeduplication = _d === void 0 ? true : _d, defaultOptions = options.defaultOptions, _e = options.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? false : _e, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version;\n var link = options.link;\n if (!link) {\n link = uri\n ? new HttpLink({ uri: uri, credentials: credentials, headers: headers })\n : ApolloLink.empty();\n }\n if (!cache) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(9) : new InvariantError(\"To initialize Apollo Client, you must specify a 'cache' property \" +\n \"in the options object. \\n\" +\n \"For more information, please visit: https://go.apollo.dev/c/docs\");\n }\n this.link = link;\n this.cache = cache;\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n if (ssrForceFetchDelay) {\n setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay);\n }\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n if (connectToDevTools && typeof window === 'object') {\n window.__APOLLO_CLIENT__ = this;\n }\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self &&\n !window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {\n var nav = window.navigator;\n var ua = nav && nav.userAgent;\n var url = void 0;\n if (typeof ua === \"string\") {\n if (ua.indexOf(\"Chrome/\") > -1) {\n url = \"https://chrome.google.com/webstore/detail/\" +\n \"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm\";\n }\n else if (ua.indexOf(\"Firefox/\") > -1) {\n url = \"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/\";\n }\n }\n if (url) {\n invariant.log(\"Download the Apollo DevTools for a better development \" +\n \"experience: \" + url);\n }\n }\n }\n this.version = version;\n this.localState = new LocalState({\n cache: cache,\n client: this,\n resolvers: resolvers,\n fragmentMatcher: fragmentMatcher,\n });\n this.queryManager = new QueryManager({\n cache: this.cache,\n link: this.link,\n queryDeduplication: queryDeduplication,\n ssrMode: ssrMode,\n clientAwareness: {\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n },\n localState: this.localState,\n assumeImmutableResults: assumeImmutableResults,\n onBroadcast: connectToDevTools ? function () {\n if (_this.devToolsHookCb) {\n _this.devToolsHookCb({\n action: {},\n state: {\n queries: _this.queryManager.getQueryStore(),\n mutations: _this.queryManager.mutationStore || {},\n },\n dataWithOptimisticResults: _this.cache.extract(true),\n });\n }\n } : void 0,\n });\n }\n ApolloClient.prototype.stop = function () {\n this.queryManager.stop();\n };\n ApolloClient.prototype.watchQuery = function (options) {\n if (this.defaultOptions.watchQuery) {\n options = mergeOptions(this.defaultOptions.watchQuery, options);\n }\n if (this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')) {\n options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' });\n }\n return this.queryManager.watchQuery(options);\n };\n ApolloClient.prototype.query = function (options) {\n if (this.defaultOptions.query) {\n options = mergeOptions(this.defaultOptions.query, options);\n }\n process.env.NODE_ENV === \"production\" ? invariant(options.fetchPolicy !== 'cache-and-network', 10) : invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.');\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' });\n }\n return this.queryManager.query(options);\n };\n ApolloClient.prototype.mutate = function (options) {\n if (this.defaultOptions.mutate) {\n options = mergeOptions(this.defaultOptions.mutate, options);\n }\n return this.queryManager.mutate(options);\n };\n ApolloClient.prototype.subscribe = function (options) {\n return this.queryManager.startGraphQLSubscription(options);\n };\n ApolloClient.prototype.readQuery = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return this.cache.readQuery(options, optimistic);\n };\n ApolloClient.prototype.readFragment = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return this.cache.readFragment(options, optimistic);\n };\n ApolloClient.prototype.writeQuery = function (options) {\n this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n };\n ApolloClient.prototype.writeFragment = function (options) {\n this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n };\n ApolloClient.prototype.__actionHookForDevTools = function (cb) {\n this.devToolsHookCb = cb;\n };\n ApolloClient.prototype.__requestRaw = function (payload) {\n return execute(this.link, payload);\n };\n ApolloClient.prototype.resetStore = function () {\n var _this = this;\n return Promise.resolve()\n .then(function () { return _this.queryManager.clearStore(); })\n .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); })\n .then(function () { return _this.reFetchObservableQueries(); });\n };\n ApolloClient.prototype.clearStore = function () {\n var _this = this;\n return Promise.resolve()\n .then(function () { return _this.queryManager.clearStore(); })\n .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); });\n };\n ApolloClient.prototype.onResetStore = function (cb) {\n var _this = this;\n this.resetStoreCallbacks.push(cb);\n return function () {\n _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; });\n };\n };\n ApolloClient.prototype.onClearStore = function (cb) {\n var _this = this;\n this.clearStoreCallbacks.push(cb);\n return function () {\n _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; });\n };\n };\n ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n };\n ApolloClient.prototype.extract = function (optimistic) {\n return this.cache.extract(optimistic);\n };\n ApolloClient.prototype.restore = function (serializedState) {\n return this.cache.restore(serializedState);\n };\n ApolloClient.prototype.addResolvers = function (resolvers) {\n this.localState.addResolvers(resolvers);\n };\n ApolloClient.prototype.setResolvers = function (resolvers) {\n this.localState.setResolvers(resolvers);\n };\n ApolloClient.prototype.getResolvers = function () {\n return this.localState.getResolvers();\n };\n ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n };\n ApolloClient.prototype.setLink = function (newLink) {\n this.link = this.queryManager.link = newLink;\n };\n return ApolloClient;\n}());\nexport { ApolloClient };\n//# sourceMappingURL=ApolloClient.js.map","export var version = '3.3.15';\n//# sourceMappingURL=version.js.map","module.exports = require('./lib/Observable.js').Observable;\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar AbstractRegistry_1 = tslib_1.__importDefault(require(\"./AbstractRegistry\"));\nvar positional_array_sorter_1 = tslib_1.__importDefault(require(\"@neos-project/positional-array-sorter\"));\nvar SynchronousRegistry = (function (_super) {\n tslib_1.__extends(SynchronousRegistry, _super);\n function SynchronousRegistry(description) {\n var _this = _super.call(this, description) || this;\n _this._registry = [];\n return _this;\n }\n SynchronousRegistry.prototype.set = function (key, value, position) {\n if (position === void 0) { position = 0; }\n if (typeof key !== 'string') {\n throw new Error('Key must be a string');\n }\n if (typeof position !== 'string' && typeof position !== 'number') {\n throw new Error('Position must be a string or a number');\n }\n var entry = { key: key, value: value };\n if (position) {\n entry.position = position;\n }\n var indexOfItemWithTheSameKey = this._registry.findIndex(function (item) { return item.key === key; });\n if (indexOfItemWithTheSameKey === -1) {\n this._registry.push(entry);\n }\n else {\n this._registry[indexOfItemWithTheSameKey] = entry;\n }\n return value;\n };\n SynchronousRegistry.prototype.get = function (key) {\n if (typeof key !== 'string') {\n console.error('Key must be a string');\n return null;\n }\n var result = this._registry.find(function (item) { return item.key === key; });\n return result ? result.value : null;\n };\n SynchronousRegistry.prototype._getChildrenWrapped = function (searchKey) {\n var unsortedChildren = this._registry.filter(function (item) { return item.key.indexOf(searchKey + '/') === 0; });\n return positional_array_sorter_1[\"default\"](unsortedChildren);\n };\n SynchronousRegistry.prototype.getChildrenAsObject = function (searchKey) {\n var result = {};\n this._getChildrenWrapped(searchKey).forEach(function (item) {\n result[item.key] = item.value;\n });\n return result;\n };\n SynchronousRegistry.prototype.getChildren = function (searchKey) {\n return this._getChildrenWrapped(searchKey).map(function (item) { return item.value; });\n };\n SynchronousRegistry.prototype.has = function (key) {\n if (typeof key !== 'string') {\n console.error('Key must be a string');\n return false;\n }\n return Boolean(this._registry.find(function (item) { return item.key === key; }));\n };\n SynchronousRegistry.prototype._getAllWrapped = function () {\n return positional_array_sorter_1[\"default\"](this._registry);\n };\n SynchronousRegistry.prototype.getAllAsObject = function () {\n var result = {};\n this._getAllWrapped().forEach(function (item) {\n result[item.key] = item.value;\n });\n return result;\n };\n SynchronousRegistry.prototype.getAllAsList = function () {\n return this._getAllWrapped().map(function (item) { return Object.assign({ id: item.key }, item.value); });\n };\n return SynchronousRegistry;\n}(AbstractRegistry_1[\"default\"]));\nexports[\"default\"] = SynchronousRegistry;\n//# sourceMappingURL=SynchronousRegistry.js.map","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","import { ApolloLink } from \"./ApolloLink.js\";\nexport var empty = ApolloLink.empty;\n//# sourceMappingURL=empty.js.map","module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","import { ApolloLink } from \"./ApolloLink.js\";\nexport var from = ApolloLink.from;\n//# sourceMappingURL=from.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var split = ApolloLink.split;\n//# sourceMappingURL=split.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var concat = ApolloLink.concat;\n//# sourceMappingURL=concat.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var execute = ApolloLink.execute;\n//# sourceMappingURL=execute.js.map","export var Cache;\n(function (Cache) {\n})(Cache || (Cache = {}));\n//# sourceMappingURL=Cache.js.map","export { ApolloProvider, ApolloConsumer, getApolloContext, resetApolloContext } from \"./context/index.js\";\nexport * from \"./hooks/index.js\";\nexport { DocumentType, operationName, parser } from \"./parser/index.js\";\nexport * from \"./types/types.js\";\n//# sourceMappingURL=index.js.map","'use strict';\n\nvar ReactNativeFile = require('./ReactNativeFile');\n\nmodule.exports = function isExtractableFile(value) {\n return (\n (typeof File !== 'undefined' && value instanceof File) ||\n (typeof Blob !== 'undefined' && value instanceof Blob) ||\n value instanceof ReactNativeFile\n );\n};\n","'use strict';\n\nmodule.exports = function ReactNativeFile(_ref) {\n var uri = _ref.uri,\n name = _ref.name,\n type = _ref.type;\n this.uri = uri;\n this.name = name;\n this.type = type;\n};\n","'use strict';\n\nmodule.exports = function formDataAppendFile(formData, fieldName, file) {\n formData.append(fieldName, file, file.name);\n};\n","'use strict';\n\nmodule.exports = require('extract-files/public/isExtractableFile');\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ASSET_SOURCE_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.ASSET_SOURCE_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment AssetSourceProps on AssetSource {\\n label\\n id\\n description\\n iconUri\\n readOnly\\n supportsTagging\\n supportsCollections\\n }\\n\"], [\"\\n fragment AssetSourceProps on AssetSource {\\n label\\n id\\n description\\n iconUri\\n readOnly\\n supportsTagging\\n supportsCollections\\n }\\n\"])));\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedAssetIdState = recoil_1.atom({\n key: 'selectedAssetIdState',\n default: null,\n});\nexports.default = selectedAssetIdState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SORT_DIRECTION = exports.SORT_BY = void 0;\nvar recoil_1 = require(\"recoil\");\nvar SORT_BY;\n(function (SORT_BY) {\n SORT_BY[\"Name\"] = \"name\";\n SORT_BY[\"LastModified\"] = \"lastModified\";\n})(SORT_BY = exports.SORT_BY || (exports.SORT_BY = {}));\nvar SORT_DIRECTION;\n(function (SORT_DIRECTION) {\n SORT_DIRECTION[\"Asc\"] = \"ASC\";\n SORT_DIRECTION[\"Desc\"] = \"DESC\";\n})(SORT_DIRECTION = exports.SORT_DIRECTION || (exports.SORT_DIRECTION = {}));\nvar selectedSortOrderState = recoil_1.atom({\n key: 'selectedSortOrderState',\n default: {\n sortBy: SORT_BY.LastModified,\n sortDirection: SORT_DIRECTION.Desc,\n },\n});\nexports.default = selectedSortOrderState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nfunction useAssetQuery(assetIdentity) {\n var _a = client_1.useQuery(queries_1.ASSET, {\n variables: { id: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetId, assetSourceId: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetSourceId },\n skip: !assetIdentity,\n }), data = _a.data, loading = _a.loading, refetch = _a.refetch;\n return { asset: (data === null || data === void 0 ? void 0 : data.asset) || null, loading: loading, refetch: refetch };\n}\nexports.default = useAssetQuery;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createEvent = void 0;\nvar pubsub_js_1 = __importDefault(require(\"pubsub-js\"));\n/**\n * Wraps the used pubsub library and exposes the methods we need\n */\nfunction createEvent(topic) {\n var event = function (payload) {\n event.publish(payload);\n };\n /**\n * Subscribe to the event\n * @returns a token which can be used to unsubscribe\n */\n event.subscribe = function (subscriber) {\n return pubsub_js_1.default.subscribe(topic, subscriber);\n };\n /**\n * Unsubscribe from the event\n * @param subscriber a function which was previously subscribed or a token which was returned by `subscribe`\n */\n event.unsubscribe = function (subscriber) {\n pubsub_js_1.default.unsubscribe(subscriber);\n };\n /**\n * Publish event and call all subscribers with payload\n * @returns true if the event has been published to at least one subscriber\n */\n event.publish = function (payload) {\n return pubsub_js_1.default.publish(topic, payload);\n };\n return event;\n}\nexports.createEvent = createEvent;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersistentStateManager = exports.IdFromObjectResolver = exports.CacheFactory = exports.ApolloErrorHandler = void 0;\nvar PersistentStateManager = __importStar(require(\"./PersistentStateManager\"));\nexports.PersistentStateManager = PersistentStateManager;\nvar IdFromObjectResolver_1 = __importDefault(require(\"./IdFromObjectResolver\"));\nexports.IdFromObjectResolver = IdFromObjectResolver_1.default;\nvar ApolloErrorHandler_1 = __importDefault(require(\"./ApolloErrorHandler\"));\nexports.ApolloErrorHandler = ApolloErrorHandler_1.default;\nvar Cache_1 = __importDefault(require(\"./Cache\"));\nexports.CacheFactory = Cache_1.default;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NEOS_ASSET_SOURCE = void 0;\nexports.NEOS_ASSET_SOURCE = 'neos';\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VIEW_MODE_SELECTION = exports.SET_VIEW_MODE_SELECTION = void 0;\nvar ViewModeSelectionQuery_1 = require(\"./ViewModeSelectionQuery\");\nObject.defineProperty(exports, \"SET_VIEW_MODE_SELECTION\", { enumerable: true, get: function () { return ViewModeSelectionQuery_1.SET_VIEW_MODE_SELECTION; } });\nObject.defineProperty(exports, \"VIEW_MODE_SELECTION\", { enumerable: true, get: function () { return ViewModeSelectionQuery_1.VIEW_MODE_SELECTION; } });\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar usageDetailsGroupFragment_1 = __importDefault(require(\"../fragments/usageDetailsGroupFragment\"));\nvar ASSET_USAGE_DETAILS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_USAGE_DETAILS($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n assetUsageDetails(id: $id, assetSourceId: $assetSourceId) {\\n ...UsageDetailsGroupProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_USAGE_DETAILS($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n assetUsageDetails(id: $id, assetSourceId: $assetSourceId) {\\n ...UsageDetailsGroupProps\\n }\\n }\\n \", \"\\n\"])), usageDetailsGroupFragment_1.default);\nexports.default = ASSET_USAGE_DETAILS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar USAGE_DETAILS_GROUP_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment UsageDetailsGroupProps on UsageDetailsGroup {\\n serviceId\\n label\\n metadataSchema {\\n name\\n label\\n type\\n }\\n usages {\\n label\\n url\\n metadata {\\n name\\n value\\n }\\n }\\n }\\n\"], [\"\\n fragment UsageDetailsGroupProps on UsageDetailsGroup {\\n serviceId\\n label\\n metadataSchema {\\n name\\n label\\n type\\n }\\n usages {\\n label\\n url\\n metadata {\\n name\\n value\\n }\\n }\\n }\\n\"])));\nexports.default = USAGE_DETAILS_GROUP_FRAGMENT;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"@media-ui/core/src/fragments/asset\");\nvar UNUSED_ASSETS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query UNUSED_ASSETS($limit: Int, $offset: Int, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n unusedAssets(limit: $limit, offset: $offset) {\\n ...AssetProps\\n isInUse @include(if: $includeUsage)\\n }\\n }\\n \", \"\\n\"], [\"\\n query UNUSED_ASSETS($limit: Int, $offset: Int, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n unusedAssets(limit: $limit, offset: $offset) {\\n ...AssetProps\\n isInUse @include(if: $includeUsage)\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = UNUSED_ASSETS;\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetUsages_1 = __importDefault(require(\"../queries/assetUsages\"));\nfunction useAssetUsagesQuery(assetIdentity) {\n var _a = client_1.useQuery(assetUsages_1.default, {\n variables: { id: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetId, assetSourceId: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetSourceId },\n skip: !assetIdentity,\n }), data = _a.data, loading = _a.loading;\n return { assetUsageDetails: (data === null || data === void 0 ? void 0 : data.assetUsageDetails) || null, loading: loading };\n}\nexports.default = useAssetUsagesQuery;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar showUnusedAssetsState = recoil_1.atom({\n key: 'showUnusedAssets',\n default: false,\n});\nexports.default = showUnusedAssetsState;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n clipboardItem: {\n cursor: 'pointer',\n minWidth: theme.spacing.goldenUnit,\n width: theme.spacing.goldenUnit,\n height: theme.spacing.goldenUnit,\n '& img': {\n display: 'block',\n width: '100%',\n height: '100%',\n objectFit: 'contain',\n },\n },\n}); });\nvar ClipboardItem = function (_a) {\n var assetIdentity = _a.assetIdentity;\n var asset = hooks_1.useAssetQuery(assetIdentity).asset;\n var dummyImage = src_1.useMediaUi().dummyImage;\n var Notify = src_1.useNotify();\n var classes = useStyles();\n var selectAsset = hooks_1.useSelectAsset();\n var translate = src_1.useIntl().translate;\n var onClick = react_1.useCallback(function () {\n if (assetIdentity) {\n selectAsset(assetIdentity);\n }\n else {\n Notify.warning(translate('clipboard.assetNotLoaded', \"Cannot select asset as it couldn't be loaded\"));\n }\n }, [assetIdentity, selectAsset, Notify, translate]);\n return (React.createElement(\"span\", { onClick: onClick, className: classes.clipboardItem, title: (asset === null || asset === void 0 ? void 0 : asset.isInClipboard) + '' },\n React.createElement(\"img\", { src: (asset === null || asset === void 0 ? void 0 : asset.thumbnailUrl) || dummyImage, alt: (asset === null || asset === void 0 ? void 0 : asset.label) || assetIdentity.assetId, width: 40, height: 36 })));\n};\nexports.default = React.memo(ClipboardItem);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ClipboardQuery_1 = require(\"../queries/ClipboardQuery\");\nvar buildResolvers = function (updateLocalState) {\n return {\n Mutation: {\n toggleClipboardState: function (_, _a, _b) {\n var _c;\n var assetId = _a.assetId, assetSourceId = _a.assetSourceId, force = _a.force;\n var cache = _b.cache;\n var clipboard = cache.readQuery({ query: ClipboardQuery_1.CLIPBOARD }).clipboard;\n if (force !== true && {}.hasOwnProperty.call(clipboard, assetId)) {\n clipboard = Object.values(clipboard).reduce(function (carry, item) {\n if (item.assetId !== assetId) {\n carry[item.assetId] = item;\n }\n return carry;\n }, {});\n }\n else if (force !== false) {\n clipboard = __assign(__assign({}, clipboard), (_c = {}, _c[assetId] = { assetId: assetId, assetSourceId: assetSourceId }, _c));\n }\n updateLocalState({ clipboard: clipboard }, cache);\n return clipboard;\n },\n },\n };\n};\nexports.default = buildResolvers;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetChangeType = void 0;\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar changedAssets_1 = __importDefault(require(\"../queries/changedAssets\"));\nvar AssetChangeType;\n(function (AssetChangeType) {\n AssetChangeType[\"ASSET_CREATED\"] = \"ASSET_CREATED\";\n AssetChangeType[\"ASSET_UPDATED\"] = \"ASSET_UPDATED\";\n AssetChangeType[\"ASSET_REPLACED\"] = \"ASSET_REPLACED\";\n AssetChangeType[\"ASSET_REMOVED\"] = \"ASSET_REMOVED\";\n})(AssetChangeType = exports.AssetChangeType || (exports.AssetChangeType = {}));\n// Check for updates every 5 seconds\nvar pollInterval = 5000;\nvar AssetLastModifiedFragment = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment AssetLastModified on Asset {\\n lastModified\\n }\\n\"], [\"\\n fragment AssetLastModified on Asset {\\n lastModified\\n }\\n\"])));\nfunction useChangedAssetsQuery() {\n var config = hooks_1.useConfigQuery().config;\n var _a = react_1.useState(null), lastUpdate = _a[0], setLastUpdate = _a[1];\n var _b = react_1.useState([]), changes = _b[0], setChanges = _b[1];\n // Query will continue to run on its own and poll the api\n var _c = client_1.useQuery(changedAssets_1.default, {\n variables: { since: lastUpdate !== null && lastUpdate !== void 0 ? lastUpdate : config === null || config === void 0 ? void 0 : config.currentServerTime },\n // TODO: slow down or skip requests when errors occur\n pollInterval: pollInterval,\n skip: !(config === null || config === void 0 ? void 0 : config.currentServerTime),\n }), data = _c.data, client = _c.client;\n // \"onComplete\" in the query options cannot be used, as it's only called once, due to the bug described in https://github.com/apollographql/apollo-client/issues/5531\n react_1.useEffect(function () {\n if (!(data === null || data === void 0 ? void 0 : data.changedAssets))\n return;\n var _a = data.changedAssets, lastModified = _a.lastModified, changes = _a.changes;\n // FIXME: Updating lastModified will immediately trigger another query for changes. Maybe we can't prevent this and rather wait for the next interval.\n if (lastModified)\n setLastUpdate(lastModified);\n var relevantChanges = changes.filter(function (change) {\n // New assets are always relevant and we surely have no previous version in the cache\n if (change.type === AssetChangeType.ASSET_CREATED) {\n return true;\n }\n // Check if we have a cached version of the changed asset\n var data = client.cache.readFragment({\n fragment: AssetLastModifiedFragment,\n id: client.cache.identify({ __typename: 'Asset', id: change.assetId }),\n });\n // Ignore changes to assets we never queried\n if (!data) {\n return false;\n }\n // Ignore changes that are older than our own version\n return data.lastModified < change.lastModified;\n });\n // Prevent triggering an update of the hook if we have zero changes since last time\n setChanges(function (prev) { return (relevantChanges.length === 0 ? prev : relevantChanges); });\n }, [data === null || data === void 0 ? void 0 : data.changedAssets, client]);\n return changes;\n}\nexports.default = useChangedAssetsQuery;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar CHANGED_ASSETS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query CHANGED_ASSETS($since: DateTime = null) {\\n changedAssets(since: $since) {\\n lastModified\\n changes {\\n assetId\\n lastModified\\n type\\n }\\n }\\n }\\n\"], [\"\\n query CHANGED_ASSETS($since: DateTime = null) {\\n changedAssets(since: $since) {\\n lastModified\\n changes {\\n assetId\\n lastModified\\n type\\n }\\n }\\n }\\n\"])));\nexports.default = CHANGED_ASSETS;\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SIMILAR_ASSETS = exports.useSimilarAssetsQuery = exports.SimilarAssetsModal = exports.similarAssetsModalState = exports.SimilarAssetsToggleButton = void 0;\nvar SimilarAssetsToggleButton_1 = __importDefault(require(\"./components/SimilarAssetsToggleButton\"));\nexports.SimilarAssetsToggleButton = SimilarAssetsToggleButton_1.default;\nvar SimilarAssetsModal_1 = __importDefault(require(\"./components/SimilarAssetsModal\"));\nexports.SimilarAssetsModal = SimilarAssetsModal_1.default;\nvar similarAssetsModalState_1 = __importDefault(require(\"./state/similarAssetsModalState\"));\nexports.similarAssetsModalState = similarAssetsModalState_1.default;\nvar useSimilarAssets_1 = __importDefault(require(\"./hooks/useSimilarAssets\"));\nexports.useSimilarAssetsQuery = useSimilarAssets_1.default;\nvar similarAssets_1 = __importDefault(require(\"./queries/similarAssets\"));\nexports.SIMILAR_ASSETS = similarAssets_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar similarAssets_1 = __importDefault(require(\"../queries/similarAssets\"));\nfunction useSimilarAssetsQuery(assetIdentity) {\n var _a = client_1.useQuery(similarAssets_1.default, {\n variables: { id: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetId, assetSourceId: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetSourceId },\n skip: !assetIdentity,\n }), data = _a.data, loading = _a.loading;\n return { similarAssets: (data === null || data === void 0 ? void 0 : data.similarAssets) || null, loading: loading };\n}\nexports.default = useSimilarAssetsQuery;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"@media-ui/core/src/fragments/asset\");\nvar SIMILAR_ASSETS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query SIMILAR_ASSETS($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n similarAssets(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query SIMILAR_ASSETS($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n similarAssets(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = SIMILAR_ASSETS;\nvar templateObject_1;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar components_1 = require(\"@media-ui/core/src/components\");\nvar UploadSection_1 = __importDefault(require(\"../UploadSection\"));\nvar PreviewSection_1 = __importDefault(require(\"../PreviewSection\"));\nvar hooks_1 = require(\"../../hooks\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n uploadArea: {\n padding: theme.spacing.full,\n },\n}); });\nvar NewAssetDialog = function () {\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var _a = hooks_1.useUploadFiles(), uploadFiles = _a.uploadFiles, uploadState = _a.uploadState, loading = _a.loading;\n var _b = hooks_1.useUploadDialogState(), dialogState = _b.state, closeDialog = _b.closeDialog, setFiles = _b.setFiles;\n var refetchAssets = src_1.useMediaUi().refetchAssets;\n var uploadPossible = !loading && dialogState.files.selected.length > 0;\n var classes = useStyles();\n var handleUpload = react_1.useCallback(function () {\n uploadFiles(dialogState.files.selected)\n .then(function (_a) {\n var uploadFiles = _a.data.uploadFiles;\n // FIXME: Mapping the uploadState to the files name is not the best solution as the same filename might be used multiple times\n // Move uploaded or failed files into separate lists\n setFiles(function (prev) {\n return {\n selected: [],\n finished: __spreadArrays(prev.finished, prev.selected.filter(function (file) {\n return uploadFiles.find(function (result) { return result.success && result.filename === file.name; });\n })),\n rejected: __spreadArrays(prev.rejected, prev.selected.filter(function (file) {\n return uploadFiles.find(function (result) { return !result.success && result.filename === file.name; });\n })),\n };\n });\n if (uploadFiles.some(function (result) { return !result.success; })) {\n Notify.warning(translate('uploadDialog.uploadFinishedWithErrors', 'Some files could not be uploaded'));\n }\n else {\n Notify.ok(translate('uploadDialog.uploadFinished', 'Upload finished'));\n }\n // Refresh list of files if any file was uploaded\n if (uploadFiles.some(function (result) { return result.success; })) {\n refetchAssets();\n }\n })\n .catch(function (error) {\n Notify.error(translate('fileUpload.error', 'Upload failed'), error);\n });\n }, [uploadFiles, dialogState.files.selected, setFiles, Notify, translate, refetchAssets]);\n var handleSetFiles = react_1.useCallback(function (files) {\n setFiles(function (prev) {\n return __assign(__assign({}, prev), { selected: files });\n });\n }, [setFiles]);\n return (React.createElement(components_1.Dialog, { isOpen: dialogState.visible, title: translate('uploadDialog.title', 'Upload assets'), onRequestClose: closeDialog, actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: closeDialog }, uploadState\n ? translate('uploadDialog.close', 'Close')\n : translate('uploadDialog.cancel', 'Cancel')),\n React.createElement(react_ui_components_1.Button, { key: \"upload\", style: \"success\", hoverStyle: \"success\", disabled: !uploadPossible, onClick: handleUpload }, translate('uploadDialog.upload', 'Upload')),\n ], style: \"wide\" },\n React.createElement(\"section\", { className: classes.uploadArea },\n React.createElement(UploadSection_1.default, { files: dialogState.files.selected, loading: loading, onSetFiles: handleSetFiles }),\n React.createElement(PreviewSection_1.default, { files: dialogState.files, loading: loading, uploadState: uploadState }))));\n};\nexports.default = React.memo(NewAssetDialog);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n fileList: {\n marginTop: theme.spacing.full,\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n fileListHeader: {\n flex: '1 1 100%',\n marginBottom: theme.spacing.full,\n fontSize: theme.fontSize,\n },\n thumb: {\n display: 'inline-flex',\n borderRadius: 2,\n border: '1px solid #eaeaea',\n marginBottom: theme.spacing.half,\n marginRight: theme.spacing.half,\n width: 100,\n height: 100,\n padding: theme.spacing.quarter,\n boxSizing: 'border-box',\n },\n thumbInner: {\n position: 'relative',\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '& span': {\n marginLeft: theme.spacing.half,\n userSelect: 'none',\n },\n },\n img: {\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n left: 0,\n top: 0,\n zIndex: -1,\n },\n stateOverlay: {\n position: 'absolute',\n content: '\"\"',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n backgroundColor: theme.colors.alternatingBackground,\n opacity: 0.3,\n zIndex: -1,\n },\n loading: {\n borderColor: theme.colors.border,\n '& $thumbInner:after': {\n extend: 'stateOverlay',\n },\n },\n success: {\n borderColor: theme.colors.success,\n '& $thumbInner:after': {\n extend: 'stateOverlay',\n backgroundColor: theme.colors.success,\n },\n },\n error: {\n borderColor: theme.colors.error,\n '& $thumbInner:after': {\n extend: 'stateOverlay',\n backgroundColor: theme.colors.error,\n },\n },\n warning: {\n color: theme.colors.warn,\n },\n}); });\nvar FilePreview = function (_a) {\n var file = _a.file, _b = _a.loading, loading = _b === void 0 ? false : _b, fileState = _a.fileState;\n var classes = useStyles();\n var success = fileState === null || fileState === void 0 ? void 0 : fileState.success;\n var error = fileState && !success;\n var stateClassName;\n if (error)\n stateClassName = classes.error;\n else if (success)\n stateClassName = classes.success;\n else if (loading)\n stateClassName = classes.loading;\n // TODO: Output helpful localised messages for results 'EXISTS', 'ADDED', 'ERROR'\n return (React.createElement(\"div\", { className: [classes.thumb, stateClassName].join(' '), title: file.name },\n React.createElement(\"div\", { className: classes.thumbInner },\n React.createElement(\"img\", { src: file.preview, alt: file.name, className: classes.img }),\n loading && React.createElement(react_ui_components_1.Icon, { icon: \"spinner\", spin: true }),\n success && React.createElement(react_ui_components_1.Icon, { icon: \"check\" }),\n error && React.createElement(react_ui_components_1.Icon, { icon: \"exclamation-circle\" }),\n (fileState === null || fileState === void 0 ? void 0 : fileState.result) && React.createElement(\"span\", null, fileState.result))));\n};\nexports.default = React.memo(FilePreview);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useUploadFile = exports.useUploadFiles = exports.useUploadDialogState = void 0;\nvar useUploadDialogState_1 = __importDefault(require(\"./useUploadDialogState\"));\nexports.useUploadDialogState = useUploadDialogState_1.default;\nvar useUploadFile_1 = __importDefault(require(\"./useUploadFile\"));\nexports.useUploadFile = useUploadFile_1.default;\nvar useUploadFiles_1 = __importDefault(require(\"./useUploadFiles\"));\nexports.useUploadFiles = useUploadFiles_1.default;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar components_1 = require(\"@media-ui/core/src/components\");\nvar UploadSection_1 = __importDefault(require(\"../UploadSection\"));\nvar PreviewSection_1 = __importDefault(require(\"../PreviewSection\"));\nvar hooks_2 = require(\"../../hooks\");\nvar useReplaceAsset_1 = __importDefault(require(\"../../hooks/useReplaceAsset\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n uploadArea: {\n padding: theme.spacing.full,\n },\n optionSection: {\n marginTop: theme.spacing.full,\n marginBottom: theme.spacing.full,\n },\n option: {\n marginTop: theme.spacing.half,\n marginBottom: theme.spacing.half,\n },\n}); });\nvar ReplaceAssetDialog = function () {\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var selectedAsset = hooks_1.useSelectedAsset();\n var _a = useReplaceAsset_1.default(), replaceAsset = _a.replaceAsset, uploadState = _a.uploadState, loading = _a.loading;\n var refetchAssets = src_1.useMediaUi().refetchAssets;\n var _b = hooks_2.useUploadDialogState(), dialogState = _b.state, closeDialog = _b.closeDialog, setFiles = _b.setFiles;\n var _c = React.useState({\n keepOriginalFilename: false,\n generateRedirects: false,\n }), replacementOptions = _c[0], setReplacementOptions = _c[1];\n var uploadPossible = !loading && dialogState.files.selected.length > 0;\n var classes = useStyles();\n var acceptedFileTypes = react_1.useMemo(function () {\n var _a, _b;\n // TODO: Extract this into a helper function\n var completeMediaType = selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.file.mediaType;\n var regex = /^(?(?:[.!#%&'`^~$*+\\-|\\w]+))\\//;\n var mainType = (_b = (_a = completeMediaType.match(regex)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.type;\n return mainType ? mainType + '/*' : '';\n }, [selectedAsset]);\n var handleUpload = react_1.useCallback(function () {\n if (dialogState.files.selected.length === 0) {\n return;\n }\n var file = dialogState.files.selected[0];\n replaceAsset({ asset: selectedAsset, file: file, options: replacementOptions })\n .then(function () {\n Notify.ok(translate('uploadDialog.replacementFinished', 'Replacement finished'));\n closeDialog();\n refetchAssets();\n })\n .catch(function (error) {\n Notify.error(translate('assetReplacement.error', 'Replacement failed'), error);\n });\n }, [replaceAsset, Notify, translate, dialogState, replacementOptions, refetchAssets, selectedAsset, closeDialog]);\n var handleSetFiles = react_1.useCallback(function (files) {\n setFiles(function (prev) {\n return __assign(__assign({}, prev), { selected: files });\n });\n }, [setFiles]);\n return (React.createElement(components_1.Dialog, { isOpen: dialogState.visible, title: translate('uploadDialog.replaceAsset', 'Replace Asset'), onRequestClose: closeDialog, actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: closeDialog }, uploadState\n ? translate('uploadDialog.close', 'Close')\n : translate('uploadDialog.cancel', 'Cancel')),\n React.createElement(react_ui_components_1.Button, { key: \"upload\", style: \"success\", hoverStyle: \"success\", disabled: !uploadPossible, onClick: handleUpload }, translate('uploadDialog.replace', 'Replace')),\n ], style: \"wide\" },\n React.createElement(\"section\", { className: classes.uploadArea },\n React.createElement(UploadSection_1.default, { files: dialogState.files.selected, loading: loading, onSetFiles: handleSetFiles, maxFiles: 1, acceptedFileTypes: acceptedFileTypes }),\n React.createElement(\"section\", { className: classes.optionSection },\n React.createElement(\"div\", { className: classes.option },\n React.createElement(react_ui_components_1.Label, null,\n React.createElement(react_ui_components_1.CheckBox, { isChecked: replacementOptions.generateRedirects, onChange: function (generateRedirects) {\n return setReplacementOptions(__assign(__assign({}, replacementOptions), { generateRedirects: generateRedirects }));\n } }),\n React.createElement(\"span\", null, translate('uploadDialog.generateRedirects', 'Generate redirects')))),\n React.createElement(\"div\", { className: classes.option },\n React.createElement(react_ui_components_1.Label, null,\n React.createElement(react_ui_components_1.CheckBox, { isChecked: replacementOptions.keepOriginalFilename, onChange: function (keepOriginalFilename) {\n return setReplacementOptions(__assign(__assign({}, replacementOptions), { keepOriginalFilename: keepOriginalFilename }));\n } }),\n React.createElement(\"span\", null, translate('uploadDialog.keepOriginalFilename', 'Keep original filename'))))),\n React.createElement(PreviewSection_1.default, { files: dialogState.files, loading: loading, uploadState: uploadState ? [uploadState] : [] }))));\n};\nexports.default = React.memo(ReplaceAssetDialog);\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = findTabbableDescendants;\n/*!\n * Adapted from jQuery UI core\n *\n * http://jqueryui.com\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/category/ui-core/\n */\n\nvar tabbableNode = /input|select|textarea|button|object/;\n\nfunction hidesContents(element) {\n var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;\n\n // If the node is empty, this is good enough\n if (zeroSize && !element.innerHTML) return true;\n\n // Otherwise we need to check some styles\n var style = window.getComputedStyle(element);\n return zeroSize ? style.getPropertyValue(\"overflow\") !== \"visible\" ||\n // if 'overflow: visible' set, check if there is actually any overflow\n element.scrollWidth <= 0 && element.scrollHeight <= 0 : style.getPropertyValue(\"display\") == \"none\";\n}\n\nfunction visible(element) {\n var parentElement = element;\n while (parentElement) {\n if (parentElement === document.body) break;\n if (hidesContents(parentElement)) return false;\n parentElement = parentElement.parentNode;\n }\n return true;\n}\n\nfunction focusable(element, isTabIndexNotNaN) {\n var nodeName = element.nodeName.toLowerCase();\n var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === \"a\" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);\n return res && visible(element);\n}\n\nfunction tabbable(element) {\n var tabIndex = element.getAttribute(\"tabindex\");\n if (tabIndex === null) tabIndex = undefined;\n var isTabIndexNaN = isNaN(tabIndex);\n return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);\n}\n\nfunction findTabbableDescendants(element) {\n return [].slice.call(element.querySelectorAll(\"*\"), 0).filter(tabbable);\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.assertNodeList = assertNodeList;\nexports.setElement = setElement;\nexports.validateElement = validateElement;\nexports.hide = hide;\nexports.show = show;\nexports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;\nexports.resetForTesting = resetForTesting;\n\nvar _warning = require(\"warning\");\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _safeHTMLElement = require(\"./safeHTMLElement\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar globalElement = null;\n\nfunction assertNodeList(nodeList, selector) {\n if (!nodeList || !nodeList.length) {\n throw new Error(\"react-modal: No elements were found for selector \" + selector + \".\");\n }\n}\n\nfunction setElement(element) {\n var useElement = element;\n if (typeof useElement === \"string\" && _safeHTMLElement.canUseDOM) {\n var el = document.querySelectorAll(useElement);\n assertNodeList(el, useElement);\n useElement = el;\n }\n globalElement = useElement || globalElement;\n return globalElement;\n}\n\nfunction validateElement(appElement) {\n var el = appElement || globalElement;\n if (el) {\n return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];\n } else {\n (0, _warning2.default)(false, [\"react-modal: App element is not defined.\", \"Please use `Modal.setAppElement(el)` or set `appElement={el}`.\", \"This is needed so screen readers don't see main content\", \"when modal is opened. It is not recommended, but you can opt-out\", \"by setting `ariaHideApp={false}`.\"].join(\" \"));\n\n return [];\n }\n}\n\nfunction hide(appElement) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var el = _step.value;\n\n el.setAttribute(\"aria-hidden\", \"true\");\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\n\nfunction show(appElement) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var el = _step2.value;\n\n el.removeAttribute(\"aria-hidden\");\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n}\n\nfunction documentNotReadyOrSSRTesting() {\n globalElement = null;\n}\n\nfunction resetForTesting() {\n globalElement = null;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// Tracks portals that are open and emits events to subscribers\n\nvar PortalOpenInstances = function PortalOpenInstances() {\n var _this = this;\n\n _classCallCheck(this, PortalOpenInstances);\n\n this.register = function (openInstance) {\n if (_this.openInstances.indexOf(openInstance) !== -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Cannot register modal instance that's already open\");\n }\n return;\n }\n _this.openInstances.push(openInstance);\n _this.emit(\"register\");\n };\n\n this.deregister = function (openInstance) {\n var index = _this.openInstances.indexOf(openInstance);\n if (index === -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Unable to deregister \" + openInstance + \" as \" + \"it was never registered\");\n }\n return;\n }\n _this.openInstances.splice(index, 1);\n _this.emit(\"deregister\");\n };\n\n this.subscribe = function (callback) {\n _this.subscribers.push(callback);\n };\n\n this.emit = function (eventType) {\n _this.subscribers.forEach(function (subscriber) {\n return subscriber(eventType,\n // shallow copy to avoid accidental mutation\n _this.openInstances.slice());\n });\n };\n\n this.openInstances = [];\n this.subscribers = [];\n};\n\nvar portalOpenInstances = new PortalOpenInstances();\n\nexports.default = portalOpenInstances;\nmodule.exports = exports[\"default\"];","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedAssetForPreviewState = recoil_1.atom({\n key: 'selectedAssetForPreviewState',\n default: null,\n});\nexports.default = selectedAssetForPreviewState;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetCollectionTree = exports.SideBarLeft = exports.AssetSourceDescription = exports.AssetSourceList = void 0;\nvar AssetSourceList_1 = __importDefault(require(\"./AssetSourceList\"));\nexports.AssetSourceList = AssetSourceList_1.default;\nvar AssetSourceDescription_1 = __importDefault(require(\"./AssetSourceDescription\"));\nexports.AssetSourceDescription = AssetSourceDescription_1.default;\nvar SideBarLeft_1 = __importDefault(require(\"./SideBarLeft\"));\nexports.SideBarLeft = SideBarLeft_1.default;\nvar Tree_1 = require(\"./Tree\");\nObject.defineProperty(exports, \"AssetCollectionTree\", { enumerable: true, get: function () { return Tree_1.AssetCollectionTree; } });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetCollectionTree = void 0;\nvar AssetCollectionTree_1 = __importDefault(require(\"./AssetCollectionTree\"));\nexports.AssetCollectionTree = AssetCollectionTree_1.default;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dndTypes = {\n TAG: 'neos-tree-tag',\n COLLECTION: 'neos-tree-collection',\n};\nexports.default = dndTypes;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/feature-asset-usage/src\");\nvar src_2 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_3 = require(\"@media-ui/feature-similar-assets/src\");\nvar components_1 = require(\"@media-ui/feature-asset-upload/src/components\");\nvar index_1 = require(\"./index\");\nvar Property_1 = __importDefault(require(\"./Property\"));\nvar Actions_1 = __importDefault(require(\"./Actions\"));\nvar InspectorContainer_1 = __importDefault(require(\"./InspectorContainer\"));\nvar useStyles = src_2.createUseMediaUiStyles(function (theme) { return ({\n textArea: {\n // TODO: Remove when overriding rule is removed from Minimal Module Style in Neos\n '.neos textarea&': {\n padding: theme.spacing.half,\n },\n },\n}); });\nvar AssetInspector = function () {\n var classes = useStyles();\n var selectedAsset = hooks_1.useSelectedAsset();\n var Notify = src_2.useNotify();\n var translate = src_2.useIntl().translate;\n var featureFlags = src_2.useMediaUi().featureFlags;\n var _a = react_1.useState(null), label = _a[0], setLabel = _a[1];\n var _b = react_1.useState(null), caption = _b[0], setCaption = _b[1];\n var _c = react_1.useState(null), copyrightNotice = _c[0], setCopyrightNotice = _c[1];\n var _d = hooks_1.useUpdateAsset(), updateAsset = _d.updateAsset, loading = _d.loading;\n var isEditable = (selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.localId) && !loading;\n var hasUnpublishedChanges = selectedAsset &&\n (label !== selectedAsset.label ||\n caption !== selectedAsset.caption ||\n copyrightNotice !== selectedAsset.copyrightNotice);\n var handleDiscard = react_1.useCallback(function () {\n if (selectedAsset) {\n setLabel(selectedAsset.label);\n setCaption(selectedAsset.caption);\n setCopyrightNotice(selectedAsset.copyrightNotice);\n }\n }, [selectedAsset, setLabel, setCaption, setCopyrightNotice]);\n var handleApply = react_1.useCallback(function () {\n if (label !== selectedAsset.label ||\n caption !== selectedAsset.caption ||\n copyrightNotice !== selectedAsset.copyrightNotice) {\n updateAsset({\n asset: selectedAsset,\n label: label,\n caption: caption,\n copyrightNotice: copyrightNotice,\n })\n .then(function () {\n Notify.ok(translate('actions.updateAsset.success', 'The asset has been updated'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.deleteAsset.error', 'Error while updating the asset'), message);\n });\n }\n }, [Notify, translate, caption, copyrightNotice, label, selectedAsset, updateAsset]);\n react_1.useEffect(function () {\n handleDiscard();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.id]);\n return (React.createElement(InspectorContainer_1.default, null,\n React.createElement(Property_1.default, { label: translate('inspector.title', 'Title') },\n React.createElement(react_ui_components_1.TextInput, { disabled: !isEditable, type: \"text\", value: label || '', onChange: setLabel, onEnterKey: handleApply })),\n React.createElement(Property_1.default, { label: translate('inspector.caption', 'Caption') },\n React.createElement(react_ui_components_1.TextArea, { className: classes.textArea, disabled: !isEditable, minRows: 3, expandedRows: 6, value: caption || '', onChange: setCaption })),\n React.createElement(Property_1.default, { label: translate('inspector.copyrightNotice', 'Copyright notice') },\n React.createElement(react_ui_components_1.TextArea, { className: classes.textArea, disabled: !isEditable, minRows: 2, expandedRows: 4, value: copyrightNotice || '', onChange: setCopyrightNotice })),\n isEditable && (React.createElement(Actions_1.default, { handleApply: handleApply, handleDiscard: handleDiscard, hasUnpublishedChanges: hasUnpublishedChanges })),\n selectedAsset.assetSource.supportsCollections && React.createElement(index_1.CollectionSelectBox, null),\n selectedAsset.assetSource.supportsTagging && React.createElement(index_1.TagSelectBoxAsset, null),\n React.createElement(src_1.AssetUsagesToggleButton, null),\n featureFlags.showSimilarAssets && React.createElement(src_3.SimilarAssetsToggleButton, null),\n !selectedAsset.assetSource.readOnly && React.createElement(components_1.AssetReplacementButton, null),\n React.createElement(index_1.MetadataView, null)));\n};\nexports.default = React.memo(AssetInspector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar media_type_1 = require(\"media-type\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n currentSelection: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n overflow: 'hidden',\n },\n headline: {\n userSelect: 'none',\n flex: '1 1 100%',\n fontWeight: 'bold',\n lineHeight: theme.spacing.goldenUnit,\n },\n label: {\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n '& svg': {\n marginRight: theme.spacing.half,\n },\n },\n}); });\nvar CurrentSelection = function () {\n var classes = useStyles();\n var selectedAsset = hooks_1.useSelectedAsset();\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var selectedTag = hooks_1.useSelectedTag();\n var selectedInspectorView = recoil_1.useRecoilValue(state_1.selectedInspectorViewState);\n var translate = src_1.useIntl().translate;\n var selection = react_1.useMemo(function () {\n var icon = 'question';\n var label = null;\n if (selectedInspectorView === 'asset') {\n if (selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.file.mediaType) {\n var mainMediaType = media_type_1.fromString(selectedAsset.file.mediaType);\n if (mainMediaType.type === 'audio')\n icon = 'file-audio';\n if (mainMediaType.type === 'video')\n icon = 'file-video';\n if (mainMediaType.type === 'image')\n icon = 'file-image';\n }\n else {\n icon = 'file';\n }\n label = selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.label;\n }\n else if (selectedInspectorView === 'assetCollection') {\n icon = 'folder';\n label = selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.title;\n }\n else if (selectedInspectorView === 'tag') {\n icon = 'tag';\n label = selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.label;\n }\n return { icon: icon, label: label };\n }, [selectedAsset, selectedTag, selectedAssetCollection, selectedInspectorView]);\n if (!selection.label)\n return null;\n return (React.createElement(\"div\", { className: classes.currentSelection },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\", className: classes.headline }, translate('currentSelection.headline', 'Selected element')),\n React.createElement(\"div\", { className: classes.label, title: selection.label },\n React.createElement(react_ui_components_1.Icon, { icon: selection.icon }),\n selection.label)));\n};\nexports.default = React.memo(CurrentSelection);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"../../../hooks\");\nvar useStyles = src_1.createUseMediaUiStyles({\n assetCount: {\n height: '100%',\n alignSelf: 'flex-start',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n userSelect: 'none',\n },\n});\nvar AssetCount = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var assetCount = hooks_1.useAssetCount();\n return (React.createElement(\"div\", { className: classes.assetCount },\n assetCount,\n \" \",\n translate('pagination.assetCount', 'assets')));\n};\nexports.default = React.memo(AssetCount);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar pagination_1 = require(\"@media-ui/core/src/constants/pagination\");\nvar PaginationItem_1 = __importDefault(require(\"./PaginationItem\"));\nvar state_2 = require(\"../../../state\");\nvar hooks_1 = require(\"../../../hooks\");\nvar useStyles = src_1.createUseMediaUiStyles({\n pagination: {\n justifySelf: 'center',\n },\n list: {\n display: 'flex',\n justifySelf: 'center',\n listStyleType: 'none',\n textAlign: 'center',\n padding: 0,\n },\n ellipsis: {\n lineHeight: '2.4rem',\n },\n});\nvar Pagination = function () {\n var classes = useStyles();\n var _a = recoil_1.useRecoilState(state_1.currentPageState), currentPage = _a[0], setCurrentPage = _a[1];\n var assetCount = hooks_1.useAssetCount();\n var translate = src_1.useIntl().translate;\n var mainView = recoil_1.useRecoilValue(state_2.mainViewState);\n var disabled = ![state_2.MainViewState.DEFAULT, state_2.MainViewState.UNUSED_ASSETS].includes(mainView);\n var numberOfPages = Math.ceil(assetCount / pagination_1.ASSETS_PER_PAGE);\n var _b = react_1.useState({\n start: 0,\n end: 0,\n hasLessPages: false,\n hasMorePages: false,\n pages: [],\n }), displayRange = _b[0], setDisplayRange = _b[1];\n var handlePageClick = react_1.useCallback(function (page) { return setCurrentPage(page); }, [setCurrentPage]);\n var handlePreviousPageClick = react_1.useCallback(function () { return setCurrentPage(function (prev) { return prev - 1; }); }, [setCurrentPage]);\n var handleNextPageClick = react_1.useCallback(function () { return setCurrentPage(function (prev) { return prev + 1; }); }, [setCurrentPage]);\n // Calculates visible display range\n react_1.useMemo(function () {\n var maxLinks = Math.min(pagination_1.PAGINATION_MAXIMUM_LINKS, numberOfPages);\n var delta = Math.floor(maxLinks / 2);\n var start = currentPage - delta;\n var end = currentPage + delta + (maxLinks % 2 === 0 ? 1 : 0);\n if (start < 1) {\n end -= start - 1;\n }\n if (end > numberOfPages) {\n start -= end - numberOfPages;\n }\n start = Math.max(start, 1);\n end = Math.min(end, numberOfPages);\n var pages = __spreadArrays(Array(end - start + 1)).map(function (_, i) { return i + start; });\n setDisplayRange({\n start: start,\n end: end,\n hasLessPages: start > 2,\n hasMorePages: end + 1 < numberOfPages,\n pages: pages,\n });\n }, [numberOfPages, currentPage]);\n return (React.createElement(\"nav\", { className: classes.pagination }, numberOfPages > 0 && (React.createElement(\"ol\", { className: classes.list },\n React.createElement(PaginationItem_1.default, { icon: \"angle-left\", title: translate('pagination.previousPageTitle', \"Go to previous page\"), onClick: handlePreviousPageClick, disabled: disabled || currentPage <= 1 }),\n displayRange.start > 1 && (React.createElement(PaginationItem_1.default, { title: translate('pagination.firstPageTitle', \"Go to first page\"), onClick: handlePageClick, disabled: disabled, page: 1 })),\n displayRange.hasLessPages && React.createElement(\"li\", { className: classes.ellipsis }, \"\\u2026\"),\n displayRange.pages.map(function (page) { return (React.createElement(PaginationItem_1.default, { key: page, selected: currentPage === page, onClick: handlePageClick, disabled: disabled, title: translate('pagination.page', \"Go to page \" + page, [page]), page: page })); }),\n displayRange.hasMorePages && React.createElement(\"li\", { className: classes.ellipsis }, \"\\u2026\"),\n displayRange.end < numberOfPages && (React.createElement(PaginationItem_1.default, { title: translate('pagination.lastPageTitle', \"Go to last page\"), onClick: handlePageClick, disabled: disabled, page: numberOfPages })),\n React.createElement(PaginationItem_1.default, { icon: \"angle-right\", title: translate('pagination.nextPageTitle', \"Go to next page\"), onClick: handleNextPageClick, disabled: disabled || currentPage === numberOfPages })))));\n};\nexports.default = React.memo(Pagination);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ViewModeSelector = exports.TypeFilter = exports.TopBar = exports.SearchBox = void 0;\nvar SearchBox_1 = __importDefault(require(\"./SearchBox\"));\nexports.SearchBox = SearchBox_1.default;\nvar TopBar_1 = __importDefault(require(\"./TopBar\"));\nexports.TopBar = TopBar_1.default;\nvar TypeFilter_1 = __importDefault(require(\"./TypeFilter\"));\nexports.TypeFilter = TypeFilter_1.default;\nvar ViewModeSelector_1 = __importDefault(require(\"./ViewModeSelector\"));\nexports.ViewModeSelector = ViewModeSelector_1.default;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar MissingAssetActions = function (_a) {\n var assetIdentity = _a.assetIdentity;\n var translate = src_1.useIntl().translate;\n var _b = src_2.useClipboard(), inClipboard = _b.inClipboard, toggleClipboardState = _b.toggleClipboardState;\n // Skip rendering if it's not in the clipboard as we only have one possible action currently\n if (!inClipboard(assetIdentity))\n return null;\n return (React.createElement(react_ui_components_1.IconButton, { title: translate('itemActions.removeFromClipboard', 'Remove from clipboard'), icon: \"trash\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\", onClick: function () { return toggleClipboardState(assetIdentity, false); } }));\n};\nexports.default = React.memo(MissingAssetActions);\n","import React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from \"../context/index.js\";\nexport function useApolloClient() {\n var client = React.useContext(getApolloContext()).client;\n process.env.NODE_ENV === \"production\" ? invariant(client, 33) : invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +\n 'have called `ApolloProvider` higher up in your tree.');\n return client;\n}\n//# sourceMappingURL=useApolloClient.js.map","import { equal } from '@wry/equality';\nimport { invariant } from 'ts-invariant';\nimport { parser, operationName } from \"../parser/index.js\";\nvar OperationData = (function () {\n function OperationData(options, context) {\n this.isMounted = false;\n this.previousOptions = {};\n this.context = {};\n this.options = {};\n this.options = options || {};\n this.context = context || {};\n }\n OperationData.prototype.getOptions = function () {\n return this.options;\n };\n OperationData.prototype.setOptions = function (newOptions, storePrevious) {\n if (storePrevious === void 0) { storePrevious = false; }\n if (storePrevious && !equal(this.options, newOptions)) {\n this.previousOptions = this.options;\n }\n this.options = newOptions;\n };\n OperationData.prototype.unmount = function () {\n this.isMounted = false;\n };\n OperationData.prototype.refreshClient = function () {\n var client = (this.options && this.options.client) ||\n (this.context && this.context.client);\n process.env.NODE_ENV === \"production\" ? invariant(!!client, 29) : invariant(!!client, 'Could not find \"client\" in the context or passed in as an option. ' +\n 'Wrap the root component in an , or pass an ' +\n 'ApolloClient instance in via options.');\n var isNew = false;\n if (client !== this.client) {\n isNew = true;\n this.client = client;\n this.cleanup();\n }\n return {\n client: this.client,\n isNew: isNew\n };\n };\n OperationData.prototype.verifyDocumentType = function (document, type) {\n var operation = parser(document);\n var requiredOperationName = operationName(type);\n var usedOperationName = operationName(operation.type);\n process.env.NODE_ENV === \"production\" ? invariant(operation.type === type, 30) : invariant(operation.type === type, \"Running a \" + requiredOperationName + \" requires a graphql \" +\n (requiredOperationName + \", but a \" + usedOperationName + \" was used instead.\"));\n };\n return OperationData;\n}());\nexport { OperationData };\n//# sourceMappingURL=OperationData.js.map","import { __assign, __extends } from \"tslib\";\nimport { equal } from '@wry/equality';\nimport { OperationData } from \"./OperationData.js\";\nvar SubscriptionData = (function (_super) {\n __extends(SubscriptionData, _super);\n function SubscriptionData(_a) {\n var options = _a.options, context = _a.context, setResult = _a.setResult;\n var _this = _super.call(this, options, context) || this;\n _this.currentObservable = {};\n _this.setResult = setResult;\n _this.initialize(options);\n return _this;\n }\n SubscriptionData.prototype.execute = function (result) {\n if (this.getOptions().skip === true) {\n this.cleanup();\n return {\n loading: false,\n error: undefined,\n data: undefined,\n variables: this.getOptions().variables\n };\n }\n var currentResult = result;\n if (this.refreshClient().isNew) {\n currentResult = this.getLoadingResult();\n }\n var shouldResubscribe = this.getOptions().shouldResubscribe;\n if (typeof shouldResubscribe === 'function') {\n shouldResubscribe = !!shouldResubscribe(this.getOptions());\n }\n if (shouldResubscribe !== false &&\n this.previousOptions &&\n Object.keys(this.previousOptions).length > 0 &&\n (this.previousOptions.subscription !== this.getOptions().subscription ||\n !equal(this.previousOptions.variables, this.getOptions().variables) ||\n this.previousOptions.skip !== this.getOptions().skip)) {\n this.cleanup();\n currentResult = this.getLoadingResult();\n }\n this.initialize(this.getOptions());\n this.startSubscription();\n this.previousOptions = this.getOptions();\n return __assign(__assign({}, currentResult), { variables: this.getOptions().variables });\n };\n SubscriptionData.prototype.afterExecute = function () {\n this.isMounted = true;\n };\n SubscriptionData.prototype.cleanup = function () {\n this.endSubscription();\n delete this.currentObservable.query;\n };\n SubscriptionData.prototype.initialize = function (options) {\n if (this.currentObservable.query || this.getOptions().skip === true)\n return;\n this.currentObservable.query = this.refreshClient().client.subscribe({\n query: options.subscription,\n variables: options.variables,\n fetchPolicy: options.fetchPolicy,\n context: options.context,\n });\n };\n SubscriptionData.prototype.startSubscription = function () {\n if (this.currentObservable.subscription)\n return;\n this.currentObservable.subscription = this.currentObservable.query.subscribe({\n next: this.updateCurrentData.bind(this),\n error: this.updateError.bind(this),\n complete: this.completeSubscription.bind(this)\n });\n };\n SubscriptionData.prototype.getLoadingResult = function () {\n return {\n loading: true,\n error: undefined,\n data: undefined\n };\n };\n SubscriptionData.prototype.updateResult = function (result) {\n if (this.isMounted) {\n this.setResult(result);\n }\n };\n SubscriptionData.prototype.updateCurrentData = function (result) {\n var onSubscriptionData = this.getOptions().onSubscriptionData;\n this.updateResult({\n data: result.data,\n loading: false,\n error: undefined\n });\n if (onSubscriptionData) {\n onSubscriptionData({\n client: this.refreshClient().client,\n subscriptionData: result\n });\n }\n };\n SubscriptionData.prototype.updateError = function (error) {\n this.updateResult({\n error: error,\n loading: false\n });\n };\n SubscriptionData.prototype.completeSubscription = function () {\n var _this = this;\n Promise.resolve().then(function () {\n var onSubscriptionComplete = _this.getOptions().onSubscriptionComplete;\n if (onSubscriptionComplete)\n onSubscriptionComplete();\n _this.endSubscription();\n });\n };\n SubscriptionData.prototype.endSubscription = function () {\n if (this.currentObservable.subscription) {\n this.currentObservable.subscription.unsubscribe();\n delete this.currentObservable.subscription;\n }\n };\n return SubscriptionData;\n}(OperationData));\nexport { SubscriptionData };\n//# sourceMappingURL=SubscriptionData.js.map","import { __assign, __extends } from \"tslib\";\nimport { equal } from '@wry/equality';\nimport { DocumentType } from \"../parser/index.js\";\nimport { ApolloError } from \"../../errors/index.js\";\nimport { OperationData } from \"./OperationData.js\";\nimport { mergeOptions } from \"../../core/index.js\";\nvar MutationData = (function (_super) {\n __extends(MutationData, _super);\n function MutationData(_a) {\n var options = _a.options, context = _a.context, result = _a.result, setResult = _a.setResult;\n var _this = _super.call(this, options, context) || this;\n _this.runMutation = function (mutationFunctionOptions) {\n if (mutationFunctionOptions === void 0) { mutationFunctionOptions = {}; }\n _this.onMutationStart();\n var mutationId = _this.generateNewMutationId();\n return _this.mutate(mutationFunctionOptions)\n .then(function (response) {\n _this.onMutationCompleted(response, mutationId);\n return response;\n })\n .catch(function (error) {\n _this.onMutationError(error, mutationId);\n if (!_this.getOptions().onError)\n throw error;\n });\n };\n _this.verifyDocumentType(options.mutation, DocumentType.Mutation);\n _this.result = result;\n _this.setResult = setResult;\n _this.mostRecentMutationId = 0;\n return _this;\n }\n MutationData.prototype.execute = function (result) {\n this.isMounted = true;\n this.verifyDocumentType(this.getOptions().mutation, DocumentType.Mutation);\n return [\n this.runMutation,\n __assign(__assign({}, result), { client: this.refreshClient().client })\n ];\n };\n MutationData.prototype.afterExecute = function () {\n this.isMounted = true;\n return this.unmount.bind(this);\n };\n MutationData.prototype.cleanup = function () {\n };\n MutationData.prototype.mutate = function (options) {\n return this.refreshClient().client.mutate(mergeOptions(this.getOptions(), options));\n };\n MutationData.prototype.onMutationStart = function () {\n if (!this.result.loading && !this.getOptions().ignoreResults) {\n this.updateResult({\n loading: true,\n error: undefined,\n data: undefined,\n called: true\n });\n }\n };\n MutationData.prototype.onMutationCompleted = function (response, mutationId) {\n var _a = this.getOptions(), onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults;\n var data = response.data, errors = response.errors;\n var error = errors && errors.length > 0\n ? new ApolloError({ graphQLErrors: errors })\n : undefined;\n var callOncomplete = function () {\n return onCompleted ? onCompleted(data) : null;\n };\n if (this.isMostRecentMutation(mutationId) && !ignoreResults) {\n this.updateResult({\n called: true,\n loading: false,\n data: data,\n error: error\n });\n }\n callOncomplete();\n };\n MutationData.prototype.onMutationError = function (error, mutationId) {\n var onError = this.getOptions().onError;\n if (this.isMostRecentMutation(mutationId)) {\n this.updateResult({\n loading: false,\n error: error,\n data: undefined,\n called: true\n });\n }\n if (onError) {\n onError(error);\n }\n };\n MutationData.prototype.generateNewMutationId = function () {\n return ++this.mostRecentMutationId;\n };\n MutationData.prototype.isMostRecentMutation = function (mutationId) {\n return this.mostRecentMutationId === mutationId;\n };\n MutationData.prototype.updateResult = function (result) {\n if (this.isMounted &&\n (!this.previousResult || !equal(this.previousResult, result))) {\n this.setResult(result);\n this.previousResult = result;\n }\n };\n return MutationData;\n}(OperationData));\nexport { MutationData };\n//# sourceMappingURL=MutationData.js.map","import { __assign, __extends } from \"tslib\";\nimport { equal } from '@wry/equality';\nimport { ApolloError } from \"../../errors/index.js\";\nimport { NetworkStatus } from \"../../core/index.js\";\nimport { DocumentType } from \"../parser/index.js\";\nimport { OperationData } from \"./OperationData.js\";\nvar QueryData = (function (_super) {\n __extends(QueryData, _super);\n function QueryData(_a) {\n var options = _a.options, context = _a.context, onNewData = _a.onNewData;\n var _this = _super.call(this, options, context) || this;\n _this.runLazy = false;\n _this.previous = Object.create(null);\n _this.runLazyQuery = function (options) {\n _this.cleanup();\n _this.runLazy = true;\n _this.lazyOptions = options;\n _this.onNewData();\n };\n _this.getQueryResult = function () {\n var result = _this.observableQueryFields();\n var options = _this.getOptions();\n if (options.skip) {\n result = __assign(__assign({}, result), { data: undefined, error: undefined, loading: false, networkStatus: NetworkStatus.ready, called: true });\n }\n else if (_this.currentObservable) {\n var currentResult = _this.currentObservable.getCurrentResult();\n var data = currentResult.data, loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors;\n var error = currentResult.error;\n if (errors && errors.length > 0) {\n error = new ApolloError({ graphQLErrors: errors });\n }\n result = __assign(__assign({}, result), { data: data,\n loading: loading,\n networkStatus: networkStatus,\n error: error, called: true });\n if (loading) {\n }\n else if (error) {\n Object.assign(result, {\n data: (_this.currentObservable.getLastResult() || {})\n .data\n });\n }\n else {\n var fetchPolicy = _this.currentObservable.options.fetchPolicy;\n var partialRefetch = options.partialRefetch;\n if (partialRefetch &&\n partial &&\n (!data || Object.keys(data).length === 0) &&\n fetchPolicy !== 'cache-only') {\n Object.assign(result, {\n loading: true,\n networkStatus: NetworkStatus.loading\n });\n result.refetch();\n return result;\n }\n }\n }\n result.client = _this.client;\n _this.setOptions(options, true);\n var previousResult = _this.previous.result;\n _this.previous.loading =\n previousResult && previousResult.loading || false;\n result.previousData = previousResult &&\n (previousResult.data || previousResult.previousData);\n _this.previous.result = result;\n _this.currentObservable && _this.currentObservable.resetQueryStoreErrors();\n return result;\n };\n _this.obsRefetch = function (variables) { var _a; return (_a = _this.currentObservable) === null || _a === void 0 ? void 0 : _a.refetch(variables); };\n _this.obsFetchMore = function (fetchMoreOptions) { return _this.currentObservable.fetchMore(fetchMoreOptions); };\n _this.obsUpdateQuery = function (mapFn) { return _this.currentObservable.updateQuery(mapFn); };\n _this.obsStartPolling = function (pollInterval) {\n var _a;\n (_a = _this.currentObservable) === null || _a === void 0 ? void 0 : _a.startPolling(pollInterval);\n };\n _this.obsStopPolling = function () {\n var _a;\n (_a = _this.currentObservable) === null || _a === void 0 ? void 0 : _a.stopPolling();\n };\n _this.obsSubscribeToMore = function (options) { return _this.currentObservable.subscribeToMore(options); };\n _this.onNewData = onNewData;\n return _this;\n }\n QueryData.prototype.execute = function () {\n this.refreshClient();\n var _a = this.getOptions(), skip = _a.skip, query = _a.query;\n if (skip || query !== this.previous.query) {\n this.removeQuerySubscription();\n this.removeObservable(!skip);\n this.previous.query = query;\n }\n this.updateObservableQuery();\n if (this.isMounted)\n this.startQuerySubscription();\n return this.getExecuteSsrResult() || this.getExecuteResult();\n };\n QueryData.prototype.executeLazy = function () {\n return !this.runLazy\n ? [\n this.runLazyQuery,\n {\n loading: false,\n networkStatus: NetworkStatus.ready,\n called: false,\n data: undefined\n }\n ]\n : [this.runLazyQuery, this.execute()];\n };\n QueryData.prototype.fetchData = function () {\n var _this = this;\n var options = this.getOptions();\n if (options.skip || options.ssr === false)\n return false;\n return new Promise(function (resolve) { return _this.startQuerySubscription(resolve); });\n };\n QueryData.prototype.afterExecute = function (_a) {\n var _b = (_a === void 0 ? {} : _a).lazy, lazy = _b === void 0 ? false : _b;\n this.isMounted = true;\n if (!lazy || this.runLazy) {\n this.handleErrorOrCompleted();\n }\n this.previousOptions = this.getOptions();\n return this.unmount.bind(this);\n };\n QueryData.prototype.cleanup = function () {\n this.removeQuerySubscription();\n this.removeObservable(true);\n delete this.previous.result;\n };\n QueryData.prototype.getOptions = function () {\n var options = _super.prototype.getOptions.call(this);\n if (this.lazyOptions) {\n options.variables = __assign(__assign({}, options.variables), this.lazyOptions.variables);\n options.context = __assign(__assign({}, options.context), this.lazyOptions.context);\n }\n if (this.runLazy) {\n delete options.skip;\n }\n return options;\n };\n QueryData.prototype.ssrInitiated = function () {\n return this.context && this.context.renderPromises;\n };\n QueryData.prototype.getExecuteResult = function () {\n var result = this.getQueryResult();\n this.startQuerySubscription();\n return result;\n };\n ;\n QueryData.prototype.getExecuteSsrResult = function () {\n var _a = this.getOptions(), ssr = _a.ssr, skip = _a.skip;\n var ssrDisabled = ssr === false;\n var fetchDisabled = this.refreshClient().client.disableNetworkFetches;\n var ssrLoading = __assign({ loading: true, networkStatus: NetworkStatus.loading, called: true, data: undefined, stale: false, client: this.client }, this.observableQueryFields());\n if (ssrDisabled && (this.ssrInitiated() || fetchDisabled)) {\n this.previous.result = ssrLoading;\n return ssrLoading;\n }\n if (this.ssrInitiated()) {\n var result = this.getQueryResult() || ssrLoading;\n if (result.loading && !skip) {\n this.context.renderPromises.addQueryPromise(this, function () { return null; });\n }\n return result;\n }\n };\n QueryData.prototype.prepareObservableQueryOptions = function () {\n var options = this.getOptions();\n this.verifyDocumentType(options.query, DocumentType.Query);\n var displayName = options.displayName || 'Query';\n if (this.ssrInitiated() &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')) {\n options.fetchPolicy = 'cache-first';\n }\n return __assign(__assign({}, options), { displayName: displayName, context: options.context });\n };\n QueryData.prototype.initializeObservableQuery = function () {\n if (this.ssrInitiated()) {\n this.currentObservable = this.context.renderPromises.getSSRObservable(this.getOptions());\n }\n if (!this.currentObservable) {\n var observableQueryOptions = this.prepareObservableQueryOptions();\n this.previous.observableQueryOptions = __assign(__assign({}, observableQueryOptions), { children: null });\n this.currentObservable = this.refreshClient().client.watchQuery(__assign({}, observableQueryOptions));\n if (this.ssrInitiated()) {\n this.context.renderPromises.registerSSRObservable(this.currentObservable, observableQueryOptions);\n }\n }\n };\n QueryData.prototype.updateObservableQuery = function () {\n if (!this.currentObservable) {\n this.initializeObservableQuery();\n return;\n }\n if (this.getOptions().skip)\n return;\n var newObservableQueryOptions = __assign(__assign({}, this.prepareObservableQueryOptions()), { children: null });\n if (!equal(newObservableQueryOptions, this.previous.observableQueryOptions)) {\n this.previous.observableQueryOptions = newObservableQueryOptions;\n this.currentObservable\n .setOptions(newObservableQueryOptions)\n .catch(function () { });\n }\n };\n QueryData.prototype.startQuerySubscription = function (onNewData) {\n var _this = this;\n if (onNewData === void 0) { onNewData = this.onNewData; }\n if (this.currentSubscription || this.getOptions().skip)\n return;\n this.currentSubscription = this.currentObservable.subscribe({\n next: function (_a) {\n var loading = _a.loading, networkStatus = _a.networkStatus, data = _a.data;\n var previousResult = _this.previous.result;\n if (previousResult &&\n previousResult.loading === loading &&\n previousResult.networkStatus === networkStatus &&\n equal(previousResult.data, data)) {\n return;\n }\n onNewData();\n },\n error: function (error) {\n _this.resubscribeToQuery();\n if (!error.hasOwnProperty('graphQLErrors'))\n throw error;\n var previousResult = _this.previous.result;\n if ((previousResult && previousResult.loading) ||\n !equal(error, _this.previous.error)) {\n _this.previous.error = error;\n onNewData();\n }\n }\n });\n };\n QueryData.prototype.resubscribeToQuery = function () {\n this.removeQuerySubscription();\n var currentObservable = this.currentObservable;\n if (currentObservable) {\n var lastError = currentObservable.getLastError();\n var lastResult = currentObservable.getLastResult();\n currentObservable.resetLastResults();\n this.startQuerySubscription();\n Object.assign(currentObservable, {\n lastError: lastError,\n lastResult: lastResult\n });\n }\n };\n QueryData.prototype.handleErrorOrCompleted = function () {\n if (!this.currentObservable || !this.previous.result)\n return;\n var _a = this.previous.result, data = _a.data, loading = _a.loading, error = _a.error;\n if (!loading) {\n var _b = this.getOptions(), query = _b.query, variables = _b.variables, onCompleted = _b.onCompleted, onError = _b.onError, skip = _b.skip;\n if (this.previousOptions &&\n !this.previous.loading &&\n equal(this.previousOptions.query, query) &&\n equal(this.previousOptions.variables, variables)) {\n return;\n }\n if (onCompleted && !error && !skip) {\n onCompleted(data);\n }\n else if (onError && error) {\n onError(error);\n }\n }\n };\n QueryData.prototype.removeQuerySubscription = function () {\n if (this.currentSubscription) {\n this.currentSubscription.unsubscribe();\n delete this.currentSubscription;\n }\n };\n QueryData.prototype.removeObservable = function (andDelete) {\n if (this.currentObservable) {\n this.currentObservable[\"tearDownQuery\"]();\n if (andDelete) {\n delete this.currentObservable;\n }\n }\n };\n QueryData.prototype.observableQueryFields = function () {\n var _a;\n return {\n variables: (_a = this.currentObservable) === null || _a === void 0 ? void 0 : _a.variables,\n refetch: this.obsRefetch,\n fetchMore: this.obsFetchMore,\n updateQuery: this.obsUpdateQuery,\n startPolling: this.obsStartPolling,\n stopPolling: this.obsStopPolling,\n subscribeToMore: this.obsSubscribeToMore\n };\n };\n return QueryData;\n}(OperationData));\nexport { QueryData };\n//# sourceMappingURL=QueryData.js.map","import { __assign } from \"tslib\";\nimport { useContext, useEffect, useReducer, useRef } from 'react';\nimport { QueryData } from \"../../data/index.js\";\nimport { useDeepMemo } from \"./useDeepMemo.js\";\nimport { getApolloContext } from \"../../context/index.js\";\nexport function useBaseQuery(query, options, lazy) {\n if (lazy === void 0) { lazy = false; }\n var context = useContext(getApolloContext());\n var _a = useReducer(function (x) { return x + 1; }, 0), tick = _a[0], forceUpdate = _a[1];\n var updatedOptions = options ? __assign(__assign({}, options), { query: query }) : { query: query };\n var queryDataRef = useRef();\n var queryData = queryDataRef.current || (queryDataRef.current = new QueryData({\n options: updatedOptions,\n context: context,\n onNewData: function () {\n if (!queryData.ssrInitiated()) {\n Promise.resolve().then(function () { return queryDataRef.current && forceUpdate(); });\n }\n else {\n forceUpdate();\n }\n }\n }));\n queryData.setOptions(updatedOptions);\n queryData.context = context;\n var memo = {\n options: __assign(__assign({}, updatedOptions), { onError: undefined, onCompleted: undefined }),\n context: context,\n tick: tick\n };\n var result = useDeepMemo(function () { return (lazy ? queryData.executeLazy() : queryData.execute()); }, memo);\n var queryResult = lazy\n ? result[1]\n : result;\n useEffect(function () {\n return function () { return queryData.cleanup(); };\n }, []);\n useEffect(function () { return queryData.afterExecute({ lazy: lazy }); }, [\n queryResult.loading,\n queryResult.networkStatus,\n queryResult.error,\n queryResult.data,\n ]);\n return result;\n}\n//# sourceMappingURL=useBaseQuery.js.map","import { useRef } from 'react';\nimport { equal } from '@wry/equality';\nexport function useDeepMemo(memoFn, key) {\n var ref = useRef();\n if (!ref.current || !equal(key, ref.current.key)) {\n ref.current = { key: key, value: memoFn() };\n }\n return ref.current.value;\n}\n//# sourceMappingURL=useDeepMemo.js.map","import { useBaseQuery } from \"./utils/useBaseQuery.js\";\nexport function useLazyQuery(query, options) {\n return useBaseQuery(query, options, true);\n}\n//# sourceMappingURL=useLazyQuery.js.map","import { __assign } from \"tslib\";\nimport { useContext, useState, useRef, useEffect } from 'react';\nimport { MutationData } from \"../data/index.js\";\nimport { getApolloContext } from \"../context/index.js\";\nexport function useMutation(mutation, options) {\n var context = useContext(getApolloContext());\n var _a = useState({ called: false, loading: false }), result = _a[0], setResult = _a[1];\n var updatedOptions = options ? __assign(__assign({}, options), { mutation: mutation }) : { mutation: mutation };\n var mutationDataRef = useRef();\n function getMutationDataRef() {\n if (!mutationDataRef.current) {\n mutationDataRef.current = new MutationData({\n options: updatedOptions,\n context: context,\n result: result,\n setResult: setResult\n });\n }\n return mutationDataRef.current;\n }\n var mutationData = getMutationDataRef();\n mutationData.setOptions(updatedOptions);\n mutationData.context = context;\n useEffect(function () { return mutationData.afterExecute(); });\n return mutationData.execute(result);\n}\n//# sourceMappingURL=useMutation.js.map","import { useBaseQuery } from \"./utils/useBaseQuery.js\";\nexport function useQuery(query, options) {\n return useBaseQuery(query, options, false);\n}\n//# sourceMappingURL=useQuery.js.map","import { __assign } from \"tslib\";\nimport { useContext, useState, useRef, useEffect } from 'react';\nimport { SubscriptionData } from \"../data/index.js\";\nimport { getApolloContext } from \"../context/index.js\";\nexport function useSubscription(subscription, options) {\n var context = useContext(getApolloContext());\n var updatedOptions = options\n ? __assign(__assign({}, options), { subscription: subscription }) : { subscription: subscription };\n var _a = useState({\n loading: !updatedOptions.skip,\n error: undefined,\n data: undefined\n }), result = _a[0], setResult = _a[1];\n var subscriptionDataRef = useRef();\n function getSubscriptionDataRef() {\n if (!subscriptionDataRef.current) {\n subscriptionDataRef.current = new SubscriptionData({\n options: updatedOptions,\n context: context,\n setResult: setResult\n });\n }\n return subscriptionDataRef.current;\n }\n var subscriptionData = getSubscriptionDataRef();\n subscriptionData.setOptions(updatedOptions, true);\n subscriptionData.context = context;\n useEffect(function () { return subscriptionData.afterExecute(); });\n useEffect(function () { return subscriptionData.cleanup.bind(subscriptionData); }, []);\n return subscriptionData.execute(result);\n}\n//# sourceMappingURL=useSubscription.js.map","import { useState, useEffect } from 'react';\nexport function useReactiveVar(rv) {\n var value = rv();\n var _a = useState(value), setValue = _a[1];\n useEffect(function () { return rv.onNextChange(setValue); }, [value]);\n useEffect(function () {\n setValue(rv());\n }, []);\n return value;\n}\n//# sourceMappingURL=useReactiveVar.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport { dep, KeyTrie } from 'optimism';\nimport { equal } from '@wry/equality';\nimport { isReference, makeReference, DeepMerger, maybeDeepFreeze, canUseWeakMap, } from \"../../utilities/index.js\";\nimport { hasOwn, fieldNameFromStoreName } from \"./helpers.js\";\nvar DELETE = Object.create(null);\nvar delModifier = function () { return DELETE; };\nvar INVALIDATE = Object.create(null);\nvar EntityStore = (function () {\n function EntityStore(policies, group) {\n var _this = this;\n this.policies = policies;\n this.group = group;\n this.data = Object.create(null);\n this.rootIds = Object.create(null);\n this.refs = Object.create(null);\n this.getFieldValue = function (objectOrReference, storeFieldName) { return maybeDeepFreeze(isReference(objectOrReference)\n ? _this.get(objectOrReference.__ref, storeFieldName)\n : objectOrReference && objectOrReference[storeFieldName]); };\n this.canRead = function (objOrRef) {\n return isReference(objOrRef)\n ? _this.has(objOrRef.__ref)\n : typeof objOrRef === \"object\";\n };\n this.toReference = function (objOrIdOrRef, mergeIntoStore) {\n if (typeof objOrIdOrRef === \"string\") {\n return makeReference(objOrIdOrRef);\n }\n if (isReference(objOrIdOrRef)) {\n return objOrIdOrRef;\n }\n var id = _this.policies.identify(objOrIdOrRef)[0];\n if (id) {\n var ref = makeReference(id);\n if (mergeIntoStore) {\n _this.merge(id, objOrIdOrRef);\n }\n return ref;\n }\n };\n }\n EntityStore.prototype.toObject = function () {\n return __assign({}, this.data);\n };\n EntityStore.prototype.has = function (dataId) {\n return this.lookup(dataId, true) !== void 0;\n };\n EntityStore.prototype.get = function (dataId, fieldName) {\n this.group.depend(dataId, fieldName);\n if (hasOwn.call(this.data, dataId)) {\n var storeObject = this.data[dataId];\n if (storeObject && hasOwn.call(storeObject, fieldName)) {\n return storeObject[fieldName];\n }\n }\n if (fieldName === \"__typename\" &&\n hasOwn.call(this.policies.rootTypenamesById, dataId)) {\n return this.policies.rootTypenamesById[dataId];\n }\n if (this instanceof Layer) {\n return this.parent.get(dataId, fieldName);\n }\n };\n EntityStore.prototype.lookup = function (dataId, dependOnExistence) {\n if (dependOnExistence)\n this.group.depend(dataId, \"__exists\");\n if (hasOwn.call(this.data, dataId)) {\n return this.data[dataId];\n }\n if (this instanceof Layer) {\n return this.parent.lookup(dataId, dependOnExistence);\n }\n if (this.policies.rootTypenamesById[dataId]) {\n return Object.create(null);\n }\n };\n EntityStore.prototype.merge = function (dataId, incoming) {\n var _this = this;\n var existing = this.lookup(dataId);\n var merged = new DeepMerger(storeObjectReconciler).merge(existing, incoming);\n this.data[dataId] = merged;\n if (merged !== existing) {\n delete this.refs[dataId];\n if (this.group.caching) {\n var fieldsToDirty_1 = Object.create(null);\n if (!existing)\n fieldsToDirty_1.__exists = 1;\n Object.keys(incoming).forEach(function (storeFieldName) {\n if (!existing || existing[storeFieldName] !== merged[storeFieldName]) {\n fieldsToDirty_1[storeFieldName] = 1;\n var fieldName = fieldNameFromStoreName(storeFieldName);\n if (fieldName !== storeFieldName &&\n !_this.policies.hasKeyArgs(merged.__typename, fieldName)) {\n fieldsToDirty_1[fieldName] = 1;\n }\n if (merged[storeFieldName] === void 0 && !(_this instanceof Layer)) {\n delete merged[storeFieldName];\n }\n }\n });\n Object.keys(fieldsToDirty_1).forEach(function (fieldName) { return _this.group.dirty(dataId, fieldName); });\n }\n }\n };\n EntityStore.prototype.modify = function (dataId, fields) {\n var _this = this;\n var storeObject = this.lookup(dataId);\n if (storeObject) {\n var changedFields_1 = Object.create(null);\n var needToMerge_1 = false;\n var allDeleted_1 = true;\n var sharedDetails_1 = {\n DELETE: DELETE,\n INVALIDATE: INVALIDATE,\n isReference: isReference,\n toReference: this.toReference,\n canRead: this.canRead,\n readField: function (fieldNameOrOptions, from) { return _this.policies.readField(typeof fieldNameOrOptions === \"string\" ? {\n fieldName: fieldNameOrOptions,\n from: from || makeReference(dataId),\n } : fieldNameOrOptions, { store: _this }); },\n };\n Object.keys(storeObject).forEach(function (storeFieldName) {\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var fieldValue = storeObject[storeFieldName];\n if (fieldValue === void 0)\n return;\n var modify = typeof fields === \"function\"\n ? fields\n : fields[storeFieldName] || fields[fieldName];\n if (modify) {\n var newValue = modify === delModifier ? DELETE :\n modify(maybeDeepFreeze(fieldValue), __assign(__assign({}, sharedDetails_1), { fieldName: fieldName,\n storeFieldName: storeFieldName, storage: _this.getStorage(dataId, storeFieldName) }));\n if (newValue === INVALIDATE) {\n _this.group.dirty(dataId, storeFieldName);\n }\n else {\n if (newValue === DELETE)\n newValue = void 0;\n if (newValue !== fieldValue) {\n changedFields_1[storeFieldName] = newValue;\n needToMerge_1 = true;\n fieldValue = newValue;\n }\n }\n }\n if (fieldValue !== void 0) {\n allDeleted_1 = false;\n }\n });\n if (needToMerge_1) {\n this.merge(dataId, changedFields_1);\n if (allDeleted_1) {\n if (this instanceof Layer) {\n this.data[dataId] = void 0;\n }\n else {\n delete this.data[dataId];\n }\n this.group.dirty(dataId, \"__exists\");\n }\n return true;\n }\n }\n return false;\n };\n EntityStore.prototype.delete = function (dataId, fieldName, args) {\n var _a;\n var storeObject = this.lookup(dataId);\n if (storeObject) {\n var typename = this.getFieldValue(storeObject, \"__typename\");\n var storeFieldName = fieldName && args\n ? this.policies.getStoreFieldName({ typename: typename, fieldName: fieldName, args: args })\n : fieldName;\n return this.modify(dataId, storeFieldName ? (_a = {},\n _a[storeFieldName] = delModifier,\n _a) : delModifier);\n }\n return false;\n };\n EntityStore.prototype.evict = function (options) {\n var evicted = false;\n if (options.id) {\n if (hasOwn.call(this.data, options.id)) {\n evicted = this.delete(options.id, options.fieldName, options.args);\n }\n if (this instanceof Layer) {\n evicted = this.parent.evict(options) || evicted;\n }\n if (options.fieldName || evicted) {\n this.group.dirty(options.id, options.fieldName || \"__exists\");\n }\n }\n return evicted;\n };\n EntityStore.prototype.clear = function () {\n this.replace(null);\n };\n EntityStore.prototype.extract = function () {\n var _this = this;\n var obj = this.toObject();\n var extraRootIds = [];\n this.getRootIdSet().forEach(function (id) {\n if (!hasOwn.call(_this.policies.rootTypenamesById, id)) {\n extraRootIds.push(id);\n }\n });\n if (extraRootIds.length) {\n obj.__META = { extraRootIds: extraRootIds.sort() };\n }\n return obj;\n };\n EntityStore.prototype.replace = function (newData) {\n var _this = this;\n Object.keys(this.data).forEach(function (dataId) {\n if (!(newData && hasOwn.call(newData, dataId))) {\n _this.delete(dataId);\n }\n });\n if (newData) {\n var __META = newData.__META, rest_1 = __rest(newData, [\"__META\"]);\n Object.keys(rest_1).forEach(function (dataId) {\n _this.merge(dataId, rest_1[dataId]);\n });\n if (__META) {\n __META.extraRootIds.forEach(this.retain, this);\n }\n }\n };\n EntityStore.prototype.retain = function (rootId) {\n return this.rootIds[rootId] = (this.rootIds[rootId] || 0) + 1;\n };\n EntityStore.prototype.release = function (rootId) {\n if (this.rootIds[rootId] > 0) {\n var count = --this.rootIds[rootId];\n if (!count)\n delete this.rootIds[rootId];\n return count;\n }\n return 0;\n };\n EntityStore.prototype.getRootIdSet = function (ids) {\n if (ids === void 0) { ids = new Set(); }\n Object.keys(this.rootIds).forEach(ids.add, ids);\n if (this instanceof Layer) {\n this.parent.getRootIdSet(ids);\n }\n else {\n Object.keys(this.policies.rootTypenamesById).forEach(ids.add, ids);\n }\n return ids;\n };\n EntityStore.prototype.gc = function () {\n var _this = this;\n var ids = this.getRootIdSet();\n var snapshot = this.toObject();\n ids.forEach(function (id) {\n if (hasOwn.call(snapshot, id)) {\n Object.keys(_this.findChildRefIds(id)).forEach(ids.add, ids);\n delete snapshot[id];\n }\n });\n var idsToRemove = Object.keys(snapshot);\n if (idsToRemove.length) {\n var root_1 = this;\n while (root_1 instanceof Layer)\n root_1 = root_1.parent;\n idsToRemove.forEach(function (id) { return root_1.delete(id); });\n }\n return idsToRemove;\n };\n EntityStore.prototype.findChildRefIds = function (dataId) {\n if (!hasOwn.call(this.refs, dataId)) {\n var found_1 = this.refs[dataId] = Object.create(null);\n var workSet_1 = new Set([this.data[dataId]]);\n var canTraverse_1 = function (obj) { return obj !== null && typeof obj === 'object'; };\n workSet_1.forEach(function (obj) {\n if (isReference(obj)) {\n found_1[obj.__ref] = true;\n }\n else if (canTraverse_1(obj)) {\n Object.values(obj)\n .filter(canTraverse_1)\n .forEach(workSet_1.add, workSet_1);\n }\n });\n }\n return this.refs[dataId];\n };\n EntityStore.prototype.makeCacheKey = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return this.group.keyMaker.lookupArray(args);\n };\n return EntityStore;\n}());\nexport { EntityStore };\nvar CacheGroup = (function () {\n function CacheGroup(caching) {\n this.caching = caching;\n this.d = null;\n this.keyMaker = new KeyTrie(canUseWeakMap);\n this.d = caching ? dep() : null;\n }\n CacheGroup.prototype.depend = function (dataId, storeFieldName) {\n if (this.d) {\n this.d(makeDepKey(dataId, storeFieldName));\n var fieldName = fieldNameFromStoreName(storeFieldName);\n if (fieldName !== storeFieldName) {\n this.d(makeDepKey(dataId, fieldName));\n }\n }\n };\n CacheGroup.prototype.dirty = function (dataId, storeFieldName) {\n if (this.d) {\n this.d.dirty(makeDepKey(dataId, storeFieldName));\n }\n };\n return CacheGroup;\n}());\nfunction makeDepKey(dataId, storeFieldName) {\n return storeFieldName + '#' + dataId;\n}\n(function (EntityStore) {\n var Root = (function (_super) {\n __extends(Root, _super);\n function Root(_a) {\n var policies = _a.policies, _b = _a.resultCaching, resultCaching = _b === void 0 ? true : _b, seed = _a.seed;\n var _this = _super.call(this, policies, new CacheGroup(resultCaching)) || this;\n _this.storageTrie = new KeyTrie(canUseWeakMap);\n _this.sharedLayerGroup = new CacheGroup(resultCaching);\n if (seed)\n _this.replace(seed);\n return _this;\n }\n Root.prototype.addLayer = function (layerId, replay) {\n return new Layer(layerId, this, replay, this.sharedLayerGroup);\n };\n Root.prototype.removeLayer = function () {\n return this;\n };\n Root.prototype.getStorage = function () {\n return this.storageTrie.lookupArray(arguments);\n };\n return Root;\n }(EntityStore));\n EntityStore.Root = Root;\n})(EntityStore || (EntityStore = {}));\nvar Layer = (function (_super) {\n __extends(Layer, _super);\n function Layer(id, parent, replay, group) {\n var _this = _super.call(this, parent.policies, group) || this;\n _this.id = id;\n _this.parent = parent;\n _this.replay = replay;\n _this.group = group;\n replay(_this);\n return _this;\n }\n Layer.prototype.addLayer = function (layerId, replay) {\n return new Layer(layerId, this, replay, this.group);\n };\n Layer.prototype.removeLayer = function (layerId) {\n var _this = this;\n var parent = this.parent.removeLayer(layerId);\n if (layerId === this.id) {\n if (this.group.caching) {\n Object.keys(this.data).forEach(function (dataId) {\n if (_this.data[dataId] !== parent.lookup(dataId)) {\n _this.delete(dataId);\n }\n });\n }\n return parent;\n }\n if (parent === this.parent)\n return this;\n return parent.addLayer(this.id, this.replay);\n };\n Layer.prototype.toObject = function () {\n return __assign(__assign({}, this.parent.toObject()), this.data);\n };\n Layer.prototype.findChildRefIds = function (dataId) {\n var fromParent = this.parent.findChildRefIds(dataId);\n return hasOwn.call(this.data, dataId) ? __assign(__assign({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent;\n };\n Layer.prototype.getStorage = function () {\n var p = this.parent;\n while (p.parent)\n p = p.parent;\n return p.getStorage.apply(p, arguments);\n };\n return Layer;\n}(EntityStore));\nfunction storeObjectReconciler(existingObject, incomingObject, property) {\n var existingValue = existingObject[property];\n var incomingValue = incomingObject[property];\n return equal(existingValue, incomingValue) ? existingValue : incomingValue;\n}\nexport function supportsResultCaching(store) {\n return !!(store instanceof EntityStore && store.group.caching);\n}\n//# sourceMappingURL=entityStore.js.map","import { __assign } from \"tslib\";\nimport { wrap } from 'optimism';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { isField, resultKeyNameFromField, isReference, makeReference, createFragmentMap, shouldInclude, addTypenameToDocument, getDefaultValues, getFragmentDefinitions, getMainDefinition, getQueryDefinition, maybeDeepFreeze, mergeDeepArray, getFragmentFromSelection, } from \"../../utilities/index.js\";\nimport { supportsResultCaching } from \"./entityStore.js\";\nimport { getTypenameFromStoreObject } from \"./helpers.js\";\nimport { MissingFieldError } from \"../core/types/common.js\";\n;\nfunction missingFromInvariant(err, context) {\n return new MissingFieldError(err.message, context.path.slice(), context.query, context.clientOnly, context.variables);\n}\nvar StoreReader = (function () {\n function StoreReader(config) {\n var _this = this;\n this.config = config;\n this.executeSelectionSet = wrap(function (options) { return _this.execSelectionSetImpl(options); }, {\n keyArgs: function (options) {\n return [\n options.selectionSet,\n options.objectOrReference,\n options.context,\n ];\n },\n makeCacheKey: function (selectionSet, parent, context) {\n if (supportsResultCaching(context.store)) {\n return context.store.makeCacheKey(selectionSet, isReference(parent) ? parent.__ref : parent, context.varString);\n }\n }\n });\n this.knownResults = new WeakMap();\n this.executeSubSelectedArray = wrap(function (options) {\n return _this.execSubSelectedArrayImpl(options);\n }, {\n makeCacheKey: function (_a) {\n var field = _a.field, array = _a.array, context = _a.context;\n if (supportsResultCaching(context.store)) {\n return context.store.makeCacheKey(field, array, context.varString);\n }\n }\n });\n this.config = __assign({ addTypename: true }, config);\n }\n StoreReader.prototype.diffQueryAgainstStore = function (_a) {\n var store = _a.store, query = _a.query, _b = _a.rootId, rootId = _b === void 0 ? 'ROOT_QUERY' : _b, variables = _a.variables, _c = _a.returnPartialData, returnPartialData = _c === void 0 ? true : _c;\n var policies = this.config.cache.policies;\n variables = __assign(__assign({}, getDefaultValues(getQueryDefinition(query))), variables);\n var execResult = this.executeSelectionSet({\n selectionSet: getMainDefinition(query).selectionSet,\n objectOrReference: makeReference(rootId),\n context: {\n store: store,\n query: query,\n policies: policies,\n variables: variables,\n varString: JSON.stringify(variables),\n fragmentMap: createFragmentMap(getFragmentDefinitions(query)),\n path: [],\n clientOnly: false,\n },\n });\n var hasMissingFields = execResult.missing && execResult.missing.length > 0;\n if (hasMissingFields && !returnPartialData) {\n throw execResult.missing[0];\n }\n return {\n result: execResult.result,\n missing: execResult.missing,\n complete: !hasMissingFields,\n };\n };\n StoreReader.prototype.isFresh = function (result, parent, selectionSet, context) {\n if (supportsResultCaching(context.store) &&\n this.knownResults.get(result) === selectionSet) {\n var latest = this.executeSelectionSet.peek(selectionSet, parent, context);\n if (latest && result === latest.result) {\n return true;\n }\n }\n return false;\n };\n StoreReader.prototype.execSelectionSetImpl = function (_a) {\n var _this = this;\n var selectionSet = _a.selectionSet, objectOrReference = _a.objectOrReference, context = _a.context;\n if (isReference(objectOrReference) &&\n !context.policies.rootTypenamesById[objectOrReference.__ref] &&\n !context.store.has(objectOrReference.__ref)) {\n return {\n result: {},\n missing: [missingFromInvariant(process.env.NODE_ENV === \"production\" ? new InvariantError(4) : new InvariantError(\"Dangling reference to missing \" + objectOrReference.__ref + \" object\"), context)],\n };\n }\n var variables = context.variables, policies = context.policies, store = context.store;\n var objectsToMerge = [];\n var finalResult = { result: null };\n var typename = store.getFieldValue(objectOrReference, \"__typename\");\n if (this.config.addTypename &&\n typeof typename === \"string\" &&\n !policies.rootIdsByTypename[typename]) {\n objectsToMerge.push({ __typename: typename });\n }\n function getMissing() {\n return finalResult.missing || (finalResult.missing = []);\n }\n function handleMissing(result) {\n var _a;\n if (result.missing)\n (_a = getMissing()).push.apply(_a, result.missing);\n return result.result;\n }\n var workSet = new Set(selectionSet.selections);\n workSet.forEach(function (selection) {\n var _a;\n if (!shouldInclude(selection, variables))\n return;\n if (isField(selection)) {\n var fieldValue = policies.readField({\n fieldName: selection.name.value,\n field: selection,\n variables: context.variables,\n from: objectOrReference,\n }, context);\n var resultName = resultKeyNameFromField(selection);\n context.path.push(resultName);\n var wasClientOnly = context.clientOnly;\n context.clientOnly = wasClientOnly || !!(selection.directives &&\n selection.directives.some(function (d) { return d.name.value === \"client\"; }));\n if (fieldValue === void 0) {\n if (!addTypenameToDocument.added(selection)) {\n getMissing().push(missingFromInvariant(process.env.NODE_ENV === \"production\" ? new InvariantError(5) : new InvariantError(\"Can't find field '\" + selection.name.value + \"' on \" + (isReference(objectOrReference)\n ? objectOrReference.__ref + \" object\"\n : \"object \" + JSON.stringify(objectOrReference, null, 2))), context));\n }\n }\n else if (Array.isArray(fieldValue)) {\n fieldValue = handleMissing(_this.executeSubSelectedArray({\n field: selection,\n array: fieldValue,\n context: context,\n }));\n }\n else if (!selection.selectionSet) {\n if (process.env.NODE_ENV !== 'production') {\n assertSelectionSetForIdValue(context.store, selection, fieldValue);\n maybeDeepFreeze(fieldValue);\n }\n }\n else if (fieldValue != null) {\n fieldValue = handleMissing(_this.executeSelectionSet({\n selectionSet: selection.selectionSet,\n objectOrReference: fieldValue,\n context: context,\n }));\n }\n if (fieldValue !== void 0) {\n objectsToMerge.push((_a = {}, _a[resultName] = fieldValue, _a));\n }\n context.clientOnly = wasClientOnly;\n invariant(context.path.pop() === resultName);\n }\n else {\n var fragment = getFragmentFromSelection(selection, context.fragmentMap);\n if (fragment && policies.fragmentMatches(fragment, typename)) {\n fragment.selectionSet.selections.forEach(workSet.add, workSet);\n }\n }\n });\n finalResult.result = mergeDeepArray(objectsToMerge);\n if (process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n this.knownResults.set(finalResult.result, selectionSet);\n return finalResult;\n };\n StoreReader.prototype.execSubSelectedArrayImpl = function (_a) {\n var _this = this;\n var field = _a.field, array = _a.array, context = _a.context;\n var missing;\n function handleMissing(childResult, i) {\n if (childResult.missing) {\n missing = missing || [];\n missing.push.apply(missing, childResult.missing);\n }\n invariant(context.path.pop() === i);\n return childResult.result;\n }\n if (field.selectionSet) {\n array = array.filter(context.store.canRead);\n }\n array = array.map(function (item, i) {\n if (item === null) {\n return null;\n }\n context.path.push(i);\n if (Array.isArray(item)) {\n return handleMissing(_this.executeSubSelectedArray({\n field: field,\n array: item,\n context: context,\n }), i);\n }\n if (field.selectionSet) {\n return handleMissing(_this.executeSelectionSet({\n selectionSet: field.selectionSet,\n objectOrReference: item,\n context: context,\n }), i);\n }\n if (process.env.NODE_ENV !== 'production') {\n assertSelectionSetForIdValue(context.store, field, item);\n }\n invariant(context.path.pop() === i);\n return item;\n });\n if (process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n return { result: array, missing: missing };\n };\n return StoreReader;\n}());\nexport { StoreReader };\nfunction assertSelectionSetForIdValue(store, field, fieldValue) {\n if (!field.selectionSet) {\n var workSet_1 = new Set([fieldValue]);\n workSet_1.forEach(function (value) {\n if (value && typeof value === \"object\") {\n process.env.NODE_ENV === \"production\" ? invariant(!isReference(value), 6) : invariant(!isReference(value), \"Missing selection set for object of type \" + getTypenameFromStoreObject(store, value) + \" returned for query field \" + field.name.value);\n Object.values(value).forEach(workSet_1.add, workSet_1);\n }\n });\n }\n}\n//# sourceMappingURL=readFromStore.js.map","import { __assign } from \"tslib\";\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { equal } from '@wry/equality';\nimport { createFragmentMap, getFragmentFromSelection, getDefaultValues, getFragmentDefinitions, getOperationDefinition, getTypenameFromResult, makeReference, isField, resultKeyNameFromField, isReference, shouldInclude, hasDirectives, cloneDeep, } from \"../../utilities/index.js\";\nimport { makeProcessedFieldsMerger, fieldNameFromStoreName, storeValueIsStoreObject } from \"./helpers.js\";\n;\nvar StoreWriter = (function () {\n function StoreWriter(cache, reader) {\n this.cache = cache;\n this.reader = reader;\n }\n StoreWriter.prototype.writeToStore = function (_a) {\n var query = _a.query, result = _a.result, dataId = _a.dataId, store = _a.store, variables = _a.variables;\n var operationDefinition = getOperationDefinition(query);\n var merger = makeProcessedFieldsMerger();\n variables = __assign(__assign({}, getDefaultValues(operationDefinition)), variables);\n var ref = this.processSelectionSet({\n result: result || Object.create(null),\n dataId: dataId,\n selectionSet: operationDefinition.selectionSet,\n mergeTree: { map: new Map },\n context: {\n store: store,\n written: Object.create(null),\n merge: function (existing, incoming) {\n return merger.merge(existing, incoming);\n },\n variables: variables,\n varString: JSON.stringify(variables),\n fragmentMap: createFragmentMap(getFragmentDefinitions(query)),\n },\n });\n if (!isReference(ref)) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(7) : new InvariantError(\"Could not identify object \" + JSON.stringify(result));\n }\n store.retain(ref.__ref);\n return ref;\n };\n StoreWriter.prototype.processSelectionSet = function (_a) {\n var _this = this;\n var dataId = _a.dataId, result = _a.result, selectionSet = _a.selectionSet, context = _a.context, mergeTree = _a.mergeTree;\n var policies = this.cache.policies;\n var _b = policies.identify(result, selectionSet, context.fragmentMap), id = _b[0], keyObject = _b[1];\n dataId = dataId || id;\n if (\"string\" === typeof dataId) {\n var sets = context.written[dataId] || (context.written[dataId] = []);\n var ref = makeReference(dataId);\n if (sets.indexOf(selectionSet) >= 0)\n return ref;\n sets.push(selectionSet);\n if (this.reader && this.reader.isFresh(result, ref, selectionSet, context)) {\n return ref;\n }\n }\n var incomingFields = Object.create(null);\n if (keyObject) {\n incomingFields = context.merge(incomingFields, keyObject);\n }\n var typename = (dataId && policies.rootTypenamesById[dataId]) ||\n getTypenameFromResult(result, selectionSet, context.fragmentMap) ||\n (dataId && context.store.get(dataId, \"__typename\"));\n if (\"string\" === typeof typename) {\n incomingFields.__typename = typename;\n }\n var workSet = new Set(selectionSet.selections);\n workSet.forEach(function (selection) {\n var _a;\n if (!shouldInclude(selection, context.variables))\n return;\n if (isField(selection)) {\n var resultFieldKey = resultKeyNameFromField(selection);\n var value = result[resultFieldKey];\n if (typeof value !== 'undefined') {\n var storeFieldName = policies.getStoreFieldName({\n typename: typename,\n fieldName: selection.name.value,\n field: selection,\n variables: context.variables,\n });\n var childTree = getChildMergeTree(mergeTree, storeFieldName);\n var incomingValue = _this.processFieldValue(value, selection, context, childTree);\n var childTypename = selection.selectionSet\n && context.store.getFieldValue(incomingValue, \"__typename\")\n || void 0;\n var merge = policies.getMergeFunction(typename, selection.name.value, childTypename);\n if (merge) {\n childTree.info = {\n field: selection,\n typename: typename,\n merge: merge,\n };\n }\n else {\n maybeRecycleChildMergeTree(mergeTree, storeFieldName);\n }\n incomingFields = context.merge(incomingFields, (_a = {},\n _a[storeFieldName] = incomingValue,\n _a));\n }\n else if (policies.usingPossibleTypes &&\n !hasDirectives([\"defer\", \"client\"], selection)) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(8) : new InvariantError(\"Missing field '\" + resultFieldKey + \"' in \" + JSON.stringify(result, null, 2).substring(0, 100));\n }\n }\n else {\n var fragment = getFragmentFromSelection(selection, context.fragmentMap);\n if (fragment &&\n policies.fragmentMatches(fragment, typename, result, context.variables)) {\n fragment.selectionSet.selections.forEach(workSet.add, workSet);\n }\n }\n });\n if (\"string\" === typeof dataId) {\n var entityRef_1 = makeReference(dataId);\n if (mergeTree.map.size) {\n incomingFields = this.applyMerges(mergeTree, entityRef_1, incomingFields, context);\n }\n if (process.env.NODE_ENV !== \"production\") {\n var hasSelectionSet_1 = function (storeFieldName) {\n return fieldsWithSelectionSets_1.has(fieldNameFromStoreName(storeFieldName));\n };\n var fieldsWithSelectionSets_1 = new Set();\n workSet.forEach(function (selection) {\n if (isField(selection) && selection.selectionSet) {\n fieldsWithSelectionSets_1.add(selection.name.value);\n }\n });\n var hasMergeFunction_1 = function (storeFieldName) {\n var childTree = mergeTree.map.get(storeFieldName);\n return Boolean(childTree && childTree.info && childTree.info.merge);\n };\n Object.keys(incomingFields).forEach(function (storeFieldName) {\n if (hasSelectionSet_1(storeFieldName) &&\n !hasMergeFunction_1(storeFieldName)) {\n warnAboutDataLoss(entityRef_1, incomingFields, storeFieldName, context.store);\n }\n });\n }\n context.store.merge(dataId, incomingFields);\n return entityRef_1;\n }\n return incomingFields;\n };\n StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {\n var _this = this;\n if (!field.selectionSet || value === null) {\n return process.env.NODE_ENV === 'production' ? value : cloneDeep(value);\n }\n if (Array.isArray(value)) {\n return value.map(function (item, i) {\n var value = _this.processFieldValue(item, field, context, getChildMergeTree(mergeTree, i));\n maybeRecycleChildMergeTree(mergeTree, i);\n return value;\n });\n }\n return this.processSelectionSet({\n result: value,\n selectionSet: field.selectionSet,\n context: context,\n mergeTree: mergeTree,\n });\n };\n StoreWriter.prototype.applyMerges = function (mergeTree, existing, incoming, context, getStorageArgs) {\n var _a;\n var _this = this;\n if (mergeTree.map.size && !isReference(incoming)) {\n var e_1 = (!Array.isArray(incoming) &&\n (isReference(existing) || storeValueIsStoreObject(existing))) ? existing : void 0;\n var i_1 = incoming;\n if (e_1 && !getStorageArgs) {\n getStorageArgs = [isReference(e_1) ? e_1.__ref : e_1];\n }\n var changedFields_1;\n var getValue_1 = function (from, name) {\n return Array.isArray(from)\n ? (typeof name === \"number\" ? from[name] : void 0)\n : context.store.getFieldValue(from, String(name));\n };\n mergeTree.map.forEach(function (childTree, storeFieldName) {\n if (getStorageArgs) {\n getStorageArgs.push(storeFieldName);\n }\n var eVal = getValue_1(e_1, storeFieldName);\n var iVal = getValue_1(i_1, storeFieldName);\n var aVal = _this.applyMerges(childTree, eVal, iVal, context, getStorageArgs);\n if (aVal !== iVal) {\n changedFields_1 = changedFields_1 || new Map;\n changedFields_1.set(storeFieldName, aVal);\n }\n if (getStorageArgs) {\n invariant(getStorageArgs.pop() === storeFieldName);\n }\n });\n if (changedFields_1) {\n incoming = (Array.isArray(i_1) ? i_1.slice(0) : __assign({}, i_1));\n changedFields_1.forEach(function (value, name) {\n incoming[name] = value;\n });\n }\n }\n if (mergeTree.info) {\n return this.cache.policies.runMergeFunction(existing, incoming, mergeTree.info, context, getStorageArgs && (_a = context.store).getStorage.apply(_a, getStorageArgs));\n }\n return incoming;\n };\n return StoreWriter;\n}());\nexport { StoreWriter };\nvar emptyMergeTreePool = [];\nfunction getChildMergeTree(_a, name) {\n var map = _a.map;\n if (!map.has(name)) {\n map.set(name, emptyMergeTreePool.pop() || { map: new Map });\n }\n return map.get(name);\n}\nfunction maybeRecycleChildMergeTree(_a, name) {\n var map = _a.map;\n var childTree = map.get(name);\n if (childTree &&\n !childTree.info &&\n !childTree.map.size) {\n emptyMergeTreePool.push(childTree);\n map.delete(name);\n }\n}\nvar warnings = new Set();\nfunction warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {\n var getChild = function (objOrRef) {\n var child = store.getFieldValue(objOrRef, storeFieldName);\n return typeof child === \"object\" && child;\n };\n var existing = getChild(existingRef);\n if (!existing)\n return;\n var incoming = getChild(incomingObj);\n if (!incoming)\n return;\n if (isReference(existing))\n return;\n if (equal(existing, incoming))\n return;\n if (Object.keys(existing).every(function (key) { return store.getFieldValue(incoming, key) !== void 0; })) {\n return;\n }\n var parentType = store.getFieldValue(existingRef, \"__typename\") ||\n store.getFieldValue(incomingObj, \"__typename\");\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var typeDotName = parentType + \".\" + fieldName;\n if (warnings.has(typeDotName))\n return;\n warnings.add(typeDotName);\n var childTypenames = [];\n if (!Array.isArray(existing) &&\n !Array.isArray(incoming)) {\n [existing, incoming].forEach(function (child) {\n var typename = store.getFieldValue(child, \"__typename\");\n if (typeof typename === \"string\" &&\n !childTypenames.includes(typename)) {\n childTypenames.push(typename);\n }\n });\n }\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Cache data may be lost when replacing the \" + fieldName + \" field of a \" + parentType + \" object.\\n\\nTo address this problem (which is not a bug in Apollo Client), \" + (childTypenames.length\n ? \"either ensure all objects of type \" +\n childTypenames.join(\" and \") + \" have an ID or a custom merge function, or \"\n : \"\") + \"define a custom merge function for the \" + typeDotName + \" field, so InMemoryCache can safely merge these objects:\\n\\n existing: \" + JSON.stringify(existing).slice(0, 1000) + \"\\n incoming: \" + JSON.stringify(incoming).slice(0, 1000) + \"\\n\\nFor more information about these options, please refer to the documentation:\\n\\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\\n\");\n}\n//# sourceMappingURL=writeToStore.js.map","import { __assign, __extends } from \"tslib\";\nimport \"./fixPolyfills.js\";\nimport { dep, wrap } from 'optimism';\nimport { ApolloCache } from \"../core/cache.js\";\nimport { MissingFieldError } from \"../core/types/common.js\";\nimport { addTypenameToDocument, isReference, } from \"../../utilities/index.js\";\nimport { StoreReader } from \"./readFromStore.js\";\nimport { StoreWriter } from \"./writeToStore.js\";\nimport { EntityStore, supportsResultCaching } from \"./entityStore.js\";\nimport { makeVar, forgetCache, recallCache } from \"./reactiveVars.js\";\nimport { defaultDataIdFromObject, Policies, } from \"./policies.js\";\nimport { hasOwn } from \"./helpers.js\";\nvar defaultConfig = {\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n typePolicies: {},\n};\nvar InMemoryCache = (function (_super) {\n __extends(InMemoryCache, _super);\n function InMemoryCache(config) {\n if (config === void 0) { config = {}; }\n var _this = _super.call(this) || this;\n _this.watches = new Set();\n _this.typenameDocumentCache = new Map();\n _this.makeVar = makeVar;\n _this.txCount = 0;\n _this.maybeBroadcastWatch = wrap(function (c, fromOptimisticTransaction) {\n return _this.broadcastWatch.call(_this, c, !!fromOptimisticTransaction);\n }, {\n makeCacheKey: function (c) {\n var store = c.optimistic ? _this.optimisticData : _this.data;\n if (supportsResultCaching(store)) {\n var optimistic = c.optimistic, rootId = c.rootId, variables = c.variables;\n return store.makeCacheKey(c.query, c.callback, JSON.stringify({ optimistic: optimistic, rootId: rootId, variables: variables }));\n }\n }\n });\n _this.watchDep = dep();\n _this.config = __assign(__assign({}, defaultConfig), config);\n _this.addTypename = !!_this.config.addTypename;\n _this.policies = new Policies({\n cache: _this,\n dataIdFromObject: _this.config.dataIdFromObject,\n possibleTypes: _this.config.possibleTypes,\n typePolicies: _this.config.typePolicies,\n });\n _this.data = new EntityStore.Root({\n policies: _this.policies,\n resultCaching: _this.config.resultCaching,\n });\n _this.optimisticData = _this.data;\n _this.storeWriter = new StoreWriter(_this, _this.storeReader = new StoreReader({\n cache: _this,\n addTypename: _this.addTypename,\n }));\n return _this;\n }\n InMemoryCache.prototype.restore = function (data) {\n if (data)\n this.data.replace(data);\n return this;\n };\n InMemoryCache.prototype.extract = function (optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return (optimistic ? this.optimisticData : this.data).extract();\n };\n InMemoryCache.prototype.read = function (options) {\n var _a = options.returnPartialData, returnPartialData = _a === void 0 ? false : _a;\n try {\n return this.storeReader.diffQueryAgainstStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: options.query,\n variables: options.variables,\n rootId: options.rootId,\n config: this.config,\n returnPartialData: returnPartialData,\n }).result || null;\n }\n catch (e) {\n if (e instanceof MissingFieldError) {\n return null;\n }\n throw e;\n }\n };\n InMemoryCache.prototype.write = function (options) {\n try {\n ++this.txCount;\n return this.storeWriter.writeToStore({\n store: this.data,\n query: options.query,\n result: options.result,\n dataId: options.dataId,\n variables: options.variables,\n });\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.modify = function (options) {\n if (hasOwn.call(options, \"id\") && !options.id) {\n return false;\n }\n var store = options.optimistic\n ? this.optimisticData\n : this.data;\n try {\n ++this.txCount;\n return store.modify(options.id || \"ROOT_QUERY\", options.fields);\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.diff = function (options) {\n return this.storeReader.diffQueryAgainstStore({\n store: options.optimistic ? this.optimisticData : this.data,\n rootId: options.id || \"ROOT_QUERY\",\n query: options.query,\n variables: options.variables,\n returnPartialData: options.returnPartialData,\n config: this.config,\n });\n };\n InMemoryCache.prototype.watch = function (watch) {\n var _this = this;\n if (!this.watches.size) {\n recallCache(this);\n }\n this.watches.add(watch);\n if (watch.immediate) {\n this.maybeBroadcastWatch(watch);\n }\n return function () {\n if (_this.watches.delete(watch) && !_this.watches.size) {\n forgetCache(_this);\n }\n _this.watchDep.dirty(watch);\n _this.maybeBroadcastWatch.forget(watch);\n };\n };\n InMemoryCache.prototype.gc = function () {\n return this.optimisticData.gc();\n };\n InMemoryCache.prototype.retain = function (rootId, optimistic) {\n return (optimistic ? this.optimisticData : this.data).retain(rootId);\n };\n InMemoryCache.prototype.release = function (rootId, optimistic) {\n return (optimistic ? this.optimisticData : this.data).release(rootId);\n };\n InMemoryCache.prototype.identify = function (object) {\n return isReference(object) ? object.__ref :\n this.policies.identify(object)[0];\n };\n InMemoryCache.prototype.evict = function (options) {\n if (!options.id) {\n if (hasOwn.call(options, \"id\")) {\n return false;\n }\n options = __assign(__assign({}, options), { id: \"ROOT_QUERY\" });\n }\n try {\n ++this.txCount;\n return this.optimisticData.evict(options);\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.reset = function () {\n this.data.clear();\n this.optimisticData = this.data;\n this.broadcastWatches();\n return Promise.resolve();\n };\n InMemoryCache.prototype.removeOptimistic = function (idToRemove) {\n var newOptimisticData = this.optimisticData.removeLayer(idToRemove);\n if (newOptimisticData !== this.optimisticData) {\n this.optimisticData = newOptimisticData;\n this.broadcastWatches();\n }\n };\n InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) {\n var _this = this;\n var perform = function (layer) {\n var _a = _this, data = _a.data, optimisticData = _a.optimisticData;\n ++_this.txCount;\n if (layer) {\n _this.data = _this.optimisticData = layer;\n }\n try {\n transaction(_this);\n }\n finally {\n --_this.txCount;\n _this.data = data;\n _this.optimisticData = optimisticData;\n }\n };\n var fromOptimisticTransaction = false;\n if (typeof optimisticId === 'string') {\n this.optimisticData = this.optimisticData.addLayer(optimisticId, perform);\n fromOptimisticTransaction = true;\n }\n else if (optimisticId === null) {\n perform(this.data);\n }\n else {\n perform();\n }\n this.broadcastWatches(fromOptimisticTransaction);\n };\n InMemoryCache.prototype.transformDocument = function (document) {\n if (this.addTypename) {\n var result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n };\n InMemoryCache.prototype.broadcastWatches = function (fromOptimisticTransaction) {\n var _this = this;\n if (!this.txCount) {\n this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c, fromOptimisticTransaction); });\n }\n };\n InMemoryCache.prototype.broadcastWatch = function (c, fromOptimisticTransaction) {\n this.watchDep.dirty(c);\n this.watchDep(c);\n var diff = this.diff({\n query: c.query,\n variables: c.variables,\n optimistic: c.optimistic,\n });\n if (c.optimistic && fromOptimisticTransaction) {\n diff.fromOptimisticTransaction = true;\n }\n c.callback(diff);\n };\n return InMemoryCache;\n}(ApolloCache));\nexport { InMemoryCache };\n//# sourceMappingURL=inMemoryCache.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import inspect from \"../jsutils/inspect.mjs\";\nimport { isNode } from \"./ast.mjs\";\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport var QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields']\n};\nexport var BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\n\nexport function visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n\n for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) {\n var k = _Object$keys2[_i2];\n clone[k] = node[k];\n }\n\n node = clone;\n }\n\n var editOffset = 0;\n\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n\n if (inArray) {\n editKey -= editOffset;\n }\n\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n\n if (node === null || node === undefined) {\n continue;\n }\n\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error(\"Invalid AST Node: \".concat(inspect(node), \".\"));\n }\n\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _visitorKeys$node$kin;\n\n stack = {\n inArray: inArray,\n index: index,\n keys: keys,\n edits: edits,\n prev: stack\n };\n inArray = Array.isArray(node);\n keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n\n var specificKindVisitor = specificVisitor[kind];\n\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\n\t\t\t// This just needs to be something that won't trample other user's Symbol.for use\n\t\t\t// It also will guide people to the source of their issues, if this is problematic.\n\t\t\t// META: It's a resource locator!\n\t\t\tresult = Symbol.for('https://github.com/benlesh/symbol-observable');\n\t\t\ttry {\n\t\t\t\tSymbol.observable = result;\n\t\t\t} catch (err) {\n\t\t\t\t// Do nothing. In some environments, users have frozen `Symbol` for security reasons,\n\t\t\t\t// if it is frozen assigning to it will throw. In this case, we don't care, because\n\t\t\t\t// they will need to use the returned value from the ponyfill.\n\t\t\t}\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n var fileName = file.name || '';\n var mimeType = (file.type || '').toLowerCase();\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim().toLowerCase();\n\n if (validType.charAt(0) === '.') {\n return fileName.toLowerCase().endsWith(validType);\n } else if (validType.endsWith('/*')) {\n // This is something like a image/* mime type\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n return mimeType === validType;\n });\n }\n\n return true;\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Modal = require(\"./components/Modal\");\n\nvar _Modal2 = _interopRequireDefault(_Modal);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _Modal2.default;\nmodule.exports = exports[\"default\"];","require('./manifest');\n","import manifest from '@neos-project/neos-ui-extensibility';\n\nimport MediaSelectionScreen from './MediaSelectionScreen';\n\nmanifest('Flowpack.Media.Ui:MediaSelectionScreen', {}, (globalRegistry, { frontendConfiguration }) => {\n const secondaryEditorsRegistry = globalRegistry.get('inspector').get('secondaryEditors');\n\n const { useNewMediaSelection } = frontendConfiguration['Flowpack.Media.Ui'];\n\n if (useNewMediaSelection) {\n secondaryEditorsRegistry.set('Neos.Neos/Inspector/Secondary/Editors/MediaSelectionScreen', {\n component: MediaSelectionScreen,\n });\n }\n});\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar createConsumerApi_1 = tslib_1.__importDefault(require(\"./createConsumerApi\"));\nexports.createConsumerApi = createConsumerApi_1[\"default\"];\nvar readFromConsumerApi_1 = tslib_1.__importDefault(require(\"./readFromConsumerApi\"));\nexports.readFromConsumerApi = readFromConsumerApi_1[\"default\"];\nvar index_1 = require(\"./registry/index\");\nexports.SynchronousRegistry = index_1.SynchronousRegistry;\nexports.SynchronousMetaRegistry = index_1.SynchronousMetaRegistry;\nexports[\"default\"] = readFromConsumerApi_1[\"default\"]('manifest');\n//# sourceMappingURL=index.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar manifest_1 = tslib_1.__importDefault(require(\"./manifest\"));\nvar createReadOnlyValue = function (value) { return ({\n value: value,\n writable: false,\n enumerable: false,\n configurable: true\n}); };\nfunction createConsumerApi(manifests, exposureMap) {\n var api = {};\n Object.keys(exposureMap).forEach(function (key) {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n Object.defineProperty(api, '@manifest', createReadOnlyValue(manifest_1[\"default\"](manifests)));\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n}\nexports[\"default\"] = createConsumerApi;\n//# sourceMappingURL=createConsumerApi.js.map","\"use strict\";\nexports.__esModule = true;\nexports[\"default\"] = (function (manifests) {\n return function (identifier, options, bootstrap) {\n var _a;\n manifests.push((_a = {},\n _a[identifier] = {\n options: options,\n bootstrap: bootstrap\n },\n _a));\n };\n});\n//# sourceMappingURL=manifest.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar SynchronousRegistry_1 = tslib_1.__importDefault(require(\"./SynchronousRegistry\"));\nexports.SynchronousRegistry = SynchronousRegistry_1[\"default\"];\nvar SynchronousMetaRegistry_1 = tslib_1.__importDefault(require(\"./SynchronousMetaRegistry\"));\nexports.SynchronousMetaRegistry = SynchronousMetaRegistry_1[\"default\"];\n//# sourceMappingURL=index.js.map","\"use strict\";\nexports.__esModule = true;\nvar AbstractRegistry = (function () {\n function AbstractRegistry(description) {\n this.SERIAL_VERSION_UID = 'd8a5aa78-978e-11e6-ae22-56b6b6499611';\n this.description = description;\n }\n return AbstractRegistry;\n}());\nexports[\"default\"] = AbstractRegistry;\n//# sourceMappingURL=AbstractRegistry.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar positionalArraySorter = function (subject, position, idKey) {\n var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f, e_7, _g;\n if (position === void 0) { position = 'position'; }\n if (idKey === void 0) { idKey = 'key'; }\n var positionAccessor = typeof position === 'string' ? function (value) { return value[position]; } : position;\n var indexMapping = {};\n var middleKeys = {};\n var startKeys = {};\n var endKeys = {};\n var beforeKeys = {};\n var afterKeys = {};\n subject.forEach(function (item, index) {\n var key = item[idKey] ? item[idKey] : String(index);\n indexMapping[key] = index;\n var positionValue = positionAccessor(item);\n var position = String(positionValue ? positionValue : index);\n var invalid = false;\n if (position.startsWith('start')) {\n var weightMatch = position.match(/start\\s+(\\d+)/);\n var weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0;\n if (!startKeys[weight]) {\n startKeys[weight] = [];\n }\n startKeys[weight].push(key);\n }\n else if (position.startsWith('end')) {\n var weightMatch = position.match(/end\\s+(\\d+)/);\n var weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0;\n if (!endKeys[weight]) {\n endKeys[weight] = [];\n }\n endKeys[weight].push(key);\n }\n else if (position.startsWith('before')) {\n var match = position.match(/before\\s+(\\S+)(\\s+(\\d+))?/);\n if (!match) {\n invalid = true;\n }\n else {\n var reference = match[1];\n var weight = match[3] ? Number(match[3]) : 0;\n if (!beforeKeys[reference]) {\n beforeKeys[reference] = {};\n }\n if (!beforeKeys[reference][weight]) {\n beforeKeys[reference][weight] = [];\n }\n beforeKeys[reference][weight].push(key);\n }\n }\n else if (position.startsWith('after')) {\n var match = position.match(/after\\s+(\\S+)(\\s+(\\d+))?/);\n if (!match) {\n invalid = true;\n }\n else {\n var reference = match[1];\n var weight = match[3] ? Number(match[3]) : 0;\n if (!afterKeys[reference]) {\n afterKeys[reference] = {};\n }\n if (!afterKeys[reference][weight]) {\n afterKeys[reference][weight] = [];\n }\n afterKeys[reference][weight].push(key);\n }\n }\n else {\n invalid = true;\n }\n if (invalid) {\n var numberPosition = parseFloat(position);\n if (isNaN(numberPosition) || !isFinite(numberPosition)) {\n numberPosition = index;\n }\n if (!middleKeys[numberPosition]) {\n middleKeys[numberPosition] = [];\n }\n middleKeys[numberPosition].push(key);\n }\n });\n var resultStart = [];\n var resultMiddle = [];\n var resultEnd = [];\n var processedKeys = [];\n var sortedWeights = function (dict, asc) {\n var weights = Object.keys(dict).map(function (x) { return Number(x); }).sort(function (a, b) { return a - b; });\n return asc ? weights : weights.reverse();\n };\n var addToResults = function (keys, result) {\n keys.forEach(function (key) {\n var e_8, _a, e_9, _b;\n if (processedKeys.indexOf(key) >= 0) {\n return;\n }\n processedKeys.push(key);\n if (beforeKeys[key]) {\n var beforeWeights = sortedWeights(beforeKeys[key], true);\n try {\n for (var beforeWeights_1 = tslib_1.__values(beforeWeights), beforeWeights_1_1 = beforeWeights_1.next(); !beforeWeights_1_1.done; beforeWeights_1_1 = beforeWeights_1.next()) {\n var i = beforeWeights_1_1.value;\n addToResults(beforeKeys[key][i], result);\n }\n }\n catch (e_8_1) { e_8 = { error: e_8_1 }; }\n finally {\n try {\n if (beforeWeights_1_1 && !beforeWeights_1_1.done && (_a = beforeWeights_1[\"return\"])) _a.call(beforeWeights_1);\n }\n finally { if (e_8) throw e_8.error; }\n }\n }\n result.push(key);\n if (afterKeys[key]) {\n var afterWeights = sortedWeights(afterKeys[key], false);\n try {\n for (var afterWeights_1 = tslib_1.__values(afterWeights), afterWeights_1_1 = afterWeights_1.next(); !afterWeights_1_1.done; afterWeights_1_1 = afterWeights_1.next()) {\n var i = afterWeights_1_1.value;\n addToResults(afterKeys[key][i], result);\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (afterWeights_1_1 && !afterWeights_1_1.done && (_b = afterWeights_1[\"return\"])) _b.call(afterWeights_1);\n }\n finally { if (e_9) throw e_9.error; }\n }\n }\n });\n };\n try {\n for (var _h = tslib_1.__values(sortedWeights(startKeys, false)), _j = _h.next(); !_j.done; _j = _h.next()) {\n var i = _j.value;\n addToResults(startKeys[i], resultStart);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_j && !_j.done && (_a = _h[\"return\"])) _a.call(_h);\n }\n finally { if (e_1) throw e_1.error; }\n }\n try {\n for (var _k = tslib_1.__values(sortedWeights(middleKeys, true)), _l = _k.next(); !_l.done; _l = _k.next()) {\n var i = _l.value;\n addToResults(middleKeys[i], resultMiddle);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_l && !_l.done && (_b = _k[\"return\"])) _b.call(_k);\n }\n finally { if (e_2) throw e_2.error; }\n }\n try {\n for (var _m = tslib_1.__values(sortedWeights(endKeys, true)), _o = _m.next(); !_o.done; _o = _m.next()) {\n var i = _o.value;\n addToResults(endKeys[i], resultEnd);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_o && !_o.done && (_c = _m[\"return\"])) _c.call(_m);\n }\n finally { if (e_3) throw e_3.error; }\n }\n try {\n for (var _p = tslib_1.__values(Object.keys(beforeKeys)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var key = _q.value;\n if (processedKeys.indexOf(key) >= 0) {\n continue;\n }\n try {\n for (var _r = (e_5 = void 0, tslib_1.__values(sortedWeights(beforeKeys[key], false))), _s = _r.next(); !_s.done; _s = _r.next()) {\n var i = _s.value;\n addToResults(beforeKeys[key][i], resultStart);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_s && !_s.done && (_e = _r[\"return\"])) _e.call(_r);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_q && !_q.done && (_d = _p[\"return\"])) _d.call(_p);\n }\n finally { if (e_4) throw e_4.error; }\n }\n try {\n for (var _t = tslib_1.__values(Object.keys(afterKeys)), _u = _t.next(); !_u.done; _u = _t.next()) {\n var key = _u.value;\n if (processedKeys.indexOf(key) >= 0) {\n continue;\n }\n try {\n for (var _v = (e_7 = void 0, tslib_1.__values(sortedWeights(afterKeys[key], false))), _w = _v.next(); !_w.done; _w = _v.next()) {\n var i = _w.value;\n addToResults(afterKeys[key][i], resultMiddle);\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (_w && !_w.done && (_g = _v[\"return\"])) _g.call(_v);\n }\n finally { if (e_7) throw e_7.error; }\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_u && !_u.done && (_f = _t[\"return\"])) _f.call(_t);\n }\n finally { if (e_6) throw e_6.error; }\n }\n var sortedKeys = tslib_1.__spread(resultStart, resultMiddle, resultEnd);\n return sortedKeys.map(function (key) { return indexMapping[key]; }).map(function (i) { return subject[i]; });\n};\nexports[\"default\"] = positionalArraySorter;\n//# sourceMappingURL=positionalArraySorter.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar SynchronousRegistry_1 = tslib_1.__importDefault(require(\"./SynchronousRegistry\"));\nvar SynchronousMetaRegistry = (function (_super) {\n tslib_1.__extends(SynchronousMetaRegistry, _super);\n function SynchronousMetaRegistry() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SynchronousMetaRegistry.prototype.set = function (key, value) {\n if (value.SERIAL_VERSION_UID !== 'd8a5aa78-978e-11e6-ae22-56b6b6499611') {\n throw new Error('You can only add registries to a meta registry');\n }\n return _super.prototype.set.call(this, key, value);\n };\n return SynchronousMetaRegistry;\n}(SynchronousRegistry_1[\"default\"]));\nexports[\"default\"] = SynchronousMetaRegistry;\n//# sourceMappingURL=SynchronousMetaRegistry.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_redux_1 = require(\"react-redux\");\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar apollo_upload_client_1 = require(\"apollo-upload-client\");\nvar plow_js_1 = require(\"plow-js\");\n// Neos dependencies are provided by the UI\n// @ts-ignore\nvar neos_ui_decorators_1 = require(\"@neos-project/neos-ui-decorators\");\n// @ts-ignore\nvar neos_ui_redux_store_1 = require(\"@neos-project/neos-ui-redux-store\");\n// Media UI dependencies\nvar src_1 = require(\"@media-ui/core/src\");\nvar core_1 = require(\"@media-ui/media-module/src/core\");\nvar App_1 = __importDefault(require(\"@media-ui/media-module/src/components/App\"));\n// GraphQL type definitions\nvar schema_graphql_1 = __importDefault(require(\"@media-ui/core/schema.graphql\"));\nvar schema_graphql_2 = __importDefault(require(\"@media-ui/feature-clipboard/schema.graphql\"));\nvar schema_graphql_3 = __importDefault(require(\"@media-ui/feature-asset-usage/schema.graphql\"));\n// GraphQL local resolvers\nvar mutation_1 = __importDefault(require(\"@media-ui/feature-clipboard/src/resolvers/mutation\"));\nvar mutation_2 = __importDefault(require(\"@media-ui/media-module/src/resolvers/mutation\"));\nvar apolloClient = null;\nvar MediaSelectionScreen = /** @class */ (function (_super) {\n __extends(MediaSelectionScreen, _super);\n function MediaSelectionScreen(props) {\n var _this = _super.call(this, props) || this;\n _this.translate = function (id, fallback, params, packageKey, sourceName) {\n if (packageKey === void 0) { packageKey = 'Flowpack.Media.Ui'; }\n if (sourceName === void 0) { sourceName = 'Main'; }\n return _this.props.i18nRegistry.translate(id, fallback, params, packageKey, sourceName);\n };\n _this.state = {\n initialLeftSideBarHiddenState: false,\n initialNodeCreationDialogOpenState: false,\n };\n return _this;\n }\n MediaSelectionScreen.prototype.componentDidMount = function () {\n var _a = this.props, isLeftSideBarHidden = _a.isLeftSideBarHidden, isNodeCreationDialogOpen = _a.isNodeCreationDialogOpen, toggleSidebar = _a.toggleSidebar;\n this.setState({\n initialLeftSideBarHiddenState: isLeftSideBarHidden,\n initialNodeCreationDialogOpenState: isNodeCreationDialogOpen,\n });\n if (!isLeftSideBarHidden && !isNodeCreationDialogOpen) {\n toggleSidebar();\n }\n };\n MediaSelectionScreen.prototype.componentWillUnmount = function () {\n var _a = this.props, isLeftSideBarHidden = _a.isLeftSideBarHidden, toggleSidebar = _a.toggleSidebar;\n var _b = this.state, initialLeftSideBarHiddenState = _b.initialLeftSideBarHiddenState, initialNodeCreationDialogOpenState = _b.initialNodeCreationDialogOpenState;\n if (initialLeftSideBarHiddenState !== isLeftSideBarHidden && !initialNodeCreationDialogOpenState) {\n toggleSidebar();\n }\n };\n MediaSelectionScreen.prototype.getConfig = function () {\n return {\n endpoints: {\n // TODO: Generate uri from Neos maybe like $get('routes.core.modules.mediaBrowser', neos);\n graphql: '/neos/graphql/media-assets',\n upload: '/neos/media-ui/upload',\n },\n // TODO: Generate image uri from Neos\n dummyImage: '/_Resources/Static/Packages/Neos.Neos/Images/dummy-image.svg',\n };\n };\n MediaSelectionScreen.prototype.getApolloClient = function () {\n if (!apolloClient) {\n var endpoints = this.getConfig().endpoints;\n var cache = core_1.CacheFactory.createCache(this.props.frontendConfiguration);\n core_1.PersistentStateManager.restoreLocalState(cache, this.props.constraints);\n apolloClient = new client_1.ApolloClient({\n cache: cache,\n link: client_1.ApolloLink.from([\n core_1.ApolloErrorHandler,\n apollo_upload_client_1.createUploadLink({\n uri: endpoints.graphql,\n credentials: 'same-origin',\n }),\n ]),\n typeDefs: [schema_graphql_1.default, schema_graphql_2.default, schema_graphql_3.default],\n resolvers: [\n mutation_2.default(core_1.PersistentStateManager.updateLocalState),\n mutation_1.default(core_1.PersistentStateManager.updateLocalState),\n ],\n });\n }\n return apolloClient;\n };\n MediaSelectionScreen.prototype.render = function () {\n var _a = this.props, addFlashMessage = _a.addFlashMessage, onComplete = _a.onComplete, constraints = _a.constraints, type = _a.type;\n var client = this.getApolloClient();\n var dummyImage = this.getConfig().dummyImage;\n var containerRef = react_1.createRef();\n var featureFlags = this.props.frontendConfiguration;\n // The Neos.UI Flashmessages only support the levels 'success', 'error' and 'info'\n var Notification = {\n info: function (message) { return addFlashMessage(message, message, 'info'); },\n ok: function (message) { return addFlashMessage(message, message, 'success'); },\n notice: function (message) { return addFlashMessage(message, message, 'info'); },\n warning: function (title, message) {\n if (message === void 0) { message = ''; }\n return addFlashMessage(title, message, 'error');\n },\n error: function (title, message) {\n if (message === void 0) { message = ''; }\n return addFlashMessage(title, message, 'error');\n },\n };\n var isInNodeCreationDialog = this.state.initialNodeCreationDialogOpenState;\n return (React.createElement(\"div\", { style: { transform: 'translateZ(0)', height: '100%', padding: isInNodeCreationDialog ? 0 : '1rem' } },\n React.createElement(src_1.IntlProvider, { translate: this.translate },\n React.createElement(src_1.NotifyProvider, { notificationApi: Notification },\n React.createElement(client_1.ApolloProvider, { client: client },\n React.createElement(recoil_1.RecoilRoot, null,\n React.createElement(src_1.MediaUiProvider, { dummyImage: dummyImage, onAssetSelection: onComplete, selectionMode: true, isInNodeCreationDialog: isInNodeCreationDialog, containerRef: containerRef, featureFlags: featureFlags, constraints: constraints || {}, assetType: type === 'images' ? 'image' : type },\n React.createElement(src_1.MediaUiThemeProvider, null,\n React.createElement(App_1.default, null)))))))));\n };\n MediaSelectionScreen = __decorate([\n react_redux_1.connect(plow_js_1.$transform({\n isLeftSideBarHidden: plow_js_1.$get('ui.leftSideBar.isHidden'),\n isNodeCreationDialogOpen: plow_js_1.$get('ui.nodeCreationDialog.isOpen'),\n }), {\n addFlashMessage: neos_ui_redux_store_1.actions.UI.FlashMessages.add,\n toggleSidebar: neos_ui_redux_store_1.actions.UI.LeftSideBar.toggle,\n }),\n neos_ui_decorators_1.neos(function (globalRegistry) { return ({\n i18nRegistry: globalRegistry.get('i18n'),\n frontendConfiguration: globalRegistry.get('frontendConfiguration').get('Flowpack.Media.Ui'),\n }); })\n // eslint-disable-next-line prettier/prettier\n ], MediaSelectionScreen);\n return MediaSelectionScreen;\n}(React.PureComponent));\nexports.default = MediaSelectionScreen;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Observable = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// === Symbol Support ===\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\n\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\n\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species'); // === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n if (value == null) return undefined;\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n\n if (ctor === null) {\n ctor = undefined;\n }\n }\n\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n\n if (!queue) {\n return;\n }\n\n subscription._queue = undefined;\n subscription._state = 'ready';\n\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({\n type: type,\n value: value\n });\n\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{\n type: type,\n value: value\n }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription =\n/*#__PURE__*/\nfunction () {\n function Subscription(observer, subscriber) {\n _classCallCheck(this, Subscription);\n\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n _createClass(Subscription, [{\n key: \"unsubscribe\",\n value: function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n }\n }, {\n key: \"closed\",\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver =\n/*#__PURE__*/\nfunction () {\n function SubscriptionObserver(subscription) {\n _classCallCheck(this, SubscriptionObserver);\n\n this._subscription = subscription;\n }\n\n _createClass(SubscriptionObserver, [{\n key: \"next\",\n value: function next(value) {\n onNotify(this._subscription, 'next', value);\n }\n }, {\n key: \"error\",\n value: function error(value) {\n onNotify(this._subscription, 'error', value);\n }\n }, {\n key: \"complete\",\n value: function complete() {\n onNotify(this._subscription, 'complete');\n }\n }, {\n key: \"closed\",\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable =\n/*#__PURE__*/\nfunction () {\n function Observable(subscriber) {\n _classCallCheck(this, Observable);\n\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n this._subscriber = subscriber;\n }\n\n _createClass(Observable, [{\n key: \"subscribe\",\n value: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n\n return new Subscription(observer, this._subscriber);\n }\n }, {\n key: \"forEach\",\n value: function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n }, {\n key: \"map\",\n value: function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"filter\",\n value: function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"reduce\",\n value: function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n observer.next(acc);\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"concat\",\n value: function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscription;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n }\n }, {\n key: \"flatMap\",\n value: function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n }\n }, {\n key: SymbolObservable,\n value: function () {\n return this;\n }\n }], [{\n key: \"from\",\n value: function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n if (x == null) throw new TypeError(x + ' is not an object');\n var method = getMethod(x, SymbolObservable);\n\n if (method) {\n var observable = method.call(x);\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n if (isObservable(observable) && observable.constructor === C) return observable;\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _item = _step.value;\n observer.next(_item);\n if (observer.closed) return;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n }\n }, {\n key: \"of\",\n value: function of() {\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n }, {\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nexports.Observable = Observable;\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export function getEnv() {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n return 'development';\n}\nexport function isEnv(env) {\n return getEnv() === env;\n}\nexport function isDevelopment() {\n return isEnv('development') === true;\n}\nexport function isTest() {\n return isEnv('test') === true;\n}\n//# sourceMappingURL=environment.js.map","'use strict';\n\nexports.createUploadLink = require('./createUploadLink');\nexports.formDataAppendFile = require('./formDataAppendFile');\nexports.isExtractableFile = require('./isExtractableFile');\nexports.ReactNativeFile = require('./ReactNativeFile');\n","'use strict';\n\nvar _extends = require('@babel/runtime/helpers/extends');\n\nvar _require = require('@apollo/client/core'),\n ApolloLink = _require.ApolloLink,\n Observable = _require.Observable;\n\nvar _require2 = require('@apollo/client/link/http'),\n createSignalIfSupported = _require2.createSignalIfSupported,\n fallbackHttpConfig = _require2.fallbackHttpConfig,\n parseAndCheckHttpResponse = _require2.parseAndCheckHttpResponse,\n rewriteURIForGET = _require2.rewriteURIForGET,\n selectHttpOptionsAndBody = _require2.selectHttpOptionsAndBody,\n selectURI = _require2.selectURI,\n serializeFetchParameter = _require2.serializeFetchParameter;\n\nvar extractFiles = require('extract-files/public/extractFiles');\n\nvar formDataAppendFile = require('./formDataAppendFile');\n\nvar isExtractableFile = require('./isExtractableFile');\n\nmodule.exports = function createUploadLink(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$uri = _ref.uri,\n fetchUri = _ref$uri === void 0 ? '/graphql' : _ref$uri,\n useGETForQueries = _ref.useGETForQueries,\n _ref$isExtractableFil = _ref.isExtractableFile,\n customIsExtractableFile =\n _ref$isExtractableFil === void 0\n ? isExtractableFile\n : _ref$isExtractableFil,\n CustomFormData = _ref.FormData,\n _ref$formDataAppendFi = _ref.formDataAppendFile,\n customFormDataAppendFile =\n _ref$formDataAppendFi === void 0\n ? formDataAppendFile\n : _ref$formDataAppendFi,\n customFetch = _ref.fetch,\n fetchOptions = _ref.fetchOptions,\n credentials = _ref.credentials,\n headers = _ref.headers,\n includeExtensions = _ref.includeExtensions;\n\n var linkConfig = {\n http: {\n includeExtensions: includeExtensions,\n },\n options: fetchOptions,\n credentials: credentials,\n headers: headers,\n };\n return new ApolloLink(function (operation) {\n var context = operation.getContext();\n var _context$clientAwaren = context.clientAwareness;\n _context$clientAwaren =\n _context$clientAwaren === void 0 ? {} : _context$clientAwaren;\n var name = _context$clientAwaren.name,\n version = _context$clientAwaren.version,\n headers = context.headers;\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: _extends(\n {},\n name && {\n 'apollographql-client-name': name,\n },\n version && {\n 'apollographql-client-version': version,\n },\n headers\n ),\n };\n\n var _selectHttpOptionsAnd = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig\n ),\n options = _selectHttpOptionsAnd.options,\n body = _selectHttpOptionsAnd.body;\n\n var _extractFiles = extractFiles(body, '', customIsExtractableFile),\n clone = _extractFiles.clone,\n files = _extractFiles.files;\n\n var uri = selectURI(operation, fetchUri);\n\n if (files.size) {\n delete options.headers['content-type'];\n var RuntimeFormData = CustomFormData || FormData;\n var form = new RuntimeFormData();\n form.append('operations', serializeFetchParameter(clone, 'Payload'));\n var map = {};\n var i = 0;\n files.forEach(function (paths) {\n map[++i] = paths;\n });\n form.append('map', JSON.stringify(map));\n i = 0;\n files.forEach(function (paths, file) {\n customFormDataAppendFile(form, ++i, file);\n });\n options.body = form;\n } else {\n if (\n useGETForQueries &&\n !operation.query.definitions.some(function (definition) {\n return (\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation'\n );\n })\n )\n options.method = 'GET';\n\n if (options.method === 'GET') {\n var _rewriteURIForGET = rewriteURIForGET(uri, body),\n newURI = _rewriteURIForGET.newURI,\n parseError = _rewriteURIForGET.parseError;\n\n if (parseError)\n return new Observable(function (observer) {\n observer.error(parseError);\n });\n uri = newURI;\n } else options.body = serializeFetchParameter(clone, 'Payload');\n }\n\n var _createSignalIfSuppor = createSignalIfSupported(),\n controller = _createSignalIfSuppor.controller;\n\n if (controller) {\n if (options.signal)\n options.signal.addEventListener('abort', function () {\n controller.abort();\n });\n options.signal = controller.signal;\n }\n\n var runtimeFetch = customFetch || fetch;\n return new Observable(function (observer) {\n var cleaningUp;\n runtimeFetch(uri, options)\n .then(function (response) {\n operation.setContext({\n response: response,\n });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n })\n .catch(function (error) {\n if (!cleaningUp) {\n if (error.result && error.result.errors && error.result.data)\n observer.next(error.result);\n observer.error(error);\n }\n });\n return function () {\n cleaningUp = true;\n if (controller) controller.abort();\n };\n });\n });\n};\n","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","'use strict';\n\nvar defaultIsExtractableFile = require('./isExtractableFile');\n\nmodule.exports = function extractFiles(value, path, isExtractableFile) {\n if (path === void 0) {\n path = '';\n }\n\n if (isExtractableFile === void 0) {\n isExtractableFile = defaultIsExtractableFile;\n }\n\n var clone;\n var files = new Map();\n\n function addFile(paths, file) {\n var storedPaths = files.get(file);\n if (storedPaths) storedPaths.push.apply(storedPaths, paths);\n else files.set(file, paths);\n }\n\n if (isExtractableFile(value)) {\n clone = null;\n addFile([path], value);\n } else {\n var prefix = path ? path + '.' : '';\n if (typeof FileList !== 'undefined' && value instanceof FileList)\n clone = Array.prototype.map.call(value, function (file, i) {\n addFile(['' + prefix + i], file);\n return null;\n });\n else if (Array.isArray(value))\n clone = value.map(function (child, i) {\n var result = extractFiles(child, '' + prefix + i, isExtractableFile);\n result.files.forEach(addFile);\n return result.clone;\n });\n else if (value && value.constructor === Object) {\n clone = {};\n\n for (var i in value) {\n var result = extractFiles(value[i], '' + prefix + i, isExtractableFile);\n result.files.forEach(addFile);\n clone[i] = result.clone;\n }\n } else clone = value;\n }\n\n return {\n clone: clone,\n files: files,\n };\n};\n","'use strict';\n\nmodule.exports = require('extract-files/public/ReactNativeFile');\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().plow;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiDecorators;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MediaUiProvider = exports.useMediaUi = exports.MediaUiContext = void 0;\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar matcher_1 = require(\"matcher\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"../hooks\");\nvar Notify_1 = require(\"./Notify\");\nvar state_1 = require(\"../state\");\nvar asset_1 = require(\"../fragments/asset\");\nexports.MediaUiContext = react_1.createContext({});\nexports.useMediaUi = function () { return react_1.useContext(exports.MediaUiContext); };\nfunction MediaUiProvider(_a) {\n var children = _a.children, dummyImage = _a.dummyImage, _b = _a.selectionMode, selectionMode = _b === void 0 ? false : _b, _c = _a.isInNodeCreationDialog, isInNodeCreationDialog = _c === void 0 ? false : _c, _d = _a.onAssetSelection, onAssetSelection = _d === void 0 ? null : _d, containerRef = _a.containerRef, featureFlags = _a.featureFlags, _e = _a.constraints, constraints = _e === void 0 ? {} : _e, _f = _a.assetType, assetType = _f === void 0 ? 'all' : _f;\n var translate = src_1.useIntl().translate;\n var Notify = Notify_1.useNotify();\n var client = client_1.useApolloClient();\n var deleteAsset = hooks_1.useDeleteAsset().deleteAsset;\n var importAsset = hooks_1.useImportAsset().importAsset;\n var _g = hooks_1.useAssetsQuery(), assets = _g.assets, refetchAssets = _g.refetch;\n var setSelectedMediaType = recoil_1.useSetRecoilState(state_1.selectedMediaTypeState);\n // Set initial media type state\n react_1.useEffect(function () {\n if (assetType) {\n setSelectedMediaType(assetType);\n }\n }, [assetType, setSelectedMediaType]);\n var handleDeleteAsset = react_1.useCallback(function (asset) {\n // TODO: Use custom modal\n var confirm = window.confirm(translate('action.deleteAsset.confirm', 'Do you really want to delete the asset ' + asset.label, [\n asset.label,\n ]));\n if (!confirm)\n return new Promise(function () { return false; });\n return deleteAsset({ assetId: asset.id, assetSourceId: asset.assetSource.id })\n .then(function () {\n Notify.ok(translate('action.deleteAsset.success', 'The asset has been deleted'));\n return true;\n })\n .catch(function (_a) {\n var message = _a.message;\n // TODO: translate possible error message or generate one on server\n Notify.error(translate('action.deleteAsset.error', 'Error while trying to delete the asset'), message);\n return false;\n });\n }, [Notify, translate, deleteAsset]);\n var isAssetSelectable = react_1.useCallback(function (asset) {\n var _a, _b;\n if (((_a = constraints.mediaTypes) === null || _a === void 0 ? void 0 : _a.length) > 0) {\n if (!matcher_1.isMatch(asset.file.mediaType, constraints.mediaTypes)) {\n return false;\n }\n }\n if (((_b = constraints.assetSources) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n if (!matcher_1.isMatch(asset.assetSource.id, constraints.assetSources)) {\n return false;\n }\n }\n return true;\n }, [constraints]);\n // Handle selection mode for the secondary Neos UI inspector\n var handleSelectAsset = react_1.useCallback(function (assetIdentity) {\n if (!onAssetSelection || !assetIdentity) {\n return;\n }\n // Read local asset data from cache as the asset editor and the constraint check require it\n var asset = client.readFragment({\n fragment: client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment LocalAssetData on Asset {\\n ...AssetProps\\n }\\n \", \"\\n \"], [\"\\n fragment LocalAssetData on Asset {\\n ...AssetProps\\n }\\n \", \"\\n \"])), asset_1.ASSET_FRAGMENT),\n fragmentName: 'LocalAssetData',\n variables: {\n includeUsage: false,\n },\n id: client.cache.identify({ __typename: 'Asset', id: assetIdentity.assetId }),\n });\n if (!isAssetSelectable(asset)) {\n Notify.notice(translate('action.selectAsset.invalidType.message', 'You can only select any of the following types: {types}', {\n types: constraints.mediaTypes.join(', '),\n }));\n return;\n }\n if (asset.localId) {\n onAssetSelection(asset.localId);\n }\n else {\n // If no local id is present, we first need to import the asset from its remote source\n importAsset(assetIdentity).then(function (_a) {\n var data = _a.data;\n onAssetSelection(data.importAsset.localId);\n });\n }\n }, [client, importAsset, onAssetSelection, isAssetSelectable, translate, Notify, constraints.mediaTypes]);\n return (React.createElement(exports.MediaUiContext.Provider, { value: {\n containerRef: containerRef,\n dummyImage: dummyImage,\n handleDeleteAsset: handleDeleteAsset,\n handleSelectAsset: handleSelectAsset,\n selectionMode: selectionMode,\n isInNodeCreationDialog: isInNodeCreationDialog,\n assets: assets,\n refetchAssets: refetchAssets,\n featureFlags: featureFlags,\n constraints: constraints,\n assetType: assetType,\n isAssetSelectable: isAssetSelectable,\n } }, children));\n}\nexports.MediaUiProvider = MediaUiProvider;\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nfunction useAssetCollectionsQuery() {\n var _a = client_1.useQuery(queries_1.ASSET_COLLECTIONS), data = _a.data, loading = _a.loading;\n return { assetCollections: (data === null || data === void 0 ? void 0 : data.assetCollections) || [], loading: loading };\n}\nexports.default = useAssetCollectionsQuery;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n asset(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n asset(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IPTC_PROPERTY_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.IPTC_PROPERTY_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment IptcPropertyProps on IptcProperty {\\n propertyName\\n value\\n }\\n\"], [\"\\n fragment IptcPropertyProps on IptcProperty {\\n propertyName\\n value\\n }\\n\"])));\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FILE_FRAGMENT = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.FILE_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment FileProps on File {\\n extension\\n mediaType\\n typeIcon {\\n url\\n alt\\n }\\n size\\n url\\n }\\n\"], [\"\\n fragment FileProps on File {\\n extension\\n mediaType\\n typeIcon {\\n url\\n alt\\n }\\n size\\n url\\n }\\n\"])));\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar ASSETS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSETS(\\n $searchTerm: String\\n $assetSourceId: AssetSourceId\\n $assetCollectionId: AssetCollectionId\\n $mediaType: MediaType\\n $tagId: TagId\\n $limit: Int\\n $offset: Int\\n $sortBy: SortBy\\n $sortDirection: SortDirection\\n $includeUsage: Boolean = false\\n ) {\\n selectedAssetSourceId @client(always: true) @export(as: \\\"assetSourceId\\\")\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n assets(\\n searchTerm: $searchTerm\\n assetSourceId: $assetSourceId\\n assetCollectionId: $assetCollectionId\\n mediaType: $mediaType\\n tagId: $tagId\\n limit: $limit\\n offset: $offset\\n sortBy: $sortBy\\n sortDirection: $sortDirection\\n ) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSETS(\\n $searchTerm: String\\n $assetSourceId: AssetSourceId\\n $assetCollectionId: AssetCollectionId\\n $mediaType: MediaType\\n $tagId: TagId\\n $limit: Int\\n $offset: Int\\n $sortBy: SortBy\\n $sortDirection: SortDirection\\n $includeUsage: Boolean = false\\n ) {\\n selectedAssetSourceId @client(always: true) @export(as: \\\"assetSourceId\\\")\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n assets(\\n searchTerm: $searchTerm\\n assetSourceId: $assetSourceId\\n assetCollectionId: $assetCollectionId\\n mediaType: $mediaType\\n tagId: $tagId\\n limit: $limit\\n offset: $offset\\n sortBy: $sortBy\\n sortDirection: $sortDirection\\n ) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = ASSETS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetCollection_1 = require(\"../fragments/assetCollection\");\nvar ASSET_COLLECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_COLLECTION($id: AssetCollectionId!) {\\n assetCollection(id: $id) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_COLLECTION($id: AssetCollectionId!) {\\n assetCollection(id: $id) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"])), assetCollection_1.ASSET_COLLECTION_FRAGMENT);\nexports.default = ASSET_COLLECTION;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetCollection_1 = require(\"../fragments/assetCollection\");\nvar ASSET_COLLECTIONS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_COLLECTIONS {\\n assetCollections {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_COLLECTIONS {\\n assetCollections {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"])), assetCollection_1.ASSET_COLLECTION_FRAGMENT);\nexports.default = ASSET_COLLECTIONS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar ASSET_COUNT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_COUNT(\\n $searchTerm: String\\n $assetSourceId: AssetSourceId\\n $assetCollectionId: AssetCollectionId\\n $mediaType: MediaType\\n $tagId: TagId\\n ) {\\n selectedAssetSourceId @client(always: true) @export(as: \\\"assetSourceId\\\")\\n assetCount(\\n searchTerm: $searchTerm\\n assetSourceId: $assetSourceId\\n assetCollectionId: $assetCollectionId\\n mediaType: $mediaType\\n tagId: $tagId\\n )\\n }\\n\"], [\"\\n query ASSET_COUNT(\\n $searchTerm: String\\n $assetSourceId: AssetSourceId\\n $assetCollectionId: AssetCollectionId\\n $mediaType: MediaType\\n $tagId: TagId\\n ) {\\n selectedAssetSourceId @client(always: true) @export(as: \\\"assetSourceId\\\")\\n assetCount(\\n searchTerm: $searchTerm\\n assetSourceId: $assetSourceId\\n assetCollectionId: $assetCollectionId\\n mediaType: $mediaType\\n tagId: $tagId\\n )\\n }\\n\"])));\nexports.default = ASSET_COUNT;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetSource_1 = require(\"../fragments/assetSource\");\nvar ASSET_SOURCES = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_SOURCES {\\n assetSources {\\n ...AssetSourceProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_SOURCES {\\n assetSources {\\n ...AssetSourceProps\\n }\\n }\\n \", \"\\n\"])), assetSource_1.ASSET_SOURCE_FRAGMENT);\nexports.default = ASSET_SOURCES;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar CONFIG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query CONFIG {\\n config {\\n uploadMaxFileSize\\n uploadMaxFileUploadLimit\\n currentServerTime\\n }\\n }\\n\"], [\"\\n query CONFIG {\\n config {\\n uploadMaxFileSize\\n uploadMaxFileUploadLimit\\n currentServerTime\\n }\\n }\\n\"])));\nexports.default = CONFIG;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"../fragments/tag\");\nvar TAG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query TAG($id: TagId!) {\\n tag(id: $id) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query TAG($id: TagId!) {\\n tag(id: $id) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nexports.default = TAG;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"../fragments/tag\");\nvar TAGS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query TAGS {\\n tags {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n query TAGS {\\n tags {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nexports.default = TAGS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SET_SELECTED_ASSET_SOURCE_ID = exports.SELECTED_ASSET_SOURCE_ID = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.SELECTED_ASSET_SOURCE_ID = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query SelectedAssetSourceId {\\n selectedAssetSourceId @client(always: true)\\n }\\n\"], [\"\\n query SelectedAssetSourceId {\\n selectedAssetSourceId @client(always: true)\\n }\\n\"])));\nexports.SET_SELECTED_ASSET_SOURCE_ID = client_1.gql(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\\n }\\n\"], [\"\\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\\n }\\n\"])));\nvar templateObject_1, templateObject_2;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar queries_1 = require(\"../queries\");\nvar useSelectedTag_1 = __importDefault(require(\"./useSelectedTag\"));\nvar useSelectedAssetCollection_1 = __importDefault(require(\"./useSelectedAssetCollection\"));\nvar state_1 = require(\"../state\");\nfunction useAssetCountQuery() {\n var searchTerm = recoil_1.useRecoilValue(state_1.searchTermState);\n var selectedTag = useSelectedTag_1.default();\n var selectedAssetCollection = useSelectedAssetCollection_1.default();\n var _a = client_1.useQuery(queries_1.ASSET_COUNT, {\n variables: {\n assetCollectionId: selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id,\n tagId: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id,\n searchTerm: searchTerm,\n },\n }), data = _a.data, loading = _a.loading;\n return { assetCount: (data === null || data === void 0 ? void 0 : data.assetCount) || 0, loading: loading };\n}\nexports.default = useAssetCountQuery;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar currentPageState = recoil_1.atom({\n key: 'currentPageState',\n default: 1,\n});\nexports.default = currentPageState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar initialLoadCompleteState = recoil_1.atom({\n key: 'initialLoadComplete',\n default: false,\n});\nexports.default = initialLoadCompleteState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar loadingState = recoil_1.atom({\n key: 'loadingState',\n default: false,\n});\nexports.default = loadingState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar searchTermState = recoil_1.atom({\n key: 'searchTermState',\n default: '',\n});\nexports.default = searchTermState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedAssetCollectionIdState = recoil_1.atom({\n key: 'selectedAssetCollectionIdState',\n default: null,\n});\nexports.default = selectedAssetCollectionIdState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedMediaTypeState = recoil_1.atom({\n key: 'selectedMediaTypeState',\n default: 'all',\n});\nexports.default = selectedMediaTypeState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedTagIdState = recoil_1.atom({\n key: 'selectedTagIdState',\n default: null,\n});\nexports.default = selectedTagIdState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar provider_1 = require(\"../provider\");\nfunction useAssetSourcesQuery() {\n var constraints = provider_1.useMediaUi().constraints;\n var _a = client_1.useQuery(queries_1.ASSET_SOURCES), data = _a.data, loading = _a.loading;\n // Filter out sources that don't match the constraints\n var assetSources = react_1.useMemo(function () {\n var assetSources = (data === null || data === void 0 ? void 0 : data.assetSources) || [];\n return constraints.assetSources\n ? assetSources.filter(function (source) {\n return constraints.assetSources.includes(source.id);\n })\n : assetSources;\n }, [data === null || data === void 0 ? void 0 : data.assetSources, constraints.assetSources]);\n // TODO: Handle error if no asset sources are available\n return { assetSources: assetSources, loading: loading };\n}\nexports.default = useAssetSourcesQuery;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar useSelectedAssetCollection_1 = __importDefault(require(\"./useSelectedAssetCollection\"));\nvar useSelectedTag_1 = __importDefault(require(\"./useSelectedTag\"));\nvar pagination_1 = require(\"../constants/pagination\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar useAssetsQuery = function () {\n var searchTerm = recoil_1.useRecoilValue(state_1.searchTermState);\n var selectedAssetCollection = useSelectedAssetCollection_1.default();\n var selectedTag = useSelectedTag_1.default();\n var mediaTypeFilter = recoil_1.useRecoilValue(state_1.selectedMediaTypeState);\n var sortOrderState = recoil_1.useRecoilValue(state_1.selectedSortOrderState);\n var currentPage = recoil_1.useRecoilValue(state_1.currentPageState);\n var _a = recoil_1.useRecoilState(state_1.loadingState), isLoading = _a[0], setIsLoading = _a[1];\n var setInitialLoadComplete = recoil_1.useSetRecoilState(state_1.initialLoadCompleteState);\n var _b = react_1.useState([]), assets = _b[0], setAssets = _b[1];\n var limit = pagination_1.ASSETS_PER_PAGE;\n var offset = (currentPage - 1) * pagination_1.ASSETS_PER_PAGE;\n var _c = client_1.useLazyQuery(queries_1.ASSETS, {\n notifyOnNetworkStatusChange: false,\n variables: {\n searchTerm: searchTerm,\n assetCollectionId: selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id,\n mediaType: mediaTypeFilter,\n tagId: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id,\n limit: limit,\n offset: offset,\n sortBy: sortOrderState.sortBy,\n sortDirection: sortOrderState.sortDirection,\n },\n }), query = _c[0], _d = _c[1], loading = _d.loading, error = _d.error, data = _d.data, refetch = _d.refetch;\n react_1.useEffect(function () {\n if (!loading && !isLoading) {\n query({\n variables: {\n searchTerm: searchTerm,\n assetCollectionId: selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id,\n mediaType: mediaTypeFilter,\n tagId: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id,\n limit: limit,\n offset: offset,\n sortBy: sortOrderState.sortBy,\n sortDirection: sortOrderState.sortDirection,\n },\n });\n setIsLoading(true);\n }\n else if (data && !loading && isLoading) {\n setIsLoading(false);\n setInitialLoadComplete(true);\n setAssets(data.assets);\n // TODO: Update currentPage if asset count changes and current page exceeds limit\n }\n // Don't include `isLoading` to prevent constant reloads\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n query,\n data,\n loading,\n offset,\n limit,\n searchTerm,\n selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.title,\n mediaTypeFilter,\n selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id,\n sortOrderState,\n ]);\n return { error: error, assets: assets, refetch: refetch };\n};\nexports.default = useAssetsQuery;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar useConfigQuery = function () {\n var _a = client_1.useQuery(queries_1.CONFIG), data = _a.data, loading = _a.loading;\n return { config: data === null || data === void 0 ? void 0 : data.config, loading: loading };\n};\nexports.default = useConfigQuery;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar mutations_1 = require(\"../mutations\");\nfunction useCreateAssetCollection() {\n var _a = client_1.useMutation(mutations_1.CREATE_ASSET_COLLECTION), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var createAssetCollection = function (title) {\n return action({\n variables: {\n title: title,\n },\n update: function (cache, _a) {\n var data = _a.data;\n var assetCollections = cache.readQuery({ query: queries_1.ASSET_COLLECTIONS }).assetCollections;\n cache.writeQuery({\n query: queries_1.ASSET_COLLECTIONS,\n data: { assetCollections: assetCollections.concat([data === null || data === void 0 ? void 0 : data.createAssetCollection]) },\n });\n },\n });\n };\n return { createAssetCollection: createAssetCollection, data: data, error: error, loading: loading };\n}\nexports.default = useCreateAssetCollection;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetCollection_1 = require(\"../fragments/assetCollection\");\nvar CREATE_ASSET_COLLECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation CreateAssetCollection($title: String!) {\\n createAssetCollection(title: $title) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation CreateAssetCollection($title: String!) {\\n createAssetCollection(title: $title) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"])), assetCollection_1.ASSET_COLLECTION_FRAGMENT);\nexports.default = CREATE_ASSET_COLLECTION;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"../fragments/tag\");\nvar CREATE_TAG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nexports.default = CREATE_TAG;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar DELETE_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\\n }\\n\"], [\"\\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\\n }\\n\"])));\nexports.default = DELETE_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar DELETE_ASSET_COLLECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\\n deleteAssetCollection(id: $id) {\\n success\\n }\\n }\\n\"], [\"\\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\\n deleteAssetCollection(id: $id) {\\n success\\n }\\n }\\n\"])));\nexports.default = DELETE_ASSET_COLLECTION;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar DELETE_TAG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation DeleteTag($id: TagId!) {\\n deleteTag(id: $id)\\n }\\n\"], [\"\\n mutation DeleteTag($id: TagId!) {\\n deleteTag(id: $id)\\n }\\n\"])));\nexports.default = DELETE_TAG;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar IMPORT_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n importAsset(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n importAsset(id: $id, assetSourceId: $assetSourceId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = IMPORT_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar SET_ASSET_COLLECTIONS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation SetAssetCollections(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $assetCollectionIds: [AssetCollectionId!]!\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation SetAssetCollections(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $assetCollectionIds: [AssetCollectionId!]!\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = SET_ASSET_COLLECTIONS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar SET_ASSET_TAGS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation SetAssetTags(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $tagIds: [TagId!]!\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation SetAssetTags(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $tagIds: [TagId!]!\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = SET_ASSET_TAGS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar TAG_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = TAG_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar UNTAG_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = UNTAG_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar asset_1 = require(\"../fragments/asset\");\nvar UPDATE_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UpdateAsset(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $label: String\\n $caption: String\\n $copyrightNotice: String\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n updateAsset(\\n id: $id\\n assetSourceId: $assetSourceId\\n label: $label\\n caption: $caption\\n copyrightNotice: $copyrightNotice\\n ) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation UpdateAsset(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $label: String\\n $caption: String\\n $copyrightNotice: String\\n $includeUsage: Boolean = false\\n ) {\\n includeUsage @client(always: true) @export(as: \\\"includeUsage\\\")\\n updateAsset(\\n id: $id\\n assetSourceId: $assetSourceId\\n label: $label\\n caption: $caption\\n copyrightNotice: $copyrightNotice\\n ) {\\n ...AssetProps\\n }\\n }\\n \", \"\\n\"])), asset_1.ASSET_FRAGMENT);\nexports.default = UPDATE_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetCollection_1 = require(\"../fragments/assetCollection\");\nvar UPDATE_ASSET_COLLECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\\n ...AssetCollectionProps\\n }\\n }\\n \", \"\\n\"])), assetCollection_1.ASSET_COLLECTION_FRAGMENT);\nexports.default = UPDATE_ASSET_COLLECTION;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar tag_1 = require(\"../fragments/tag\");\nvar UPDATE_TAG = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UpdateTag($id: TagId!, $label: String) {\\n updateTag(id: $id, label: $label) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"], [\"\\n mutation UpdateTag($id: TagId!, $label: String) {\\n updateTag(id: $id, label: $label) {\\n ...TagProps\\n }\\n }\\n \", \"\\n\"])), tag_1.TAG_FRAGMENT);\nexports.default = UPDATE_TAG;\nvar templateObject_1;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar mutations_1 = require(\"../mutations\");\nfunction useCreateTag() {\n var _a = client_1.useMutation(mutations_1.CREATE_TAG), action = _a[0], _b = _a[1], error = _b.error, data = _b.data;\n var createTag = function (label, assetCollectionId) {\n return action({\n variables: { label: label, assetCollectionId: assetCollectionId },\n // FIXME: Optimistic response has to be adjusted as we don't know the id of the created tag\n // optimisticResponse: {\n // __typename: 'Mutation',\n // createTag: {\n // __typename: 'Tag',\n // label: label,\n // }\n // },\n update: function (proxy, _a) {\n var newTag = _a.data.createTag;\n var assetCollections = proxy.readQuery({ query: queries_1.ASSET_COLLECTIONS }).assetCollections;\n var updatedAssetCollections = assetCollections.map(function (assetCollection) {\n if (assetCollection.id === assetCollectionId) {\n return __assign(__assign({}, assetCollection), { tags: __spreadArrays(assetCollection.tags, [newTag]) });\n }\n return assetCollection;\n });\n proxy.writeQuery({\n query: queries_1.ASSET_COLLECTIONS,\n data: { assetCollections: updatedAssetCollections },\n });\n var tags = proxy.readQuery({ query: queries_1.TAGS }).tags;\n if (!tags.find(function (tag) { return (tag === null || tag === void 0 ? void 0 : tag.label) === (newTag === null || newTag === void 0 ? void 0 : newTag.label); })) {\n proxy.writeQuery({\n query: queries_1.TAGS,\n data: {\n tags: __spreadArrays(tags, [newTag]),\n },\n });\n }\n },\n });\n };\n return { createTag: createTag, data: data, error: error };\n}\nexports.default = useCreateTag;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar mutations_1 = require(\"../mutations\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar index_1 = require(\"./index\");\nvar events_1 = require(\"../events\");\nfunction useDeleteAsset() {\n var _a = client_1.useMutation(mutations_1.DELETE_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data;\n var _c = recoil_1.useRecoilState(state_1.selectedAssetIdState), selectedAssetId = _c[0], setSelectedAsset = _c[1];\n var assetRemoved = index_1.useEvent(events_1.assetRemovedEvent);\n // TODO: Check whether an optimisticResponse can be used here\n // Without a fast asset usage count retrieval a lot of negative responses are possible\n var deleteAsset = function (_a) {\n var assetId = _a.assetId, assetSourceId = _a.assetSourceId;\n return action({\n variables: { id: assetId, assetSourceId: assetSourceId },\n refetchQueries: [\n {\n query: queries_1.ASSET,\n variables: { id: assetId, assetSourceId: assetSourceId },\n },\n ],\n update: function (cache, _a) {\n var success = _a.data.deleteAsset;\n if (!success)\n return;\n // Remove deleted asset from cache\n cache.evict({ id: cache.identify({ __typename: 'Asset', id: assetId }) });\n cache.gc();\n },\n }).then(function (_a) {\n var success = _a.data.deleteAsset;\n if (!success) {\n throw new Error('Could not delete asset');\n }\n assetRemoved({ assetId: assetId, assetSourceId: assetSourceId });\n // Unselect currently selected asset if it was just deleted\n if (assetId === (selectedAssetId === null || selectedAssetId === void 0 ? void 0 : selectedAssetId.assetId)) {\n setSelectedAsset(null);\n }\n });\n };\n return { deleteAsset: deleteAsset, data: data, error: error };\n}\nexports.default = useDeleteAsset;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assetUpdatedEvent = exports.assetRemovedEvent = exports.assetCreatedEvent = void 0;\nvar createEvent_1 = require(\"./createEvent\");\nvar assetCreatedEvent = createEvent_1.createEvent('ASSET_CREATED');\nexports.assetCreatedEvent = assetCreatedEvent;\nvar assetRemovedEvent = createEvent_1.createEvent('ASSET_REMOVED');\nexports.assetRemovedEvent = assetRemovedEvent;\nvar assetUpdatedEvent = createEvent_1.createEvent('ASSET_UPDATED');\nexports.assetUpdatedEvent = assetUpdatedEvent;\n","/**\n * Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk\n * License: MIT - http://mrgnrdrck.mit-license.org\n *\n * https://github.com/mroderick/PubSubJS\n */\n\n(function (root, factory){\n 'use strict';\n\n var PubSub = {};\n root.PubSub = PubSub;\n factory(PubSub);\n // CommonJS and Node.js module support\n if (typeof exports === 'object'){\n if (module !== undefined && module.exports) {\n exports = module.exports = PubSub; // Node.js specific `module.exports`\n }\n exports.PubSub = PubSub; // CommonJS module 1.1.1 spec\n module.exports = exports = PubSub; // CommonJS\n }\n // AMD support\n /* eslint-disable no-undef */\n else if (typeof define === 'function' && define.amd){\n define(function() { return PubSub; });\n /* eslint-enable no-undef */\n }\n\n}(( typeof window === 'object' && window ) || this, function (PubSub){\n 'use strict';\n\n var messages = {},\n lastUid = -1,\n ALL_SUBSCRIBING_MSG = '*';\n\n function hasKeys(obj){\n var key;\n\n for (key in obj){\n if ( Object.prototype.hasOwnProperty.call(obj, key) ){\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns a function that throws the passed exception, for use as argument for setTimeout\n * @alias throwException\n * @function\n * @param { Object } ex An Error object\n */\n function throwException( ex ){\n return function reThrowException(){\n throw ex;\n };\n }\n\n function callSubscriberWithDelayedExceptions( subscriber, message, data ){\n try {\n subscriber( message, data );\n } catch( ex ){\n setTimeout( throwException( ex ), 0);\n }\n }\n\n function callSubscriberWithImmediateExceptions( subscriber, message, data ){\n subscriber( message, data );\n }\n\n function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){\n var subscribers = messages[matchedMessage],\n callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions,\n s;\n\n if ( !Object.prototype.hasOwnProperty.call( messages, matchedMessage ) ) {\n return;\n }\n\n for (s in subscribers){\n if ( Object.prototype.hasOwnProperty.call(subscribers, s)){\n callSubscriber( subscribers[s], originalMessage, data );\n }\n }\n }\n\n function createDeliveryFunction( message, data, immediateExceptions ){\n return function deliverNamespaced(){\n var topic = String( message ),\n position = topic.lastIndexOf( '.' );\n\n // deliver the message as it is now\n deliverMessage(message, message, data, immediateExceptions);\n\n // trim the hierarchy and deliver message to each level\n while( position !== -1 ){\n topic = topic.substr( 0, position );\n position = topic.lastIndexOf('.');\n deliverMessage( message, topic, data, immediateExceptions );\n }\n\n deliverMessage(message, ALL_SUBSCRIBING_MSG, data, immediateExceptions);\n };\n }\n\n function hasDirectSubscribersFor( message ) {\n var topic = String( message ),\n found = Boolean(Object.prototype.hasOwnProperty.call( messages, topic ) && hasKeys(messages[topic]));\n\n return found;\n }\n\n function messageHasSubscribers( message ){\n var topic = String( message ),\n found = hasDirectSubscribersFor(topic) || hasDirectSubscribersFor(ALL_SUBSCRIBING_MSG),\n position = topic.lastIndexOf( '.' );\n\n while ( !found && position !== -1 ){\n topic = topic.substr( 0, position );\n position = topic.lastIndexOf( '.' );\n found = hasDirectSubscribersFor(topic);\n }\n\n return found;\n }\n\n function publish( message, data, sync, immediateExceptions ){\n message = (typeof message === 'symbol') ? message.toString() : message;\n\n var deliver = createDeliveryFunction( message, data, immediateExceptions ),\n hasSubscribers = messageHasSubscribers( message );\n\n if ( !hasSubscribers ){\n return false;\n }\n\n if ( sync === true ){\n deliver();\n } else {\n setTimeout( deliver, 0 );\n }\n return true;\n }\n\n /**\n * Publishes the message, passing the data to it's subscribers\n * @function\n * @alias publish\n * @param { String } message The message to publish\n * @param {} data The data to pass to subscribers\n * @return { Boolean }\n */\n PubSub.publish = function( message, data ){\n return publish( message, data, false, PubSub.immediateExceptions );\n };\n\n /**\n * Publishes the message synchronously, passing the data to it's subscribers\n * @function\n * @alias publishSync\n * @param { String } message The message to publish\n * @param {} data The data to pass to subscribers\n * @return { Boolean }\n */\n PubSub.publishSync = function( message, data ){\n return publish( message, data, true, PubSub.immediateExceptions );\n };\n\n /**\n * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if you need to unsubscribe\n * @function\n * @alias subscribe\n * @param { String } message The message to subscribe to\n * @param { Function } func The function to call when a new message is published\n * @return { String }\n */\n PubSub.subscribe = function( message, func ){\n if ( typeof func !== 'function'){\n return false;\n }\n\n message = (typeof message === 'symbol') ? message.toString() : message;\n\n // message is not registered yet\n if ( !Object.prototype.hasOwnProperty.call( messages, message ) ){\n messages[message] = {};\n }\n\n // forcing token as String, to allow for future expansions without breaking usage\n // and allow for easy use as key names for the 'messages' object\n var token = 'uid_' + String(++lastUid);\n messages[message][token] = func;\n\n // return token for unsubscribing\n return token;\n };\n\n PubSub.subscribeAll = function( func ){\n return PubSub.subscribe(ALL_SUBSCRIBING_MSG, func);\n };\n\n /**\n * Subscribes the passed function to the passed message once\n * @function\n * @alias subscribeOnce\n * @param { String } message The message to subscribe to\n * @param { Function } func The function to call when a new message is published\n * @return { PubSub }\n */\n PubSub.subscribeOnce = function( message, func ){\n var token = PubSub.subscribe( message, function(){\n // before func apply, unsubscribe message\n PubSub.unsubscribe( token );\n func.apply( this, arguments );\n });\n return PubSub;\n };\n\n /**\n * Clears all subscriptions\n * @function\n * @public\n * @alias clearAllSubscriptions\n */\n PubSub.clearAllSubscriptions = function clearAllSubscriptions(){\n messages = {};\n };\n\n /**\n * Clear subscriptions by the topic\n * @function\n * @public\n * @alias clearAllSubscriptions\n * @return { int }\n */\n PubSub.clearSubscriptions = function clearSubscriptions(topic){\n var m;\n for (m in messages){\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){\n delete messages[m];\n }\n }\n };\n\n /**\n Count subscriptions by the topic\n * @function\n * @public\n * @alias countSubscriptions\n * @return { Array }\n */\n PubSub.countSubscriptions = function countSubscriptions(topic){\n var m;\n // eslint-disable-next-line no-unused-vars\n var token;\n var count = 0;\n for (m in messages) {\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0) {\n for (token in messages[m]) {\n count++;\n }\n break;\n }\n }\n return count;\n };\n\n\n /**\n Gets subscriptions by the topic\n * @function\n * @public\n * @alias getSubscriptions\n */\n PubSub.getSubscriptions = function getSubscriptions(topic){\n var m;\n var list = [];\n for (m in messages){\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){\n list.push(m);\n }\n }\n return list;\n };\n\n /**\n * Removes subscriptions\n *\n * - When passed a token, removes a specific subscription.\n *\n\t * - When passed a function, removes all subscriptions for that function\n *\n\t * - When passed a topic, removes all subscriptions for that topic (hierarchy)\n * @function\n * @public\n * @alias subscribeOnce\n * @param { String | Function } value A token, function or topic to unsubscribe from\n * @example // Unsubscribing with a token\n * var token = PubSub.subscribe('mytopic', myFunc);\n * PubSub.unsubscribe(token);\n * @example // Unsubscribing with a function\n * PubSub.unsubscribe(myFunc);\n * @example // Unsubscribing from a topic\n * PubSub.unsubscribe('mytopic');\n */\n PubSub.unsubscribe = function(value){\n var descendantTopicExists = function(topic) {\n var m;\n for ( m in messages ){\n if ( Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0 ){\n // a descendant of the topic exists:\n return true;\n }\n }\n\n return false;\n },\n isTopic = typeof value === 'string' && ( Object.prototype.hasOwnProperty.call(messages, value) || descendantTopicExists(value) ),\n isToken = !isTopic && typeof value === 'string',\n isFunction = typeof value === 'function',\n result = false,\n m, message, t;\n\n if (isTopic){\n PubSub.clearSubscriptions(value);\n return;\n }\n\n for ( m in messages ){\n if ( Object.prototype.hasOwnProperty.call( messages, m ) ){\n message = messages[m];\n\n if ( isToken && message[value] ){\n delete message[value];\n result = value;\n // tokens are unique, so we can just stop here\n break;\n }\n\n if (isFunction) {\n for ( t in message ){\n if (Object.prototype.hasOwnProperty.call(message, t) && message[t] === value){\n delete message[t];\n result = true;\n }\n }\n }\n }\n }\n\n return result;\n };\n}));\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar mutations_1 = require(\"../mutations\");\nfunction useDeleteAssetCollection() {\n var _a = client_1.useMutation(mutations_1.DELETE_ASSET_COLLECTION), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var deleteAssetCollection = function (id) {\n return action({\n variables: {\n id: id,\n },\n optimisticResponse: {\n deleteAssetCollection: {\n success: true,\n __typename: 'DeleteAssetCollectionResult',\n },\n },\n update: function (cache) {\n var assetCollections = cache.readQuery({ query: queries_1.ASSET_COLLECTIONS }).assetCollections;\n cache.writeQuery({\n query: queries_1.ASSET_COLLECTIONS,\n data: { assetCollections: assetCollections.filter(function (c) { return c.id !== id; }) },\n });\n },\n });\n };\n return { deleteAssetCollection: deleteAssetCollection, data: data, error: error, loading: loading };\n}\nexports.default = useDeleteAssetCollection;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../state\");\nvar queries_1 = require(\"../queries\");\nvar mutations_1 = require(\"../mutations\");\nfunction useDeleteTag() {\n var _a = client_1.useMutation(mutations_1.DELETE_TAG), action = _a[0], _b = _a[1], error = _b.error, data = _b.data;\n var _c = recoil_1.useRecoilState(state_1.selectedTagIdState), selectedTagId = _c[0], setSelectedTagId = _c[1];\n var deleteTag = function (id) {\n return action({\n variables: { id: id },\n optimisticResponse: {\n __typename: 'Mutation',\n deleteTag: true,\n },\n update: function (proxy, _a) {\n var success = _a.data.deleteTag;\n if (!success)\n return;\n var assetCollections = proxy.readQuery({ query: queries_1.ASSET_COLLECTIONS }).assetCollections;\n var updatedAssetCollections = assetCollections.map(function (assetCollection) {\n return __assign(__assign({}, assetCollection), { tags: assetCollection.tags.filter(function (tag) { return (tag === null || tag === void 0 ? void 0 : tag.id) !== id; }) });\n });\n proxy.writeQuery({\n query: queries_1.ASSET_COLLECTIONS,\n data: { assetCollections: updatedAssetCollections },\n });\n var tags = proxy.readQuery({ query: queries_1.TAGS }).tags;\n proxy.writeQuery({\n query: queries_1.TAGS,\n data: {\n tags: tags.filter(function (tag) { return tag.id !== id; }),\n },\n });\n },\n }).then(function (success) {\n // Unselect currently selected tag if it was just deleted\n if (success && id === selectedTagId) {\n setSelectedTagId(null);\n }\n });\n };\n return { deleteTag: deleteTag, data: data, error: error };\n}\nexports.default = useDeleteTag;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction useEvent(event) {\n return event;\n}\nexports.default = useEvent;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useImportAsset() {\n var _a = client_1.useMutation(mutations_1.IMPORT_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var importAsset = function (assetIdentity) {\n return action({\n variables: {\n id: assetIdentity.assetId,\n assetSourceId: assetIdentity.assetSourceId,\n },\n });\n };\n return { importAsset: importAsset, data: data, error: error, loading: loading };\n}\nexports.default = useImportAsset;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar provider_1 = require(\"../provider\");\nvar state_1 = require(\"../state\");\nvar selectedInspectorViewState_1 = __importDefault(require(\"../state/selectedInspectorViewState\"));\nvar useSelectAsset = function () {\n var setSelectedAssetId = recoil_1.useSetRecoilState(state_1.selectedAssetIdState);\n var setSelectedInspectorView = recoil_1.useSetRecoilState(selectedInspectorViewState_1.default);\n var handleSelectAsset = provider_1.useMediaUi().handleSelectAsset;\n return react_1.useCallback(function (assetIdentity) {\n if (!assetIdentity)\n return;\n setSelectedAssetId(assetIdentity);\n handleSelectAsset(assetIdentity);\n setSelectedInspectorView('asset');\n }, [setSelectedAssetId, handleSelectAsset, setSelectedInspectorView]);\n};\nexports.default = useSelectAsset;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../state\");\nvar useSelectAssetCollection = function () {\n var setSelectedAssetCollectionId = recoil_1.useSetRecoilState(state_1.selectedAssetCollectionIdState);\n var setSelectedTagId = recoil_1.useSetRecoilState(state_1.selectedTagIdState);\n var setSelectedAssetId = recoil_1.useSetRecoilState(state_1.selectedAssetIdState);\n var setSelectedInspectorView = recoil_1.useSetRecoilState(state_1.selectedInspectorViewState);\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n return react_1.useCallback(function (assetCollection) {\n setSelectedInspectorView('assetCollection');\n setSelectedTagId(null);\n setSelectedAssetId(null);\n setCurrentPage(1);\n setSelectedAssetCollectionId(assetCollection === null || assetCollection === void 0 ? void 0 : assetCollection.id);\n }, [setSelectedInspectorView, setSelectedTagId, setSelectedAssetId, setCurrentPage, setSelectedAssetCollectionId]);\n};\nexports.default = useSelectAssetCollection;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar queries_1 = require(\"../queries\");\nvar index_1 = require(\"./index\");\nvar state_1 = require(\"../state\");\nvar useSelectAssetSource = function () {\n var selectedAssetSourceQuery = client_1.useQuery(queries_1.SELECTED_ASSET_SOURCE_ID);\n var selectedAssetSourceId = selectedAssetSourceQuery.data.selectedAssetSourceId;\n var assetSources = index_1.useAssetSourcesQuery().assetSources;\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n var selectedAssetSource = react_1.useMemo(function () { return assetSources.find(function (assetSource) { return assetSource.id === selectedAssetSourceId; }); }, [assetSources, selectedAssetSourceId]);\n var mutateSelectedAssetSourceId = client_1.useMutation(queries_1.SET_SELECTED_ASSET_SOURCE_ID)[0];\n var setSelectedAssetSource = react_1.useCallback(function (assetSource) {\n setCurrentPage(1);\n return mutateSelectedAssetSourceId({\n variables: { selectedAssetSourceId: assetSource.id },\n });\n }, [mutateSelectedAssetSourceId, setCurrentPage]);\n return [selectedAssetSource, setSelectedAssetSource];\n};\nexports.default = useSelectAssetSource;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../state\");\nvar selectedInspectorViewState_1 = __importDefault(require(\"../state/selectedInspectorViewState\"));\nvar useSelectTag = function () {\n var setSelectedAssetCollectionId = recoil_1.useSetRecoilState(state_1.selectedAssetCollectionIdState);\n var setSelectedTagId = recoil_1.useSetRecoilState(state_1.selectedTagIdState);\n var setSelectedAssetId = recoil_1.useSetRecoilState(state_1.selectedAssetIdState);\n var setSelectedInspectorView = recoil_1.useSetRecoilState(selectedInspectorViewState_1.default);\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n return react_1.useCallback(function (tag, assetCollection) {\n if (assetCollection === void 0) { assetCollection = null; }\n setSelectedInspectorView('tag');\n setSelectedAssetCollectionId(assetCollection === null || assetCollection === void 0 ? void 0 : assetCollection.id);\n setSelectedTagId(tag === null || tag === void 0 ? void 0 : tag.id);\n setCurrentPage(1);\n setSelectedAssetId(null);\n }, [setCurrentPage, setSelectedAssetCollectionId, setSelectedAssetId, setSelectedInspectorView, setSelectedTagId]);\n};\nexports.default = useSelectTag;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar selectedAssetIdState_1 = __importDefault(require(\"../state/selectedAssetIdState\"));\nvar useAssetQuery_1 = __importDefault(require(\"./useAssetQuery\"));\nvar useSelectedAsset = function () {\n var selectedAssetId = recoil_1.useRecoilValue(selectedAssetIdState_1.default);\n var asset = useAssetQuery_1.default(selectedAssetId).asset;\n return asset;\n};\nexports.default = useSelectedAsset;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useSetAssetCollections() {\n var _a = client_1.useMutation(mutations_1.SET_ASSET_COLLECTIONS), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var setAssetCollections = function (_a) {\n var asset = _a.asset, assetCollections = _a.assetCollections;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n assetCollectionIds: assetCollections.map(function (c) { return c.id; }),\n },\n optimisticResponse: {\n __typename: 'Mutation',\n setAssetCollections: __assign(__assign({}, asset), { collections: assetCollections }),\n },\n });\n };\n return { setAssetCollections: setAssetCollections, data: data, error: error, loading: loading };\n}\nexports.default = useSetAssetCollections;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useSetAssetTags() {\n var _a = client_1.useMutation(mutations_1.SET_ASSET_TAGS), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var setAssetTags = function (_a) {\n var asset = _a.asset, tags = _a.tags;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n tagIds: tags.map(function (tag) { return tag.id; }),\n },\n optimisticResponse: {\n __typename: 'Mutation',\n setAssetTags: __assign(__assign({}, asset), { tags: tags }),\n },\n });\n };\n return { setAssetTags: setAssetTags, data: data, error: error, loading: loading };\n}\nexports.default = useSetAssetTags;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nfunction useAssetTagsQuery() {\n var _a = client_1.useQuery(queries_1.TAGS), data = _a.data, loading = _a.loading;\n return { tags: (data === null || data === void 0 ? void 0 : data.tags) || [], loading: loading };\n}\nexports.default = useAssetTagsQuery;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUntagAsset() {\n var _a = client_1.useMutation(mutations_1.UNTAG_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var untagAsset = function (_a) {\n var asset = _a.asset, tagName = _a.tagName;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n tag: tagName,\n },\n optimisticResponse: {\n __typename: 'Mutation',\n untagAsset: __assign(__assign({}, asset), { tags: __spreadArrays(asset.tags.filter(function (tag) { return tag.label !== tagName; })) }),\n },\n });\n };\n return { untagAsset: untagAsset, data: data, error: error, loading: loading };\n}\nexports.default = useUntagAsset;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUpdateAsset() {\n var _a = client_1.useMutation(mutations_1.UPDATE_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var updateAsset = function (_a) {\n var asset = _a.asset, label = _a.label, caption = _a.caption, copyrightNotice = _a.copyrightNotice;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n label: label,\n caption: caption,\n copyrightNotice: copyrightNotice,\n },\n optimisticResponse: {\n __typename: 'Mutation',\n updateAsset: __assign(__assign({}, asset), { label: label,\n caption: caption,\n copyrightNotice: copyrightNotice }),\n },\n });\n };\n return { updateAsset: updateAsset, data: data, error: error, loading: loading };\n}\nexports.default = useUpdateAsset;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUpdateAssetCollection() {\n var _a = client_1.useMutation(mutations_1.UPDATE_ASSET_COLLECTION), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var updateAssetCollection = function (_a) {\n var assetCollection = _a.assetCollection, title = _a.title, tags = _a.tags;\n return action({\n variables: {\n id: assetCollection.id,\n title: title,\n tagIds: tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return tag.id; }),\n },\n optimisticResponse: {\n updateAssetCollection: __assign(__assign(__assign(__assign({}, assetCollection), { title: title }), (title\n ? {\n title: title,\n }\n : {})), (tags\n ? {\n tags: tags,\n }\n : {})),\n },\n });\n };\n return { updateAssetCollection: updateAssetCollection, data: data, error: error, loading: loading };\n}\nexports.default = useUpdateAssetCollection;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUpdateTag() {\n var _a = client_1.useMutation(mutations_1.UPDATE_TAG), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var updateTag = function (_a) {\n var tag = _a.tag, label = _a.label;\n return action({\n variables: {\n id: tag.id,\n label: label,\n },\n optimisticResponse: {\n updateTag: __assign(__assign(__assign({}, tag), { label: label }), (label\n ? {\n label: label,\n }\n : {})),\n },\n });\n };\n return { updateTag: updateTag, data: data, error: error, loading: loading };\n}\nexports.default = useUpdateTag;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IntlProvider = exports.useIntl = exports.IntlContext = void 0;\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nexports.IntlContext = react_1.createContext(null);\nexports.useIntl = function () { return react_1.useContext(exports.IntlContext); };\nfunction IntlProvider(_a) {\n var children = _a.children, translate = _a.translate;\n return React.createElement(exports.IntlContext.Provider, { value: { translate: translate } }, children);\n}\nexports.IntlProvider = IntlProvider;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MediaUiThemeProvider = exports.createUseMediaUiStyles = exports.useMediaUiTheme = void 0;\nvar React = __importStar(require(\"react\"));\nvar react_jss_1 = require(\"react-jss\");\nvar jss_1 = __importDefault(require(\"jss\"));\nvar jss_plugin_cache_1 = __importDefault(require(\"jss-plugin-cache\"));\nvar styleConstants_1 = require(\"@neos-project/build-essentials/src/styles/styleConstants\");\nvar ThemeContext = React.createContext({});\nvar theming = react_jss_1.createTheming(ThemeContext);\nvar ThemeProvider = theming.ThemeProvider, useTheme = theming.useTheme;\njss_1.default.use(jss_plugin_cache_1.default());\n// Extend theme config from Neos.Ui package\nvar mediaUiTheme = {\n spacing: styleConstants_1.config.spacing,\n fontSize: __assign(__assign({}, styleConstants_1.config.fontSize), { large: '18px' }),\n size: __assign(__assign({}, styleConstants_1.config.size), { sidebarWidth: '250px', scrollbarSize: '4px' }),\n colors: {\n primary: styleConstants_1.config.colors.primaryBlue,\n text: styleConstants_1.config.colors.contrastBright,\n mainBackground: styleConstants_1.config.colors.contrastNeutral,\n alternatingBackground: styleConstants_1.config.colors.contrastDark,\n border: styleConstants_1.config.colors.contrastDark,\n inactive: styleConstants_1.config.colors.contrastBright,\n success: styleConstants_1.config.colors.success,\n warn: styleConstants_1.config.colors.warn,\n error: styleConstants_1.config.colors.error,\n generated: styleConstants_1.config.colors.success,\n warning: styleConstants_1.config.colors.warn,\n deleted: styleConstants_1.config.colors.error,\n disabled: styleConstants_1.config.colors.contrastDark,\n assetBackground: styleConstants_1.config.colors.contrastDarkest,\n captionBackground: styleConstants_1.config.colors.contrastNeutral,\n moduleBackground: styleConstants_1.config.colors.contrastDarker,\n scrollbarBackground: 'transparent',\n scrollbarForeground: styleConstants_1.config.colors.contrastBright,\n },\n transition: styleConstants_1.config.transition,\n loadingIndicatorZIndex: 10024,\n paginationZIndex: 10022,\n lightboxZIndex: 10023,\n};\nexports.useMediaUiTheme = useTheme;\nexports.createUseMediaUiStyles = function (styles) {\n return react_jss_1.createUseStyles(styles, { theming: theming });\n};\nfunction MediaUiThemeProvider(_a) {\n var children = _a.children;\n return React.createElement(ThemeProvider, { theme: mediaUiTheme }, children);\n}\nexports.MediaUiThemeProvider = MediaUiThemeProvider;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getDisplayName;\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');\n}","function cachePlugin() {\n var cache = new WeakMap();\n\n function onCreateRule(name, decl, _ref) {\n var parent = _ref.parent;\n return parent && name ? cache.get(parent.rules.raw[name]) || null : null;\n }\n\n function onProcessRule(rule) {\n var _rule$options = rule.options,\n sheet = _rule$options.sheet,\n parent = _rule$options.parent;\n\n if (!parent || sheet && sheet.options.link) {\n return;\n }\n\n var originalStyle = parent.rules.raw[rule.key];\n if (!cache.get(originalStyle)) cache.set(originalStyle, rule);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}\n\nexport default cachePlugin;\n","const upperFirst = require('lodash.upperfirst');\n\n// Global CSS variables for Neos.Ui\nconst config = {\n spacing: {\n goldenUnit: '40px',\n full: '16px',\n half: '8px',\n quarter: '4px'\n },\n size: {\n sidebarWidth: '320px'\n },\n transition: {\n fast: '.1s',\n default: '.25s',\n slow: '.5s'\n },\n zIndex: {\n secondaryToolbar: ['linkIconButtonFlyout'],\n flashMessageContainer: '6',\n loadingIndicatorContainer: '5',\n secondaryInspector: ['context', 'iframe', 'close'],\n secondaryInspectorElevated: ['context', 'dropdownContents'],\n dialog: ['context'],\n fullScreenClose: ['context'],\n drawer: ['context'],\n bar: ['context'],\n primaryToolbar: '4',\n checkboxInput: ['context'],\n dropdownContents: ['context'],\n selectBoxContents: '3',\n notInlineEditableOverlay: ['context'],\n calendarFakeInputMirror: ['context'],\n rdtPicker: ['context'],\n sideBar: ['dropTargetBefore', 'dropTargetAfter'],\n wrapperDropdown: ['context'],\n unappliedChangesOverlay: ['context'],\n nodeToolBar: '2147483646'\n },\n fontSize: {\n base: '14px',\n small: '12px'\n },\n fonts: {\n headings: {\n family: 'Noto Sans',\n style: 'Regular',\n cssWeight: '400'\n },\n copy: {\n family: 'Noto Sans',\n style: 'Regular',\n cssWeight: '400'\n }\n },\n colors: {\n primaryViolet: '#26224C',\n primaryVioletHover: '#342f5f',\n primaryBlue: '#00ADEE',\n primaryBlueHover: '#35c3f8',\n contrastDarkest: '#141414',\n contrastDarker: '#222',\n contrastDark: '#3f3f3f',\n contrastNeutral: '#323232',\n contrastBright: '#999',\n contrastBrighter: '#adadad',\n contrastBrightest: '#FFF',\n success: '#00a338',\n successHover: '#0bb344',\n warn: '#ff8700',\n warnHover: '#fda23d',\n error: '#ff460d',\n errorHover: '#ff6a3c',\n uncheckedCheckboxTick: '#5B5B5B'\n }\n};\n\nconst generateCssVarsObject = (subject = config, predicate = '') => {\n const hasPredicate = predicate && predicate.length;\n let target = {};\n\n Object.keys(subject).forEach(key => {\n const val = subject[key];\n const camelKey = upperFirst(key);\n const nestedPredicate = hasPredicate ? predicate + camelKey : key;\n\n if (Array.isArray(val)) {\n val.forEach((item, index) => {\n target[`--${predicate}-${camelKey}-${upperFirst(item)}`] = `${index + 1}`;\n });\n } else if (typeof val === 'object') {\n target = Object.assign({}, target, generateCssVarsObject(val, nestedPredicate));\n } else {\n target[`--${predicate}-${camelKey}`] = val;\n }\n });\n\n return target;\n};\n\nmodule.exports = {\n config,\n generateCssVarsObject\n};\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe23',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20f0',\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nmodule.exports = upperFirst;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Dialog = void 0;\nvar React = __importStar(require(\"react\"));\nvar ReactDOM = __importStar(require(\"react-dom\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\n//\n// @TODO: Remove this once https://github.com/neos/neos-ui/issues/2925 is solved.\n//\nexports.Dialog = function (props) {\n var dialogRef = React.useRef();\n React.useEffect(function () {\n var _a;\n if (dialogRef.current) {\n var section = ReactDOM.findDOMNode(dialogRef.current); // eslint-disable-line react/no-find-dom-node\n (_a = section === null || section === void 0 ? void 0 : section.firstElementChild) === null || _a === void 0 ? void 0 : _a.setAttribute('data-ignore_click_outside', 'true');\n }\n }, [dialogRef]);\n return React.createElement(react_ui_components_1.Dialog, __assign({}, props, { ref: dialogRef }));\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction humanFileSize(bytes, si) {\n if (si === void 0) { si = false; }\n var thresh = si ? 1000 : 1024;\n if (Math.abs(bytes) < thresh) {\n return bytes + ' B';\n }\n var units = si\n ? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n : ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];\n var u = -1;\n do {\n bytes /= thresh;\n ++u;\n } while (Math.abs(bytes) >= thresh && u < units.length - 1);\n return bytes.toFixed(1) + ' ' + units[u];\n}\nexports.default = humanFileSize;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateLocalState = exports.resetLocalState = exports.restoreLocalState = exports.getItem = void 0;\nvar queries_1 = require(\"@media-ui/core/src/queries\");\nvar neos_1 = require(\"@media-ui/core/src/constants/neos\");\nvar hooks_1 = require(\"../hooks\");\nvar queries_2 = require(\"../queries\");\nvar src_1 = require(\"@media-ui/feature-clipboard/src\");\nvar STORAGE_PREFIX = 'flowpack.mediaui';\nfunction writeToCache(cache, _a) {\n var _b = _a.selectedAssetSourceId, selectedAssetSourceId = _b === void 0 ? undefined : _b, _c = _a.viewModeSelection, viewModeSelection = _c === void 0 ? undefined : _c, _d = _a.clipboard, clipboard = _d === void 0 ? undefined : _d;\n if (selectedAssetSourceId !== undefined) {\n cache.writeQuery({\n query: queries_1.SELECTED_ASSET_SOURCE_ID,\n data: { selectedAssetSourceId: selectedAssetSourceId },\n });\n }\n if (viewModeSelection !== undefined) {\n cache.writeQuery({\n query: queries_2.VIEW_MODE_SELECTION,\n data: { viewModeSelection: viewModeSelection },\n });\n }\n if (clipboard !== undefined) {\n cache.writeQuery({\n query: src_1.CLIPBOARD,\n data: { clipboard: clipboard },\n });\n }\n}\nfunction getItem(key) {\n try {\n return JSON.parse(localStorage.getItem(STORAGE_PREFIX + \".\" + key));\n }\n catch (e) {\n console.error(\"Could not parse item \\\"\" + key + \"\\\" from storage\", e);\n }\n return undefined;\n}\nexports.getItem = getItem;\nfunction restoreLocalState(cache, constraints) {\n var _a;\n if (constraints === void 0) { constraints = {}; }\n var selectedAssetSourceId = getItem('selectedAssetSourceId') || neos_1.NEOS_ASSET_SOURCE;\n if (((_a = constraints.assetSources) === null || _a === void 0 ? void 0 : _a.length) > 0 && !constraints.assetSources.includes(selectedAssetSourceId)) {\n selectedAssetSourceId = constraints.assetSources[0];\n }\n var viewModeSelection = getItem('viewModeSelection') || hooks_1.VIEW_MODES.Thumbnails;\n var clipboard = getItem('clipboard') || {};\n writeToCache(cache, { selectedAssetSourceId: selectedAssetSourceId, viewModeSelection: viewModeSelection, clipboard: clipboard });\n}\nexports.restoreLocalState = restoreLocalState;\nfunction resetLocalState(cache) {\n writeToCache(cache, {\n selectedAssetSourceId: neos_1.NEOS_ASSET_SOURCE,\n viewModeSelection: hooks_1.VIEW_MODES.Thumbnails,\n clipboard: {},\n });\n}\nexports.resetLocalState = resetLocalState;\nfunction updateLocalState(data, cache) {\n Object.keys(data).forEach(function (key) {\n localStorage.setItem(STORAGE_PREFIX + \".\" + key, JSON.stringify(data[key]));\n });\n writeToCache(cache, __assign({}, data));\n}\nexports.updateLocalState = updateLocalState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VIEW_MODES = void 0;\nvar client_1 = require(\"@apollo/client\");\nvar queries_1 = require(\"../queries\");\nvar VIEW_MODES;\n(function (VIEW_MODES) {\n VIEW_MODES[\"Thumbnails\"] = \"thumbnails\";\n VIEW_MODES[\"List\"] = \"list\";\n})(VIEW_MODES = exports.VIEW_MODES || (exports.VIEW_MODES = {}));\nfunction useViewModeSelection() {\n var viewModeSelectionQuery = client_1.useQuery(queries_1.VIEW_MODE_SELECTION);\n var viewModeSelection = viewModeSelectionQuery.data.viewModeSelection;\n var mutateViewModeSelection = client_1.useMutation(queries_1.SET_VIEW_MODE_SELECTION)[0];\n var setViewModeSelection = function (viewMode) {\n return mutateViewModeSelection({\n variables: { viewModeSelection: viewMode },\n });\n };\n return [viewModeSelection, setViewModeSelection];\n}\nexports.default = useViewModeSelection;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SET_VIEW_MODE_SELECTION = exports.VIEW_MODE_SELECTION = void 0;\nvar client_1 = require(\"@apollo/client\");\nexports.VIEW_MODE_SELECTION = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ViewModeSelection {\\n viewModeSelection @client(always: true)\\n }\\n\"], [\"\\n query ViewModeSelection {\\n viewModeSelection @client(always: true)\\n }\\n\"])));\nexports.SET_VIEW_MODE_SELECTION = client_1.gql(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n mutation SetViewModeSelection($viewModeSelection: String) {\\n setViewModeSelection(viewModeSelection: $viewModeSelection) @client\\n }\\n\"], [\"\\n mutation SetViewModeSelection($viewModeSelection: String) {\\n setViewModeSelection(viewModeSelection: $viewModeSelection) @client\\n }\\n\"])));\nvar templateObject_1, templateObject_2;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_1 = require(\"@media-ui/feature-asset-usage/src\");\nvar state_1 = require(\"../state\");\nvar useAssetCount = function () {\n var assetCount = hooks_1.useAssetCountQuery().assetCount;\n var mainView = recoil_1.useRecoilValue(state_1.mainViewState);\n var _a = src_1.useUnusedAssetCountQuery(), unusedAssetCountLoaded = _a.called, loadUnusedAssetCount = _a.load, unusedAssetCount = _a.unusedAssetCount;\n var count = mainView === state_1.MainViewState.UNUSED_ASSETS ? unusedAssetCount : assetCount;\n react_1.useEffect(function () {\n if (mainView === state_1.MainViewState.UNUSED_ASSETS && !unusedAssetCountLoaded)\n loadUnusedAssetCount();\n }, [mainView, unusedAssetCountLoaded, loadUnusedAssetCount]);\n return count;\n};\nexports.default = useAssetCount;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UsageDetailsMetadataType = void 0;\nvar UsageDetailsMetadataType;\n(function (UsageDetailsMetadataType) {\n UsageDetailsMetadataType[\"TEXT\"] = \"TEXT\";\n UsageDetailsMetadataType[\"DATE\"] = \"DATE\";\n UsageDetailsMetadataType[\"DATETIME\"] = \"DATETIME\";\n UsageDetailsMetadataType[\"URL\"] = \"URL\";\n})(UsageDetailsMetadataType = exports.UsageDetailsMetadataType || (exports.UsageDetailsMetadataType = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar assetUsageDetailsModalState_1 = __importDefault(require(\"../state/assetUsageDetailsModalState\"));\nvar useAssetUsages_1 = __importDefault(require(\"../hooks/useAssetUsages\"));\nvar AssetUsageSection_1 = __importDefault(require(\"./AssetUsageSection\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetUsage: {\n padding: theme.spacing.full,\n '& section + section': {\n marginTop: theme.spacing.full,\n },\n },\n usageTable: {\n width: '100%',\n '& th': {\n fontWeight: 'bold',\n },\n '& td, & th': {\n padding: theme.spacing.quarter,\n '&:first-child': {\n paddingLeft: 0,\n },\n '&:last-child': {\n paddingRight: 0,\n },\n },\n '.neos & a': {\n color: theme.colors.primary,\n '&:hover': {\n color: theme.colors.primary,\n textDecoration: 'underline',\n },\n },\n },\n}); });\nvar AssetUsagesModal = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var _a = recoil_1.useRecoilState(assetUsageDetailsModalState_1.default), isOpen = _a[0], setIsOpen = _a[1];\n var asset = hooks_1.useSelectedAsset();\n var _b = useAssetUsages_1.default(asset ? { assetId: asset.id, assetSourceId: asset.assetSource.id } : null), assetUsageDetails = _b.assetUsageDetails, loading = _b.loading;\n var handleRequestClose = react_1.useCallback(function () { return setIsOpen(false); }, [setIsOpen]);\n return (React.createElement(react_ui_components_1.Dialog, { isOpen: isOpen, title: translate('assetUsage.title', \"Usage details for \" + asset.label, { asset: asset.label }), onRequestClose: handleRequestClose, style: \"wide\", actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: handleRequestClose }, translate('assetUsage.cancel', 'Cancel')),\n ] },\n React.createElement(\"div\", { className: classes.assetUsage }, (assetUsageDetails === null || assetUsageDetails === void 0 ? void 0 : assetUsageDetails.length) > 0 ? (assetUsageDetails.map(function (usageDetailsGroup, index) { return (React.createElement(AssetUsageSection_1.default, { key: index, usageDetailsGroup: usageDetailsGroup })); })) : (React.createElement(\"span\", null, loading\n ? translate('assetUsagesModal.loading', 'Loading...')\n : translate('assetUsagesModal.noResults', 'No results'))))));\n};\nexports.default = React.memo(AssetUsagesModal);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n usageSection: {\n '& h2': {\n fontWeight: 'bold',\n },\n },\n usageTable: {\n width: '100%',\n marginTop: theme.spacing.full,\n '& th': {\n fontWeight: 'bold',\n },\n '& td, & th': {\n padding: theme.spacing.quarter,\n '&:first-child': {\n paddingLeft: 0,\n },\n '&:last-child': {\n paddingRight: 0,\n },\n },\n '.neos & a': {\n color: theme.colors.primary,\n '&:hover': {\n color: theme.colors.primary,\n textDecoration: 'underline',\n },\n },\n },\n}); });\nvar AssetUsageSection = function (_a) {\n var usageDetailsGroup = _a.usageDetailsGroup;\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var label = usageDetailsGroup.label, usages = usageDetailsGroup.usages, metadataSchema = usageDetailsGroup.metadataSchema;\n return (React.createElement(\"section\", { className: classes.usageSection },\n React.createElement(\"h2\", null, label),\n usages.length > 0 && (React.createElement(\"table\", { className: classes.usageTable },\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"th\", null, translate('assetUsageSection.label', 'Label')),\n metadataSchema.map(function (schema, index) { return (React.createElement(\"th\", { key: index }, schema.label)); }))),\n React.createElement(\"tbody\", null, usages.map(function (assetUsage, index) { return (React.createElement(\"tr\", { key: index },\n React.createElement(\"td\", null,\n React.createElement(\"a\", { href: assetUsage.url, target: \"_blank\", rel: \"noreferrer\" }, assetUsage.label)),\n metadataSchema.map(function (_a, index) {\n var name = _a.name, type = _a.type;\n var usage = assetUsage.metadata.find(function (usage) { return usage.name == name; });\n return usage ? (React.createElement(\"td\", { key: index }, type == 'DATETIME' || type == 'DATE' ? (new Date(usage.value).toLocaleString()) : type == 'URL' ? (React.createElement(\"a\", { href: usage.value, target: \"_blank\", rel: \"noreferrer\" }, name)) : (usage.value))) : null;\n }))); }))))));\n};\nexports.default = React.memo(AssetUsageSection);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar assetUsageDetailsModalState_1 = __importDefault(require(\"../state/assetUsageDetailsModalState\"));\nvar AssetUsagesToggleButton = function () {\n var _a = recoil_1.useRecoilState(assetUsageDetailsModalState_1.default), assetUsagesModalOpen = _a[0], setAssetUsagesModalOpen = _a[1];\n var translate = src_1.useIntl().translate;\n // TODO: Resolve actual usage when calculation is fast enough or data has been preloaded\n var usage = 1;\n return (React.createElement(react_ui_components_1.Button, { disabled: !usage, size: \"regular\", style: assetUsagesModalOpen ? 'brand' : 'lighter', hoverStyle: \"brand\", onClick: function () { return setAssetUsagesModalOpen(true); } }, translate('assetUsageList.toggle', 'Show usages')));\n};\nexports.default = React.memo(AssetUsagesToggleButton);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar client_1 = require(\"@apollo/client\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar pagination_1 = require(\"@media-ui/core/src/constants/pagination\");\nvar unusedAssets_1 = __importDefault(require(\"../queries/unusedAssets\"));\nvar showUnusedAssetsState_1 = __importDefault(require(\"../state/showUnusedAssetsState\"));\nvar useUnusedAssetsQuery = function () {\n var currentPage = recoil_1.useRecoilValue(state_1.currentPageState);\n var _a = recoil_1.useRecoilState(state_1.loadingState), isLoading = _a[0], setIsLoading = _a[1];\n var showUnusedAssets = recoil_1.useRecoilValue(showUnusedAssetsState_1.default);\n var _b = react_1.useState([]), assets = _b[0], setAssets = _b[1];\n var limit = pagination_1.ASSETS_PER_PAGE;\n var offset = (currentPage - 1) * pagination_1.ASSETS_PER_PAGE;\n var _c = client_1.useLazyQuery(unusedAssets_1.default, {\n notifyOnNetworkStatusChange: false,\n variables: {\n limit: limit,\n offset: offset,\n },\n }), query = _c[0], _d = _c[1], loading = _d.loading, error = _d.error, data = _d.data, refetch = _d.refetch;\n react_1.useEffect(function () {\n if (showUnusedAssets && !loading && !isLoading) {\n query({\n variables: {\n limit: limit,\n offset: offset,\n },\n });\n setIsLoading(true);\n }\n else if (data && !loading && isLoading) {\n setIsLoading(false);\n setAssets(data.unusedAssets);\n // TODO: Update currentPage if asset count changes and current page exceeds limit\n }\n // Don't include `isLoading` to prevent constant reloads\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [query, data, loading, offset, limit, showUnusedAssets]);\n return { error: error, assets: assets, refetch: refetch };\n};\nexports.default = useUnusedAssetsQuery;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar unusedAssetCount_1 = __importDefault(require(\"./unusedAssetCount\"));\nfunction useUnusedAssetCountQuery() {\n var _a = client_1.useLazyQuery(unusedAssetCount_1.default), load = _a[0], _b = _a[1], called = _b.called, loading = _b.loading, data = _b.data;\n return { called: called, load: load, unusedAssetCount: (data === null || data === void 0 ? void 0 : data.unusedAssetCount) || 0, loading: loading };\n}\nexports.default = useUnusedAssetCountQuery;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar UNUSED_ASSET_COUNT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query UNUSED_ASSET_COUNT {\\n unusedAssetCount\\n }\\n\"], [\"\\n query UNUSED_ASSET_COUNT {\\n unusedAssetCount\\n }\\n\"])));\nexports.default = UNUSED_ASSET_COUNT;\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar createAssetCollectionDialogState = recoil_1.atom({\n key: 'createAssetCollectionDialogState',\n default: {\n visible: false,\n title: '',\n },\n});\nexports.default = createAssetCollectionDialogState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar recoil_1 = require(\"recoil\");\nvar createTagDialogState = recoil_1.atom({\n key: 'createTagDialogState',\n default: {\n visible: false,\n label: '',\n },\n});\nexports.default = createTagDialogState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MainViewState = exports.mainViewState = void 0;\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/feature-clipboard/src\");\nvar src_2 = require(\"@media-ui/feature-asset-usage/src\");\nvar MainViewState;\n(function (MainViewState) {\n MainViewState[MainViewState[\"DEFAULT\"] = 0] = \"DEFAULT\";\n MainViewState[MainViewState[\"CLIPBOARD\"] = 1] = \"CLIPBOARD\";\n MainViewState[MainViewState[\"UNUSED_ASSETS\"] = 2] = \"UNUSED_ASSETS\";\n})(MainViewState || (MainViewState = {}));\nexports.MainViewState = MainViewState;\nvar mainViewState = recoil_1.selector({\n key: 'mainViewState',\n get: function (_a) {\n var get = _a.get;\n var clipboardVisible = get(src_1.clipboardVisibleState);\n var showUnusedAssets = get(src_2.showUnusedAssetsState);\n if (clipboardVisible)\n return MainViewState.CLIPBOARD;\n if (showUnusedAssets)\n return MainViewState.UNUSED_ASSETS;\n return MainViewState.DEFAULT;\n },\n});\nexports.mainViewState = mainViewState;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar ClipboardItem_1 = __importDefault(require(\"./ClipboardItem\"));\nvar useClipboard_1 = __importDefault(require(\"../hooks/useClipboard\"));\nvar clipboardVisibleState_1 = __importDefault(require(\"../state/clipboardVisibleState\"));\nvar useStyles = src_1.createUseMediaUiStyles({\n clipboard: {\n height: '100%',\n alignSelf: 'flex-end',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n userSelect: 'none',\n margin: '0 -.3rem',\n '& > *': {\n margin: '0 .3rem',\n },\n },\n});\nvar ClipboardToggle = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var clipboard = useClipboard_1.default().clipboard;\n var _a = recoil_1.useRecoilState(clipboardVisibleState_1.default), clipboardVisible = _a[0], setClipboardVisible = _a[1];\n var initialLoadComplete = recoil_1.useRecoilValue(state_1.initialLoadCompleteState);\n var toggleClipboard = react_1.useCallback(function () { return setClipboardVisible(function (prev) { return !prev; }); }, [setClipboardVisible]);\n var size = Object.keys(clipboard).length;\n if (!initialLoadComplete)\n return null;\n return (React.createElement(\"div\", { className: classes.clipboard },\n React.createElement(react_ui_components_1.Button, { disabled: size === 0, size: \"regular\", style: clipboardVisible ? 'brand' : 'lighter', hoverStyle: \"brand\", onClick: toggleClipboard },\n translate('clipboard.toggle', 'Clipboard'),\n \" (\",\n size,\n \")\"),\n Object.values(clipboard)\n .slice()\n .reverse()\n .slice(0, 3)\n .map(function (assetIdentity) { return (React.createElement(ClipboardItem_1.default, { key: assetIdentity.assetId, assetIdentity: assetIdentity })); })));\n};\nexports.default = React.memo(ClipboardToggle);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar useClipboard_1 = __importDefault(require(\"../hooks/useClipboard\"));\nvar clipboardVisibleState_1 = __importDefault(require(\"../state/clipboardVisibleState\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n clipboardActions: {\n display: 'flex',\n alignItems: 'baseline',\n backgroundColor: theme.colors.captionBackground,\n },\n}); });\nvar ClipboardActions = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var clipboardVisible = recoil_1.useRecoilValue(clipboardVisibleState_1.default);\n var _a = useClipboard_1.default(), clipboard = _a.clipboard, flushClipboard = _a.flushClipboard;\n var deleteAsset = hooks_1.useDeleteAsset().deleteAsset;\n var Notify = src_1.useNotify();\n var onDeleteClipboard = react_1.useCallback(function () {\n if (!confirm(translate('clipboard.deleteAssets.confirm', 'Delete all assets in the clipboard?')))\n return;\n Promise.all(Object.values(clipboard).map(function (assetIdentity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, deleteAsset(assetIdentity)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); }))\n .then(function () {\n Notify.ok(translate('clipboard.deleteAssets.success', 'The assets have been deleted'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('clipboard.deleteAssets.error', 'Error while trying to delete the assets'), message);\n });\n }, [translate, clipboard, deleteAsset, Notify]);\n var onFlushClipboard = react_1.useCallback(function () {\n if (!confirm(translate('clipboard.flush.confirm', 'Remove all assets from clipboard?')))\n return;\n flushClipboard();\n }, [flushClipboard, translate]);\n if (!clipboardVisible)\n return null;\n return (React.createElement(\"div\", { className: classes.clipboardActions },\n React.createElement(react_ui_components_1.IconButton, { title: translate('clipboard.deleteAsset', 'Delete all assets in clipboard'), icon: \"trash\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\", onClick: onDeleteClipboard }),\n React.createElement(react_ui_components_1.IconButton, { title: translate('clipboard.flush', 'Flush clipboard'), icon: \"clipboard\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\", onClick: onFlushClipboard })));\n};\nexports.default = React.memo(ClipboardActions);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar events_1 = require(\"@media-ui/core/src/events\");\nvar index_1 = require(\"../index\");\n/**\n * Renderless component to keep the clipboard updated when certain event occur\n */\nvar ClipboardWatcher = function () {\n var toggleClipboardState = index_1.useClipboard().toggleClipboardState;\n var assetRemoved = hooks_1.useEvent(events_1.assetRemovedEvent);\n react_1.useEffect(function () {\n var onAssetDelete = function (topic, assetIdentity) {\n toggleClipboardState(assetIdentity, false);\n };\n var token = assetRemoved.subscribe(onAssetDelete);\n return function () {\n assetRemoved.unsubscribe(token);\n };\n }, [toggleClipboardState, assetRemoved]);\n return null;\n};\nexports.default = ClipboardWatcher;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\n/**\n * This resolver is used by the Apollo Cache to allow identifying\n * the entities for modification, especially for optimistic responses.\n *\n * This is only helpful for entities without unique ids\n */\nfunction IdFromObjectResolver(object) {\n var id = object.__typename + \"_\";\n switch (object.__typename) {\n case 'Image':\n return id + object.url;\n case 'AssetFile':\n return id + object.url;\n default:\n return client_1.defaultDataIdFromObject(object);\n }\n}\nexports.default = IdFromObjectResolver;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar error_1 = require(\"@apollo/client/link/error\");\n// TODO: Use NotificationHandler to show simplified error message to user\nvar ApolloErrorHandler = error_1.onError(function (_a) {\n var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError;\n if (graphQLErrors) {\n graphQLErrors.map(function (data) {\n return console.error(data.extensions.category === 'internal' ? '[Internal server error]' : '[GraphQL error]', data.path, data);\n });\n }\n if (networkError)\n console.error(\"[Network error]: \" + networkError);\n});\nexports.default = ApolloErrorHandler;\n","import { __extends } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nexport function onError(errorHandler) {\n return new ApolloLink(function (operation, forward) {\n return new Observable(function (observer) {\n var sub;\n var retriedSub;\n var retriedResult;\n try {\n sub = forward(operation).subscribe({\n next: function (result) {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation: operation,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: function (networkError) {\n retriedResult = errorHandler({\n operation: operation,\n networkError: networkError,\n graphQLErrors: networkError &&\n networkError.result &&\n networkError.result.errors,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: function () {\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n }\n catch (e) {\n errorHandler({ networkError: e, operation: operation, forward: forward });\n observer.error(e);\n }\n return function () {\n if (sub)\n sub.unsubscribe();\n if (retriedSub)\n sub.unsubscribe();\n };\n });\n });\n}\nvar ErrorLink = (function (_super) {\n __extends(ErrorLink, _super);\n function ErrorLink(errorHandler) {\n var _this = _super.call(this) || this;\n _this.link = onError(errorHandler);\n return _this;\n }\n ErrorLink.prototype.request = function (operation, forward) {\n return this.link.request(operation, forward);\n };\n return ErrorLink;\n}(ApolloLink));\nexport { ErrorLink };\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar index_1 = require(\"./index\");\nvar CacheFactory = /** @class */ (function () {\n function CacheFactory() {\n }\n CacheFactory.createCache = function (featureFlags) {\n return new client_1.InMemoryCache({\n dataIdFromObject: index_1.IdFromObjectResolver,\n typePolicies: {\n Query: {\n fields: {\n // These resolvers allow fetching single entities from the cache that were already retrieved from any previous query\n asset: function (_, _a) {\n var args = _a.args, toReference = _a.toReference;\n return args.id ? toReference({ __typename: 'Asset', id: args.id }) : null;\n },\n tag: function (_, _a) {\n var args = _a.args, toReference = _a.toReference;\n return args.id ? toReference({ __typename: 'Tag', id: args.id }) : null;\n },\n assetCollection: function (_, _a) {\n var args = _a.args, toReference = _a.toReference;\n return args.id ? toReference({ __typename: 'AssetCollection', id: args.id }) : null;\n },\n includeUsage: function () {\n return featureFlags.queryAssetUsage;\n },\n },\n },\n Mutation: {\n fields: {\n includeUsage: function () {\n return featureFlags.queryAssetUsage;\n },\n },\n },\n Asset: {\n keyFields: ['id'],\n fields: {\n isInClipboard: function (_, _a) {\n var variables = _a.variables;\n var clipboard = index_1.PersistentStateManager.getItem('clipboard') || [];\n return {}.hasOwnProperty.call(clipboard, variables.id);\n },\n },\n },\n Tag: {\n keyFields: ['id'],\n },\n AssetCollection: {\n keyFields: ['id'],\n },\n AssetSource: {\n keyFields: ['id'],\n },\n },\n });\n };\n return CacheFactory;\n}());\nexports.default = CacheFactory;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-asset-usage/src\");\nvar src_3 = require(\"@media-ui/feature-clipboard/src\");\nvar src_4 = require(\"@media-ui/feature-concurrent-editing/src\");\nvar src_5 = require(\"@media-ui/feature-similar-assets/src\");\nvar state_1 = require(\"@media-ui/feature-asset-upload/src/state\");\nvar components_1 = require(\"@media-ui/feature-asset-upload/src/components\");\nvar src_6 = require(\"@media-ui/feature-asset-preview/src\");\nvar SideBarLeft_1 = require(\"./SideBarLeft\");\nvar SideBarRight_1 = require(\"./SideBarRight\");\nvar LoadingIndicator_1 = __importDefault(require(\"./LoadingIndicator\"));\nvar BottomBar_1 = require(\"./BottomBar\");\nvar TopBar_1 = require(\"./TopBar\");\nvar Main_1 = require(\"./Main\");\nvar ErrorBoundary_1 = __importDefault(require(\"./ErrorBoundary\"));\nvar state_2 = require(\"../state\");\nvar Dialogs_1 = require(\"./Dialogs\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n container: function (_a) {\n var selectionMode = _a.selectionMode, isInNodeCreationDialog = _a.isInNodeCreationDialog;\n return ({\n display: 'grid',\n // TODO: Find a way to not calculate height to allow scrolling in main grid area\n height: isInNodeCreationDialog\n ? \"calc(100% - 61px - 8px)\" // Remove bottom bar and add padding\n : \"calc(100vh - 48px - 61px - 41px)\",\n gridTemplateRows: '40px 1fr',\n gridTemplateColumns: selectionMode\n ? theme.size.sidebarWidth + ' 1fr'\n : theme.size.sidebarWidth + ' 1fr ' + theme.size.sidebarWidth,\n gridTemplateAreas: selectionMode\n ? \"\\n \\\"left top\\\"\\n \\\"left main\\\"\\n \"\n : \"\\n \\\"left top right\\\"\\n \\\"left main right\\\"\\n \",\n gridGap: theme.spacing.full,\n lineHeight: 1.5,\n overflow: 'hidden',\n });\n },\n gridColumn: {\n height: '100%',\n overflowY: 'auto',\n },\n gridRight: {\n extend: 'gridColumn',\n gridArea: 'right',\n },\n gridLeft: {\n extend: 'gridColumn',\n gridArea: 'left',\n },\n gridMain: {\n extend: 'gridColumn',\n gridArea: 'main',\n },\n gridTop: {\n gridArea: 'top',\n },\n '@global': {\n '#media-ui-app': {\n scrollbarWidth: 'thin',\n scrollbarColor: theme.colors.scrollbarForeground + \" \" + theme.colors.scrollbarBackground,\n '& ::-webkit-scrollbar': {\n width: theme.size.scrollbarSize,\n },\n '& ::-webkit-scrollbar-track': {\n background: theme.colors.scrollbarBackground,\n },\n '& ::-webkit-scrollbar-thumb': {\n backgroundColor: theme.colors.scrollbarForeground,\n },\n },\n '.neos.neos-module-management-mediaui > .neos-module-wrap': {\n paddingLeft: '1rem',\n paddingRight: '1rem',\n paddingTop: '3rem',\n paddingBottom: '0',\n },\n // Hack to prevent a dropdown to be behind the bottom bar - issue #79\n 'body > [class*=\"_selectBox__contents_\"]': {\n zIndex: 99999,\n },\n },\n}); });\nvar App = function () {\n var _a = src_1.useMediaUi(), selectionMode = _a.selectionMode, isInNodeCreationDialog = _a.isInNodeCreationDialog, containerRef = _a.containerRef;\n var showUploadDialog = recoil_1.useRecoilValue(state_1.uploadDialogVisibleState).visible;\n var showCreateTagDialog = recoil_1.useRecoilValue(state_2.createTagDialogState).visible;\n var showCreateAssetCollectionDialog = recoil_1.useRecoilValue(state_2.createAssetCollectionDialogState).visible;\n var showAssetUsagesModal = recoil_1.useRecoilValue(src_2.assetUsageDetailsModalState);\n var showSimilarAssetsModal = recoil_1.useRecoilValue(src_5.similarAssetsModalState);\n var classes = useStyles({ selectionMode: selectionMode, isInNodeCreationDialog: isInNodeCreationDialog });\n return (React.createElement(\"div\", { className: classes.container, ref: containerRef },\n React.createElement(LoadingIndicator_1.default, null),\n React.createElement(\"div\", { className: classes.gridLeft },\n React.createElement(ErrorBoundary_1.default, null,\n React.createElement(SideBarLeft_1.SideBarLeft, null))),\n React.createElement(\"div\", { className: classes.gridTop },\n React.createElement(TopBar_1.TopBar, null)),\n React.createElement(\"div\", { className: classes.gridMain },\n React.createElement(ErrorBoundary_1.default, null,\n React.createElement(Main_1.Main, null))),\n React.createElement(BottomBar_1.BottomBar, null),\n !selectionMode && (React.createElement(\"div\", { className: classes.gridRight },\n React.createElement(ErrorBoundary_1.default, null,\n React.createElement(SideBarRight_1.SideBarRight, null)))),\n React.createElement(src_6.AssetPreview, null),\n showAssetUsagesModal && React.createElement(src_2.AssetUsagesModal, null),\n showUploadDialog && React.createElement(components_1.UploadDialog, null),\n showCreateTagDialog && React.createElement(Dialogs_1.CreateTagDialog, null),\n showCreateAssetCollectionDialog && React.createElement(Dialogs_1.CreateAssetCollectionDialog, null),\n showSimilarAssetsModal && React.createElement(src_5.SimilarAssetsModal, null),\n React.createElement(src_3.ClipboardWatcher, null),\n React.createElement(src_4.ConcurrentChangeMonitor, null)));\n};\nexports.default = React.memo(App);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssetChangeType = exports.changedAssets = exports.useChangedAssetsQuery = exports.ConcurrentChangeMonitor = void 0;\nvar ConcurrentChangeMonitor_1 = __importDefault(require(\"./components/ConcurrentChangeMonitor\"));\nexports.ConcurrentChangeMonitor = ConcurrentChangeMonitor_1.default;\nvar useChangedAssetsQuery_1 = __importStar(require(\"./hooks/useChangedAssetsQuery\"));\nexports.useChangedAssetsQuery = useChangedAssetsQuery_1.default;\nObject.defineProperty(exports, \"AssetChangeType\", { enumerable: true, get: function () { return useChangedAssetsQuery_1.AssetChangeType; } });\nvar changedAssets_1 = __importDefault(require(\"./queries/changedAssets\"));\nexports.changedAssets = changedAssets_1.default;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar neos_1 = require(\"@media-ui/core/src/constants/neos\");\nvar events_1 = require(\"@media-ui/core/src/events\");\nvar useChangedAssetsQuery_1 = __importStar(require(\"../hooks/useChangedAssetsQuery\"));\n/**\n * Renderless component to watch for remote changes, update cached assets and inform the user if necessary\n */\nvar ConcurrentChangeMonitor = function () {\n var changedAssets = useChangedAssetsQuery_1.default();\n var refetchAsset = hooks_1.useAssetQuery().refetch;\n var refetchAssets = hooks_1.useAssetsQuery().refetch;\n react_1.useEffect(function () {\n changedAssets === null || changedAssets === void 0 ? void 0 : changedAssets.forEach(function (change) {\n switch (change.type) {\n case useChangedAssetsQuery_1.AssetChangeType.ASSET_REPLACED:\n case useChangedAssetsQuery_1.AssetChangeType.ASSET_UPDATED:\n refetchAsset({ id: change.assetId, assetSourceId: neos_1.NEOS_ASSET_SOURCE }).then(function () {\n // TODO: Show some notification in the ui\n console.info(change.assetId, change.type, 'An asset was updated due to a remote change');\n });\n events_1.assetUpdatedEvent({ assetId: change.assetId, assetSourceId: neos_1.NEOS_ASSET_SOURCE });\n break;\n case useChangedAssetsQuery_1.AssetChangeType.ASSET_CREATED:\n refetchAssets().then(function () {\n // TODO: Show some notification in the ui\n console.info(change.assetId, change.type, 'An asset was created remotely');\n });\n events_1.assetCreatedEvent({ assetId: change.assetId, assetSourceId: neos_1.NEOS_ASSET_SOURCE });\n break;\n case useChangedAssetsQuery_1.AssetChangeType.ASSET_REMOVED:\n refetchAssets().then(function () {\n // TODO: Show some notification in the ui\n console.info(change.assetId, change.type, 'An asset was removed remotely');\n });\n events_1.assetRemovedEvent({ assetId: change.assetId, assetSourceId: neos_1.NEOS_ASSET_SOURCE });\n break;\n default:\n console.debug(change, 'unhandled remote change');\n }\n });\n }, [changedAssets, refetchAsset, refetchAssets]);\n return null;\n};\nexports.default = React.memo(ConcurrentChangeMonitor);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar similarAssetsModalState_1 = __importDefault(require(\"../state/similarAssetsModalState\"));\nvar SimilarAssetsToggleButton = function () {\n var _a = recoil_1.useRecoilState(similarAssetsModalState_1.default), similarAssetsModalOpen = _a[0], setSimilarAssetsModalOpen = _a[1];\n var translate = src_1.useIntl().translate;\n return (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: similarAssetsModalOpen ? 'brand' : 'lighter', hoverStyle: \"brand\", onClick: function () { return setSimilarAssetsModalOpen(true); } }, translate('similarAssetsModal.show', 'Show similar assets')));\n};\nexports.default = React.memo(SimilarAssetsToggleButton);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar similarAssetsModalState_1 = __importDefault(require(\"../state/similarAssetsModalState\"));\nvar useSimilarAssets_1 = __importDefault(require(\"../hooks/useSimilarAssets\"));\nvar SimilarAsset_1 = __importDefault(require(\"./SimilarAsset\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetUsage: {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',\n gridGap: theme.spacing.full,\n padding: theme.spacing.full,\n },\n}); });\nvar SimilarAssetsModal = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var _a = recoil_1.useRecoilState(similarAssetsModalState_1.default), isOpen = _a[0], setIsOpen = _a[1];\n var asset = hooks_1.useSelectedAsset();\n var _b = useSimilarAssets_1.default(asset ? { assetId: asset.id, assetSourceId: asset.assetSource.id } : null), similarAssets = _b.similarAssets, loading = _b.loading;\n var handleRequestClose = react_1.useCallback(function () { return setIsOpen(false); }, [setIsOpen]);\n return (React.createElement(react_ui_components_1.Dialog, { isOpen: isOpen, title: translate('similarAssetsModal.title', \"Similar assets to \" + asset.label, { asset: asset.label }), onRequestClose: handleRequestClose, style: \"wide\", actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: handleRequestClose }, translate('similarAssetsModal.cancel', 'Cancel')),\n ] },\n React.createElement(\"div\", { className: classes.assetUsage }, (similarAssets === null || similarAssets === void 0 ? void 0 : similarAssets.length) > 0 ? (similarAssets.map(function (asset, index) { return React.createElement(SimilarAsset_1.default, { key: index, asset: asset }); })) : (React.createElement(\"span\", null, loading\n ? translate('similarAssetsModal.loading', 'Loading...')\n : translate('similarAssetsModal.noResults', 'No results'))))));\n};\nexports.default = React.memo(SimilarAssetsModal);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n similarAsset: {\n margin: '0',\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n },\n picture: {\n backgroundColor: theme.colors.assetBackground,\n '& img': {\n display: 'block',\n height: '250px',\n width: '100%',\n objectFit: 'contain',\n },\n },\n caption: {\n backgroundColor: theme.colors.captionBackground,\n transition: \"background-color \" + theme.transition.fast,\n padding: theme.spacing.half,\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n '& img': {\n width: '1.3rem',\n height: 'auto',\n marginRight: theme.spacing.half,\n },\n },\n}); });\nvar SimilarAsset = function (_a) {\n var asset = _a.asset;\n var classes = useStyles();\n var dummyImage = src_1.useMediaUi().dummyImage;\n return (React.createElement(\"figure\", { className: classes.similarAsset },\n React.createElement(\"picture\", { className: classes.picture },\n React.createElement(\"img\", { src: !asset ? dummyImage : asset.thumbnailUrl, alt: asset === null || asset === void 0 ? void 0 : asset.label })),\n React.createElement(\"figcaption\", { className: classes.caption }, asset && (React.createElement(React.Fragment, null,\n React.createElement(\"img\", { src: asset.file.typeIcon.url, alt: asset.file.typeIcon.alt }),\n React.createElement(\"span\", null, asset.label))))));\n};\nexports.default = React.memo(SimilarAsset);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../state\");\nvar uploadDialogVisibleState_1 = require(\"../state/uploadDialogVisibleState\");\nvar useUploadDialogState = function () {\n // TODO: Use reducer instead to manage the state of files in their various states -> simplifies code in dialogs\n var _a = react_1.useState({\n selected: [],\n finished: [],\n rejected: [],\n }), files = _a[0], setFiles = _a[1];\n var _b = recoil_1.useRecoilState(state_1.uploadDialogVisibleState), dialogState = _b[0], setDialogState = _b[1];\n var handleClose = react_1.useCallback(function () {\n // Make sure to revoke the data uris to avoid memory leaks\n files.selected.forEach(function (file) { return URL.revokeObjectURL(file.preview); });\n files.finished.forEach(function (file) { return URL.revokeObjectURL(file.preview); });\n files.rejected.forEach(function (file) { return URL.revokeObjectURL(file.preview); });\n setFiles({\n selected: [],\n finished: [],\n rejected: [],\n });\n setDialogState({ uploadType: uploadDialogVisibleState_1.UPLOAD_TYPE.new, visible: false });\n }, [files, setFiles, setDialogState]);\n return {\n state: __assign(__assign({}, dialogState), { files: files }),\n closeDialog: handleClose,\n setFiles: setFiles,\n };\n};\nexports.default = useUploadDialogState;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUploadFile() {\n var _a = client_1.useMutation(mutations_1.UPLOAD_FILE), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var tagId = recoil_1.useRecoilValue(state_1.selectedTagIdState);\n var assetCollectionId = recoil_1.useRecoilValue(state_1.selectedAssetCollectionIdState);\n var uploadFile = function (file) {\n return action({\n variables: {\n file: file,\n tagId: tagId,\n assetCollectionId: assetCollectionId,\n },\n });\n };\n return { uploadFile: uploadFile, uploadState: (data === null || data === void 0 ? void 0 : data.uploadFile) || {}, error: error, loading: loading };\n}\nexports.default = useUploadFile;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar REPLACE_ASSET = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation ReplaceAsset(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $file: Upload!\\n $options: AssetReplacementOptionsInput!\\n ) {\\n replaceAsset(id: $id, assetSourceId: $assetSourceId, file: $file, options: $options) {\\n filename\\n success\\n result\\n }\\n }\\n\"], [\"\\n mutation ReplaceAsset(\\n $id: AssetId!\\n $assetSourceId: AssetSourceId!\\n $file: Upload!\\n $options: AssetReplacementOptionsInput!\\n ) {\\n replaceAsset(id: $id, assetSourceId: $assetSourceId, file: $file, options: $options) {\\n filename\\n success\\n result\\n }\\n }\\n\"])));\nexports.default = REPLACE_ASSET;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar UPLOAD_FILES = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UploadFiles($files: [Upload!]!, $tagId: TagId, $assetCollectionId: AssetCollectionId) {\\n uploadFiles(files: $files, tagId: $tagId, assetCollectionId: $assetCollectionId) {\\n filename\\n success\\n result\\n }\\n }\\n\"], [\"\\n mutation UploadFiles($files: [Upload!]!, $tagId: TagId, $assetCollectionId: AssetCollectionId) {\\n uploadFiles(files: $files, tagId: $tagId, assetCollectionId: $assetCollectionId) {\\n filename\\n success\\n result\\n }\\n }\\n\"])));\nexports.default = UPLOAD_FILES;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar UPLOAD_FILE = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n mutation UploadFile($file: Upload!, $tagId: TagId, $assetCollectionId: AssetCollectionId) {\\n uploadFile(file: $file, tagId: $tagId, assetCollectionId: $assetCollectionId) {\\n filename\\n success\\n result\\n }\\n }\\n\"], [\"\\n mutation UploadFile($file: Upload!, $tagId: TagId, $assetCollectionId: AssetCollectionId) {\\n uploadFile(file: $file, tagId: $tagId, assetCollectionId: $assetCollectionId) {\\n filename\\n success\\n result\\n }\\n }\\n\"])));\nexports.default = UPLOAD_FILE;\nvar templateObject_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar mutations_1 = require(\"../mutations\");\nfunction useUploadFiles() {\n var _a = client_1.useMutation(mutations_1.UPLOAD_FILES), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var tagId = recoil_1.useRecoilValue(state_1.selectedTagIdState);\n var assetCollectionId = recoil_1.useRecoilValue(state_1.selectedAssetCollectionIdState);\n var uploadFiles = function (files) {\n return action({\n variables: {\n files: files,\n tagId: tagId,\n assetCollectionId: assetCollectionId,\n },\n });\n };\n return { uploadFiles: uploadFiles, uploadState: (data === null || data === void 0 ? void 0 : data.uploadFiles) || [], error: error, loading: loading };\n}\nexports.default = useUploadFiles;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar mutations_1 = require(\"../mutations\");\nfunction useReplaceAsset() {\n var _a = client_1.useMutation(mutations_1.REPLACE_ASSET), action = _a[0], _b = _a[1], error = _b.error, data = _b.data, loading = _b.loading;\n var replaceAsset = function (_a) {\n var asset = _a.asset, file = _a.file, options = _a.options;\n return action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n file: file,\n options: options,\n },\n });\n };\n return { replaceAsset: replaceAsset, uploadState: (data === null || data === void 0 ? void 0 : data.replaceAsset) || null, error: error, loading: loading };\n}\nexports.default = useReplaceAsset;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar state_1 = require(\"../../state\");\nvar uploadDialogVisibleState_1 = require(\"../../state/uploadDialogVisibleState\");\nvar NewAssetDialog_1 = __importDefault(require(\"./NewAssetDialog\"));\nvar ReplaceAssetDialog_1 = __importDefault(require(\"./ReplaceAssetDialog\"));\nvar UploadDialog = function () {\n var _a = recoil_1.useRecoilValue(state_1.uploadDialogVisibleState), visible = _a.visible, uploadType = _a.uploadType;\n return (visible && (uploadType === uploadDialogVisibleState_1.UPLOAD_TYPE.update ? React.createElement(ReplaceAssetDialog_1.default, null) : React.createElement(NewAssetDialog_1.default, null))) || null;\n};\nexports.default = React.memo(UploadDialog);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"../state\");\nvar uploadDialogVisibleState_1 = require(\"../state/uploadDialogVisibleState\");\nvar AssetReplacementButton = function () {\n var _a = recoil_1.useRecoilState(state_1.uploadDialogVisibleState), dialogState = _a[0], setDialogState = _a[1];\n var translate = src_1.useIntl().translate;\n return (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: dialogState.visible && dialogState.uploadType === uploadDialogVisibleState_1.UPLOAD_TYPE.update ? 'brand' : 'lighter', hoverStyle: \"brand\", onClick: function () { return setDialogState({ visible: true, uploadType: uploadDialogVisibleState_1.UPLOAD_TYPE.update }); } }, translate('asssetReplacement.toggle', 'Replace asset')));\n};\nexports.default = React.memo(AssetReplacementButton);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"../state\");\nvar uploadDialogVisibleState_1 = require(\"../state/uploadDialogVisibleState\");\nfunction UploadButton() {\n var translate = src_1.useIntl().translate;\n var setUploadDialogState = recoil_1.useSetRecoilState(state_1.uploadDialogVisibleState);\n return (React.createElement(\"div\", null,\n React.createElement(react_ui_components_1.Button, { size: \"regular\", style: \"lighter\", hoverStyle: \"brand\", onClick: function () { return setUploadDialogState({ visible: true, uploadType: uploadDialogVisibleState_1.UPLOAD_TYPE.new }); } },\n React.createElement(react_ui_components_1.Icon, { icon: \"upload\" }),\n \" \",\n translate('uploadButton.label', 'Upload'))));\n}\nexports.default = UploadButton;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_image_lightbox_1 = __importDefault(require(\"react-image-lightbox\"));\nvar recoil_1 = require(\"recoil\");\nrequire(\"react-image-lightbox/style.css\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar selectedAssetForPreviewState_1 = __importDefault(require(\"../state/selectedAssetForPreviewState\"));\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar react_1 = require(\"react\");\nvar useStyles = src_1.createUseMediaUiStyles({\n lightbox: {\n '& .ril__image': {\n maxWidth: '100%',\n },\n },\n});\nvar useLightBoxContainer = function (defaultContainer) {\n if (defaultContainer === void 0) { defaultContainer = null; }\n var lightBoxContainerRef = React.useRef(defaultContainer);\n React.useEffect(function () {\n if (defaultContainer === null) {\n var newLightBoxContainer_1 = document.createElement('div');\n newLightBoxContainer_1.setAttribute('data-ignore_click_outside', 'true');\n document.body.appendChild(newLightBoxContainer_1);\n lightBoxContainerRef.current = newLightBoxContainer_1;\n return function () { return newLightBoxContainer_1.remove(); };\n }\n lightBoxContainerRef.current = defaultContainer;\n }, [defaultContainer]);\n return lightBoxContainerRef;\n};\nfunction AssetPreview() {\n var classes = useStyles();\n var theme = src_1.useMediaUiTheme();\n var _a = src_1.useMediaUi(), containerRef = _a.containerRef, isInNodeCreationDialog = _a.isInNodeCreationDialog, assets = _a.assets;\n var _b = recoil_1.useRecoilState(selectedAssetForPreviewState_1.default), selectedAssetForPreview = _b[0], setSelectedAssetForPreview = _b[1];\n var asset = hooks_1.useAssetQuery(selectedAssetForPreview).asset;\n var lightBoxContainer = useLightBoxContainer(isInNodeCreationDialog ? null : containerRef.current);\n var _c = react_1.useMemo(function () {\n if (!asset)\n return [null, null];\n var currentAssetIndex = assets.findIndex(function (_a) {\n var id = _a.id;\n return id === asset.id;\n });\n return [\n currentAssetIndex > 0 ? assets[currentAssetIndex - 1] : null,\n currentAssetIndex < assets.length - 1 ? assets[currentAssetIndex + 1] : null,\n ];\n }, [assets, asset]), prevAsset = _c[0], nextAsset = _c[1];\n // TODO: Handle pdf fiels with pdf viewer https://github.com/Flowpack/media-ui/issues/29\n if (!asset)\n return null;\n return (React.createElement(react_image_lightbox_1.default, { reactModalStyle: { overlay: { zIndex: theme.lightboxZIndex } }, reactModalProps: { parentSelector: function () { return lightBoxContainer.current; } }, wrapperClassName: classes.lightbox, mainSrc: asset.previewUrl, mainSrcThumbnail: asset.thumbnailUrl, imageTitle: asset.label, imageCaption: asset.caption, onCloseRequest: function () { return setSelectedAssetForPreview(null); }, prevSrc: prevAsset === null || prevAsset === void 0 ? void 0 : prevAsset.previewUrl, prevSrcThumbnail: prevAsset === null || prevAsset === void 0 ? void 0 : prevAsset.thumbnailUrl, prevLabel: prevAsset === null || prevAsset === void 0 ? void 0 : prevAsset.label, onMovePrevRequest: function () {\n return setSelectedAssetForPreview(prevAsset ? { assetId: prevAsset.id, assetSourceId: prevAsset.assetSource.id } : null);\n }, nextSrc: nextAsset === null || nextAsset === void 0 ? void 0 : nextAsset.previewUrl, nextSrcThumbnail: nextAsset === null || nextAsset === void 0 ? void 0 : nextAsset.thumbnailUrl, nextLabel: nextAsset === null || nextAsset === void 0 ? void 0 : nextAsset.label, onMoveNextRequest: function () {\n return setSelectedAssetForPreview(nextAsset ? { assetId: nextAsset.id, assetSourceId: nextAsset.assetSource.id } : null);\n } }));\n}\nexports.default = AssetPreview;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Modal from 'react-modal';\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\n/**\n * Placeholder for future translate functionality\n */\nfunction translate(str) {\n var replaceStrings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (!str) {\n return '';\n }\n\n var translated = str;\n\n if (replaceStrings) {\n Object.keys(replaceStrings).forEach(function (placeholder) {\n translated = translated.replace(placeholder, replaceStrings[placeholder]);\n });\n }\n\n return translated;\n}\nfunction getWindowWidth() {\n return typeof global.window !== 'undefined' ? global.window.innerWidth : 0;\n}\nfunction getWindowHeight() {\n return typeof global.window !== 'undefined' ? global.window.innerHeight : 0;\n} // Get the highest window context that isn't cross-origin\n// (When in an iframe)\n\nfunction getHighestSafeWindowContext() {\n var self = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.window.self;\n var referrer = self.document.referrer; // If we reached the top level, return self\n\n if (self === global.window.top || !referrer) {\n return self;\n }\n\n var getOrigin = function getOrigin(href) {\n return href.match(/(.*\\/\\/.*?)(\\/|$)/)[1];\n }; // If parent is the same origin, we can move up one context\n // Reference: https://stackoverflow.com/a/21965342/1601953\n\n\n if (getOrigin(self.location.href) === getOrigin(referrer)) {\n return getHighestSafeWindowContext(self.parent);\n } // If a different origin, we consider the current level\n // as the top reachable one\n\n\n return self;\n}\n\n// Min image zoom level\nvar MIN_ZOOM_LEVEL = 0; // Max image zoom level\n\nvar MAX_ZOOM_LEVEL = 300; // Size ratio between previous and next zoom levels\n\nvar ZOOM_RATIO = 1.007; // How much to increase/decrease the zoom level when the zoom buttons are clicked\n\nvar ZOOM_BUTTON_INCREMENT_SIZE = 100; // Used to judge the amount of horizontal scroll needed to initiate a image move\n\nvar WHEEL_MOVE_X_THRESHOLD = 200; // Used to judge the amount of vertical scroll needed to initiate a zoom action\n\nvar WHEEL_MOVE_Y_THRESHOLD = 1;\nvar KEYS = {\n ESC: 27,\n LEFT_ARROW: 37,\n RIGHT_ARROW: 39\n}; // Actions\n\nvar ACTION_NONE = 0;\nvar ACTION_MOVE = 1;\nvar ACTION_SWIPE = 2;\nvar ACTION_PINCH = 3;\n\nvar SOURCE_ANY = 0;\nvar SOURCE_MOUSE = 1;\nvar SOURCE_TOUCH = 2;\nvar SOURCE_POINTER = 3; // Minimal swipe distance\n\nvar MIN_SWIPE_DISTANCE = 200;\n\nvar ReactImageLightbox =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ReactImageLightbox, _Component);\n\n _createClass(ReactImageLightbox, null, [{\n key: \"isTargetMatchImage\",\n value: function isTargetMatchImage(target) {\n return target && /ril-image-current/.test(target.className);\n }\n }, {\n key: \"parseMouseEvent\",\n value: function parseMouseEvent(mouseEvent) {\n return {\n id: 'mouse',\n source: SOURCE_MOUSE,\n x: parseInt(mouseEvent.clientX, 10),\n y: parseInt(mouseEvent.clientY, 10)\n };\n }\n }, {\n key: \"parseTouchPointer\",\n value: function parseTouchPointer(touchPointer) {\n return {\n id: touchPointer.identifier,\n source: SOURCE_TOUCH,\n x: parseInt(touchPointer.clientX, 10),\n y: parseInt(touchPointer.clientY, 10)\n };\n }\n }, {\n key: \"parsePointerEvent\",\n value: function parsePointerEvent(pointerEvent) {\n return {\n id: pointerEvent.pointerId,\n source: SOURCE_POINTER,\n x: parseInt(pointerEvent.clientX, 10),\n y: parseInt(pointerEvent.clientY, 10)\n };\n } // Request to transition to the previous image\n\n }, {\n key: \"getTransform\",\n value: function getTransform(_ref) {\n var _ref$x = _ref.x,\n x = _ref$x === void 0 ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === void 0 ? 0 : _ref$y,\n _ref$zoom = _ref.zoom,\n zoom = _ref$zoom === void 0 ? 1 : _ref$zoom,\n width = _ref.width,\n targetWidth = _ref.targetWidth;\n var nextX = x;\n var windowWidth = getWindowWidth();\n\n var scaleFactor = zoom * (targetWidth / width);\n return {\n transform: \"translate3d(\".concat(nextX, \"px,\").concat(y, \"px,0) scale3d(\").concat(scaleFactor, \",\").concat(scaleFactor, \",1)\")\n };\n }\n }]);\n\n function ReactImageLightbox(props) {\n var _this;\n\n _classCallCheck(this, ReactImageLightbox);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactImageLightbox).call(this, props));\n _this.state = {\n //-----------------------------\n // Animation\n //-----------------------------\n // Lightbox is closing\n // When Lightbox is mounted, if animation is enabled it will open with the reverse of the closing animation\n isClosing: !props.animationDisabled,\n // Component parts should animate (e.g., when images are moving, or image is being zoomed)\n shouldAnimate: false,\n //-----------------------------\n // Zoom settings\n //-----------------------------\n // Zoom level of image\n zoomLevel: MIN_ZOOM_LEVEL,\n //-----------------------------\n // Image position settings\n //-----------------------------\n // Horizontal offset from center\n offsetX: 0,\n // Vertical offset from center\n offsetY: 0,\n // image load error for srcType\n loadErrorStatus: {}\n }; // Refs\n\n _this.outerEl = React.createRef();\n _this.zoomInBtn = React.createRef();\n _this.zoomOutBtn = React.createRef();\n _this.caption = React.createRef();\n _this.closeIfClickInner = _this.closeIfClickInner.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageDoubleClick = _this.handleImageDoubleClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageMouseWheel = _this.handleImageMouseWheel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyInput = _this.handleKeyInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMouseUp = _this.handleMouseUp.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleOuterMousewheel = _this.handleOuterMousewheel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTouchStart = _this.handleTouchStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTouchMove = _this.handleTouchMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTouchEnd = _this.handleTouchEnd.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePointerEvent = _this.handlePointerEvent.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCaptionMousewheel = _this.handleCaptionMousewheel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleWindowResize = _this.handleWindowResize.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleZoomInButtonClick = _this.handleZoomInButtonClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleZoomOutButtonClick = _this.handleZoomOutButtonClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestClose = _this.requestClose.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestMoveNext = _this.requestMoveNext.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestMovePrev = _this.requestMovePrev.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(ReactImageLightbox, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n // Timeouts - always clear it before umount\n this.timeouts = []; // Current action\n\n this.currentAction = ACTION_NONE; // Events source\n\n this.eventsSource = SOURCE_ANY; // Empty pointers list\n\n this.pointerList = []; // Prevent inner close\n\n this.preventInnerClose = false;\n this.preventInnerCloseTimeout = null; // Used to disable animation when changing props.mainSrc|nextSrc|prevSrc\n\n this.keyPressed = false; // Used to store load state / dimensions of images\n\n this.imageCache = {}; // Time the last keydown event was called (used in keyboard action rate limiting)\n\n this.lastKeyDownTime = 0; // Used for debouncing window resize event\n\n this.resizeTimeout = null; // Used to determine when actions are triggered by the scroll wheel\n\n this.wheelActionTimeout = null;\n this.resetScrollTimeout = null;\n this.scrollX = 0;\n this.scrollY = 0; // Used in panning zoomed images\n\n this.moveStartX = 0;\n this.moveStartY = 0;\n this.moveStartOffsetX = 0;\n this.moveStartOffsetY = 0; // Used to swipe\n\n this.swipeStartX = 0;\n this.swipeStartY = 0;\n this.swipeEndX = 0;\n this.swipeEndY = 0; // Used to pinch\n\n this.pinchTouchList = null;\n this.pinchDistance = 0; // Used to differentiate between images with identical src\n\n this.keyCounter = 0; // Used to detect a move when all src's remain unchanged (four or more of the same image in a row)\n\n this.moveRequested = false;\n\n if (!this.props.animationDisabled) {\n // Make opening animation play\n this.setState({\n isClosing: false\n });\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n // Prevents cross-origin errors when using a cross-origin iframe\n this.windowContext = getHighestSafeWindowContext();\n this.listeners = {\n resize: this.handleWindowResize,\n mouseup: this.handleMouseUp,\n touchend: this.handleTouchEnd,\n touchcancel: this.handleTouchEnd,\n pointerdown: this.handlePointerEvent,\n pointermove: this.handlePointerEvent,\n pointerup: this.handlePointerEvent,\n pointercancel: this.handlePointerEvent\n };\n Object.keys(this.listeners).forEach(function (type) {\n _this2.windowContext.addEventListener(type, _this2.listeners[type]);\n });\n this.loadAllImages();\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var _this3 = this;\n\n // Iterate through the source types for prevProps and nextProps to\n // determine if any of the sources changed\n var sourcesChanged = false;\n var prevSrcDict = {};\n var nextSrcDict = {};\n this.getSrcTypes().forEach(function (srcType) {\n if (_this3.props[srcType.name] !== nextProps[srcType.name]) {\n sourcesChanged = true;\n prevSrcDict[_this3.props[srcType.name]] = true;\n nextSrcDict[nextProps[srcType.name]] = true;\n }\n });\n\n if (sourcesChanged || this.moveRequested) {\n // Reset the loaded state for images not rendered next\n Object.keys(prevSrcDict).forEach(function (prevSrc) {\n if (!(prevSrc in nextSrcDict) && prevSrc in _this3.imageCache) {\n _this3.imageCache[prevSrc].loaded = false;\n }\n });\n this.moveRequested = false; // Load any new images\n\n this.loadAllImages(nextProps);\n }\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate() {\n // Wait for move...\n return !this.moveRequested;\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var _this4 = this;\n\n this.didUnmount = true;\n Object.keys(this.listeners).forEach(function (type) {\n _this4.windowContext.removeEventListener(type, _this4.listeners[type]);\n });\n this.timeouts.forEach(function (tid) {\n return clearTimeout(tid);\n });\n }\n }, {\n key: \"setTimeout\",\n value: function (_setTimeout) {\n function setTimeout(_x, _x2) {\n return _setTimeout.apply(this, arguments);\n }\n\n setTimeout.toString = function () {\n return _setTimeout.toString();\n };\n\n return setTimeout;\n }(function (func, time) {\n var _this5 = this;\n\n var id = setTimeout(function () {\n _this5.timeouts = _this5.timeouts.filter(function (tid) {\n return tid !== id;\n });\n func();\n }, time);\n this.timeouts.push(id);\n return id;\n })\n }, {\n key: \"setPreventInnerClose\",\n value: function setPreventInnerClose() {\n var _this6 = this;\n\n if (this.preventInnerCloseTimeout) {\n this.clearTimeout(this.preventInnerCloseTimeout);\n }\n\n this.preventInnerClose = true;\n this.preventInnerCloseTimeout = this.setTimeout(function () {\n _this6.preventInnerClose = false;\n _this6.preventInnerCloseTimeout = null;\n }, 100);\n } // Get info for the best suited image to display with the given srcType\n\n }, {\n key: \"getBestImageForType\",\n value: function getBestImageForType(srcType) {\n var imageSrc = this.props[srcType];\n var fitSizes = {};\n\n if (this.isImageLoaded(imageSrc)) {\n // Use full-size image if available\n fitSizes = this.getFitSizes(this.imageCache[imageSrc].width, this.imageCache[imageSrc].height);\n } else if (this.isImageLoaded(this.props[\"\".concat(srcType, \"Thumbnail\")])) {\n // Fall back to using thumbnail if the image has not been loaded\n imageSrc = this.props[\"\".concat(srcType, \"Thumbnail\")];\n fitSizes = this.getFitSizes(this.imageCache[imageSrc].width, this.imageCache[imageSrc].height, true);\n } else {\n return null;\n }\n\n return {\n src: imageSrc,\n height: this.imageCache[imageSrc].height,\n width: this.imageCache[imageSrc].width,\n targetHeight: fitSizes.height,\n targetWidth: fitSizes.width\n };\n } // Get sizing for when an image is larger than the window\n\n }, {\n key: \"getFitSizes\",\n value: function getFitSizes(width, height, stretch) {\n var boxSize = this.getLightboxRect();\n var maxHeight = boxSize.height - this.props.imagePadding * 2;\n var maxWidth = boxSize.width - this.props.imagePadding * 2;\n\n if (!stretch) {\n maxHeight = Math.min(maxHeight, height);\n maxWidth = Math.min(maxWidth, width);\n }\n\n var maxRatio = maxWidth / maxHeight;\n var srcRatio = width / height;\n\n if (maxRatio > srcRatio) {\n // height is the constraining dimension of the photo\n return {\n width: width * maxHeight / height,\n height: maxHeight\n };\n }\n\n return {\n width: maxWidth,\n height: height * maxWidth / width\n };\n }\n }, {\n key: \"getMaxOffsets\",\n value: function getMaxOffsets() {\n var zoomLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.zoomLevel;\n var currentImageInfo = this.getBestImageForType('mainSrc');\n\n if (currentImageInfo === null) {\n return {\n maxX: 0,\n minX: 0,\n maxY: 0,\n minY: 0\n };\n }\n\n var boxSize = this.getLightboxRect();\n var zoomMultiplier = this.getZoomMultiplier(zoomLevel);\n var maxX = 0;\n\n if (zoomMultiplier * currentImageInfo.width - boxSize.width < 0) {\n // if there is still blank space in the X dimension, don't limit except to the opposite edge\n maxX = (boxSize.width - zoomMultiplier * currentImageInfo.width) / 2;\n } else {\n maxX = (zoomMultiplier * currentImageInfo.width - boxSize.width) / 2;\n }\n\n var maxY = 0;\n\n if (zoomMultiplier * currentImageInfo.height - boxSize.height < 0) {\n // if there is still blank space in the Y dimension, don't limit except to the opposite edge\n maxY = (boxSize.height - zoomMultiplier * currentImageInfo.height) / 2;\n } else {\n maxY = (zoomMultiplier * currentImageInfo.height - boxSize.height) / 2;\n }\n\n return {\n maxX: maxX,\n maxY: maxY,\n minX: -1 * maxX,\n minY: -1 * maxY\n };\n } // Get image src types\n\n }, {\n key: \"getSrcTypes\",\n value: function getSrcTypes() {\n return [{\n name: 'mainSrc',\n keyEnding: \"i\".concat(this.keyCounter)\n }, {\n name: 'mainSrcThumbnail',\n keyEnding: \"t\".concat(this.keyCounter)\n }, {\n name: 'nextSrc',\n keyEnding: \"i\".concat(this.keyCounter + 1)\n }, {\n name: 'nextSrcThumbnail',\n keyEnding: \"t\".concat(this.keyCounter + 1)\n }, {\n name: 'prevSrc',\n keyEnding: \"i\".concat(this.keyCounter - 1)\n }, {\n name: 'prevSrcThumbnail',\n keyEnding: \"t\".concat(this.keyCounter - 1)\n }];\n }\n /**\n * Get sizing when the image is scaled\n */\n\n }, {\n key: \"getZoomMultiplier\",\n value: function getZoomMultiplier() {\n var zoomLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.zoomLevel;\n return Math.pow(ZOOM_RATIO, zoomLevel);\n }\n /**\n * Get the size of the lightbox in pixels\n */\n\n }, {\n key: \"getLightboxRect\",\n value: function getLightboxRect() {\n if (this.outerEl.current) {\n return this.outerEl.current.getBoundingClientRect();\n }\n\n return {\n width: getWindowWidth(),\n height: getWindowHeight(),\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n }\n }, {\n key: \"clearTimeout\",\n value: function (_clearTimeout) {\n function clearTimeout(_x3) {\n return _clearTimeout.apply(this, arguments);\n }\n\n clearTimeout.toString = function () {\n return _clearTimeout.toString();\n };\n\n return clearTimeout;\n }(function (id) {\n this.timeouts = this.timeouts.filter(function (tid) {\n return tid !== id;\n });\n clearTimeout(id);\n }) // Change zoom level\n\n }, {\n key: \"changeZoom\",\n value: function changeZoom(zoomLevel, clientX, clientY) {\n // Ignore if zoom disabled\n if (!this.props.enableZoom) {\n return;\n } // Constrain zoom level to the set bounds\n\n\n var nextZoomLevel = Math.max(MIN_ZOOM_LEVEL, Math.min(MAX_ZOOM_LEVEL, zoomLevel)); // Ignore requests that don't change the zoom level\n\n if (nextZoomLevel === this.state.zoomLevel) {\n return;\n }\n\n if (nextZoomLevel === MIN_ZOOM_LEVEL) {\n // Snap back to center if zoomed all the way out\n this.setState({\n zoomLevel: nextZoomLevel,\n offsetX: 0,\n offsetY: 0\n });\n return;\n }\n\n var imageBaseSize = this.getBestImageForType('mainSrc');\n\n if (imageBaseSize === null) {\n return;\n }\n\n var currentZoomMultiplier = this.getZoomMultiplier();\n var nextZoomMultiplier = this.getZoomMultiplier(nextZoomLevel); // Default to the center of the image to zoom when no mouse position specified\n\n var boxRect = this.getLightboxRect();\n var pointerX = typeof clientX !== 'undefined' ? clientX - boxRect.left : boxRect.width / 2;\n var pointerY = typeof clientY !== 'undefined' ? clientY - boxRect.top : boxRect.height / 2;\n var currentImageOffsetX = (boxRect.width - imageBaseSize.width * currentZoomMultiplier) / 2;\n var currentImageOffsetY = (boxRect.height - imageBaseSize.height * currentZoomMultiplier) / 2;\n var currentImageRealOffsetX = currentImageOffsetX - this.state.offsetX;\n var currentImageRealOffsetY = currentImageOffsetY - this.state.offsetY;\n var currentPointerXRelativeToImage = (pointerX - currentImageRealOffsetX) / currentZoomMultiplier;\n var currentPointerYRelativeToImage = (pointerY - currentImageRealOffsetY) / currentZoomMultiplier;\n var nextImageRealOffsetX = pointerX - currentPointerXRelativeToImage * nextZoomMultiplier;\n var nextImageRealOffsetY = pointerY - currentPointerYRelativeToImage * nextZoomMultiplier;\n var nextImageOffsetX = (boxRect.width - imageBaseSize.width * nextZoomMultiplier) / 2;\n var nextImageOffsetY = (boxRect.height - imageBaseSize.height * nextZoomMultiplier) / 2;\n var nextOffsetX = nextImageOffsetX - nextImageRealOffsetX;\n var nextOffsetY = nextImageOffsetY - nextImageRealOffsetY; // When zooming out, limit the offset so things don't get left askew\n\n if (this.currentAction !== ACTION_PINCH) {\n var maxOffsets = this.getMaxOffsets();\n\n if (this.state.zoomLevel > nextZoomLevel) {\n nextOffsetX = Math.max(maxOffsets.minX, Math.min(maxOffsets.maxX, nextOffsetX));\n nextOffsetY = Math.max(maxOffsets.minY, Math.min(maxOffsets.maxY, nextOffsetY));\n }\n }\n\n this.setState({\n zoomLevel: nextZoomLevel,\n offsetX: nextOffsetX,\n offsetY: nextOffsetY\n });\n }\n }, {\n key: \"closeIfClickInner\",\n value: function closeIfClickInner(event) {\n if (!this.preventInnerClose && event.target.className.search(/\\bril-inner\\b/) > -1) {\n this.requestClose(event);\n }\n }\n /**\n * Handle user keyboard actions\n */\n\n }, {\n key: \"handleKeyInput\",\n value: function handleKeyInput(event) {\n event.stopPropagation(); // Ignore key input during animations\n\n if (this.isAnimating()) {\n return;\n } // Allow slightly faster navigation through the images when user presses keys repeatedly\n\n\n if (event.type === 'keyup') {\n this.lastKeyDownTime -= this.props.keyRepeatKeyupBonus;\n return;\n }\n\n var keyCode = event.which || event.keyCode; // Ignore key presses that happen too close to each other (when rapid fire key pressing or holding down the key)\n // But allow it if it's a lightbox closing action\n\n var currentTime = new Date();\n\n if (currentTime.getTime() - this.lastKeyDownTime < this.props.keyRepeatLimit && keyCode !== KEYS.ESC) {\n return;\n }\n\n this.lastKeyDownTime = currentTime.getTime();\n\n switch (keyCode) {\n // ESC key closes the lightbox\n case KEYS.ESC:\n event.preventDefault();\n this.requestClose(event);\n break;\n // Left arrow key moves to previous image\n\n case KEYS.LEFT_ARROW:\n if (!this.props.prevSrc) {\n return;\n }\n\n event.preventDefault();\n this.keyPressed = true;\n this.requestMovePrev(event);\n break;\n // Right arrow key moves to next image\n\n case KEYS.RIGHT_ARROW:\n if (!this.props.nextSrc) {\n return;\n }\n\n event.preventDefault();\n this.keyPressed = true;\n this.requestMoveNext(event);\n break;\n }\n }\n /**\n * Handle a mouse wheel event over the lightbox container\n */\n\n }, {\n key: \"handleOuterMousewheel\",\n value: function handleOuterMousewheel(event) {\n var _this7 = this;\n\n // Prevent scrolling of the background\n event.stopPropagation();\n var xThreshold = WHEEL_MOVE_X_THRESHOLD;\n var actionDelay = 0;\n var imageMoveDelay = 500;\n this.clearTimeout(this.resetScrollTimeout);\n this.resetScrollTimeout = this.setTimeout(function () {\n _this7.scrollX = 0;\n _this7.scrollY = 0;\n }, 300); // Prevent rapid-fire zoom behavior\n\n if (this.wheelActionTimeout !== null || this.isAnimating()) {\n return;\n }\n\n if (Math.abs(event.deltaY) < Math.abs(event.deltaX)) {\n // handle horizontal scrolls with image moves\n this.scrollY = 0;\n this.scrollX += event.deltaX;\n var bigLeapX = xThreshold / 2; // If the scroll amount has accumulated sufficiently, or a large leap was taken\n\n if (this.scrollX >= xThreshold || event.deltaX >= bigLeapX) {\n // Scroll right moves to next\n this.requestMoveNext(event);\n actionDelay = imageMoveDelay;\n this.scrollX = 0;\n } else if (this.scrollX <= -1 * xThreshold || event.deltaX <= -1 * bigLeapX) {\n // Scroll left moves to previous\n this.requestMovePrev(event);\n actionDelay = imageMoveDelay;\n this.scrollX = 0;\n }\n } // Allow successive actions after the set delay\n\n\n if (actionDelay !== 0) {\n this.wheelActionTimeout = this.setTimeout(function () {\n _this7.wheelActionTimeout = null;\n }, actionDelay);\n }\n }\n }, {\n key: \"handleImageMouseWheel\",\n value: function handleImageMouseWheel(event) {\n var yThreshold = WHEEL_MOVE_Y_THRESHOLD;\n\n if (Math.abs(event.deltaY) >= Math.abs(event.deltaX)) {\n event.stopPropagation(); // If the vertical scroll amount was large enough, perform a zoom\n\n if (Math.abs(event.deltaY) < yThreshold) {\n return;\n }\n\n this.scrollX = 0;\n this.scrollY += event.deltaY;\n this.changeZoom(this.state.zoomLevel - event.deltaY, event.clientX, event.clientY);\n }\n }\n /**\n * Handle a double click on the current image\n */\n\n }, {\n key: \"handleImageDoubleClick\",\n value: function handleImageDoubleClick(event) {\n if (this.state.zoomLevel > MIN_ZOOM_LEVEL) {\n // A double click when zoomed in zooms all the way out\n this.changeZoom(MIN_ZOOM_LEVEL, event.clientX, event.clientY);\n } else {\n // A double click when zoomed all the way out zooms in\n this.changeZoom(this.state.zoomLevel + ZOOM_BUTTON_INCREMENT_SIZE, event.clientX, event.clientY);\n }\n }\n }, {\n key: \"shouldHandleEvent\",\n value: function shouldHandleEvent(source) {\n if (this.eventsSource === source) {\n return true;\n }\n\n if (this.eventsSource === SOURCE_ANY) {\n this.eventsSource = source;\n return true;\n }\n\n switch (source) {\n case SOURCE_MOUSE:\n return false;\n\n case SOURCE_TOUCH:\n this.eventsSource = SOURCE_TOUCH;\n this.filterPointersBySource();\n return true;\n\n case SOURCE_POINTER:\n if (this.eventsSource === SOURCE_MOUSE) {\n this.eventsSource = SOURCE_POINTER;\n this.filterPointersBySource();\n return true;\n }\n\n return false;\n\n default:\n return false;\n }\n }\n }, {\n key: \"addPointer\",\n value: function addPointer(pointer) {\n this.pointerList.push(pointer);\n }\n }, {\n key: \"removePointer\",\n value: function removePointer(pointer) {\n this.pointerList = this.pointerList.filter(function (_ref2) {\n var id = _ref2.id;\n return id !== pointer.id;\n });\n }\n }, {\n key: \"filterPointersBySource\",\n value: function filterPointersBySource() {\n var _this8 = this;\n\n this.pointerList = this.pointerList.filter(function (_ref3) {\n var source = _ref3.source;\n return source === _this8.eventsSource;\n });\n }\n }, {\n key: \"handleMouseDown\",\n value: function handleMouseDown(event) {\n if (this.shouldHandleEvent(SOURCE_MOUSE) && ReactImageLightbox.isTargetMatchImage(event.target)) {\n this.addPointer(ReactImageLightbox.parseMouseEvent(event));\n this.multiPointerStart(event);\n }\n }\n }, {\n key: \"handleMouseMove\",\n value: function handleMouseMove(event) {\n if (this.shouldHandleEvent(SOURCE_MOUSE)) {\n this.multiPointerMove(event, [ReactImageLightbox.parseMouseEvent(event)]);\n }\n }\n }, {\n key: \"handleMouseUp\",\n value: function handleMouseUp(event) {\n if (this.shouldHandleEvent(SOURCE_MOUSE)) {\n this.removePointer(ReactImageLightbox.parseMouseEvent(event));\n this.multiPointerEnd(event);\n }\n }\n }, {\n key: \"handlePointerEvent\",\n value: function handlePointerEvent(event) {\n if (this.shouldHandleEvent(SOURCE_POINTER)) {\n switch (event.type) {\n case 'pointerdown':\n if (ReactImageLightbox.isTargetMatchImage(event.target)) {\n this.addPointer(ReactImageLightbox.parsePointerEvent(event));\n this.multiPointerStart(event);\n }\n\n break;\n\n case 'pointermove':\n this.multiPointerMove(event, [ReactImageLightbox.parsePointerEvent(event)]);\n break;\n\n case 'pointerup':\n case 'pointercancel':\n this.removePointer(ReactImageLightbox.parsePointerEvent(event));\n this.multiPointerEnd(event);\n break;\n }\n }\n }\n }, {\n key: \"handleTouchStart\",\n value: function handleTouchStart(event) {\n var _this9 = this;\n\n if (this.shouldHandleEvent(SOURCE_TOUCH) && ReactImageLightbox.isTargetMatchImage(event.target)) {\n [].forEach.call(event.changedTouches, function (eventTouch) {\n return _this9.addPointer(ReactImageLightbox.parseTouchPointer(eventTouch));\n });\n this.multiPointerStart(event);\n }\n }\n }, {\n key: \"handleTouchMove\",\n value: function handleTouchMove(event) {\n if (this.shouldHandleEvent(SOURCE_TOUCH)) {\n this.multiPointerMove(event, [].map.call(event.changedTouches, function (eventTouch) {\n return ReactImageLightbox.parseTouchPointer(eventTouch);\n }));\n }\n }\n }, {\n key: \"handleTouchEnd\",\n value: function handleTouchEnd(event) {\n var _this10 = this;\n\n if (this.shouldHandleEvent(SOURCE_TOUCH)) {\n [].map.call(event.changedTouches, function (touch) {\n return _this10.removePointer(ReactImageLightbox.parseTouchPointer(touch));\n });\n this.multiPointerEnd(event);\n }\n }\n }, {\n key: \"decideMoveOrSwipe\",\n value: function decideMoveOrSwipe(pointer) {\n if (this.state.zoomLevel <= MIN_ZOOM_LEVEL) {\n this.handleSwipeStart(pointer);\n } else {\n this.handleMoveStart(pointer);\n }\n }\n }, {\n key: \"multiPointerStart\",\n value: function multiPointerStart(event) {\n this.handleEnd(null);\n\n switch (this.pointerList.length) {\n case 1:\n {\n event.preventDefault();\n this.decideMoveOrSwipe(this.pointerList[0]);\n break;\n }\n\n case 2:\n {\n event.preventDefault();\n this.handlePinchStart(this.pointerList);\n break;\n }\n }\n }\n }, {\n key: \"multiPointerMove\",\n value: function multiPointerMove(event, pointerList) {\n switch (this.currentAction) {\n case ACTION_MOVE:\n {\n event.preventDefault();\n this.handleMove(pointerList[0]);\n break;\n }\n\n case ACTION_SWIPE:\n {\n event.preventDefault();\n this.handleSwipe(pointerList[0]);\n break;\n }\n\n case ACTION_PINCH:\n {\n event.preventDefault();\n this.handlePinch(pointerList);\n break;\n }\n }\n }\n }, {\n key: \"multiPointerEnd\",\n value: function multiPointerEnd(event) {\n if (this.currentAction !== ACTION_NONE) {\n this.setPreventInnerClose();\n this.handleEnd(event);\n }\n\n switch (this.pointerList.length) {\n case 0:\n {\n this.eventsSource = SOURCE_ANY;\n break;\n }\n\n case 1:\n {\n event.preventDefault();\n this.decideMoveOrSwipe(this.pointerList[0]);\n break;\n }\n\n case 2:\n {\n event.preventDefault();\n this.handlePinchStart(this.pointerList);\n break;\n }\n }\n }\n }, {\n key: \"handleEnd\",\n value: function handleEnd(event) {\n switch (this.currentAction) {\n case ACTION_MOVE:\n this.handleMoveEnd(event);\n break;\n\n case ACTION_SWIPE:\n this.handleSwipeEnd(event);\n break;\n\n case ACTION_PINCH:\n this.handlePinchEnd(event);\n break;\n }\n } // Handle move start over the lightbox container\n // This happens:\n // - On a mouseDown event\n // - On a touchstart event\n\n }, {\n key: \"handleMoveStart\",\n value: function handleMoveStart(_ref4) {\n var clientX = _ref4.x,\n clientY = _ref4.y;\n\n if (!this.props.enableZoom) {\n return;\n }\n\n this.currentAction = ACTION_MOVE;\n this.moveStartX = clientX;\n this.moveStartY = clientY;\n this.moveStartOffsetX = this.state.offsetX;\n this.moveStartOffsetY = this.state.offsetY;\n } // Handle dragging over the lightbox container\n // This happens:\n // - After a mouseDown and before a mouseUp event\n // - After a touchstart and before a touchend event\n\n }, {\n key: \"handleMove\",\n value: function handleMove(_ref5) {\n var clientX = _ref5.x,\n clientY = _ref5.y;\n var newOffsetX = this.moveStartX - clientX + this.moveStartOffsetX;\n var newOffsetY = this.moveStartY - clientY + this.moveStartOffsetY;\n\n if (this.state.offsetX !== newOffsetX || this.state.offsetY !== newOffsetY) {\n this.setState({\n offsetX: newOffsetX,\n offsetY: newOffsetY\n });\n }\n }\n }, {\n key: \"handleMoveEnd\",\n value: function handleMoveEnd() {\n var _this11 = this;\n\n this.currentAction = ACTION_NONE;\n this.moveStartX = 0;\n this.moveStartY = 0;\n this.moveStartOffsetX = 0;\n this.moveStartOffsetY = 0; // Snap image back into frame if outside max offset range\n\n var maxOffsets = this.getMaxOffsets();\n var nextOffsetX = Math.max(maxOffsets.minX, Math.min(maxOffsets.maxX, this.state.offsetX));\n var nextOffsetY = Math.max(maxOffsets.minY, Math.min(maxOffsets.maxY, this.state.offsetY));\n\n if (nextOffsetX !== this.state.offsetX || nextOffsetY !== this.state.offsetY) {\n this.setState({\n offsetX: nextOffsetX,\n offsetY: nextOffsetY,\n shouldAnimate: true\n });\n this.setTimeout(function () {\n _this11.setState({\n shouldAnimate: false\n });\n }, this.props.animationDuration);\n }\n }\n }, {\n key: \"handleSwipeStart\",\n value: function handleSwipeStart(_ref6) {\n var clientX = _ref6.x,\n clientY = _ref6.y;\n this.currentAction = ACTION_SWIPE;\n this.swipeStartX = clientX;\n this.swipeStartY = clientY;\n this.swipeEndX = clientX;\n this.swipeEndY = clientY;\n }\n }, {\n key: \"handleSwipe\",\n value: function handleSwipe(_ref7) {\n var clientX = _ref7.x,\n clientY = _ref7.y;\n this.swipeEndX = clientX;\n this.swipeEndY = clientY;\n }\n }, {\n key: \"handleSwipeEnd\",\n value: function handleSwipeEnd(event) {\n var xDiff = this.swipeEndX - this.swipeStartX;\n var xDiffAbs = Math.abs(xDiff);\n var yDiffAbs = Math.abs(this.swipeEndY - this.swipeStartY);\n this.currentAction = ACTION_NONE;\n this.swipeStartX = 0;\n this.swipeStartY = 0;\n this.swipeEndX = 0;\n this.swipeEndY = 0;\n\n if (!event || this.isAnimating() || xDiffAbs < yDiffAbs * 1.5) {\n return;\n }\n\n if (xDiffAbs < MIN_SWIPE_DISTANCE) {\n var boxRect = this.getLightboxRect();\n\n if (xDiffAbs < boxRect.width / 4) {\n return;\n }\n }\n\n if (xDiff > 0 && this.props.prevSrc) {\n event.preventDefault();\n this.requestMovePrev();\n } else if (xDiff < 0 && this.props.nextSrc) {\n event.preventDefault();\n this.requestMoveNext();\n }\n }\n }, {\n key: \"calculatePinchDistance\",\n value: function calculatePinchDistance() {\n var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pinchTouchList,\n _ref9 = _slicedToArray(_ref8, 2),\n a = _ref9[0],\n b = _ref9[1];\n\n return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));\n }\n }, {\n key: \"calculatePinchCenter\",\n value: function calculatePinchCenter() {\n var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pinchTouchList,\n _ref11 = _slicedToArray(_ref10, 2),\n a = _ref11[0],\n b = _ref11[1];\n\n return {\n x: a.x - (a.x - b.x) / 2,\n y: a.y - (a.y - b.y) / 2\n };\n }\n }, {\n key: \"handlePinchStart\",\n value: function handlePinchStart(pointerList) {\n if (!this.props.enableZoom) {\n return;\n }\n\n this.currentAction = ACTION_PINCH;\n this.pinchTouchList = pointerList.map(function (_ref12) {\n var id = _ref12.id,\n x = _ref12.x,\n y = _ref12.y;\n return {\n id: id,\n x: x,\n y: y\n };\n });\n this.pinchDistance = this.calculatePinchDistance();\n }\n }, {\n key: \"handlePinch\",\n value: function handlePinch(pointerList) {\n this.pinchTouchList = this.pinchTouchList.map(function (oldPointer) {\n for (var i = 0; i < pointerList.length; i += 1) {\n if (pointerList[i].id === oldPointer.id) {\n return pointerList[i];\n }\n }\n\n return oldPointer;\n });\n var newDistance = this.calculatePinchDistance();\n var zoomLevel = this.state.zoomLevel + newDistance - this.pinchDistance;\n this.pinchDistance = newDistance;\n\n var _this$calculatePinchC = this.calculatePinchCenter(this.pinchTouchList),\n clientX = _this$calculatePinchC.x,\n clientY = _this$calculatePinchC.y;\n\n this.changeZoom(zoomLevel, clientX, clientY);\n }\n }, {\n key: \"handlePinchEnd\",\n value: function handlePinchEnd() {\n this.currentAction = ACTION_NONE;\n this.pinchTouchList = null;\n this.pinchDistance = 0;\n } // Handle the window resize event\n\n }, {\n key: \"handleWindowResize\",\n value: function handleWindowResize() {\n this.clearTimeout(this.resizeTimeout);\n this.resizeTimeout = this.setTimeout(this.forceUpdate.bind(this), 100);\n }\n }, {\n key: \"handleZoomInButtonClick\",\n value: function handleZoomInButtonClick() {\n var nextZoomLevel = this.state.zoomLevel + ZOOM_BUTTON_INCREMENT_SIZE;\n this.changeZoom(nextZoomLevel);\n\n if (nextZoomLevel === MAX_ZOOM_LEVEL) {\n this.zoomOutBtn.current.focus();\n }\n }\n }, {\n key: \"handleZoomOutButtonClick\",\n value: function handleZoomOutButtonClick() {\n var nextZoomLevel = this.state.zoomLevel - ZOOM_BUTTON_INCREMENT_SIZE;\n this.changeZoom(nextZoomLevel);\n\n if (nextZoomLevel === MIN_ZOOM_LEVEL) {\n this.zoomInBtn.current.focus();\n }\n }\n }, {\n key: \"handleCaptionMousewheel\",\n value: function handleCaptionMousewheel(event) {\n event.stopPropagation();\n\n if (!this.caption.current) {\n return;\n }\n\n var _this$caption$current = this.caption.current.getBoundingClientRect(),\n height = _this$caption$current.height;\n\n var _this$caption$current2 = this.caption.current,\n scrollHeight = _this$caption$current2.scrollHeight,\n scrollTop = _this$caption$current2.scrollTop;\n\n if (event.deltaY > 0 && height + scrollTop >= scrollHeight || event.deltaY < 0 && scrollTop <= 0) {\n event.preventDefault();\n }\n } // Detach key and mouse input events\n\n }, {\n key: \"isAnimating\",\n value: function isAnimating() {\n return this.state.shouldAnimate || this.state.isClosing;\n } // Check if image is loaded\n\n }, {\n key: \"isImageLoaded\",\n value: function isImageLoaded(imageSrc) {\n return imageSrc && imageSrc in this.imageCache && this.imageCache[imageSrc].loaded;\n } // Load image from src and call callback with image width and height on load\n\n }, {\n key: \"loadImage\",\n value: function loadImage(srcType, imageSrc, done) {\n var _this12 = this;\n\n // Return the image info if it is already cached\n if (this.isImageLoaded(imageSrc)) {\n this.setTimeout(function () {\n done();\n }, 1);\n return;\n }\n\n var inMemoryImage = new global.Image();\n\n if (this.props.imageCrossOrigin) {\n inMemoryImage.crossOrigin = this.props.imageCrossOrigin;\n }\n\n inMemoryImage.onerror = function (errorEvent) {\n _this12.props.onImageLoadError(imageSrc, srcType, errorEvent); // failed to load so set the state loadErrorStatus\n\n\n _this12.setState(function (prevState) {\n return {\n loadErrorStatus: _objectSpread({}, prevState.loadErrorStatus, _defineProperty({}, srcType, true))\n };\n });\n\n done(errorEvent);\n };\n\n inMemoryImage.onload = function () {\n _this12.props.onImageLoad(imageSrc, srcType, inMemoryImage);\n\n _this12.imageCache[imageSrc] = {\n loaded: true,\n width: inMemoryImage.width,\n height: inMemoryImage.height\n };\n done();\n };\n\n inMemoryImage.src = imageSrc;\n } // Load all images and their thumbnails\n\n }, {\n key: \"loadAllImages\",\n value: function loadAllImages() {\n var _this13 = this;\n\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n\n var generateLoadDoneCallback = function generateLoadDoneCallback(srcType, imageSrc) {\n return function (err) {\n // Give up showing image on error\n if (err) {\n return;\n } // Don't rerender if the src is not the same as when the load started\n // or if the component has unmounted\n\n\n if (_this13.props[srcType] !== imageSrc || _this13.didUnmount) {\n return;\n } // Force rerender with the new image\n\n\n _this13.forceUpdate();\n };\n }; // Load the images\n\n\n this.getSrcTypes().forEach(function (srcType) {\n var type = srcType.name; // there is no error when we try to load it initially\n\n if (props[type] && _this13.state.loadErrorStatus[type]) {\n _this13.setState(function (prevState) {\n return {\n loadErrorStatus: _objectSpread({}, prevState.loadErrorStatus, _defineProperty({}, type, false))\n };\n });\n } // Load unloaded images\n\n\n if (props[type] && !_this13.isImageLoaded(props[type])) {\n _this13.loadImage(type, props[type], generateLoadDoneCallback(type, props[type]));\n }\n });\n } // Request that the lightbox be closed\n\n }, {\n key: \"requestClose\",\n value: function requestClose(event) {\n var _this14 = this;\n\n // Call the parent close request\n var closeLightbox = function closeLightbox() {\n return _this14.props.onCloseRequest(event);\n };\n\n if (this.props.animationDisabled || event.type === 'keydown' && !this.props.animationOnKeyInput) {\n // No animation\n closeLightbox();\n return;\n } // With animation\n // Start closing animation\n\n\n this.setState({\n isClosing: true\n }); // Perform the actual closing at the end of the animation\n\n this.setTimeout(closeLightbox, this.props.animationDuration);\n }\n }, {\n key: \"requestMove\",\n value: function requestMove(direction, event) {\n var _this15 = this;\n\n // Reset the zoom level on image move\n var nextState = {\n zoomLevel: MIN_ZOOM_LEVEL,\n offsetX: 0,\n offsetY: 0\n }; // Enable animated states\n\n if (!this.props.animationDisabled && (!this.keyPressed || this.props.animationOnKeyInput)) {\n nextState.shouldAnimate = true;\n this.setTimeout(function () {\n return _this15.setState({\n shouldAnimate: false\n });\n }, this.props.animationDuration);\n }\n\n this.keyPressed = false;\n this.moveRequested = true;\n\n if (direction === 'prev') {\n this.keyCounter -= 1;\n this.setState(nextState);\n this.props.onMovePrevRequest(event);\n } else {\n this.keyCounter += 1;\n this.setState(nextState);\n this.props.onMoveNextRequest(event);\n }\n } // Request to transition to the next image\n\n }, {\n key: \"requestMoveNext\",\n value: function requestMoveNext(event) {\n this.requestMove('next', event);\n } // Request to transition to the previous image\n\n }, {\n key: \"requestMovePrev\",\n value: function requestMovePrev(event) {\n this.requestMove('prev', event);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this16 = this;\n\n var _this$props = this.props,\n animationDisabled = _this$props.animationDisabled,\n animationDuration = _this$props.animationDuration,\n clickOutsideToClose = _this$props.clickOutsideToClose,\n discourageDownloads = _this$props.discourageDownloads,\n enableZoom = _this$props.enableZoom,\n imageTitle = _this$props.imageTitle,\n nextSrc = _this$props.nextSrc,\n prevSrc = _this$props.prevSrc,\n toolbarButtons = _this$props.toolbarButtons,\n reactModalStyle = _this$props.reactModalStyle,\n _onAfterOpen = _this$props.onAfterOpen,\n imageCrossOrigin = _this$props.imageCrossOrigin,\n reactModalProps = _this$props.reactModalProps;\n var _this$state = this.state,\n zoomLevel = _this$state.zoomLevel,\n offsetX = _this$state.offsetX,\n offsetY = _this$state.offsetY,\n isClosing = _this$state.isClosing,\n loadErrorStatus = _this$state.loadErrorStatus;\n var boxSize = this.getLightboxRect();\n var transitionStyle = {}; // Transition settings for sliding animations\n\n if (!animationDisabled && this.isAnimating()) {\n transitionStyle = _objectSpread({}, transitionStyle, {\n transition: \"transform \".concat(animationDuration, \"ms\")\n });\n } // Key endings to differentiate between images with the same src\n\n\n var keyEndings = {};\n this.getSrcTypes().forEach(function (_ref13) {\n var name = _ref13.name,\n keyEnding = _ref13.keyEnding;\n keyEndings[name] = keyEnding;\n }); // Images to be displayed\n\n var images = [];\n\n var addImage = function addImage(srcType, imageClass, transforms) {\n // Ignore types that have no source defined for their full size image\n if (!_this16.props[srcType]) {\n return;\n }\n\n var bestImageInfo = _this16.getBestImageForType(srcType);\n\n var imageStyle = _objectSpread({}, transitionStyle, ReactImageLightbox.getTransform(_objectSpread({}, transforms, bestImageInfo)));\n\n if (zoomLevel > MIN_ZOOM_LEVEL) {\n imageStyle.cursor = 'move';\n } // support IE 9 and 11\n\n\n var hasTrueValue = function hasTrueValue(object) {\n return Object.keys(object).some(function (key) {\n return object[key];\n });\n }; // when error on one of the loads then push custom error stuff\n\n\n if (bestImageInfo === null && hasTrueValue(loadErrorStatus)) {\n images.push(React.createElement(\"div\", {\n className: \"\".concat(imageClass, \" ril__image ril-errored\"),\n style: imageStyle,\n key: _this16.props[srcType] + keyEndings[srcType]\n }, React.createElement(\"div\", {\n className: \"ril__errorContainer\"\n }, _this16.props.imageLoadErrorMessage)));\n return;\n }\n\n if (bestImageInfo === null) {\n var loadingIcon = React.createElement(\"div\", {\n className: \"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon\"\n }, _toConsumableArray(new Array(12)).map(function (_, index) {\n return React.createElement(\"div\", {\n // eslint-disable-next-line react/no-array-index-key\n key: index,\n className: \"ril-loading-circle-point ril__loadingCirclePoint\"\n });\n })); // Fall back to loading icon if the thumbnail has not been loaded\n\n images.push(React.createElement(\"div\", {\n className: \"\".concat(imageClass, \" ril__image ril-not-loaded\"),\n style: imageStyle,\n key: _this16.props[srcType] + keyEndings[srcType]\n }, React.createElement(\"div\", {\n className: \"ril__loadingContainer\"\n }, loadingIcon)));\n return;\n }\n\n var imageSrc = bestImageInfo.src;\n\n if (discourageDownloads) {\n imageStyle.backgroundImage = \"url('\".concat(imageSrc, \"')\");\n images.push(React.createElement(\"div\", {\n className: \"\".concat(imageClass, \" ril__image ril__imageDiscourager\"),\n onDoubleClick: _this16.handleImageDoubleClick,\n onWheel: _this16.handleImageMouseWheel,\n style: imageStyle,\n key: imageSrc + keyEndings[srcType]\n }, React.createElement(\"div\", {\n className: \"ril-download-blocker ril__downloadBlocker\"\n })));\n } else {\n images.push(React.createElement(\"img\", _extends({}, imageCrossOrigin ? {\n crossOrigin: imageCrossOrigin\n } : {}, {\n className: \"\".concat(imageClass, \" ril__image\"),\n onDoubleClick: _this16.handleImageDoubleClick,\n onWheel: _this16.handleImageMouseWheel,\n onDragStart: function onDragStart(e) {\n return e.preventDefault();\n },\n style: imageStyle,\n src: imageSrc,\n key: imageSrc + keyEndings[srcType],\n alt: typeof imageTitle === 'string' ? imageTitle : translate('Image'),\n draggable: false\n })));\n }\n };\n\n var zoomMultiplier = this.getZoomMultiplier(); // Next Image (displayed on the right)\n\n addImage('nextSrc', 'ril-image-next ril__imageNext', {\n x: boxSize.width\n }); // Main Image\n\n addImage('mainSrc', 'ril-image-current', {\n x: -1 * offsetX,\n y: -1 * offsetY,\n zoom: zoomMultiplier\n }); // Previous Image (displayed on the left)\n\n addImage('prevSrc', 'ril-image-prev ril__imagePrev', {\n x: -1 * boxSize.width\n });\n var modalStyle = {\n overlay: _objectSpread({\n zIndex: 1000,\n backgroundColor: 'transparent'\n }, reactModalStyle.overlay),\n content: _objectSpread({\n backgroundColor: 'transparent',\n overflow: 'hidden',\n // Needed, otherwise keyboard shortcuts scroll the page\n border: 'none',\n borderRadius: 0,\n padding: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0\n }, reactModalStyle.content)\n };\n return React.createElement(Modal, _extends({\n isOpen: true,\n onRequestClose: clickOutsideToClose ? this.requestClose : undefined,\n onAfterOpen: function onAfterOpen() {\n // Focus on the div with key handlers\n if (_this16.outerEl.current) {\n _this16.outerEl.current.focus();\n }\n\n _onAfterOpen();\n },\n style: modalStyle,\n contentLabel: translate('Lightbox'),\n appElement: typeof global.window !== 'undefined' ? global.window.document.body : undefined\n }, reactModalProps), React.createElement(\"div\", {\n // eslint-disable-line jsx-a11y/no-static-element-interactions\n // Floating modal with closing animations\n className: \"ril-outer ril__outer ril__outerAnimating \".concat(this.props.wrapperClassName, \" \").concat(isClosing ? 'ril-closing ril__outerClosing' : ''),\n style: {\n transition: \"opacity \".concat(animationDuration, \"ms\"),\n animationDuration: \"\".concat(animationDuration, \"ms\"),\n animationDirection: isClosing ? 'normal' : 'reverse'\n },\n ref: this.outerEl,\n onWheel: this.handleOuterMousewheel,\n onMouseMove: this.handleMouseMove,\n onMouseDown: this.handleMouseDown,\n onTouchStart: this.handleTouchStart,\n onTouchMove: this.handleTouchMove,\n tabIndex: \"-1\" // Enables key handlers on div\n ,\n onKeyDown: this.handleKeyInput,\n onKeyUp: this.handleKeyInput\n }, React.createElement(\"div\", {\n // eslint-disable-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n // Image holder\n className: \"ril-inner ril__inner\",\n onClick: clickOutsideToClose ? this.closeIfClickInner : undefined\n }, images), prevSrc && React.createElement(\"button\", {\n // Move to previous image button\n type: \"button\",\n className: \"ril-prev-button ril__navButtons ril__navButtonPrev\",\n key: \"prev\",\n \"aria-label\": this.props.prevLabel,\n onClick: !this.isAnimating() ? this.requestMovePrev : undefined // Ignore clicks during animation\n\n }), nextSrc && React.createElement(\"button\", {\n // Move to next image button\n type: \"button\",\n className: \"ril-next-button ril__navButtons ril__navButtonNext\",\n key: \"next\",\n \"aria-label\": this.props.nextLabel,\n onClick: !this.isAnimating() ? this.requestMoveNext : undefined // Ignore clicks during animation\n\n }), React.createElement(\"div\", {\n // Lightbox toolbar\n className: \"ril-toolbar ril__toolbar\"\n }, React.createElement(\"ul\", {\n className: \"ril-toolbar-left ril__toolbarSide ril__toolbarLeftSide\"\n }, React.createElement(\"li\", {\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, React.createElement(\"span\", {\n className: \"ril-toolbar__item__child ril__toolbarItemChild\"\n }, imageTitle))), React.createElement(\"ul\", {\n className: \"ril-toolbar-right ril__toolbarSide ril__toolbarRightSide\"\n }, toolbarButtons && toolbarButtons.map(function (button, i) {\n return React.createElement(\"li\", {\n key: \"button_\".concat(i + 1),\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, button);\n }), enableZoom && React.createElement(\"li\", {\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, React.createElement(\"button\", {\n // Lightbox zoom in button\n type: \"button\",\n key: \"zoom-in\",\n \"aria-label\": this.props.zoomInLabel,\n className: ['ril-zoom-in', 'ril__toolbarItemChild', 'ril__builtinButton', 'ril__zoomInButton'].concat(_toConsumableArray(zoomLevel === MAX_ZOOM_LEVEL ? ['ril__builtinButtonDisabled'] : [])).join(' '),\n ref: this.zoomInBtn,\n disabled: this.isAnimating() || zoomLevel === MAX_ZOOM_LEVEL,\n onClick: !this.isAnimating() && zoomLevel !== MAX_ZOOM_LEVEL ? this.handleZoomInButtonClick : undefined\n })), enableZoom && React.createElement(\"li\", {\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, React.createElement(\"button\", {\n // Lightbox zoom out button\n type: \"button\",\n key: \"zoom-out\",\n \"aria-label\": this.props.zoomOutLabel,\n className: ['ril-zoom-out', 'ril__toolbarItemChild', 'ril__builtinButton', 'ril__zoomOutButton'].concat(_toConsumableArray(zoomLevel === MIN_ZOOM_LEVEL ? ['ril__builtinButtonDisabled'] : [])).join(' '),\n ref: this.zoomOutBtn,\n disabled: this.isAnimating() || zoomLevel === MIN_ZOOM_LEVEL,\n onClick: !this.isAnimating() && zoomLevel !== MIN_ZOOM_LEVEL ? this.handleZoomOutButtonClick : undefined\n })), React.createElement(\"li\", {\n className: \"ril-toolbar__item ril__toolbarItem\"\n }, React.createElement(\"button\", {\n // Lightbox close button\n type: \"button\",\n key: \"close\",\n \"aria-label\": this.props.closeLabel,\n className: \"ril-close ril-toolbar__item__child ril__toolbarItemChild ril__builtinButton ril__closeButton\",\n onClick: !this.isAnimating() ? this.requestClose : undefined // Ignore clicks during animation\n\n })))), this.props.imageCaption && // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n React.createElement(\"div\", {\n // Image caption\n onWheel: this.handleCaptionMousewheel,\n onMouseDown: function onMouseDown(event) {\n return event.stopPropagation();\n },\n className: \"ril-caption ril__caption\",\n ref: this.caption\n }, React.createElement(\"div\", {\n className: \"ril-caption-content ril__captionContent\"\n }, this.props.imageCaption))));\n }\n }]);\n\n return ReactImageLightbox;\n}(Component);\n\nReactImageLightbox.propTypes = {\n //-----------------------------\n // Image sources\n //-----------------------------\n // Main display image url\n mainSrc: PropTypes.string.isRequired,\n // eslint-disable-line react/no-unused-prop-types\n // Previous display image url (displayed to the left)\n // If left undefined, movePrev actions will not be performed, and the button not displayed\n prevSrc: PropTypes.string,\n // Next display image url (displayed to the right)\n // If left undefined, moveNext actions will not be performed, and the button not displayed\n nextSrc: PropTypes.string,\n //-----------------------------\n // Image thumbnail sources\n //-----------------------------\n // Thumbnail image url corresponding to props.mainSrc\n mainSrcThumbnail: PropTypes.string,\n // eslint-disable-line react/no-unused-prop-types\n // Thumbnail image url corresponding to props.prevSrc\n prevSrcThumbnail: PropTypes.string,\n // eslint-disable-line react/no-unused-prop-types\n // Thumbnail image url corresponding to props.nextSrc\n nextSrcThumbnail: PropTypes.string,\n // eslint-disable-line react/no-unused-prop-types\n //-----------------------------\n // Event Handlers\n //-----------------------------\n // Close window event\n // Should change the parent state such that the lightbox is not rendered\n onCloseRequest: PropTypes.func.isRequired,\n // Move to previous image event\n // Should change the parent state such that props.prevSrc becomes props.mainSrc,\n // props.mainSrc becomes props.nextSrc, etc.\n onMovePrevRequest: PropTypes.func,\n // Move to next image event\n // Should change the parent state such that props.nextSrc becomes props.mainSrc,\n // props.mainSrc becomes props.prevSrc, etc.\n onMoveNextRequest: PropTypes.func,\n // Called when an image fails to load\n // (imageSrc: string, srcType: string, errorEvent: object): void\n onImageLoadError: PropTypes.func,\n // Called when image successfully loads\n onImageLoad: PropTypes.func,\n // Open window event\n onAfterOpen: PropTypes.func,\n //-----------------------------\n // Download discouragement settings\n //-----------------------------\n // Enable download discouragement (prevents [right-click -> Save Image As...])\n discourageDownloads: PropTypes.bool,\n //-----------------------------\n // Animation settings\n //-----------------------------\n // Disable all animation\n animationDisabled: PropTypes.bool,\n // Disable animation on actions performed with keyboard shortcuts\n animationOnKeyInput: PropTypes.bool,\n // Animation duration (ms)\n animationDuration: PropTypes.number,\n //-----------------------------\n // Keyboard shortcut settings\n //-----------------------------\n // Required interval of time (ms) between key actions\n // (prevents excessively fast navigation of images)\n keyRepeatLimit: PropTypes.number,\n // Amount of time (ms) restored after each keyup\n // (makes rapid key presses slightly faster than holding down the key to navigate images)\n keyRepeatKeyupBonus: PropTypes.number,\n //-----------------------------\n // Image info\n //-----------------------------\n // Image title\n imageTitle: PropTypes.node,\n // Image caption\n imageCaption: PropTypes.node,\n // Optional crossOrigin attribute\n imageCrossOrigin: PropTypes.string,\n //-----------------------------\n // Lightbox style\n //-----------------------------\n // Set z-index style, etc., for the parent react-modal (format: https://github.com/reactjs/react-modal#styles )\n reactModalStyle: PropTypes.shape({}),\n // Padding (px) between the edge of the window and the lightbox\n imagePadding: PropTypes.number,\n wrapperClassName: PropTypes.string,\n //-----------------------------\n // Other\n //-----------------------------\n // Array of custom toolbar buttons\n toolbarButtons: PropTypes.arrayOf(PropTypes.node),\n // When true, clicks outside of the image close the lightbox\n clickOutsideToClose: PropTypes.bool,\n // Set to false to disable zoom functionality and hide zoom buttons\n enableZoom: PropTypes.bool,\n // Override props set on react-modal (https://github.com/reactjs/react-modal)\n reactModalProps: PropTypes.shape({}),\n // Aria-labels\n nextLabel: PropTypes.string,\n prevLabel: PropTypes.string,\n zoomInLabel: PropTypes.string,\n zoomOutLabel: PropTypes.string,\n closeLabel: PropTypes.string,\n imageLoadErrorMessage: PropTypes.node\n};\nReactImageLightbox.defaultProps = {\n imageTitle: null,\n imageCaption: null,\n toolbarButtons: null,\n reactModalProps: {},\n animationDisabled: false,\n animationDuration: 300,\n animationOnKeyInput: false,\n clickOutsideToClose: true,\n closeLabel: 'Close lightbox',\n discourageDownloads: false,\n enableZoom: true,\n imagePadding: 10,\n imageCrossOrigin: null,\n keyRepeatKeyupBonus: 40,\n keyRepeatLimit: 180,\n mainSrcThumbnail: null,\n nextLabel: 'Next image',\n nextSrc: null,\n nextSrcThumbnail: null,\n onAfterOpen: function onAfterOpen() {},\n onImageLoadError: function onImageLoadError() {},\n onImageLoad: function onImageLoad() {},\n onMoveNextRequest: function onMoveNextRequest() {},\n onMovePrevRequest: function onMovePrevRequest() {},\n prevLabel: 'Previous image',\n prevSrc: null,\n prevSrcThumbnail: null,\n reactModalStyle: {},\n wrapperClassName: '',\n zoomInLabel: 'Zoom in',\n zoomOutLabel: 'Zoom out',\n imageLoadErrorMessage: 'This image failed to load'\n};\n\nexport default ReactImageLightbox;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.bodyOpenClassName = exports.portalClassName = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ModalPortal = require(\"./ModalPortal\");\n\nvar _ModalPortal2 = _interopRequireDefault(_ModalPortal);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar portalClassName = exports.portalClassName = \"ReactModalPortal\";\nvar bodyOpenClassName = exports.bodyOpenClassName = \"ReactModal__Body--open\";\n\nvar isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;\n\nvar getCreatePortal = function getCreatePortal() {\n return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;\n};\n\nfunction getParentElement(parentSelector) {\n return parentSelector();\n}\n\nvar Modal = function (_Component) {\n _inherits(Modal, _Component);\n\n function Modal() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Modal);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {\n !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);\n var parent = getParentElement(_this.props.parentSelector);\n if (parent && parent.contains(_this.node)) {\n parent.removeChild(_this.node);\n } else {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"parentSelector\" prop did not returned any DOM ' + \"element. Make sure that the parent element is unmounted to \" + \"avoid any memory leaks.\");\n }\n }, _this.portalRef = function (ref) {\n _this.portal = ref;\n }, _this.renderPortal = function (props) {\n var createPortal = getCreatePortal();\n var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node);\n _this.portalRef(portal);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Modal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!_safeHTMLElement.canUseDOM) return;\n\n if (!isReact16) {\n this.node = document.createElement(\"div\");\n }\n this.node.className = this.props.portalClassName;\n\n var parent = getParentElement(this.props.parentSelector);\n parent.appendChild(this.node);\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps) {\n var prevParent = getParentElement(prevProps.parentSelector);\n var nextParent = getParentElement(this.props.parentSelector);\n return { prevParent: prevParent, nextParent: nextParent };\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, _, snapshot) {\n if (!_safeHTMLElement.canUseDOM) return;\n var _props = this.props,\n isOpen = _props.isOpen,\n portalClassName = _props.portalClassName;\n\n\n if (prevProps.portalClassName !== portalClassName) {\n this.node.className = portalClassName;\n }\n\n var prevParent = snapshot.prevParent,\n nextParent = snapshot.nextParent;\n\n if (nextParent !== prevParent) {\n prevParent.removeChild(this.node);\n nextParent.appendChild(this.node);\n }\n\n // Stop unnecessary renders if modal is remaining closed\n if (!prevProps.isOpen && !isOpen) return;\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;\n\n var state = this.portal.state;\n var now = Date.now();\n var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);\n\n if (closesAt) {\n if (!state.beforeClose) {\n this.portal.closeWithTimeout();\n }\n\n setTimeout(this.removePortal, closesAt - now);\n } else {\n this.removePortal();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!_safeHTMLElement.canUseDOM || !isReact16) {\n return null;\n }\n\n if (!this.node && isReact16) {\n this.node = document.createElement(\"div\");\n }\n\n var createPortal = getCreatePortal();\n return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({\n ref: this.portalRef,\n defaultStyles: Modal.defaultStyles\n }, this.props)), this.node);\n }\n }], [{\n key: \"setAppElement\",\n value: function setAppElement(element) {\n ariaAppHider.setElement(element);\n }\n\n /* eslint-disable react/no-unused-prop-types */\n\n /* eslint-enable react/no-unused-prop-types */\n\n }]);\n\n return Modal;\n}(_react.Component);\n\nModal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n portalClassName: _propTypes2.default.string,\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n ariaHideApp: _propTypes2.default.bool,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n parentSelector: _propTypes2.default.func,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func\n};\nModal.defaultProps = {\n isOpen: false,\n portalClassName: portalClassName,\n bodyOpenClassName: bodyOpenClassName,\n role: \"dialog\",\n ariaHideApp: true,\n closeTimeoutMS: 0,\n shouldFocusAfterRender: true,\n shouldCloseOnEsc: true,\n shouldCloseOnOverlayClick: true,\n shouldReturnFocusAfterClose: true,\n preventScroll: false,\n parentSelector: function parentSelector() {\n return document.body;\n },\n overlayElement: function overlayElement(props, contentEl) {\n return _react2.default.createElement(\n \"div\",\n props,\n contentEl\n );\n },\n contentElement: function contentElement(props, children) {\n return _react2.default.createElement(\n \"div\",\n props,\n children\n );\n }\n};\nModal.defaultStyles = {\n overlay: {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(255, 255, 255, 0.75)\"\n },\n content: {\n position: \"absolute\",\n top: \"40px\",\n left: \"40px\",\n right: \"40px\",\n bottom: \"40px\",\n border: \"1px solid #ccc\",\n background: \"#fff\",\n overflow: \"auto\",\n WebkitOverflowScrolling: \"touch\",\n borderRadius: \"4px\",\n outline: \"none\",\n padding: \"20px\"\n }\n};\n\n\n(0, _reactLifecyclesCompat.polyfill)(Modal);\n\nexports.default = Modal;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _focusManager = require(\"../helpers/focusManager\");\n\nvar focusManager = _interopRequireWildcard(_focusManager);\n\nvar _scopeTab = require(\"../helpers/scopeTab\");\n\nvar _scopeTab2 = _interopRequireDefault(_scopeTab);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _classList = require(\"../helpers/classList\");\n\nvar classList = _interopRequireWildcard(_classList);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _portalOpenInstances = require(\"../helpers/portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nrequire(\"../helpers/bodyTrap\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// so that our CSS is statically analyzable\nvar CLASS_NAMES = {\n overlay: \"ReactModal__Overlay\",\n content: \"ReactModal__Content\"\n};\n\nvar TAB_KEY = 9;\nvar ESC_KEY = 27;\n\nvar ariaHiddenInstances = 0;\n\nvar ModalPortal = function (_Component) {\n _inherits(ModalPortal, _Component);\n\n function ModalPortal(props) {\n _classCallCheck(this, ModalPortal);\n\n var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));\n\n _this.setOverlayRef = function (overlay) {\n _this.overlay = overlay;\n _this.props.overlayRef && _this.props.overlayRef(overlay);\n };\n\n _this.setContentRef = function (content) {\n _this.content = content;\n _this.props.contentRef && _this.props.contentRef(content);\n };\n\n _this.afterClose = function () {\n var _this$props = _this.props,\n appElement = _this$props.appElement,\n ariaHideApp = _this$props.ariaHideApp,\n htmlOpenClassName = _this$props.htmlOpenClassName,\n bodyOpenClassName = _this$props.bodyOpenClassName;\n\n // Remove classes.\n\n bodyOpenClassName && classList.remove(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.remove(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n // Reset aria-hidden attribute if all modals have been removed\n if (ariaHideApp && ariaHiddenInstances > 0) {\n ariaHiddenInstances -= 1;\n\n if (ariaHiddenInstances === 0) {\n ariaAppHider.show(appElement);\n }\n }\n\n if (_this.props.shouldFocusAfterRender) {\n if (_this.props.shouldReturnFocusAfterClose) {\n focusManager.returnFocus(_this.props.preventScroll);\n focusManager.teardownScopedFocus();\n } else {\n focusManager.popWithoutFocus();\n }\n }\n\n if (_this.props.onAfterClose) {\n _this.props.onAfterClose();\n }\n\n _portalOpenInstances2.default.deregister(_this);\n };\n\n _this.open = function () {\n _this.beforeOpen();\n if (_this.state.afterOpen && _this.state.beforeClose) {\n clearTimeout(_this.closeTimer);\n _this.setState({ beforeClose: false });\n } else {\n if (_this.props.shouldFocusAfterRender) {\n focusManager.setupScopedFocus(_this.node);\n focusManager.markForFocusLater();\n }\n\n _this.setState({ isOpen: true }, function () {\n _this.setState({ afterOpen: true });\n\n if (_this.props.isOpen && _this.props.onAfterOpen) {\n _this.props.onAfterOpen({\n overlayEl: _this.overlay,\n contentEl: _this.content\n });\n }\n });\n }\n };\n\n _this.close = function () {\n if (_this.props.closeTimeoutMS > 0) {\n _this.closeWithTimeout();\n } else {\n _this.closeWithoutTimeout();\n }\n };\n\n _this.focusContent = function () {\n return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });\n };\n\n _this.closeWithTimeout = function () {\n var closesAt = Date.now() + _this.props.closeTimeoutMS;\n _this.setState({ beforeClose: true, closesAt: closesAt }, function () {\n _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());\n });\n };\n\n _this.closeWithoutTimeout = function () {\n _this.setState({\n beforeClose: false,\n isOpen: false,\n afterOpen: false,\n closesAt: null\n }, _this.afterClose);\n };\n\n _this.handleKeyDown = function (event) {\n if (event.keyCode === TAB_KEY) {\n (0, _scopeTab2.default)(_this.content, event);\n }\n\n if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) {\n event.stopPropagation();\n _this.requestClose(event);\n }\n };\n\n _this.handleOverlayOnClick = function (event) {\n if (_this.shouldClose === null) {\n _this.shouldClose = true;\n }\n\n if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {\n if (_this.ownerHandlesClose()) {\n _this.requestClose(event);\n } else {\n _this.focusContent();\n }\n }\n _this.shouldClose = null;\n };\n\n _this.handleContentOnMouseUp = function () {\n _this.shouldClose = false;\n };\n\n _this.handleOverlayOnMouseDown = function (event) {\n if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {\n event.preventDefault();\n }\n };\n\n _this.handleContentOnClick = function () {\n _this.shouldClose = false;\n };\n\n _this.handleContentOnMouseDown = function () {\n _this.shouldClose = false;\n };\n\n _this.requestClose = function (event) {\n return _this.ownerHandlesClose() && _this.props.onRequestClose(event);\n };\n\n _this.ownerHandlesClose = function () {\n return _this.props.onRequestClose;\n };\n\n _this.shouldBeClosed = function () {\n return !_this.state.isOpen && !_this.state.beforeClose;\n };\n\n _this.contentHasFocus = function () {\n return document.activeElement === _this.content || _this.content.contains(document.activeElement);\n };\n\n _this.buildClassName = function (which, additional) {\n var classNames = (typeof additional === \"undefined\" ? \"undefined\" : _typeof(additional)) === \"object\" ? additional : {\n base: CLASS_NAMES[which],\n afterOpen: CLASS_NAMES[which] + \"--after-open\",\n beforeClose: CLASS_NAMES[which] + \"--before-close\"\n };\n var className = classNames.base;\n if (_this.state.afterOpen) {\n className = className + \" \" + classNames.afterOpen;\n }\n if (_this.state.beforeClose) {\n className = className + \" \" + classNames.beforeClose;\n }\n return typeof additional === \"string\" && additional ? className + \" \" + additional : className;\n };\n\n _this.attributesFromObject = function (prefix, items) {\n return Object.keys(items).reduce(function (acc, name) {\n acc[prefix + \"-\" + name] = items[name];\n return acc;\n }, {});\n };\n\n _this.state = {\n afterOpen: false,\n beforeClose: false\n };\n\n _this.shouldClose = null;\n _this.moveFromContentToOverlay = null;\n return _this;\n }\n\n _createClass(ModalPortal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.isOpen) {\n this.open();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== \"production\") {\n if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"bodyOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"htmlOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n }\n\n if (this.props.isOpen && !prevProps.isOpen) {\n this.open();\n } else if (!this.props.isOpen && prevProps.isOpen) {\n this.close();\n }\n\n // Focus only needs to be set once when the modal is being opened\n if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {\n this.focusContent();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.state.isOpen) {\n this.afterClose();\n }\n clearTimeout(this.closeTimer);\n }\n }, {\n key: \"beforeOpen\",\n value: function beforeOpen() {\n var _props = this.props,\n appElement = _props.appElement,\n ariaHideApp = _props.ariaHideApp,\n htmlOpenClassName = _props.htmlOpenClassName,\n bodyOpenClassName = _props.bodyOpenClassName;\n\n // Add classes.\n\n bodyOpenClassName && classList.add(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.add(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n if (ariaHideApp) {\n ariaHiddenInstances += 1;\n ariaAppHider.hide(appElement);\n }\n\n _portalOpenInstances2.default.register(this);\n }\n\n // Don't steal focus from inner elements\n\n }, {\n key: \"render\",\n value: function render() {\n var _props2 = this.props,\n id = _props2.id,\n className = _props2.className,\n overlayClassName = _props2.overlayClassName,\n defaultStyles = _props2.defaultStyles,\n children = _props2.children;\n\n var contentStyles = className ? {} : defaultStyles.content;\n var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;\n\n if (this.shouldBeClosed()) {\n return null;\n }\n\n var overlayProps = {\n ref: this.setOverlayRef,\n className: this.buildClassName(\"overlay\", overlayClassName),\n style: _extends({}, overlayStyles, this.props.style.overlay),\n onClick: this.handleOverlayOnClick,\n onMouseDown: this.handleOverlayOnMouseDown\n };\n\n var contentProps = _extends({\n id: id,\n ref: this.setContentRef,\n style: _extends({}, contentStyles, this.props.style.content),\n className: this.buildClassName(\"content\", className),\n tabIndex: \"-1\",\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleContentOnMouseDown,\n onMouseUp: this.handleContentOnMouseUp,\n onClick: this.handleContentOnClick,\n role: this.props.role,\n \"aria-label\": this.props.contentLabel\n }, this.attributesFromObject(\"aria\", _extends({ modal: true }, this.props.aria)), this.attributesFromObject(\"data\", this.props.data || {}), {\n \"data-testid\": this.props.testId\n });\n\n var contentElement = this.props.contentElement(contentProps, children);\n return this.props.overlayElement(overlayProps, contentElement);\n }\n }]);\n\n return ModalPortal;\n}(_react.Component);\n\nModalPortal.defaultProps = {\n style: {\n overlay: {},\n content: {}\n },\n defaultStyles: {}\n};\nModalPortal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n defaultStyles: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n ariaHideApp: _propTypes2.default.bool,\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onAfterClose: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n children: _propTypes2.default.node,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func,\n testId: _propTypes2.default.string\n};\nexports.default = ModalPortal;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleBlur = handleBlur;\nexports.handleFocus = handleFocus;\nexports.markForFocusLater = markForFocusLater;\nexports.returnFocus = returnFocus;\nexports.popWithoutFocus = popWithoutFocus;\nexports.setupScopedFocus = setupScopedFocus;\nexports.teardownScopedFocus = teardownScopedFocus;\n\nvar _tabbable = require(\"../helpers/tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar focusLaterElements = [];\nvar modalElement = null;\nvar needToFocus = false;\n\nfunction handleBlur() {\n needToFocus = true;\n}\n\nfunction handleFocus() {\n if (needToFocus) {\n needToFocus = false;\n if (!modalElement) {\n return;\n }\n // need to see how jQuery shims document.on('focusin') so we don't need the\n // setTimeout, firefox doesn't support focusin, if it did, we could focus\n // the element outside of a setTimeout. Side-effect of this implementation\n // is that the document.body gets focus, and then we focus our element right\n // after, seems fine.\n setTimeout(function () {\n if (modalElement.contains(document.activeElement)) {\n return;\n }\n var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;\n el.focus();\n }, 0);\n }\n}\n\nfunction markForFocusLater() {\n focusLaterElements.push(document.activeElement);\n}\n\n/* eslint-disable no-console */\nfunction returnFocus() {\n var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var toFocus = null;\n try {\n if (focusLaterElements.length !== 0) {\n toFocus = focusLaterElements.pop();\n toFocus.focus({ preventScroll: preventScroll });\n }\n return;\n } catch (e) {\n console.warn([\"You tried to return focus to\", toFocus, \"but it is not in the DOM anymore\"].join(\" \"));\n }\n}\n/* eslint-enable no-console */\n\nfunction popWithoutFocus() {\n focusLaterElements.length > 0 && focusLaterElements.pop();\n}\n\nfunction setupScopedFocus(element) {\n modalElement = element;\n\n if (window.addEventListener) {\n window.addEventListener(\"blur\", handleBlur, false);\n document.addEventListener(\"focus\", handleFocus, true);\n } else {\n window.attachEvent(\"onBlur\", handleBlur);\n document.attachEvent(\"onFocus\", handleFocus);\n }\n}\n\nfunction teardownScopedFocus() {\n modalElement = null;\n\n if (window.addEventListener) {\n window.removeEventListener(\"blur\", handleBlur);\n document.removeEventListener(\"focus\", handleFocus);\n } else {\n window.detachEvent(\"onBlur\", handleBlur);\n document.detachEvent(\"onFocus\", handleFocus);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = scopeTab;\n\nvar _tabbable = require(\"./tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction scopeTab(node, event) {\n var tabbable = (0, _tabbable2.default)(node);\n\n if (!tabbable.length) {\n // Do nothing, since there are no elements that can receive focus.\n event.preventDefault();\n return;\n }\n\n var target = void 0;\n\n var shiftKey = event.shiftKey;\n var head = tabbable[0];\n var tail = tabbable[tabbable.length - 1];\n\n // proceed with default browser behavior on tab.\n // Focus on last element on shift + tab.\n if (node === document.activeElement) {\n if (!shiftKey) return;\n target = tail;\n }\n\n if (tail === document.activeElement && !shiftKey) {\n target = head;\n }\n\n if (head === document.activeElement && shiftKey) {\n target = tail;\n }\n\n if (target) {\n event.preventDefault();\n target.focus();\n return;\n }\n\n // Safari radio issue.\n //\n // Safari does not move the focus to the radio button,\n // so we need to force it to really walk through all elements.\n //\n // This is very error prone, since we are trying to guess\n // if it is a safari browser from the first occurence between\n // chrome or safari.\n //\n // The chrome user agent contains the first ocurrence\n // as the 'chrome/version' and later the 'safari/version'.\n var checkSafari = /(\\bChrome\\b|\\bSafari\\b)\\//.exec(navigator.userAgent);\n var isSafariDesktop = checkSafari != null && checkSafari[1] != \"Chrome\" && /\\biPod\\b|\\biPad\\b/g.exec(navigator.userAgent) == null;\n\n // If we are not in safari desktop, let the browser control\n // the focus\n if (!isSafariDesktop) return;\n\n var x = tabbable.indexOf(document.activeElement);\n\n if (x > -1) {\n x += shiftKey ? -1 : 1;\n }\n\n target = tabbable[x];\n\n // If the tabbable element does not exist,\n // focus head/tail based on shiftKey\n if (typeof target === \"undefined\") {\n event.preventDefault();\n target = shiftKey ? tail : head;\n target.focus();\n return;\n }\n\n event.preventDefault();\n\n target.focus();\n}\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\n}());\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.dumpClassLists = dumpClassLists;\nvar htmlClassList = {};\nvar docBodyClassList = {};\n\nfunction dumpClassLists() {\n if (process.env.NODE_ENV !== \"production\") {\n var classes = document.getElementsByTagName(\"html\")[0].className;\n var buffer = \"Show tracked classes:\\n\\n\";\n\n buffer += \" (\" + classes + \"):\\n\";\n for (var x in htmlClassList) {\n buffer += \" \" + x + \" \" + htmlClassList[x] + \"\\n\";\n }\n\n classes = document.body.className;\n\n // eslint-disable-next-line max-len\n buffer += \"\\n\\ndoc.body (\" + classes + \"):\\n\";\n for (var _x in docBodyClassList) {\n buffer += \" \" + _x + \" \" + docBodyClassList[_x] + \"\\n\";\n }\n\n buffer += \"\\n\";\n\n // eslint-disable-next-line no-console\n console.log(buffer);\n }\n}\n\n/**\n * Track the number of reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar incrementReference = function incrementReference(poll, className) {\n if (!poll[className]) {\n poll[className] = 0;\n }\n poll[className] += 1;\n return className;\n};\n\n/**\n * Drop the reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar decrementReference = function decrementReference(poll, className) {\n if (poll[className]) {\n poll[className] -= 1;\n }\n return className;\n};\n\n/**\n * Track a class and add to the given class list.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be tracked.\n */\nvar trackClass = function trackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n incrementReference(poll, className);\n classListRef.add(className);\n });\n};\n\n/**\n * Untrack a class and remove from the given class list if the reference\n * reaches 0.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be untracked.\n */\nvar untrackClass = function untrackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n decrementReference(poll, className);\n poll[className] === 0 && classListRef.remove(className);\n });\n};\n\n/**\n * Public inferface to add classes to the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar add = exports.add = function add(element, classString) {\n return trackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};\n\n/**\n * Public inferface to remove classes from the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar remove = exports.remove = function remove(element, classString) {\n return untrackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};","\"use strict\";\n\nvar _portalOpenInstances = require(\"./portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Body focus trap see Issue #742\n\nvar before = void 0,\n after = void 0,\n instances = [];\n\nfunction focusContent() {\n if (instances.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Open instances > 0 expected\");\n }\n return;\n }\n instances[instances.length - 1].focusContent();\n}\n\nfunction bodyTrap(eventType, openInstances) {\n if (!before || !after) {\n before = document.createElement(\"div\");\n before.setAttribute(\"data-react-modal-body-trap\", \"\");\n before.style.position = \"absolute\";\n before.style.opacity = \"0\";\n before.setAttribute(\"tabindex\", \"0\");\n before.addEventListener(\"focus\", focusContent);\n after = before.cloneNode();\n after.addEventListener(\"focus\", focusContent);\n }\n\n instances = openInstances;\n\n if (instances.length > 0) {\n // Add focus trap\n if (document.body.firstChild !== before) {\n document.body.insertBefore(before, document.body.firstChild);\n }\n if (document.body.lastChild !== after) {\n document.body.appendChild(after);\n }\n } else {\n // Remove focus trap\n if (before.parentElement) {\n before.parentElement.removeChild(before);\n }\n if (after.parentElement) {\n after.parentElement.removeChild(after);\n }\n }\n}\n\n_portalOpenInstances2.default.subscribe(bodyTrap);","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n }\n // Binding \"this\" is important for shallow renderer support.\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(\n prevProps,\n prevState\n );\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n}\n\n// React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (\n typeof Component.getDerivedStateFromProps !== 'function' &&\n typeof prototype.getSnapshotBeforeUpdate !== 'function'\n ) {\n return Component;\n }\n\n // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n if (\n foundWillMountName !== null ||\n foundWillReceivePropsName !== null ||\n foundWillUpdateName !== null\n ) {\n var componentName = Component.displayName || Component.name;\n var newApiName =\n typeof Component.getDerivedStateFromProps === 'function'\n ? 'getDerivedStateFromProps()'\n : 'getSnapshotBeforeUpdate()';\n\n throw Error(\n 'Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' +\n componentName +\n ' uses ' +\n newApiName +\n ' but also contains the following legacy lifecycles:' +\n (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') +\n (foundWillReceivePropsName !== null\n ? '\\n ' + foundWillReceivePropsName\n : '') +\n (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') +\n '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' +\n 'https://fb.me/react-async-component-lifecycle-hooks'\n );\n }\n\n // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n }\n\n // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error(\n 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'\n );\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(\n prevProps,\n prevState,\n maybeSnapshot\n ) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag\n ? this.__reactInternalSnapshot\n : maybeSnapshot;\n\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"ril__outer\":\"style__ril__outer___1zYzZ\",\"ril__outerClosing\":\"style__ril__outerClosing___3n_rB\",\"ril__inner\":\"style__ril__inner___dYbbg\",\"ril__image\":\"style__ril__image___ohhGk\",\"ril__imagePrev\":\"style__ril__imagePrev___1TitV\",\"ril__imageNext\":\"style__ril__imageNext___qIMp_\",\"ril__imageDiscourager\":\"style__ril__imageDiscourager___1loUi\",\"ril__navButtons\":\"style__ril__navButtons___rD-18\",\"ril__navButtonPrev\":\"style__ril__navButtonPrev___3XfSU\",\"ril__navButtonNext\":\"style__ril__navButtonNext___lV26z\",\"ril__downloadBlocker\":\"style__ril__downloadBlocker___2Jwql\",\"ril__caption\":\"style__ril__caption___20juT\",\"ril__toolbar\":\"style__ril__toolbar___10lYy\",\"ril__captionContent\":\"style__ril__captionContent___6dnIh\",\"ril__toolbarSide\":\"style__ril__toolbarSide___1-5RY\",\"ril__toolbarLeftSide\":\"style__ril__toolbarLeftSide___33kts\",\"ril__toolbarRightSide\":\"style__ril__toolbarRightSide___3xRiA\",\"ril__toolbarItem\":\"style__ril__toolbarItem___33nhp\",\"ril__toolbarItemChild\":\"style__ril__toolbarItemChild___1uo52\",\"ril__builtinButton\":\"style__ril__builtinButton___2ew22\",\"ril__builtinButtonDisabled\":\"style__ril__builtinButtonDisabled___3xK7K\",\"ril__closeButton\":\"style__ril__closeButton___2Ge8S\",\"ril__zoomInButton\":\"style__ril__zoomInButton___2okkJ\",\"ril__zoomOutButton\":\"style__ril__zoomOutButton___2U6Nk\",\"ril__outerAnimating\":\"style__ril__outerAnimating___2Z5fK\",\"closeWindow\":\"style__closeWindow___2YNOe\",\"ril__loadingCircle\":\"style__ril__loadingCircle___23cHC\",\"ril__loadingCirclePoint\":\"style__ril__loadingCirclePoint___3pCVl\",\"pointFade\":\"style__pointFade___2ppwA\",\"ril__loadingContainer\":\"style__ril__loadingContainer___38L0C\",\"ril__errorContainer\":\"style__ril__errorContainer___3sKjX\",\"ril__loadingContainer__icon\":\"style__ril__loadingContainer__icon___2nrVt\"};","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Presentation_1 = require(\"../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetSourceList: {\n border: \"1px solid \" + theme.colors.border,\n padding: \"0 \" + theme.spacing.full,\n },\n item: {\n display: 'flex',\n alignItems: 'center',\n '& a': {\n fontWeight: 'normal',\n cursor: 'pointer',\n userSelect: 'none',\n '&:hover': {\n color: theme.colors.primary,\n },\n },\n },\n itemSelected: {\n '&, .neos.neos-module &': {\n color: theme.colors.primary,\n },\n },\n}); });\nfunction AssetSourceList() {\n var classes = useStyles();\n var assetSources = hooks_1.useAssetSourcesQuery().assetSources;\n var translate = src_1.useIntl().translate;\n var _a = hooks_1.useSelectAssetSource(), selectedAssetSource = _a[0], setSelectedAssetSource = _a[1];\n // We don't show the source selection if there is only one\n if (!assetSources || assetSources.length < 2)\n return null;\n return (React.createElement(\"nav\", { className: classes.assetSourceList },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"box\", label: translate('assetSourceList.header', 'Media sources') })), assetSources === null || assetSources === void 0 ? void 0 :\n assetSources.map(function (assetSource) { return (React.createElement(Presentation_1.IconLabel, { key: assetSource.id, label: assetSource.label, iconUri: assetSource.iconUri, className: classes.item },\n React.createElement(\"a\", { className: (selectedAssetSource === null || selectedAssetSource === void 0 ? void 0 : selectedAssetSource.id) === assetSource.id ? classes.itemSelected : null, onClick: function () { return setSelectedAssetSource(assetSource); } }, assetSource.id === 'neos' ? translate('assetsource.local', 'Local') : assetSource.label))); })));\n}\nexports.default = AssetSourceList;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles({\n assetLabel: {\n display: 'inline-block',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n },\n});\nvar AssetLabel = function (_a) {\n var label = _a.label;\n var classes = useStyles();\n return React.createElement(\"span\", { className: classes.assetLabel }, label);\n};\nexports.default = React.memo(AssetLabel);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n column: {\n display: 'grid',\n gridAutoRows: 'minmax(0, min-content)',\n gridGap: theme.spacing.full,\n overflowY: 'auto',\n overflowX: 'hidden',\n height: '100%',\n },\n}); });\nfunction Column(_a) {\n var children = _a.children;\n var classes = useStyles();\n return React.createElement(\"div\", { className: classes.column }, children);\n}\nexports.default = Column;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n iconWrap: {\n verticalAlign: 'middle',\n },\n label: {\n fontWeight: 'bold',\n lineHeight: theme.spacing.goldenUnit,\n paddingLeft: theme.spacing.half,\n userSelect: 'none',\n },\n imgIcon: {\n width: 'auto',\n height: '18px',\n },\n}); });\nvar IconLabel = function (_a) {\n var _b = _a.icon, icon = _b === void 0 ? 'question' : _b, _c = _a.iconUri, iconUri = _c === void 0 ? '' : _c, _d = _a.label, label = _d === void 0 ? '' : _d, _e = _a.className, className = _e === void 0 ? '' : _e, _f = _a.children, children = _f === void 0 ? null : _f;\n var classes = useStyles();\n return (React.createElement(\"div\", { className: className },\n React.createElement(\"span\", { className: classes.iconWrap }, iconUri ? React.createElement(\"img\", { src: iconUri, alt: label, className: classes.imgIcon }) : React.createElement(react_ui_components_1.Icon, { icon: icon })),\n React.createElement(\"span\", { className: classes.label }, children || label || '')));\n};\nexports.default = React.memo(IconLabel);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n propertyList: {\n overflow: 'hidden',\n width: '100%',\n maxWidth: '100%',\n '& dt': {\n backgroundColor: theme.colors.alternatingBackground,\n color: 'white',\n fontWeight: 'bold',\n padding: theme.spacing.half + \" \" + theme.spacing.half + \" 0\",\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n width: \"calc(\" + theme.size.sidebarWidth + \" - \" + theme.spacing.full + \")\",\n },\n '& dd': {\n backgroundColor: theme.colors.alternatingBackground,\n color: theme.colors.inactive,\n margin: '0 0 1px',\n padding: theme.spacing.half,\n textOverflow: 'ellipsis',\n overflowX: 'hidden',\n whiteSpace: 'nowrap',\n width: \"calc(\" + theme.size.sidebarWidth + \" - \" + theme.spacing.full + \")\",\n },\n },\n}); });\nvar PropertyList = function (_a) {\n var children = _a.children;\n var classes = useStyles();\n return React.createElement(\"dl\", { className: classes.propertyList }, children);\n};\nexports.default = React.memo(PropertyList);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar PropertyListItem = function (_a) {\n var label = _a.label, value = _a.value;\n return (React.createElement(React.Fragment, null,\n React.createElement(\"dt\", null, label),\n React.createElement(\"dd\", null, value)));\n};\nexports.default = React.memo(PropertyListItem);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Presentation_1 = require(\"../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetSourceDescription: {\n border: \"1px solid \" + theme.colors.border,\n '& .ReactCollapse--collapse': {\n transition: \"height \" + theme.transition.slow,\n },\n },\n panelHeader: {\n '& button': {\n position: 'absolute',\n },\n },\n}); });\nfunction AssetSourceDescription() {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var selectedAssetSource = hooks_1.useSelectAssetSource()[0];\n if (!(selectedAssetSource === null || selectedAssetSource === void 0 ? void 0 : selectedAssetSource.description))\n return null;\n return (React.createElement(react_ui_components_1.ToggablePanel, { closesToBottom: true, className: classes.assetSourceDescription },\n React.createElement(react_ui_components_1.ToggablePanel.Header, { className: classes.panelHeader },\n React.createElement(Presentation_1.IconLabel, { icon: \"info-circle\", label: translate('assetSourceDe' + 'scription.header', 'Media source description') })),\n React.createElement(react_ui_components_1.ToggablePanel.Contents, null,\n React.createElement(\"p\", null, selectedAssetSource.description))));\n}\nexports.default = AssetSourceDescription;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar Tree_1 = require(\"./Tree\");\nvar index_1 = require(\"./index\");\nvar Presentation_1 = require(\"../Presentation\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar components_1 = require(\"@media-ui/feature-asset-upload/src/components\");\nvar SideBarLeft = function () {\n var selectionMode = src_1.useMediaUi().selectionMode;\n var components = [\n !selectionMode && components_1.UploadButton,\n index_1.AssetSourceList,\n Tree_1.AssetCollectionTree,\n index_1.AssetSourceDescription,\n ].filter(Boolean);\n return (React.createElement(Presentation_1.Column, null, components.map(function (Component, index) { return (React.createElement(Component, { key: index })); })));\n};\nexports.default = React.memo(SideBarLeft);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar AssetCollectionTreeNode_1 = __importDefault(require(\"./AssetCollectionTreeNode\"));\nvar TagTreeNode_1 = __importDefault(require(\"./TagTreeNode\"));\nvar Presentation_1 = require(\"../../Presentation\");\nvar AddAssetCollectionButton_1 = __importDefault(require(\"./AddAssetCollectionButton\"));\nvar AddTagButton_1 = __importDefault(require(\"./AddTagButton\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n assetCollectionTree: {\n border: \"1px solid \" + theme.colors.border,\n },\n headline: {\n padding: \"0 \" + theme.spacing.full,\n },\n iconWrap: {\n width: theme.spacing.goldenUnit,\n display: 'inline-flex',\n justifyContent: 'center',\n },\n toolbar: {\n borderTop: \"1px solid \" + theme.colors.border,\n },\n tree: {\n borderTop: \"1px solid \" + theme.colors.border,\n },\n}); });\nvar AssetCollectionTree = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var selectAssetCollection = hooks_1.useSelectAssetCollection();\n var selectTag = hooks_1.useSelectTag();\n var setSelectedAssetCollectionId = recoil_1.useSetRecoilState(state_1.selectedAssetCollectionIdState);\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var selectedTag = hooks_1.useSelectedTag();\n var setSelectedAssetId = recoil_1.useSetRecoilState(state_1.selectedAssetIdState);\n var setSelectedTagId = recoil_1.useSetRecoilState(state_1.selectedTagIdState);\n var tags = hooks_1.useTagsQuery().tags;\n var assetCollections = hooks_1.useAssetCollectionsQuery().assetCollections;\n var selectedAssetSource = hooks_1.useSelectAssetSource()[0];\n var deleteTag = hooks_1.useDeleteTag().deleteTag;\n var deleteAssetCollection = hooks_1.useDeleteAssetCollection().deleteAssetCollection;\n var onClickDelete = react_1.useCallback(function () {\n if (selectedTag) {\n // TODO: Use custom modal\n var confirm_1 = window.confirm(translate('action.deleteTag.confirm', 'Do you really want to delete the tag ' + selectedTag.label, [\n selectedTag.label,\n ]));\n if (!confirm_1)\n return;\n deleteTag(selectedTag.id)\n .then(function () {\n Notify.ok(translate('action.deleteTag.success', 'The tag has been deleted'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('action.deleteTag.error', 'Error while trying to delete the tag'), message);\n });\n setSelectedTagId(null);\n setSelectedAssetCollectionId(null);\n setSelectedAssetId(null);\n }\n else if (selectedAssetCollection) {\n // TODO: Use custom modal\n var confirm_2 = window.confirm(translate('action.deleteAssetCollection.confirm', 'Do you really want to delete the asset collection ' + selectedAssetCollection.title, [selectedAssetCollection.title]));\n if (!confirm_2)\n return;\n deleteAssetCollection(selectedAssetCollection.id)\n .then(function () {\n Notify.ok(translate('assetCollectionActions.delete.success', 'Asset collection was successfully deleted'));\n })\n .catch(function (error) {\n Notify.error(translate('assetCollectionActions.delete.error', 'Failed to delete asset collection'), error.message);\n });\n setSelectedTagId(null);\n setSelectedAssetCollectionId(null);\n setSelectedAssetId(null);\n }\n }, [\n selectedTag,\n selectedAssetCollection,\n translate,\n deleteTag,\n setSelectedTagId,\n setSelectedAssetCollectionId,\n setSelectedAssetId,\n Notify,\n deleteAssetCollection,\n ]);\n if (!(selectedAssetSource === null || selectedAssetSource === void 0 ? void 0 : selectedAssetSource.supportsCollections))\n return null;\n return (React.createElement(\"nav\", { className: classes.assetCollectionTree },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\", className: classes.headline },\n React.createElement(Presentation_1.IconLabel, { icon: \"folder\", label: translate('assetCollectionList.header', 'Collections') })),\n React.createElement(\"div\", { className: classes.toolbar },\n React.createElement(AddAssetCollectionButton_1.default, null),\n React.createElement(AddTagButton_1.default, null),\n React.createElement(react_ui_components_1.IconButton, { icon: \"trash-alt\", size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", disabled: !selectedAssetCollection && !selectedTag, title: translate('assetCollectionTree.toolbar.delete', 'Delete'), onClick: onClickDelete })),\n React.createElement(react_ui_components_1.Tree, { className: classes.tree },\n React.createElement(AssetCollectionTreeNode_1.default, { isActive: !selectedAssetCollection && !selectedTag, label: translate('assetCollectionList.showAll', 'All'), title: translate('assetCollectionList.showAll.title', 'Show assets for all collections'), level: 1, onClick: selectAssetCollection, assetCollection: null, collapsedByDefault: false }, tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return (React.createElement(TagTreeNode_1.default, { key: tag.id, tag: tag, isActive: !selectedAssetCollection && tag.id == (selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id), level: 2, onClick: selectTag })); })),\n assetCollections.map(function (assetCollection, index) {\n var _a;\n return (React.createElement(AssetCollectionTreeNode_1.default, { key: index, assetCollection: assetCollection, onClick: selectAssetCollection, level: 1, isActive: assetCollection.title == (selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.title) && !selectedTag }, (_a = assetCollection.tags) === null || _a === void 0 ? void 0 : _a.map(function (tag) { return (React.createElement(TagTreeNode_1.default, { key: tag.id, tag: tag, assetCollection: assetCollection, isActive: assetCollection.id == (selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id) && tag.id == (selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id), level: 2, onClick: selectTag })); })));\n }))));\n};\nexports.default = React.memo(AssetCollectionTree);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar dndTypes_1 = __importDefault(require(\"@media-ui/core/src/constants/dndTypes\"));\nvar AssetCollectionTreeNode = function (_a) {\n var isActive = _a.isActive, assetCollection = _a.assetCollection, label = _a.label, title = _a.title, children = _a.children, level = _a.level, onClick = _a.onClick, _b = _a.collapsedByDefault, collapsedByDefault = _b === void 0 ? true : _b;\n var _c = react_1.useState(collapsedByDefault), collapsed = _c[0], setCollapsed = _c[1];\n var handleToggle = react_1.useCallback(function () { return setCollapsed(!collapsed); }, [collapsed]);\n var handleClick = react_1.useCallback(function () { return onClick(assetCollection); }, [onClick, assetCollection]);\n return (React.createElement(react_ui_components_1.Tree.Node, null,\n React.createElement(react_ui_components_1.Tree.Node.Header, { isActive: isActive, isCollapsed: children.length === 0 || collapsed, isFocused: isActive, isLoading: false, hasError: false, label: label || assetCollection.title, title: title || assetCollection.title, icon: \"folder\", nodeDndType: dndTypes_1.default.COLLECTION, level: level, onToggle: handleToggle, onClick: handleClick, hasChildren: children.length > 0 }),\n !collapsed && children));\n};\nexports.default = React.memo(AssetCollectionTreeNode);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar dndTypes_1 = __importDefault(require(\"@media-ui/core/src/constants/dndTypes\"));\nvar TagTreeNode = function (_a) {\n var tag = _a.tag, isActive = _a.isActive, assetCollection = _a.assetCollection, label = _a.label, title = _a.title, onClick = _a.onClick, level = _a.level;\n var handleClick = react_1.useCallback(function () { return onClick(tag, assetCollection); }, [onClick, tag, assetCollection]);\n // TODO: Adjust rendering for nested tags\n return (React.createElement(react_ui_components_1.Tree.Node, null,\n React.createElement(react_ui_components_1.Tree.Node.Header, { isActive: isActive, isCollapsed: true, isFocused: isActive, isLoading: false, hasError: false, label: label || tag.label, title: title || tag.label, icon: \"tag\", nodeDndType: dndTypes_1.default.TAG, level: level, onClick: handleClick, hasChildren: false })));\n};\nexports.default = React.memo(TagTreeNode);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"../../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n plusIcon: {\n top: '15px !important',\n left: '13px !important',\n width: '9px !important',\n },\n});\nvar AddAssetCollectionButton = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var setCreateAssetCollectionDialogState = recoil_1.useSetRecoilState(state_1.createAssetCollectionDialogState);\n var onClickCreate = react_1.useCallback(function () {\n setCreateAssetCollectionDialogState({ title: '', visible: true });\n }, [setCreateAssetCollectionDialogState]);\n return (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", title: translate('assetCollectionTree.toolbar.createAssetCollection', 'Create new asset collection'), onClick: onClickCreate },\n React.createElement(\"span\", { className: \"fa-layers fa-fw\" },\n React.createElement(react_ui_components_1.Icon, { icon: \"folder\" }),\n React.createElement(react_ui_components_1.Icon, { icon: \"plus\", color: \"primaryBlue\", className: classes.plusIcon }))));\n};\nexports.default = React.memo(AddAssetCollectionButton);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"../../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n plusIcon: {\n top: '13px !important',\n left: '11px !important',\n width: '9px !important',\n },\n});\nvar AddTagButton = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var setCreateTagDialogState = recoil_1.useSetRecoilState(state_1.createTagDialogState);\n var onClickCreate = react_1.useCallback(function () {\n setCreateTagDialogState({ label: '', visible: true });\n }, [setCreateTagDialogState]);\n return (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", title: translate('assetCollectionTree.toolbar.createTag', 'Create new tag'), onClick: onClickCreate },\n React.createElement(\"span\", { className: \"fa-layers fa-fw\" },\n React.createElement(react_ui_components_1.Icon, { icon: \"tag\" }),\n React.createElement(react_ui_components_1.Icon, { icon: \"plus\", color: \"primaryBlue\", className: classes.plusIcon }))));\n};\nexports.default = React.memo(AddTagButton);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CurrentSelection = exports.SideBarRight = void 0;\nvar SideBarRight_1 = __importDefault(require(\"./SideBarRight\"));\nexports.SideBarRight = SideBarRight_1.default;\nvar CurrentSelection_1 = __importDefault(require(\"./CurrentSelection\"));\nexports.CurrentSelection = CurrentSelection_1.default;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar Inspector_1 = require(\"./Inspector\");\nvar CurrentSelection_1 = __importDefault(require(\"./CurrentSelection\"));\nvar Presentation_1 = require(\"../Presentation\");\nvar SideBarRight = function () {\n // TODO: Read from component store\n var components = [\n CurrentSelection_1.default,\n Inspector_1.AssetInspector,\n Inspector_1.AssetCollectionInspector,\n Inspector_1.TagInspector,\n Inspector_1.IptcMetadataInspector,\n ];\n return (React.createElement(Presentation_1.Column, null, components.map(function (Component, index) { return (React.createElement(Component, { key: index })); })));\n};\nexports.default = React.memo(SideBarRight);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar VariantsInspector_1 = __importDefault(require(\"@media-ui/feature-asset-variants/src/components/VariantsInspector\"));\nvar PropertyInspector_1 = __importDefault(require(\"./PropertyInspector\"));\nvar recoil_1 = require(\"recoil\");\nvar useStyles = src_1.createUseMediaUiStyles(function () { return ({\n tabContent: {\n height: 'calc(100% - 42px)',\n },\n}); });\nvar AssetInspector = function () {\n var classes = useStyles();\n var selectedAsset = hooks_1.useSelectedAsset();\n var featureFlags = src_1.useMediaUi().featureFlags;\n var selectedInspectorView = recoil_1.useRecoilValue(state_1.selectedInspectorViewState);\n if (!selectedAsset || selectedInspectorView !== 'asset')\n return null;\n return featureFlags.showVariantsEditor ? (React.createElement(react_ui_components_1.Tabs, { theme: { tabs__content: classes.tabContent } },\n React.createElement(react_ui_components_1.Tabs.Panel, { icon: \"pencil\", key: \"editor\", id: \"editor\" },\n React.createElement(PropertyInspector_1.default, null)),\n React.createElement(react_ui_components_1.Tabs.Panel, { icon: \"images\" },\n React.createElement(VariantsInspector_1.default, null)))) : (React.createElement(PropertyInspector_1.default, null));\n};\nexports.default = React.memo(AssetInspector);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __importDefault(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar useAssetVariants_1 = __importDefault(require(\"../hooks/useAssetVariants\"));\nvar Variant_1 = __importDefault(require(\"./Variant\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n variantsContainer: {\n padding: theme.spacing.full + \" \" + theme.spacing.half,\n },\n variantItem: {\n marginTop: theme.spacing.full,\n },\n}); });\nvar VariantsInspector = function () {\n var _a, _b;\n var translate = src_1.useIntl().translate;\n var selectedAsset = hooks_1.useSelectedAsset();\n var result = useAssetVariants_1.default({ assetId: selectedAsset.id, assetSourceId: selectedAsset.assetSource.id });\n var classes = useStyles();\n return (react_1.default.createElement(\"div\", { className: classes.variantsContainer }, result.loading ? (react_1.default.createElement(\"div\", null, \"Loading Variants\")) : (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(\"h1\", null, \"Image Variants\"),\n react_1.default.createElement(\"ul\", null, ((_a = result.variants) === null || _a === void 0 ? void 0 : _a.length) > 0 ? ((_b = result.variants) === null || _b === void 0 ? void 0 : _b.map(function (variant) { return (react_1.default.createElement(\"li\", { className: classes.variantItem, key: \"variant-\" + variant.id },\n react_1.default.createElement(Variant_1.default, __assign({}, variant)))); })) : (react_1.default.createElement(\"li\", null, translate('assetVariants.noVariantsFound', 'No variants found'))))))));\n};\nexports.default = VariantsInspector;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar assetVariants_1 = __importDefault(require(\"../queries/assetVariants\"));\nfunction useAssetVariants(assetIdentity) {\n var _a = client_1.useQuery(assetVariants_1.default, {\n variables: { id: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetId, assetSourceId: assetIdentity === null || assetIdentity === void 0 ? void 0 : assetIdentity.assetSourceId },\n skip: !assetIdentity,\n }), data = _a.data, loading = _a.loading, refetch = _a.refetch;\n return { variants: (data === null || data === void 0 ? void 0 : data.assetVariants) || null, loading: loading, refetch: refetch };\n}\nexports.default = useAssetVariants;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar cropInformation_1 = __importDefault(require(\"../fragments/cropInformation\"));\nvar ASSET_VARIANTS = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n query ASSET_VARIANTS($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n assetVariants(id: $id, assetSourceId: $assetSourceId) {\\n id\\n width\\n height\\n presetIdentifier\\n variantName\\n hasCrop\\n previewUrl\\n cropInformation {\\n ...CropInformationProps\\n }\\n }\\n }\\n \", \"\\n\"], [\"\\n query ASSET_VARIANTS($id: AssetId!, $assetSourceId: AssetSourceId!) {\\n assetVariants(id: $id, assetSourceId: $assetSourceId) {\\n id\\n width\\n height\\n presetIdentifier\\n variantName\\n hasCrop\\n previewUrl\\n cropInformation {\\n ...CropInformationProps\\n }\\n }\\n }\\n \", \"\\n\"])), cropInformation_1.default);\nexports.default = ASSET_VARIANTS;\nvar templateObject_1;\n","\"use strict\";\nvar __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"@apollo/client\");\nvar CROP_INFORMATION_FRAGMENT = client_1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n fragment CropInformationProps on CropInformation {\\n width\\n height\\n x\\n y\\n }\\n\"], [\"\\n fragment CropInformationProps on CropInformation {\\n width\\n height\\n x\\n y\\n }\\n\"])));\nexports.default = CROP_INFORMATION_FRAGMENT;\nvar templateObject_1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __importDefault(require(\"react\"));\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n variantContainer: {\n backgroundColor: theme.colors.assetBackground,\n },\n picture: {\n height: 200,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n image: {\n maxHeight: '100%',\n objectFit: 'contain',\n display: 'block',\n backgroundImage: 'repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)',\n backgroundPosition: '0 0, 10px 10px',\n backgroundSize: '20px 20px',\n },\n caption: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: theme.spacing.half,\n backgroundColor: theme.colors.captionBackground,\n },\n infoContainer: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n maxWidth: theme.size.sidebarWidth,\n },\n info: {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n variantSizes: {\n fontSize: theme.fontSize.small,\n },\n}); });\nvar Variant = function (_a) {\n var presetIdentifier = _a.presetIdentifier, variantName = _a.variantName, width = _a.width, height = _a.height, previewUrl = _a.previewUrl;\n var classes = useStyles();\n return (react_1.default.createElement(\"div\", { className: classes.variantContainer },\n react_1.default.createElement(\"picture\", { className: classes.picture },\n react_1.default.createElement(\"img\", { className: classes.image, src: previewUrl, alt: variantName })),\n react_1.default.createElement(\"figcaption\", { className: classes.caption },\n react_1.default.createElement(\"div\", { className: classes.infoContainer },\n presetIdentifier ? react_1.default.createElement(\"span\", { className: classes.info },\n \"Preset: \",\n presetIdentifier) : null,\n variantName ? react_1.default.createElement(\"span\", { className: classes.info },\n \"Variant: \",\n variantName) : null,\n react_1.default.createElement(\"span\", { className: classes.variantSizes },\n \"W: \",\n width,\n \" H: \",\n height)))));\n};\nexports.default = Variant;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar _1 = require(\".\");\nvar recoil_1 = require(\"recoil\");\nvar Actions_1 = __importDefault(require(\"./Actions\"));\nvar Property_1 = __importDefault(require(\"./Property\"));\nvar InspectorContainer_1 = __importDefault(require(\"./InspectorContainer\"));\nvar AssetCollectionInspector = function () {\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var selectedInspectorView = recoil_1.useRecoilValue(state_1.selectedInspectorViewState);\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var _a = react_1.useState(null), title = _a[0], setTitle = _a[1];\n var updateAssetCollection = hooks_1.useUpdateAssetCollection().updateAssetCollection;\n var hasUnpublishedChanges = selectedAssetCollection && title !== selectedAssetCollection.title;\n var handleDiscard = react_1.useCallback(function () {\n if (selectedAssetCollection) {\n setTitle(selectedAssetCollection.title);\n }\n }, [selectedAssetCollection, setTitle]);\n var handleApply = react_1.useCallback(function () {\n if (title !== selectedAssetCollection.title) {\n updateAssetCollection({\n assetCollection: selectedAssetCollection,\n title: title,\n })\n .then(function () {\n Notify.ok(translate('actions.updateAssetCollection.success', 'The asset collection has been updated'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.deleteAssetCollection.error', 'Error while updating the asset collection'), message);\n });\n }\n }, [Notify, translate, selectedAssetCollection, updateAssetCollection, title]);\n react_1.useEffect(function () {\n handleDiscard();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id]);\n if (!selectedAssetCollection || selectedInspectorView !== 'assetCollection')\n return null;\n return (React.createElement(InspectorContainer_1.default, null,\n React.createElement(Property_1.default, { label: translate('inspector.title', 'Title') },\n React.createElement(react_ui_components_1.TextInput, { type: \"text\", value: title || '', onChange: setTitle, onEnterKey: handleApply })),\n React.createElement(Actions_1.default, { handleApply: handleApply, handleDiscard: handleDiscard, hasUnpublishedChanges: hasUnpublishedChanges }),\n React.createElement(_1.TagSelectBoxAssetCollection, null)));\n};\nexports.default = React.memo(AssetCollectionInspector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Presentation_1 = require(\"../../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n iptcData: {\n '& dl': {\n '& dt': {\n backgroundColor: theme.colors.alternatingBackground,\n fontWeight: 'bold',\n color: 'white',\n padding: '8px 8px 0',\n },\n '& dd': {\n backgroundColor: theme.colors.alternatingBackground,\n marginBottom: '1px',\n padding: '8px',\n color: theme.colors.inactive,\n },\n },\n },\n}); });\nvar IptcMetadataInspector = function () {\n var _a;\n var classes = useStyles();\n var selectedAsset = hooks_1.useSelectedAsset();\n var translate = src_1.useIntl().translate;\n if (!((_a = selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.iptcProperties) === null || _a === void 0 ? void 0 : _a.length))\n return null;\n return (React.createElement(\"div\", { className: classes.iptcData },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"camera\", label: translate('inspector.iptcMetadata', 'IPTC Metadata') })),\n React.createElement(Presentation_1.PropertyList, null, selectedAsset.iptcProperties.map(function (iptcProperty) { return (React.createElement(Presentation_1.PropertyListItem, { key: iptcProperty.propertyName, label: iptcProperty.propertyName, value: iptcProperty.value })); }))));\n};\nexports.default = React.memo(IptcMetadataInspector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar helper_1 = require(\"@media-ui/core/src/helper\");\nvar Presentation_1 = require(\"../../Presentation\");\nvar MetadataView = function () {\n var translate = src_1.useIntl().translate;\n var selectedAsset = hooks_1.useSelectedAsset();\n if (!selectedAsset)\n return null;\n return (React.createElement(\"div\", null,\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"info-circle\", label: translate('inspector.metadata', 'Metadata') })),\n React.createElement(Presentation_1.PropertyList, null,\n selectedAsset.file.size > 0 && (React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.fileSize', 'Size'), value: helper_1.humanFileSize(selectedAsset.file.size) })),\n React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.lastModified', 'Last modified'), value: new Date(selectedAsset.lastModified).toLocaleString() }),\n React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.dimensions', 'Dimensions'), value: selectedAsset.width + \"px x \" + selectedAsset.height + \"px\" }),\n React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.mediaType', 'MIME type'), value: selectedAsset.file.mediaType }),\n React.createElement(Presentation_1.PropertyListItem, { label: translate('inspector.property.filename', 'Filename'), value: selectedAsset.filename }))));\n};\nexports.default = React.memo(MetadataView);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Actions_1 = __importDefault(require(\"./Actions\"));\nvar Property_1 = __importDefault(require(\"./Property\"));\nvar InspectorContainer_1 = __importDefault(require(\"./InspectorContainer\"));\nvar TagInspector = function () {\n var selectedTag = hooks_1.useSelectedTag();\n var selectedInspectorView = recoil_1.useRecoilValue(state_1.selectedInspectorViewState);\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var _a = react_1.useState(null), label = _a[0], setLabel = _a[1];\n var updateTag = hooks_1.useUpdateTag().updateTag;\n var hasUnpublishedChanges = selectedTag && label !== selectedTag.label;\n var handleDiscard = react_1.useCallback(function () {\n if (selectedTag) {\n setLabel(selectedTag.label);\n }\n }, [selectedTag, setLabel]);\n var handleApply = react_1.useCallback(function () {\n if (label !== selectedTag.label) {\n updateTag({\n tag: selectedTag,\n label: label,\n })\n .then(function () {\n Notify.ok(translate('actions.updateTag.success', 'The tag has been updated'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.updateTag.error', 'Error while updating the tag'), message);\n });\n }\n }, [Notify, translate, selectedTag, updateTag, label]);\n react_1.useEffect(function () {\n handleDiscard();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id]);\n if (!selectedTag || selectedInspectorView !== 'tag')\n return null;\n return (React.createElement(InspectorContainer_1.default, null,\n React.createElement(Property_1.default, { label: translate('inspector.label', 'Label') },\n React.createElement(react_ui_components_1.TextInput, { type: \"text\", value: label || '', onChange: setLabel, onEnterKey: handleApply })),\n React.createElement(Actions_1.default, { handleApply: handleApply, handleDiscard: handleDiscard, hasUnpublishedChanges: hasUnpublishedChanges })));\n};\nexports.default = React.memo(TagInspector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar Presentation_1 = require(\"../../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles({\n tagSelectBox: {},\n tagSelection: {},\n});\nvar TagSelectBox = function (_a) {\n var values = _a.values, options = _a.options, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b;\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var handleChange = function (tagIds) { return onChange(tagIds.map(function (tagId) { return options.find(function (o) { return o.id === tagId; }); })); };\n return (React.createElement(\"div\", { className: classes.tagSelectBox },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"tags\", label: translate('inspector.tags', 'Tags') })),\n React.createElement(react_ui_components_1.MultiSelectBox, { className: classes.tagSelection, disabled: disabled, placeholder: translate('inspector.tags.placeholder', 'Select a tag'), noMatchesFoundLabel: translate('general.noMatchesFound', 'No matches found'), values: values, optionValueField: \"id\", options: options, searchOptions: options, onValuesChange: handleChange })));\n};\nexports.default = React.memo(TagSelectBox);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar _1 = require(\".\");\nvar tagsMatchAsset = function (tags, asset) {\n return (tags\n .map(function (tag) { return tag.id; })\n .sort()\n .join(',') ===\n asset.tags\n .map(function (tag) { return tag.id; })\n .sort()\n .join(','));\n};\nvar TagSelectBoxAsset = function () {\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var allTags = hooks_1.useTagsQuery().tags;\n var _a = hooks_1.useSetAssetTags(), setAssetTags = _a.setAssetTags, loading = _a.loading;\n var selectedAsset = hooks_1.useSelectedAsset();\n var selectedTagIds = react_1.useMemo(function () { return selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.tags.map(function (_a) {\n var id = _a.id;\n return id;\n }).sort(); }, [selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.tags]);\n var handleChange = react_1.useCallback(function (newTags) {\n if (!tagsMatchAsset(newTags, selectedAsset)) {\n setAssetTags({\n asset: selectedAsset,\n tags: newTags,\n })\n .then(function () {\n Notify.ok(translate('actions.setAssetTags.success', 'The asset has been tagged'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.setAssetTags.error', 'Error while tagging the asset'), message);\n });\n }\n }, [Notify, selectedAsset, setAssetTags, translate]);\n if (!selectedAsset)\n return null;\n return (React.createElement(_1.TagSelectBox, { values: selectedTagIds, options: allTags, onChange: handleChange, disabled: loading || selectedAsset.assetSource.readOnly }));\n};\nexports.default = React.memo(TagSelectBoxAsset);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar _1 = require(\".\");\nvar tagsMatchAssetCollection = function (tags, assetCollection) {\n return (tags\n .map(function (tag) { return tag.id; })\n .sort()\n .join(',') ===\n assetCollection.tags\n .map(function (tag) { return tag.id; })\n .sort()\n .join(','));\n};\nvar TagSelectBoxAssetCollection = function () {\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var allTags = hooks_1.useTagsQuery().tags;\n var updateAssetCollection = hooks_1.useUpdateAssetCollection().updateAssetCollection;\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var tagIds = react_1.useMemo(function () { return selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.tags.map(function (_a) {\n var id = _a.id;\n return id;\n }).sort(); }, [\n selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.tags,\n ]);\n var handleChange = react_1.useCallback(function (newTags) {\n if (!tagsMatchAssetCollection(newTags, selectedAssetCollection)) {\n updateAssetCollection({\n assetCollection: selectedAssetCollection,\n tags: newTags,\n })\n .then(function () {\n Notify.ok(translate('actions.tagAssetCollection.success', 'The asset collection has been tagged'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.tagAssetCollection.error', 'Error while tagging the asset collection'), message);\n });\n }\n }, [Notify, selectedAssetCollection, updateAssetCollection, translate]);\n if (!selectedAssetCollection)\n return null;\n return React.createElement(_1.TagSelectBox, { values: tagIds, options: allTags, onChange: handleChange });\n};\nexports.default = React.memo(TagSelectBoxAssetCollection);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar Presentation_1 = require(\"../../Presentation\");\nvar useStyles = src_1.createUseMediaUiStyles({\n collectionSelectBox: {},\n collectionSelection: {},\n});\nvar collectionsMatchAsset = function (assetCollectionIds, asset) {\n return assetCollectionIds.join(',') === asset.collections.map(function (collection) { return collection.id; }).join(',');\n};\nvar CollectionSelectBox = function () {\n var classes = useStyles();\n var Notify = src_1.useNotify();\n var translate = src_1.useIntl().translate;\n var assetCollections = hooks_1.useAssetCollectionsQuery().assetCollections;\n var _a = hooks_1.useSetAssetCollections(), setAssetCollections = _a.setAssetCollections, loading = _a.loading;\n var selectedAsset = hooks_1.useSelectedAsset();\n var assetCollectionsWithLabel = react_1.useMemo(function () { return assetCollections.map(function (_a) {\n var title = _a.title, rest = __rest(_a, [\"title\"]);\n return (__assign({ label: title }, rest));\n }); }, [assetCollections]);\n var assetCollectionIds = react_1.useMemo(function () { return selectedAsset === null || selectedAsset === void 0 ? void 0 : selectedAsset.collections.map(function (_a) {\n var id = _a.id;\n return id;\n }); }, [selectedAsset]);\n var handleChange = react_1.useCallback(function (newAssetCollectionIds) {\n if (!collectionsMatchAsset(newAssetCollectionIds, selectedAsset)) {\n setAssetCollections({\n asset: selectedAsset,\n assetCollections: assetCollections.filter(function (c) { return newAssetCollectionIds.includes(c.id); }),\n })\n .then(function () {\n Notify.ok(translate('actions.setAssetCollections.success', 'The collections for the asset have been set'));\n })\n .catch(function (_a) {\n var message = _a.message;\n Notify.error(translate('actions.setAssetCollections.error', 'Error while setting the collections for the asset'), message);\n });\n }\n }, [Notify, selectedAsset, setAssetCollections, assetCollections, translate]);\n if (!selectedAsset)\n return null;\n return (React.createElement(\"div\", { className: classes.collectionSelectBox },\n React.createElement(react_ui_components_1.Headline, { type: \"h2\" },\n React.createElement(Presentation_1.IconLabel, { icon: \"folder\", label: translate('inspector.assetCollections', 'Collections') })),\n React.createElement(react_ui_components_1.MultiSelectBox, { className: classes.collectionSelection, disabled: loading || selectedAsset.assetSource.readOnly, placeholder: translate('inspector.collections.placeholder', 'Select a collection'), values: assetCollectionIds, optionValueField: \"id\", options: assetCollectionsWithLabel, searchOptions: assetCollectionsWithLabel, noMatchesFoundLabel: translate('general.noMatchesFound', 'No matches found'), onValuesChange: handleChange })));\n};\nexports.default = React.memo(CollectionSelectBox);\n","/**\n * media-type\n * @author Lovell Fuller\n *\n * This code is distributed under the Apache License Version 2.0, the terms of\n * which may be found at http://www.apache.org/licenses/LICENSE-2.0.html\n */\n\nvar MediaType = function() {\n this.type = null;\n this._setSubtypeAndSuffix(null);\n this.parameters = {};\n};\n\nMediaType.prototype.isValid = function() {\n return this.type !== null && this.subtype !== null && this.subtype !== \"example\";\n};\n\nMediaType.prototype._setSubtypeAndSuffix = function(subtype) {\n this.subtype = subtype;\n this.subtypeFacets = [];\n this.suffix = null;\n if (subtype) {\n if (subtype.indexOf(\"+\") > -1 && subtype.substr(-1) !== \"+\") {\n var fixes = subtype.split(\"+\", 2);\n this.subtype = fixes[0];\n this.subtypeFacets = fixes[0].split(\".\");\n this.suffix = fixes[1];\n } else {\n this.subtypeFacets = subtype.split(\".\");\n }\n }\n};\n\nMediaType.prototype.hasSuffix = function() {\n return !!this.suffix;\n};\n\nMediaType.prototype._firstSubtypeFacetEquals = function(str) {\n return this.subtypeFacets.length > 0 && this.subtypeFacets[0] === str;\n};\n\nMediaType.prototype.isVendor = function() {\n return this._firstSubtypeFacetEquals(\"vnd\");\n};\n\nMediaType.prototype.isPersonal = function() {\n return this._firstSubtypeFacetEquals(\"prs\");\n};\n\nMediaType.prototype.isExperimental = function() {\n return this._firstSubtypeFacetEquals(\"x\") || this.subtype.substring(0, 2).toLowerCase() === \"x-\";\n};\n\nMediaType.prototype.asString = function() {\n var str = \"\";\n if (this.isValid()) {\n str = str + this.type + \"/\" + this.subtype;\n if (this.hasSuffix()) {\n str = str + \"+\" + this.suffix;\n }\n var parameterKeys = Object.keys(this.parameters);\n if (parameterKeys.length > 0) {\n var parameters = [];\n var that = this;\n parameterKeys.sort(function(a, b) {\n return a.localeCompare(b);\n }).forEach(function(element) {\n parameters.push(element + \"=\" + wrapQuotes(that.parameters[element]));\n });\n str = str + \";\" + parameters.join(\";\");\n }\n }\n return str;\n};\n\nvar wrapQuotes = function(str) {\n return (str.indexOf(\";\") > -1) ? '\"' + str + '\"' : str;\n};\n\nvar unwrapQuotes = function(str) {\n return (str.substr(0, 1) === '\"' && str.substr(-1) === '\"') ? str.substr(1, str.length - 2) : str;\n};\n\nvar mediaTypeMatcher = /^(application|audio|font|image|message|model|multipart|text|video|\\*)\\/([a-zA-Z0-9!#$%^&\\*_\\-\\+{}\\|'.`~]{1,127})(;.*)?$/;\n\nvar parameterSplitter = /;(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*(?![^\\\"]*\\\"))/;\n\nexports.fromString = function(str) {\n var mediaType = new MediaType();\n if (str) {\n var match = str.match(mediaTypeMatcher);\n if (match && !(match[1] === '*' && match[2] !== '*')) { \n mediaType.type = match[1];\n mediaType._setSubtypeAndSuffix(match[2]);\n if (match[3]) {\n match[3].substr(1).split(parameterSplitter).forEach(function(parameter) {\n var keyAndValue = parameter.split('=', 2);\n if (keyAndValue.length === 2) {\n mediaType.parameters[keyAndValue[0].toLowerCase().trim()] = unwrapQuotes(keyAndValue[1].trim());\n }\n });\n }\n }\n }\n return mediaType;\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n '@keyframes cssloadWidth': {\n '0%, 100%': {\n transitionTimingFunction: 'cubic-bezier(1, 0, .65, .85)',\n },\n '0%': {\n width: 0,\n },\n '100%': {\n width: '100%',\n },\n },\n container: {\n left: 0,\n top: 0,\n height: '2px',\n position: 'fixed',\n width: '100vw',\n zIndex: theme.loadingIndicatorZIndex,\n },\n indicator: {\n height: '2px',\n position: 'relative',\n width: '100%',\n },\n bar: {\n height: '100%',\n position: 'relative',\n backgroundColor: theme.colors.warn,\n animation: '$cssloadWidth 2s cubic-bezier(.45, 0, 1, 1) infinite',\n },\n}); });\nfunction LoadingIndicator() {\n var classes = useStyles();\n var isLoading = recoil_1.useRecoilValue(state_1.loadingState);\n return (React.createElement(React.Fragment, null, isLoading && (React.createElement(\"div\", { className: classes.container },\n React.createElement(\"div\", { className: classes.indicator },\n React.createElement(\"div\", { className: classes.bar }))))));\n}\nexports.default = LoadingIndicator;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BottomBar = exports.Pagination = exports.AssetCount = void 0;\nvar BottomBar_1 = __importDefault(require(\"./BottomBar\"));\nexports.BottomBar = BottomBar_1.default;\nvar Pagination_1 = __importDefault(require(\"./Pagination/Pagination\"));\nexports.Pagination = Pagination_1.default;\nvar AssetCount_1 = __importDefault(require(\"./AssetCount/AssetCount\"));\nexports.AssetCount = AssetCount_1.default;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar AssetCount_1 = __importDefault(require(\"./AssetCount/AssetCount\"));\nvar Pagination_1 = __importDefault(require(\"./Pagination/Pagination\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n bottomBar: function (_a) {\n var isInNodeCreationDialog = _a.isInNodeCreationDialog, selectionMode = _a.selectionMode;\n return ({\n display: 'grid',\n gridTemplateColumns: isInNodeCreationDialog || selectionMode ? 'repeat(3, 1fr)' : '350px 1fr 350px',\n gridGap: theme.spacing.goldenUnit,\n position: 'fixed',\n bottom: isInNodeCreationDialog ? -16 : 0,\n left: isInNodeCreationDialog ? -16 : 0,\n right: isInNodeCreationDialog ? -16 : 0,\n borderTop: \"1px solid \" + theme.colors.border,\n backgroundColor: theme.colors.moduleBackground,\n zIndex: theme.paginationZIndex,\n });\n },\n}); });\nvar BottomBar = function () {\n var _a = src_1.useMediaUi(), isInNodeCreationDialog = _a.isInNodeCreationDialog, selectionMode = _a.selectionMode;\n var classes = useStyles({ isInNodeCreationDialog: isInNodeCreationDialog, selectionMode: selectionMode });\n var components = react_1.useMemo(function () { return [AssetCount_1.default, Pagination_1.default, src_2.ClipboardToggle]; }, []);\n return (React.createElement(\"div\", { className: classes.bottomBar }, components.map(function (Component, index) { return (React.createElement(Component, { key: index })); })));\n};\nexports.default = React.memo(BottomBar);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar useStyles = src_1.createUseMediaUiStyles({\n item: {\n userSelect: 'none',\n '& button': {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n },\n },\n});\nvar PaginationItem = function (_a) {\n var title = _a.title, label = _a.label, onClick = _a.onClick, _b = _a.page, page = _b === void 0 ? null : _b, _c = _a.selected, selected = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, icon = _a.icon;\n var classes = useStyles();\n return (React.createElement(\"li\", { className: [classes.item, selected ? classes.selected : ''].join(' ') }, icon ? (React.createElement(react_ui_components_1.IconButton, { icon: icon, disabled: disabled, size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", title: title, onClick: function () { return onClick(page); } })) : (React.createElement(react_ui_components_1.Button, { icon: icon, disabled: disabled, size: \"regular\", style: selected ? 'brand' : 'transparent', hoverStyle: \"brand\", title: title, onClick: function () { return onClick(page); } }, label || page))));\n};\nexports.default = React.memo(PaginationItem);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar state_2 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n searchBox: {\n flex: 1,\n '& input[type=\"search\"]': {\n '-webkit-appearance': 'auto',\n width: '100%',\n '&::-webkit-search-cancel-button': {\n '-webkit-appearance': 'searchfield-cancel-button',\n cursor: 'pointer',\n },\n },\n },\n});\nvar SearchBox = function () {\n var classes = useStyles();\n var _a = recoil_1.useRecoilState(state_1.searchTermState), searchTerm = _a[0], setSearchTerm = _a[1];\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n var _b = react_1.useState(searchTerm), searchValue = _b[0], setSearchValue = _b[1];\n var translate = src_1.useIntl().translate;\n var mainView = recoil_1.useRecoilValue(state_2.mainViewState);\n var handleSearch = react_1.useCallback(function () {\n setSearchTerm(searchValue);\n setCurrentPage(1);\n }, [searchValue, setCurrentPage, setSearchTerm]);\n if (mainView !== state_2.MainViewState.DEFAULT)\n return null;\n return (React.createElement(\"div\", { className: classes.searchBox },\n React.createElement(react_ui_components_1.TextInput, { value: searchValue, type: \"search\", onChange: function (value) { return setSearchValue(value); }, onEnterKey: handleSearch, placeholder: translate('searchBox.placeholder', 'Search') })));\n};\nexports.default = React.memo(SearchBox);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar index_1 = require(\"./index\");\nvar SortOrderSelector_1 = __importDefault(require(\"./SortOrderSelector\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n topBar: {\n display: 'flex',\n flexWrap: 'nowrap',\n justifyContent: 'flex-end',\n margin: \"0 -\" + theme.spacing.half,\n // Add spacing in selection mode to prevent overlap with close button of secondary inspector view\n paddingRight: function (props) { return (props.selectionMode ? theme.spacing.goldenUnit : null); },\n '& > *': {\n margin: \"0 \" + theme.spacing.half,\n },\n },\n}); });\nvar TopBar = function () {\n var selectionMode = src_1.useMediaUi().selectionMode;\n var classes = useStyles({ selectionMode: selectionMode });\n var components = react_1.useMemo(function () { return [src_2.ClipboardActions, index_1.SearchBox, index_1.TypeFilter, SortOrderSelector_1.default, index_1.ViewModeSelector]; }, []);\n return (React.createElement(\"div\", { className: classes.topBar }, components.map(function (Component, index) { return (React.createElement(Component, { key: index })); })));\n};\nexports.default = React.memo(TopBar);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar selectedSortOrderState_1 = __importStar(require(\"@media-ui/core/src/state/selectedSortOrderState\"));\nvar useStyles = src_1.createUseMediaUiStyles({\n sortingState: {\n display: 'flex',\n flex: 1,\n minWidth: 0,\n },\n selectBox: {\n minWidth: 0,\n },\n});\nvar SortOrderSelector = function () {\n var _a = src_1.useMediaUi(), isInNodeCreationDialog = _a.isInNodeCreationDialog, selectionMode = _a.selectionMode;\n var classes = useStyles();\n var _b = recoil_1.useRecoilState(selectedSortOrderState_1.default), sortOrderState = _b[0], setSortOrderState = _b[1];\n var translate = src_1.useIntl().translate;\n var hideOptionIcon = isInNodeCreationDialog || selectionMode;\n var handleChangeSortBy = react_1.useCallback(function (sortBy) {\n setSortOrderState(__assign(__assign({}, sortOrderState), { sortBy: sortBy }));\n }, [sortOrderState, setSortOrderState]);\n var handleSwitchSortDirection = react_1.useCallback(function () {\n setSortOrderState(__assign(__assign({}, sortOrderState), { sortDirection: sortOrderState.sortDirection === selectedSortOrderState_1.SORT_DIRECTION.Asc ? selectedSortOrderState_1.SORT_DIRECTION.Desc : selectedSortOrderState_1.SORT_DIRECTION.Asc }));\n }, [sortOrderState, setSortOrderState]);\n var sortByOptions = react_1.useMemo(function () {\n return [\n {\n value: selectedSortOrderState_1.SORT_BY.LastModified,\n label: translate('sortingState.sortBy.values.lastModified', 'Last Modified'),\n icon: hideOptionIcon ? '' : 'calendar',\n },\n {\n value: selectedSortOrderState_1.SORT_BY.Name,\n label: translate('sortingState.sortBy.values.name', 'Name'),\n icon: hideOptionIcon ? '' : 'font',\n },\n ];\n }, [translate, hideOptionIcon]);\n return (React.createElement(\"div\", { className: classes.sortingState },\n React.createElement(\"div\", { className: classes.selectBox },\n React.createElement(react_ui_components_1.SelectBox, { className: classes.selectBox, options: Object.values(sortByOptions), onValueChange: handleChangeSortBy, value: sortOrderState.sortBy, optionValueField: \"value\" })),\n React.createElement(react_ui_components_1.IconButton, { icon: sortOrderState.sortDirection === selectedSortOrderState_1.SORT_DIRECTION.Asc ? 'sort-amount-up' : 'sort-amount-down', size: \"regular\", title: translate(\"sortingState.dortOrder.value.\" + (sortOrderState.sortDirection === selectedSortOrderState_1.SORT_DIRECTION.Asc ? selectedSortOrderState_1.SORT_DIRECTION.Desc : selectedSortOrderState_1.SORT_DIRECTION.Asc), \"Switch sort direction\"), style: \"neutral\", hoverStyle: \"brand\", onClick: handleSwitchSortDirection })));\n};\nexports.default = React.memo(SortOrderSelector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar src_2 = require(\"@media-ui/feature-asset-usage/src\");\nvar state_2 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n typeFilter: {},\n selectBox: {\n minWidth: 'auto',\n },\n});\nvar UNUSED_FILTER_VALUE = 'unused';\nvar TypeFilter = function () {\n var classes = useStyles();\n var _a = src_1.useMediaUi(), featureFlags = _a.featureFlags, assetType = _a.assetType;\n var _b = recoil_1.useRecoilState(state_1.selectedMediaTypeState), mediaTypeFilter = _b[0], setMediaTypeFilter = _b[1];\n var _c = recoil_1.useRecoilState(src_2.showUnusedAssetsState), showUnusedAssets = _c[0], setShowUnusedAssets = _c[1];\n var setCurrentPage = recoil_1.useSetRecoilState(state_1.currentPageState);\n var translate = src_1.useIntl().translate;\n var mainView = recoil_1.useRecoilValue(state_2.mainViewState);\n var currentValue = showUnusedAssets ? UNUSED_FILTER_VALUE : mediaTypeFilter;\n var onValueChange = react_1.useCallback(function (value) {\n setShowUnusedAssets(value === 'unused');\n if (value !== UNUSED_FILTER_VALUE) {\n setMediaTypeFilter(value);\n }\n setCurrentPage(1);\n }, [setCurrentPage, setShowUnusedAssets, setMediaTypeFilter]);\n var mediaTypeOptions = react_1.useMemo(function () {\n var options = {\n video: {\n value: 'video',\n label: translate('typeFilter.mediaType.values.video', 'Video'),\n icon: 'file-video',\n disabled: assetType !== 'all' && assetType !== 'video',\n },\n audio: {\n value: 'audio',\n label: translate('typeFilter.mediaType.values.audio', 'Audio'),\n icon: 'file-audio',\n disabled: assetType !== 'all' && assetType !== 'audio',\n },\n image: {\n value: 'image',\n label: translate('typeFilter.mediaType.values.image', 'Images'),\n icon: 'file-image',\n disabled: assetType !== 'all' && assetType !== 'image',\n },\n // TODO: The Media API currently only knows \"Document\" internally which is not a valid mimetype\n document: {\n value: 'document',\n label: translate('typeFilter.mediaType.values.document', 'Document'),\n icon: 'file',\n disabled: assetType !== 'all' && assetType !== 'document',\n },\n };\n if (featureFlags.queryAssetUsage) {\n options[UNUSED_FILTER_VALUE] = {\n value: UNUSED_FILTER_VALUE,\n label: translate('typeFilter.mediaType.values.unused', 'Unused'),\n icon: 'fab fa-creative-commons-zero',\n disabled: assetType !== 'all',\n };\n }\n return options;\n }, [translate, featureFlags, assetType]);\n if (![state_2.MainViewState.DEFAULT, state_2.MainViewState.UNUSED_ASSETS].includes(mainView))\n return null;\n return (React.createElement(\"div\", { className: classes.typeFilter },\n React.createElement(react_ui_components_1.SelectBox, { className: classes.selectBox, options: Object.values(mediaTypeOptions), onValueChange: onValueChange, value: currentValue, allowEmpty: assetType === 'all', placeholderIcon: \"photo-video\", placeholder: translate('typeFilter.mediaType.values.all', 'All'), optionValueField: \"value\" })));\n};\nexports.default = React.memo(TypeFilter);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"../../hooks\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n viewModeSelector: {\n display: 'flex',\n alignItems: 'baseline',\n '& label': {\n marginRight: theme.spacing.quarter,\n },\n },\n selectBox: {\n minWidth: 'auto',\n },\n}); });\nvar ViewModeSelector = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var _a = hooks_1.useViewModeSelection(), viewModeSelection = _a[0], setViewModeSelection = _a[1];\n return (React.createElement(\"div\", { className: classes.viewModeSelector },\n React.createElement(react_ui_components_1.IconButton, { icon: viewModeSelection === hooks_1.VIEW_MODES.List ? 'th' : 'th-list', size: \"regular\", title: translate(\"viewModeSelector.viewMode.\" + (viewModeSelection === hooks_1.VIEW_MODES.List ? hooks_1.VIEW_MODES.Thumbnails : hooks_1.VIEW_MODES.List), \"Switch mode\"), style: \"neutral\", hoverStyle: \"brand\", onClick: function () {\n return setViewModeSelection(viewModeSelection === hooks_1.VIEW_MODES.List ? hooks_1.VIEW_MODES.Thumbnails : hooks_1.VIEW_MODES.List);\n } })));\n};\nexports.default = React.memo(ViewModeSelector);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar src_3 = require(\"@media-ui/feature-asset-preview/src\");\nvar AssetActions = function (_a) {\n var _b;\n var asset = _a.asset;\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var handleDeleteAsset = src_1.useMediaUi().handleDeleteAsset;\n var setSelectedAssetForPreview = recoil_1.useSetRecoilState(src_3.selectedAssetForPreviewState);\n var importAsset = hooks_1.useImportAsset().importAsset;\n var toggleClipboardState = src_2.useClipboard().toggleClipboardState;\n // TODO: Optimize rendering this component when hooks change, as it takes quite a bit of time\n var onImportAsset = react_1.useCallback(function () {\n importAsset({ assetId: asset.id, assetSourceId: asset.assetSource.id })\n .then(function () {\n Notify.ok(translate('assetActions.import.success', 'Asset was successfully imported'));\n })\n .catch(function (error) {\n Notify.error(translate('assetActions.import.error', 'Failed to import asset'), error.message);\n });\n }, [importAsset, asset, Notify, translate]);\n return (React.createElement(React.Fragment, null,\n React.createElement(react_ui_components_1.IconButton, { title: translate('itemActions.preview', 'Preview asset'), icon: \"expand-alt\", size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", onClick: function () { return setSelectedAssetForPreview({ assetId: asset.id, assetSourceId: asset.assetSource.id }); } }),\n !asset.imported && !asset.localId && (React.createElement(react_ui_components_1.IconButton, { title: translate('itemActions.import', 'Import asset'), icon: \"cloud-download-alt\", size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", onClick: onImportAsset })),\n !asset.assetSource.readOnly && (React.createElement(react_ui_components_1.IconButton, { title: asset.isInUse\n ? translate('itemActions.delete.disabled', 'Cannot delete an asset that is in use')\n : translate('itemActions.delete', 'Delete asset'), disabled: asset.isInUse, icon: \"trash\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\", onClick: function () { return handleDeleteAsset(asset); } })),\n ((_b = asset.file) === null || _b === void 0 ? void 0 : _b.url) && (React.createElement(\"a\", { href: asset.file.url, download: true, title: translate('itemActions.download', 'Download asset') },\n React.createElement(react_ui_components_1.IconButton, { icon: \"download\", size: \"regular\", style: \"transparent\", hoverStyle: \"warn\" }))),\n asset.localId && (React.createElement(react_ui_components_1.IconButton, { title: translate('itemActions.copyToClipboard', 'Copy to clipboard'), icon: asset.isInClipboard ? 'clipboard-check' : 'clipboard', size: \"regular\", style: \"transparent\", hoverStyle: \"brand\", className: asset.isInClipboard ? 'button--active' : '', onClick: function () { return toggleClipboardState({ assetId: asset.id, assetSourceId: asset.assetSource.id }); } }))));\n};\nexports.default = React.memo(AssetActions);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_2 = require(\"@media-ui/feature-asset-preview/src\");\nvar index_1 = require(\"./index\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n listView: function (_a) {\n var isInNodeCreationDialog = _a.isInNodeCreationDialog;\n return ({\n height: isInNodeCreationDialog ? '100%' : 'auto',\n '& table': {\n borderSpacing: '0 1px',\n width: '100%',\n '& th': {\n textAlign: 'left',\n lineHeight: theme.spacing.goldenUnit,\n padding: \"0 \" + theme.spacing.half,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n userSelect: 'none',\n '&:first-child, &:last-child': {\n padding: 0,\n },\n },\n },\n });\n },\n tableHeader: {\n position: 'sticky',\n backgroundColor: 'var(--grayDark)',\n top: '0px',\n zIndex: '1',\n },\n}); });\nvar ListView = function (_a) {\n var assetIdentities = _a.assetIdentities;\n var isInNodeCreationDialog = src_1.useMediaUi().isInNodeCreationDialog;\n var classes = useStyles({ isInNodeCreationDialog: isInNodeCreationDialog });\n var translate = src_1.useIntl().translate;\n var setSelectedAssetForPreview = recoil_1.useSetRecoilState(src_2.selectedAssetForPreviewState);\n var selectAsset = hooks_1.useSelectAsset();\n var onSelect = react_1.useCallback(function (assetIdentity, openPreview) {\n if (openPreview === void 0) { openPreview = false; }\n if (openPreview) {\n setSelectedAssetForPreview(assetIdentity);\n }\n else {\n selectAsset(assetIdentity);\n }\n }, [setSelectedAssetForPreview, selectAsset]);\n return (React.createElement(\"section\", { className: classes.listView },\n React.createElement(\"table\", null,\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"th\", { className: classes.tableHeader }),\n React.createElement(\"th\", { className: classes.tableHeader }, translate('thumbnailView.header.name', 'Name')),\n React.createElement(\"th\", { className: classes.tableHeader }, translate('thumbnailView.header.lastModified', 'Last Modified')),\n React.createElement(\"th\", { className: classes.tableHeader }, translate('thumbnailView.header.fileSize', 'File size')),\n React.createElement(\"th\", { className: classes.tableHeader }, translate('thumbnailView.header.mediaType', 'Type')),\n React.createElement(\"th\", { className: classes.tableHeader }))),\n React.createElement(\"tbody\", null, assetIdentities.map(function (assetIdentity, index) { return (React.createElement(index_1.ListViewItem, { key: index, assetIdentity: assetIdentity, onSelect: onSelect })); })))));\n};\nexports.default = React.memo(ListView);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar helper_1 = require(\"@media-ui/core/src/helper\");\nvar index_1 = require(\"./index\");\nvar Presentation_1 = require(\"../Presentation\");\nvar MissingAssetActions_1 = __importDefault(require(\"./MissingAssetActions\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n listViewItem: {\n backgroundColor: theme.colors.mainBackground,\n '&:nth-of-type(2n)': {\n backgroundColor: theme.colors.alternatingBackground,\n },\n '&:hover': {\n backgroundColor: theme.colors.primary,\n },\n },\n selected: {\n backgroundColor: theme.colors.primary,\n '&:nth-of-type(2n)': {\n backgroundColor: theme.colors.primary,\n },\n },\n textColumn: {\n padding: \"0 \" + theme.spacing.half,\n whiteSpace: 'nowrap',\n userSelect: 'none',\n cursor: 'pointer',\n width: '1px',\n '& > *': {\n verticalAlign: 'middle',\n },\n },\n previewColumn: {\n minWidth: theme.spacing.goldenUnit,\n width: theme.spacing.goldenUnit,\n cursor: 'pointer',\n '& picture': {\n display: 'block',\n width: '100%',\n height: theme.spacing.goldenUnit,\n textAlign: 'center',\n '& img, & svg': {\n display: 'inline-block',\n width: '100%',\n height: '100%',\n objectFit: 'contain',\n },\n },\n },\n labelColumn: {\n extend: 'textColumn',\n display: 'table',\n tableLayout: 'fixed',\n width: '100%',\n lineHeight: theme.spacing.goldenUnit,\n userSelect: 'text',\n '& > *': {\n width: '100%',\n },\n },\n lastModifiedColumn: {\n extend: 'textColumn',\n },\n fileSizeColumn: {\n extend: 'textColumn',\n },\n mediaTypeColumn: {\n extend: 'textColumn',\n maxWidth: '100px',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n actionsColumn: {\n extend: 'textColumn',\n textAlign: 'right',\n },\n}); });\nvar dateFormatOptions = {\n weekday: 'short',\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n};\nvar ListViewItem = function (_a) {\n var assetIdentity = _a.assetIdentity, onSelect = _a.onSelect;\n var classes = useStyles();\n var _b = src_1.useMediaUi(), dummyImage = _b.dummyImage, isAssetSelectable = _b.isAssetSelectable;\n var _c = hooks_1.useAssetQuery(assetIdentity), asset = _c.asset, loading = _c.loading;\n var selectedAssetId = recoil_1.useRecoilState(state_1.selectedAssetIdState)[0];\n var isSelected = (selectedAssetId === null || selectedAssetId === void 0 ? void 0 : selectedAssetId.assetId) === assetIdentity.assetId;\n var canBeSelected = react_1.useMemo(function () { return isAssetSelectable(asset); }, [asset, isAssetSelectable]);\n var onSelectItem = react_1.useCallback(function () { return onSelect(assetIdentity, isSelected); }, [onSelect, assetIdentity, isSelected]);\n return (React.createElement(\"tr\", { className: [classes.listViewItem, isSelected ? classes.selected : ''].join(' ') },\n React.createElement(\"td\", { className: classes.previewColumn, onClick: onSelectItem },\n React.createElement(\"picture\", null, canBeSelected ? (React.createElement(\"img\", { src: (asset === null || asset === void 0 ? void 0 : asset.thumbnailUrl) || dummyImage, alt: asset === null || asset === void 0 ? void 0 : asset.label, width: 40, height: 36 })) : (React.createElement(react_ui_components_1.Icon, { icon: \"ban\", color: \"error\" })))),\n React.createElement(\"td\", { className: classes.labelColumn, onClick: onSelectItem }, asset && React.createElement(Presentation_1.AssetLabel, { label: asset.label })),\n React.createElement(\"td\", { className: classes.lastModifiedColumn, onClick: onSelectItem }, asset && new Date(asset.lastModified).toLocaleString([], dateFormatOptions)),\n React.createElement(\"td\", { className: classes.fileSizeColumn, onClick: onSelectItem }, asset && helper_1.humanFileSize(asset.file.size)),\n React.createElement(\"td\", { className: classes.mediaTypeColumn, onClick: onSelectItem, title: asset === null || asset === void 0 ? void 0 : asset.file.mediaType }, asset === null || asset === void 0 ? void 0 : asset.file.mediaType),\n React.createElement(\"td\", { className: classes.actionsColumn }, !loading &&\n (asset ? React.createElement(index_1.AssetActions, { asset: asset }) : React.createElement(MissingAssetActions_1.default, { assetIdentity: assetIdentity })))));\n};\nexports.default = React.memo(ListViewItem, function (prev, next) { return prev.assetIdentity.assetId === next.assetIdentity.assetId; });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar src_2 = require(\"@media-ui/feature-clipboard/src\");\nvar src_3 = require(\"@media-ui/feature-asset-usage/src\");\nvar hooks_1 = require(\"../../hooks\");\nvar index_1 = require(\"./index\");\nvar LoadingLabel_1 = __importDefault(require(\"../LoadingLabel\"));\nvar state_1 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n emptyStateWrapper: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: 'inherit',\n },\n});\nvar Main = function () {\n var classes = useStyles();\n var viewModeSelection = hooks_1.useViewModeSelection()[0];\n var assets = src_1.useMediaUi().assets;\n var unusedAssets = src_3.useUnusedAssetsQuery().assets;\n var clipboard = src_2.useClipboard().clipboard;\n var mainView = recoil_1.useRecoilValue(state_1.mainViewState);\n var setClipboardVisible = recoil_1.useSetRecoilState(src_2.clipboardVisibleState);\n var translate = src_1.useIntl().translate;\n var _a = react_1.useState([]), assetIdentities = _a[0], setAssetIdentities = _a[1];\n var queriedAssets = react_1.useMemo(function () {\n return assets\n .filter(function (asset) { return asset === null || asset === void 0 ? void 0 : asset.id; })\n .map(function (_a) {\n var id = _a.id, assetSource = _a.assetSource;\n return { assetId: id, assetSourceId: assetSource.id };\n });\n }, [assets]);\n var queriedUnusedAssets = react_1.useMemo(function () {\n return unusedAssets\n .filter(function (asset) { return asset === null || asset === void 0 ? void 0 : asset.id; })\n .map(function (_a) {\n var id = _a.id, assetSource = _a.assetSource;\n return { assetId: id, assetSourceId: assetSource.id };\n });\n }, [unusedAssets]);\n react_1.useEffect(function () {\n if (mainView === state_1.MainViewState.CLIPBOARD) {\n setAssetIdentities(Object.values(clipboard));\n }\n else if (mainView === state_1.MainViewState.UNUSED_ASSETS) {\n setAssetIdentities(queriedUnusedAssets);\n }\n else {\n setAssetIdentities(queriedAssets);\n }\n }, [mainView, queriedAssets, queriedUnusedAssets, clipboard, setAssetIdentities]);\n return assetIdentities.length > 0 ? (viewModeSelection === hooks_1.VIEW_MODES.List ? (React.createElement(index_1.ListView, { assetIdentities: assetIdentities })) : (React.createElement(index_1.ThumbnailView, { assetIdentities: assetIdentities }))) : (React.createElement(\"div\", { className: classes.emptyStateWrapper }, mainView === state_1.MainViewState.CLIPBOARD ? (React.createElement(react_ui_components_1.Button, { size: \"regular\", style: \"brand\", hoverStyle: \"brand\", onClick: function () { return setClipboardVisible(false); } }, translate('clipboard.close', 'Close clipboard'))) : (React.createElement(LoadingLabel_1.default, { loadingText: translate('assetList.loading', 'Loading assets'), emptyText: translate('assetList.empty', 'No assets found') }))));\n};\nexports.default = React.memo(Main);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar useStyles = src_1.createUseMediaUiStyles({\n loadingLabel: {},\n});\nvar LoadingLabel = function (_a) {\n var loadingText = _a.loadingText, emptyText = _a.emptyText;\n var classes = useStyles();\n var isLoading = recoil_1.useRecoilValue(state_1.loadingState);\n return React.createElement(\"div\", { className: classes.loadingLabel }, isLoading ? loadingText : emptyText);\n};\nexports.default = React.memo(LoadingLabel);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar state_1 = require(\"@media-ui/core/src/state\");\nvar index_1 = require(\"./index\");\nvar Presentation_1 = require(\"../Presentation\");\nvar MissingAssetActions_1 = __importDefault(require(\"./MissingAssetActions\"));\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n thumbnail: {\n margin: '0',\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n '&:hover $caption': {\n backgroundColor: theme.colors.primary,\n },\n '&:hover $toolBar': {\n pointerEvents: 'all',\n backgroundColor: 'rgba(0.15, 0.15, 0.15, 0.25)',\n '& button': {\n opacity: 1,\n '&[disabled]': {\n opacity: 0.5,\n },\n '&.button--active': {\n '& svg': {\n color: 'white',\n },\n },\n },\n },\n },\n picture: {\n cursor: 'pointer',\n height: '250px',\n display: 'flex',\n alignItems: 'center',\n alignContent: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.assetBackground,\n '& img': {\n display: 'block',\n backgroundImage: 'repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)',\n backgroundPosition: '0 0, 10px 10px',\n backgroundSize: '20px 20px',\n maxHeight: '250px',\n maxWidth: '100%',\n },\n },\n caption: {\n backgroundColor: theme.colors.captionBackground,\n transition: \"background-color \" + theme.transition.fast,\n padding: theme.spacing.half,\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n '& img, & svg': {\n width: '1.3rem',\n height: 'auto',\n marginRight: theme.spacing.half,\n },\n },\n selected: {\n backgroundColor: theme.colors.primary,\n },\n toolBar: {\n display: 'flex',\n position: 'absolute',\n top: theme.spacing.quarter,\n right: theme.spacing.quarter,\n pointerEvents: 'none',\n backgroundColor: 'transparent',\n transition: 'background-color .1s ease-in',\n '& button, & button[disabled]': {\n transition: 'opacity .1s ease-in',\n opacity: 0,\n '&.button--active': {\n opacity: 1,\n '& svg': {\n color: theme.colors.primary,\n },\n },\n },\n },\n label: {\n position: 'absolute',\n top: theme.spacing.quarter,\n left: theme.spacing.quarter,\n fontSize: theme.fontSize.small,\n borderRadius: '3px',\n padding: '2px 4px',\n userSelect: 'none',\n },\n disabled: {\n '& $picture': {\n filter: 'grayscale(1)',\n cursor: 'not-allowed',\n },\n },\n}); });\nvar Thumbnail = function (_a) {\n var assetIdentity = _a.assetIdentity, onSelect = _a.onSelect;\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var _b = src_1.useMediaUi(), dummyImage = _b.dummyImage, isAssetSelectable = _b.isAssetSelectable;\n var _c = hooks_1.useAssetQuery(assetIdentity), asset = _c.asset, loading = _c.loading;\n var selectedAssetId = recoil_1.useRecoilValue(state_1.selectedAssetIdState);\n var isSelected = (selectedAssetId === null || selectedAssetId === void 0 ? void 0 : selectedAssetId.assetId) === assetIdentity.assetId;\n var canBeSelected = react_1.useMemo(function () { return isAssetSelectable(asset); }, [asset, isAssetSelectable]);\n return (React.createElement(\"figure\", { className: [classes.thumbnail, !canBeSelected && classes.disabled].join(' '), title: asset === null || asset === void 0 ? void 0 : asset.label },\n (asset === null || asset === void 0 ? void 0 : asset.imported) && React.createElement(\"span\", { className: classes.label }, translate('asset.label.imported', 'Imported')),\n React.createElement(\"picture\", { onClick: function () { return onSelect(assetIdentity, isSelected); }, className: classes.picture },\n React.createElement(\"img\", { src: loading || !asset ? dummyImage : asset.thumbnailUrl, alt: asset === null || asset === void 0 ? void 0 : asset.label })),\n React.createElement(\"figcaption\", { className: [classes.caption, isSelected ? classes.selected : ''].join(' ') }, asset && (React.createElement(React.Fragment, null,\n canBeSelected && asset.file ? (React.createElement(\"img\", { src: asset.file.typeIcon.url, alt: asset.file.typeIcon.alt })) : (React.createElement(react_ui_components_1.Icon, { icon: \"ban\", color: \"error\" })),\n React.createElement(Presentation_1.AssetLabel, { label: asset.label })))),\n React.createElement(\"div\", { className: classes.toolBar }, !loading &&\n (asset ? React.createElement(index_1.AssetActions, { asset: asset }) : React.createElement(MissingAssetActions_1.default, { assetIdentity: assetIdentity })))));\n};\nexports.default = React.memo(Thumbnail, function (prev, next) { return prev.assetIdentity.assetId === next.assetIdentity.assetId; });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar src_2 = require(\"@media-ui/feature-asset-preview/src\");\nvar index_1 = require(\"./index\");\nvar useStyles = src_1.createUseMediaUiStyles(function (theme) { return ({\n thumbnailView: {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',\n gridGap: theme.spacing.full,\n },\n}); });\nvar ThumbnailView = function (_a) {\n var assetIdentities = _a.assetIdentities;\n var classes = useStyles();\n var setSelectedAssetForPreview = recoil_1.useSetRecoilState(src_2.selectedAssetForPreviewState);\n var selectAsset = hooks_1.useSelectAsset();\n var onSelect = react_1.useCallback(function (assetIdentity, openPreview) {\n if (openPreview === void 0) { openPreview = false; }\n if (openPreview) {\n setSelectedAssetForPreview(assetIdentity);\n }\n else {\n selectAsset(assetIdentity);\n }\n }, [setSelectedAssetForPreview, selectAsset]);\n return (React.createElement(\"section\", { className: classes.thumbnailView }, assetIdentities.map(function (assetIdentity, index) { return (React.createElement(index_1.Thumbnail, { key: index, assetIdentity: assetIdentity, onSelect: onSelect })); })));\n};\nexports.default = React.memo(ThumbnailView);\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __importDefault(require(\"react\"));\nvar Notify_1 = require(\"@media-ui/core/src/provider/Notify\");\nvar ErrorBoundary = /** @class */ (function (_super) {\n __extends(ErrorBoundary, _super);\n function ErrorBoundary(props) {\n var _this = _super.call(this, props) || this;\n _this.state = { hasError: false };\n return _this;\n }\n ErrorBoundary.getDerivedStateFromError = function () {\n return { hasError: true };\n };\n ErrorBoundary.prototype.componentDidCatch = function (error) {\n this.context.error(error.name, error.message);\n };\n ErrorBoundary.prototype.render = function () {\n if (this.state.hasError) {\n return (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(\"p\", { style: { color: 'red' } }, \"Something went wrong.\"),\n react_1.default.createElement(\"br\", null),\n react_1.default.createElement(\"button\", { className: \"neos-button\", onClick: function () { return window.location.reload(); } }, \"Reload\")));\n }\n return this.props.children;\n };\n ErrorBoundary.contextType = Notify_1.NotifyContext;\n return ErrorBoundary;\n}(react_1.default.Component));\nexports.default = ErrorBoundary;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CreateAssetCollectionDialog = exports.CreateTagDialog = void 0;\nvar CreateTagDialog_1 = __importDefault(require(\"./CreateTagDialog\"));\nexports.CreateTagDialog = CreateTagDialog_1.default;\nvar CreateAssetCollectionDialog_1 = __importDefault(require(\"./CreateAssetCollectionDialog\"));\nexports.CreateAssetCollectionDialog = CreateAssetCollectionDialog_1.default;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar react_1 = require(\"react\");\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar components_1 = require(\"@media-ui/core/src/components\");\nvar state_1 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles(function () { return ({\n formBody: {\n padding: 16,\n },\n}); });\nvar CreateTagDialog = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var selectedAssetCollection = hooks_1.useSelectedAssetCollection();\n var _a = recoil_1.useRecoilState(state_1.createTagDialogState), dialogState = _a[0], setDialogState = _a[1];\n var createPossible = !!(dialogState.label && dialogState.label.trim());\n var createTag = hooks_1.useCreateTag().createTag;\n var handleRequestClose = react_1.useCallback(function () { return setDialogState({ visible: false, label: '' }); }, [setDialogState]);\n var handleCreate = react_1.useCallback(function () {\n setDialogState(function (state) { return (__assign(__assign({}, state), { visible: false })); });\n createTag(dialogState.label, selectedAssetCollection === null || selectedAssetCollection === void 0 ? void 0 : selectedAssetCollection.id)\n .then(function () {\n Notify.ok(translate('assetCollectionActions.create.success', 'Tag was created'));\n })\n .catch(function (error) {\n Notify.error(translate('assetCollectionActions.create.error', 'Failed to create tag'), error.message);\n });\n }, [Notify, setDialogState, createTag, dialogState, translate, selectedAssetCollection]);\n var setLabel = react_1.useCallback(function (label) { return setDialogState(function (state) { return (__assign(__assign({}, state), { label: label })); }); }, [setDialogState]);\n return (React.createElement(components_1.Dialog, { isOpen: dialogState.visible, title: translate('createTagDialog.title', 'Create tag'), onRequestClose: handleRequestClose, actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: handleRequestClose }, translate('general.cancel', 'Cancel')),\n React.createElement(react_ui_components_1.Button, { key: \"upload\", style: \"success\", hoverStyle: \"success\", disabled: !createPossible, onClick: handleCreate }, translate('general.create', 'Create')),\n ] },\n React.createElement(\"div\", { className: classes.formBody },\n React.createElement(react_ui_components_1.Label, null, translate('general.label', 'Label')),\n React.createElement(react_ui_components_1.TextInput, { setFocus: true, type: \"text\", value: dialogState.label, onChange: setLabel, onEnterKey: createPossible ? handleCreate : null }))));\n};\nexports.default = React.memo(CreateTagDialog);\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar recoil_1 = require(\"recoil\");\nvar react_ui_components_1 = require(\"@neos-project/react-ui-components\");\nvar src_1 = require(\"@media-ui/core/src\");\nvar hooks_1 = require(\"@media-ui/core/src/hooks\");\nvar components_1 = require(\"@media-ui/core/src/components\");\nvar react_1 = require(\"react\");\nvar state_1 = require(\"../../state\");\nvar useStyles = src_1.createUseMediaUiStyles(function () { return ({\n formBody: {\n padding: 16,\n },\n}); });\nvar CreateAssetCollectionDialog = function () {\n var classes = useStyles();\n var translate = src_1.useIntl().translate;\n var Notify = src_1.useNotify();\n var _a = recoil_1.useRecoilState(state_1.createAssetCollectionDialogState), dialogState = _a[0], setDialogState = _a[1];\n var createPossible = !!(dialogState.title && dialogState.title.trim());\n var createAssetCollection = hooks_1.useCreateAssetCollection().createAssetCollection;\n var handleRequestClose = react_1.useCallback(function () { return setDialogState({ title: '', visible: false }); }, [setDialogState]);\n var handleCreate = react_1.useCallback(function () {\n setDialogState(function (state) { return (__assign(__assign({}, state), { visible: false })); });\n createAssetCollection(dialogState.title)\n .then(function () {\n Notify.ok(translate('assetCollectionActions.create.success', 'Asset collection was created'));\n })\n .catch(function (error) {\n Notify.error(translate('assetCollectionActions.create.error', 'Failed to create asset collection'), error.message);\n });\n }, [Notify, setDialogState, createAssetCollection, dialogState, translate]);\n var setTitle = react_1.useCallback(function (title) { return setDialogState(function (state) { return (__assign(__assign({}, state), { title: title })); }); }, [setDialogState]);\n return (React.createElement(components_1.Dialog, { isOpen: dialogState.visible, title: translate('createAssetCollectionDialog.title', 'Create Asset Collection'), onRequestClose: handleRequestClose, actions: [\n React.createElement(react_ui_components_1.Button, { key: \"cancel\", style: \"neutral\", hoverStyle: \"darken\", onClick: handleRequestClose }, translate('general.cancel', 'Cancel')),\n React.createElement(react_ui_components_1.Button, { key: \"upload\", style: \"success\", hoverStyle: \"success\", disabled: !createPossible, onClick: handleCreate }, translate('general.create', 'Create')),\n ] },\n React.createElement(\"div\", { className: classes.formBody },\n React.createElement(react_ui_components_1.Label, null, translate('general.title', 'Title')),\n React.createElement(react_ui_components_1.TextInput, { setFocus: true, type: \"text\", value: dialogState.title, onChange: setTitle, onEnterKey: createPossible ? handleCreate : null }))));\n};\nexports.default = React.memo(CreateAssetCollectionDialog);\n","module.exports = \"directive @client(always: Boolean!) on FIELD\\n\\ndirective @export(as: String!) on FIELD\\n\\ntype AssetIdentity {\\n id: AssetId!\\n assetSourceId: AssetSourceId!\\n}\\n\\nextend type Query {\\n selectedAssetSourceId: String\\n viewModeSelection: String\\n}\\n\\nextend type Mutation {\\n setSelectedAssetSourceId(selectedAssetSourceId: String): String\\n setViewModeSelection(viewModeSelection: String): String\\n}\\n\"","module.exports = \"extend type Query {\\n clipboard: [AssetIdentity]!\\n}\\n\\nextend type Asset {\\n isInClipboard: Boolean!\\n}\\n\\nextend type Mutation {\\n toggleClipboardState(assetId: AssetId!, assetSourceId: AssetSourceId!, force: Boolean): [AssetIdentity]!\\n}\\n\"","module.exports = \"extend type Query {\\n includeUsage: Boolean!\\n}\\n\\nextend type Mutation {\\n includeUsage: Boolean!\\n}\\n\"","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar buildResolvers = function (updateLocalState) {\n return {\n Mutation: {\n setSelectedAssetSourceId: function (_, _a, _b) {\n var selectedAssetSourceId = _a.selectedAssetSourceId;\n var cache = _b.cache;\n updateLocalState({ selectedAssetSourceId: selectedAssetSourceId }, cache);\n return selectedAssetSourceId;\n },\n setViewModeSelection: function (_, _a, _b) {\n var viewModeSelection = _a.viewModeSelection;\n var cache = _b.cache;\n updateLocalState({ viewModeSelection: viewModeSelection }, cache);\n return viewModeSelection;\n },\n },\n };\n};\nexports.default = buildResolvers;\n","import React, { createContext } from 'react';\nimport warning from 'tiny-warning';\nimport PropTypes from 'prop-types';\nimport hoist from 'hoist-non-react-statics';\nimport getDisplayName from 'react-display-name';\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object' && !Array.isArray(obj);\n}\n\nfunction createThemeProvider(context) {\n var ThemeProvider =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(ThemeProvider, _React$Component);\n\n function ThemeProvider() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"cachedTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"lastOuterTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"lastTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"renderProvider\", function (outerTheme) {\n var children = _this.props.children;\n return React.createElement(context.Provider, {\n value: _this.getTheme(outerTheme)\n }, children);\n });\n\n return _this;\n }\n\n var _proto = ThemeProvider.prototype;\n\n // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation\n _proto.getTheme = function getTheme(outerTheme) {\n if (this.props.theme !== this.lastTheme || outerTheme !== this.lastOuterTheme || !this.cachedTheme) {\n this.lastOuterTheme = outerTheme;\n this.lastTheme = this.props.theme;\n\n if (typeof this.lastTheme === 'function') {\n var theme = this.props.theme;\n this.cachedTheme = theme(outerTheme);\n process.env.NODE_ENV !== \"production\" ? warning(isObject(this.cachedTheme), '[ThemeProvider] Please return an object from your theme function') : void 0;\n } else {\n var _theme = this.props.theme;\n process.env.NODE_ENV !== \"production\" ? warning(isObject(_theme), '[ThemeProvider] Please make your theme prop a plain object') : void 0;\n this.cachedTheme = outerTheme ? _extends({}, outerTheme, _theme) : _theme;\n }\n }\n\n return this.cachedTheme;\n };\n\n _proto.render = function render() {\n var children = this.props.children;\n\n if (!children) {\n return null;\n }\n\n return React.createElement(context.Consumer, null, this.renderProvider);\n };\n\n return ThemeProvider;\n }(React.Component);\n\n if (process.env.NODE_ENV !== 'production') {\n ThemeProvider.propTypes = {\n // eslint-disable-next-line react/require-default-props\n children: PropTypes.node,\n theme: PropTypes.oneOfType([PropTypes.shape({}), PropTypes.func]).isRequired\n };\n }\n\n return ThemeProvider;\n}\n\nfunction createWithTheme(context) {\n return function hoc(Component) {\n var withTheme = React.forwardRef(function (props, ref) {\n return React.createElement(context.Consumer, null, function (theme) {\n process.env.NODE_ENV !== \"production\" ? warning(isObject(theme), '[theming] Please use withTheme only with the ThemeProvider') : void 0;\n return React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n });\n });\n\n if (process.env.NODE_ENV !== 'production') {\n withTheme.displayName = \"WithTheme(\" + getDisplayName(Component) + \")\";\n }\n\n hoist(withTheme, Component);\n return withTheme;\n };\n}\n\nfunction createUseTheme(context) {\n var useTheme = function useTheme() {\n var theme = React.useContext(context);\n process.env.NODE_ENV !== \"production\" ? warning(isObject(theme), '[theming] Please use useTheme only with the ThemeProvider') : void 0;\n return theme;\n };\n\n return useTheme;\n}\n\nfunction createTheming(context) {\n return {\n context: context,\n withTheme: createWithTheme(context),\n useTheme: createUseTheme(context),\n ThemeProvider: createThemeProvider(context)\n };\n}\n\nvar ThemeContext = createContext();\n\nvar _createTheming = createTheming(ThemeContext),\n withTheme = _createTheming.withTheme,\n ThemeProvider = _createTheming.ThemeProvider,\n useTheme = _createTheming.useTheme;\n\nexport { useTheme, ThemeContext, withTheme, createTheming, ThemeProvider };\n","import warning from 'tiny-warning';\nimport { createRule } from 'jss';\n\nvar now = Date.now();\nvar fnValuesNs = \"fnValues\" + now;\nvar fnRuleNs = \"fnStyle\" + ++now;\n\nvar functionPlugin = function functionPlugin() {\n return {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (typeof decl !== 'function') return null;\n var rule = createRule(name, {}, options);\n rule[fnRuleNs] = decl;\n return rule;\n },\n onProcessStyle: function onProcessStyle(style, rule) {\n // We need to extract function values from the declaration, so that we can keep core unaware of them.\n // We need to do that only once.\n // We don't need to extract functions on each style update, since this can happen only once.\n // We don't support function values inside of function rules.\n if (fnValuesNs in rule || fnRuleNs in rule) return style;\n var fnValues = {};\n\n for (var prop in style) {\n var value = style[prop];\n if (typeof value !== 'function') continue;\n delete style[prop];\n fnValues[prop] = value;\n } // $FlowFixMe[prop-missing]\n\n\n rule[fnValuesNs] = fnValues;\n return style;\n },\n onUpdate: function onUpdate(data, rule, sheet, options) {\n var styleRule = rule; // $FlowFixMe[prop-missing]\n\n var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object\n // will be returned from that function.\n\n if (fnRule) {\n // Empty object will remove all currently defined props\n // in case function rule returns a falsy value.\n styleRule.style = fnRule(data) || {};\n\n if (process.env.NODE_ENV === 'development') {\n for (var prop in styleRule.style) {\n if (typeof styleRule.style[prop] === 'function') {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;\n break;\n }\n }\n }\n } // $FlowFixMe[prop-missing]\n\n\n var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.\n\n if (fnValues) {\n for (var _prop in fnValues) {\n styleRule.prop(_prop, fnValues[_prop](data), options);\n }\n }\n }\n };\n};\n\nexport default functionPlugin;\n","import $$observable from 'symbol-observable';\nimport { createRule } from 'jss';\n\nvar isObservable = function isObservable(value) {\n return value && value[$$observable] && value === value[$$observable]();\n};\n\nvar observablePlugin = function observablePlugin(updateOptions) {\n return {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (!isObservable(decl)) return null; // Cast `decl` to `Observable`, since it passed the type guard.\n\n var style$ = decl;\n var rule = createRule(name, {}, options); // TODO\n // Call `stream.subscribe()` returns a subscription, which should be explicitly\n // unsubscribed from when we know this sheet is no longer needed.\n\n style$.subscribe(function (style) {\n for (var prop in style) {\n rule.prop(prop, style[prop], updateOptions);\n }\n });\n return rule;\n },\n onProcessRule: function onProcessRule(rule) {\n if (rule && rule.type !== 'style') return;\n var styleRule = rule;\n var style = styleRule.style;\n\n var _loop = function _loop(prop) {\n var value = style[prop];\n if (!isObservable(value)) return \"continue\";\n delete style[prop];\n value.subscribe({\n next: function next(nextValue) {\n styleRule.prop(prop, nextValue, updateOptions);\n }\n });\n };\n\n for (var prop in style) {\n var _ret = _loop(prop);\n\n if (_ret === \"continue\") continue;\n }\n }\n };\n};\n\nexport default observablePlugin;\n","import warning from 'tiny-warning';\n\nvar semiWithNl = /;\\n/;\n\n/**\n * Naive CSS parser.\n * - Supports only rule body (no selectors)\n * - Requires semicolon and new line after the value (except of last line)\n * - No nested rules support\n */\nvar parse = function parse(cssText) {\n var style = {};\n var split = cssText.split(semiWithNl);\n\n for (var i = 0; i < split.length; i++) {\n var decl = (split[i] || '').trim();\n if (!decl) continue;\n var colonIndex = decl.indexOf(':');\n\n if (colonIndex === -1) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Malformed CSS string \\\"\" + decl + \"\\\"\") : void 0;\n continue;\n }\n\n var prop = decl.substr(0, colonIndex).trim();\n var value = decl.substr(colonIndex + 1).trim();\n style[prop] = value;\n }\n\n return style;\n};\n\nvar onProcessRule = function onProcessRule(rule) {\n if (typeof rule.style === 'string') {\n // $FlowFixMe[prop-missing] We can safely assume that rule has the style property\n rule.style = parse(rule.style);\n }\n};\n\nfunction templatePlugin() {\n return {\n onProcessRule: onProcessRule\n };\n}\n\nexport default templatePlugin;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport { RuleList } from 'jss';\n\nvar at = '@global';\nvar atPrefix = '@global ';\n\nvar GlobalContainerRule =\n/*#__PURE__*/\nfunction () {\n function GlobalContainerRule(key, styles, options) {\n this.type = 'global';\n this.at = at;\n this.rules = void 0;\n this.options = void 0;\n this.key = void 0;\n this.isProcessed = false;\n this.key = key;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var selector in styles) {\n this.rules.add(selector, styles[selector]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = GlobalContainerRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (rule) this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString() {\n return this.rules.toString();\n };\n\n return GlobalContainerRule;\n}();\n\nvar GlobalPrefixedRule =\n/*#__PURE__*/\nfunction () {\n function GlobalPrefixedRule(key, style, options) {\n this.type = 'global';\n this.at = at;\n this.options = void 0;\n this.rule = void 0;\n this.isProcessed = false;\n this.key = void 0;\n this.key = key;\n this.options = options;\n var selector = key.substr(atPrefix.length);\n this.rule = options.jss.createRule(selector, style, _extends({}, options, {\n parent: this\n }));\n }\n\n var _proto2 = GlobalPrefixedRule.prototype;\n\n _proto2.toString = function toString(options) {\n return this.rule ? this.rule.toString(options) : '';\n };\n\n return GlobalPrefixedRule;\n}();\n\nvar separatorRegExp = /\\s*,\\s*/g;\n\nfunction addScope(selector, scope) {\n var parts = selector.split(separatorRegExp);\n var scoped = '';\n\n for (var i = 0; i < parts.length; i++) {\n scoped += scope + \" \" + parts[i].trim();\n if (parts[i + 1]) scoped += ', ';\n }\n\n return scoped;\n}\n\nfunction handleNestedGlobalContainerRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n var rules = style ? style[at] : null;\n if (!rules) return;\n\n for (var name in rules) {\n sheet.addRule(name, rules[name], _extends({}, options, {\n selector: addScope(name, rule.selector)\n }));\n }\n\n delete style[at];\n}\n\nfunction handlePrefixedGlobalRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n\n for (var prop in style) {\n if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;\n var selector = addScope(prop.substr(at.length), rule.selector);\n sheet.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n delete style[prop];\n }\n}\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssGlobal() {\n function onCreateRule(name, styles, options) {\n if (!name) return null;\n\n if (name === at) {\n return new GlobalContainerRule(name, styles, options);\n }\n\n if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {\n return new GlobalPrefixedRule(name, styles, options);\n }\n\n var parent = options.parent;\n\n if (parent) {\n if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {\n options.scoped = false;\n }\n }\n\n if (options.scoped === false) {\n options.selector = name;\n }\n\n return null;\n }\n\n function onProcessRule(rule, sheet) {\n if (rule.type !== 'style' || !sheet) return;\n handleNestedGlobalContainerRule(rule, sheet);\n handlePrefixedGlobalRule(rule, sheet);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}\n\nexport default jssGlobal;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport warning from 'tiny-warning';\n\nvar isObject = function isObject(obj) {\n return obj && typeof obj === 'object' && !Array.isArray(obj);\n};\n\nvar valueNs = \"extendCurrValue\" + Date.now();\n\nfunction mergeExtend(style, rule, sheet, newStyle) {\n var extendType = typeof style.extend; // Extend using a rule name.\n\n if (extendType === 'string') {\n if (!sheet) return;\n var refRule = sheet.getRule(style.extend);\n if (!refRule) return;\n\n if (refRule === rule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] A rule tries to extend itself \\n\" + rule.toString()) : void 0;\n return;\n }\n\n var parent = refRule.options.parent;\n\n if (parent) {\n var originalStyle = parent.rules.raw[style.extend];\n extend(originalStyle, rule, sheet, newStyle);\n }\n\n return;\n } // Extend using an array.\n\n\n if (Array.isArray(style.extend)) {\n for (var index = 0; index < style.extend.length; index++) {\n var singleExtend = style.extend[index];\n var singleStyle = typeof singleExtend === 'string' ? _extends({}, style, {\n extend: singleExtend\n }) : style.extend[index];\n extend(singleStyle, rule, sheet, newStyle);\n }\n\n return;\n } // Extend is a style object.\n\n\n for (var prop in style.extend) {\n if (prop === 'extend') {\n extend(style.extend.extend, rule, sheet, newStyle);\n continue;\n }\n\n if (isObject(style.extend[prop])) {\n if (!(prop in newStyle)) newStyle[prop] = {};\n extend(style.extend[prop], rule, sheet, newStyle[prop]);\n continue;\n }\n\n newStyle[prop] = style.extend[prop];\n }\n}\n\nfunction mergeRest(style, rule, sheet, newStyle) {\n // Copy base style.\n for (var prop in style) {\n if (prop === 'extend') continue;\n\n if (isObject(newStyle[prop]) && isObject(style[prop])) {\n extend(style[prop], rule, sheet, newStyle[prop]);\n continue;\n }\n\n if (isObject(style[prop])) {\n newStyle[prop] = extend(style[prop], rule, sheet);\n continue;\n }\n\n newStyle[prop] = style[prop];\n }\n}\n/**\n * Recursively extend styles.\n */\n\n\nfunction extend(style, rule, sheet, newStyle) {\n if (newStyle === void 0) {\n newStyle = {};\n }\n\n mergeExtend(style, rule, sheet, newStyle);\n mergeRest(style, rule, sheet, newStyle);\n return newStyle;\n}\n/**\n * Handle `extend` property.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssExtend() {\n function onProcessStyle(style, rule, sheet) {\n if ('extend' in style) return extend(style, rule, sheet);\n return style;\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop !== 'extend') return value; // Value is empty, remove properties set previously.\n\n if (value == null || value === false) {\n // $FlowFixMe[prop-missing]\n for (var key in rule[valueNs]) {\n rule.prop(key, null);\n } // $FlowFixMe[prop-missing] Flow complains because there is no indexer property in StyleRule\n\n\n rule[valueNs] = null;\n return null;\n }\n\n if (typeof value === 'object') {\n // $FlowFixMe[invalid-in-rhs] This will be an object\n for (var _key in value) {\n // $FlowFixMe[incompatible-use] This will be an object\n rule.prop(_key, value[_key]);\n } // $FlowFixMe[prop-missing] Flow complains because there is no indexer property in StyleRule\n\n\n rule[valueNs] = value;\n } // Make sure we don't set the value in the core.\n\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default jssExtend;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport warning from 'tiny-warning';\n\nvar separatorRegExp = /\\s*,\\s*/g;\nvar parentRegExp = /&/g;\nvar refRegExp = /\\$([\\w-]+)/g;\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\nfunction jssNested() {\n // Get a function to be used for $ref replacement.\n function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : void 0;\n return key;\n };\n }\n\n function replaceParentRefs(nestedProp, parentProp) {\n var parentSelectors = parentProp.split(separatorRegExp);\n var nestedSelectors = nestedProp.split(separatorRegExp);\n var result = '';\n\n for (var i = 0; i < parentSelectors.length; i++) {\n var parent = parentSelectors[i];\n\n for (var j = 0; j < nestedSelectors.length; j++) {\n var nested = nestedSelectors[j];\n if (result) result += ', '; // Replace all & by the parent or prefix & with the parent.\n\n result += nested.indexOf('&') !== -1 ? nested.replace(parentRegExp, parent) : parent + \" \" + nested;\n }\n }\n\n return result;\n }\n\n function getOptions(rule, container, prevOptions) {\n // Options has been already created, now we only increase index.\n if (prevOptions) return _extends({}, prevOptions, {\n index: prevOptions.index + 1 // $FlowFixMe[prop-missing]\n\n });\n var nestingLevel = rule.options.nestingLevel;\n nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;\n\n var options = _extends({}, rule.options, {\n nestingLevel: nestingLevel,\n index: container.indexOf(rule) + 1 // We don't need the parent name to be set options for chlid.\n\n });\n\n delete options.name;\n return options;\n }\n\n function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style') return style;\n var styleRule = rule;\n var container = styleRule.options.parent;\n var options;\n var replaceRef;\n\n for (var prop in style) {\n var isNested = prop.indexOf('&') !== -1;\n var isNestedConditional = prop[0] === '@';\n if (!isNested && !isNestedConditional) continue;\n options = getOptions(styleRule, container, options);\n\n if (isNested) {\n var selector = replaceParentRefs(prop, styleRule.selector); // Lazily create the ref replacer function just once for\n // all nested rules within the sheet.\n\n if (!replaceRef) replaceRef = getReplaceRef(container, sheet); // Replace all $refs.\n\n selector = selector.replace(refRegExp, replaceRef);\n container.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n } else if (isNestedConditional) {\n // Place conditional right after the parent rule to ensure right ordering.\n container.addRule(prop, {}, options) // Flow expects more options but they aren't required\n // And flow doesn't know this will always be a StyleRule which has the addRule method\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n .addRule(styleRule.key, style[prop], {\n selector: styleRule.selector\n });\n }\n\n delete style[prop];\n }\n\n return style;\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssNested;\n","import warning from 'tiny-warning';\n\n/**\n * Set selector.\n *\n * @param {Object} original rule\n * @param {String} className class string\n * @return {Boolean} flag, indicating function was successfull or not\n */\nfunction registerClass(rule, className) {\n // Skip falsy values\n if (!className) return true; // Support array of class names `{composes: ['foo', 'bar']}`\n\n if (Array.isArray(className)) {\n for (var index = 0; index < className.length; index++) {\n var isSetted = registerClass(rule, className[index]);\n if (!isSetted) return false;\n }\n\n return true;\n } // Support space separated class names `{composes: 'foo bar'}`\n\n\n if (className.indexOf(' ') > -1) {\n return registerClass(rule, className.split(' '));\n }\n\n var _ref = rule.options,\n parent = _ref.parent; // It is a ref to a local rule.\n\n if (className[0] === '$') {\n var refRule = parent.getRule(className.substr(1));\n\n if (!refRule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced rule is not defined. \\n\" + rule.toString()) : void 0;\n return false;\n }\n\n if (refRule === rule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Cyclic composition detected. \\n\" + rule.toString()) : void 0;\n return false;\n }\n\n parent.classes[rule.key] += \" \" + parent.classes[refRule.key];\n return true;\n }\n\n parent.classes[rule.key] += \" \" + className;\n return true;\n}\n/**\n * Convert compose property to additional class, remove property from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssCompose() {\n function onProcessStyle(style, rule) {\n if (!('composes' in style)) return style;\n registerClass(rule, style.composes); // Remove composes property to prevent infinite loop.\n\n delete style.composes;\n return style;\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssCompose;\n","/* eslint-disable no-var, prefer-template */\nvar uppercasePattern = /[A-Z]/g\nvar msPattern = /^ms-/\nvar cache = {}\n\nfunction toHyphenLower(match) {\n return '-' + match.toLowerCase()\n}\n\nfunction hyphenateStyleName(name) {\n if (cache.hasOwnProperty(name)) {\n return cache[name]\n }\n\n var hName = name.replace(uppercasePattern, toHyphenLower)\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)\n}\n\nexport default hyphenateStyleName\n","import hyphenate from 'hyphenate-style-name';\n\n/**\n * Convert camel cased property names to dash separated.\n *\n * @param {Object} style\n * @return {Object}\n */\n\nfunction convertCase(style) {\n var converted = {};\n\n for (var prop in style) {\n var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop);\n converted[key] = style[prop];\n }\n\n if (style.fallbacks) {\n if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);\n }\n\n return converted;\n}\n/**\n * Allow camel cased property names by converting them back to dasherized.\n *\n * @param {Rule} rule\n */\n\n\nfunction camelCase() {\n function onProcessStyle(style) {\n if (Array.isArray(style)) {\n // Handle rules like @font-face, which can have multiple styles in an array\n for (var index = 0; index < style.length; index++) {\n style[index] = convertCase(style[index]);\n }\n\n return style;\n }\n\n return convertCase(style);\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop.indexOf('--') === 0) {\n return value;\n }\n\n var hyphenatedProp = hyphenate(prop); // There was no camel case in place\n\n if (prop === hyphenatedProp) return value;\n rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default camelCase;\n","import { hasCSSTOMSupport } from 'jss';\n\nvar px = hasCSSTOMSupport && CSS ? CSS.px : 'px';\nvar ms = hasCSSTOMSupport && CSS ? CSS.ms : 'ms';\nvar percent = hasCSSTOMSupport && CSS ? CSS.percent : '%';\n/**\n * Generated jss-plugin-default-unit CSS property units\n *\n * @type object\n */\n\nvar defaultUnits = {\n // Animation properties\n 'animation-delay': ms,\n 'animation-duration': ms,\n // Background properties\n 'background-position': px,\n 'background-position-x': px,\n 'background-position-y': px,\n 'background-size': px,\n // Border Properties\n border: px,\n 'border-bottom': px,\n 'border-bottom-left-radius': px,\n 'border-bottom-right-radius': px,\n 'border-bottom-width': px,\n 'border-left': px,\n 'border-left-width': px,\n 'border-radius': px,\n 'border-right': px,\n 'border-right-width': px,\n 'border-top': px,\n 'border-top-left-radius': px,\n 'border-top-right-radius': px,\n 'border-top-width': px,\n 'border-width': px,\n 'border-block': px,\n 'border-block-end': px,\n 'border-block-end-width': px,\n 'border-block-start': px,\n 'border-block-start-width': px,\n 'border-block-width': px,\n 'border-inline': px,\n 'border-inline-end': px,\n 'border-inline-end-width': px,\n 'border-inline-start': px,\n 'border-inline-start-width': px,\n 'border-inline-width': px,\n 'border-start-start-radius': px,\n 'border-start-end-radius': px,\n 'border-end-start-radius': px,\n 'border-end-end-radius': px,\n // Margin properties\n margin: px,\n 'margin-bottom': px,\n 'margin-left': px,\n 'margin-right': px,\n 'margin-top': px,\n 'margin-block': px,\n 'margin-block-end': px,\n 'margin-block-start': px,\n 'margin-inline': px,\n 'margin-inline-end': px,\n 'margin-inline-start': px,\n // Padding properties\n padding: px,\n 'padding-bottom': px,\n 'padding-left': px,\n 'padding-right': px,\n 'padding-top': px,\n 'padding-block': px,\n 'padding-block-end': px,\n 'padding-block-start': px,\n 'padding-inline': px,\n 'padding-inline-end': px,\n 'padding-inline-start': px,\n // Mask properties\n 'mask-position-x': px,\n 'mask-position-y': px,\n 'mask-size': px,\n // Width and height properties\n height: px,\n width: px,\n 'min-height': px,\n 'max-height': px,\n 'min-width': px,\n 'max-width': px,\n // Position properties\n bottom: px,\n left: px,\n top: px,\n right: px,\n inset: px,\n 'inset-block': px,\n 'inset-block-end': px,\n 'inset-block-start': px,\n 'inset-inline': px,\n 'inset-inline-end': px,\n 'inset-inline-start': px,\n // Shadow properties\n 'box-shadow': px,\n 'text-shadow': px,\n // Column properties\n 'column-gap': px,\n 'column-rule': px,\n 'column-rule-width': px,\n 'column-width': px,\n // Font and text properties\n 'font-size': px,\n 'font-size-delta': px,\n 'letter-spacing': px,\n 'text-decoration-thickness': px,\n 'text-indent': px,\n 'text-stroke': px,\n 'text-stroke-width': px,\n 'word-spacing': px,\n // Motion properties\n motion: px,\n 'motion-offset': px,\n // Outline properties\n outline: px,\n 'outline-offset': px,\n 'outline-width': px,\n // Perspective properties\n perspective: px,\n 'perspective-origin-x': percent,\n 'perspective-origin-y': percent,\n // Transform properties\n 'transform-origin': percent,\n 'transform-origin-x': percent,\n 'transform-origin-y': percent,\n 'transform-origin-z': percent,\n // Transition properties\n 'transition-delay': ms,\n 'transition-duration': ms,\n // Alignment properties\n 'vertical-align': px,\n 'flex-basis': px,\n // Some random properties\n 'shape-margin': px,\n size: px,\n gap: px,\n // Grid properties\n grid: px,\n 'grid-gap': px,\n 'row-gap': px,\n 'grid-row-gap': px,\n 'grid-column-gap': px,\n 'grid-template-rows': px,\n 'grid-template-columns': px,\n 'grid-auto-rows': px,\n 'grid-auto-columns': px,\n // Not existing properties.\n // Used to avoid issues with jss-plugin-expand integration.\n 'box-shadow-x': px,\n 'box-shadow-y': px,\n 'box-shadow-blur': px,\n 'box-shadow-spread': px,\n 'font-line-height': px,\n 'text-shadow-x': px,\n 'text-shadow-y': px,\n 'text-shadow-blur': px\n};\n\n/**\n * Clones the object and adds a camel cased property version.\n */\nfunction addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n\n var newObj = {};\n\n for (var _key in obj) {\n newObj[_key] = obj[_key];\n newObj[_key.replace(regExp, replace)] = obj[_key];\n }\n\n return newObj;\n}\n\nvar units = addCamelCasedVersion(defaultUnits);\n/**\n * Recursive deep style passing function\n */\n\nfunction iterate(prop, value, options) {\n if (value == null) return value;\n\n if (Array.isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n value[i] = iterate(prop, value[i], options);\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n for (var innerProp in value) {\n value[innerProp] = iterate(innerProp, value[innerProp], options);\n }\n } else {\n for (var _innerProp in value) {\n value[_innerProp] = iterate(prop + \"-\" + _innerProp, value[_innerProp], options);\n }\n } // eslint-disable-next-line no-restricted-globals\n\n } else if (typeof value === 'number' && isNaN(value) === false) {\n var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.\n\n if (unit && !(value === 0 && unit === px)) {\n return typeof unit === 'function' ? unit(value).toString() : \"\" + value + unit;\n }\n\n return value.toString();\n }\n\n return value;\n}\n/**\n * Add unit to numeric values.\n */\n\n\nfunction defaultUnit(options) {\n if (options === void 0) {\n options = {};\n }\n\n var camelCasedOptions = addCamelCasedVersion(options);\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n for (var prop in style) {\n style[prop] = iterate(prop, style[prop], camelCasedOptions);\n }\n\n return style;\n }\n\n function onChangeValue(value, prop) {\n return iterate(prop, value, camelCasedOptions);\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default defaultUnit;\n","/**\n * A scheme for converting properties from array to regular style.\n * All properties listed below will be transformed to a string separated by space.\n */\nvar propArray = {\n 'background-size': true,\n 'background-position': true,\n border: true,\n 'border-bottom': true,\n 'border-left': true,\n 'border-top': true,\n 'border-right': true,\n 'border-radius': true,\n 'border-image': true,\n 'border-width': true,\n 'border-style': true,\n 'border-color': true,\n 'box-shadow': true,\n flex: true,\n margin: true,\n padding: true,\n outline: true,\n 'transform-origin': true,\n transform: true,\n transition: true\n /**\n * A scheme for converting arrays to regular styles inside of objects.\n * For e.g.: \"{position: [0, 0]}\" => \"background-position: 0 0;\".\n */\n\n};\nvar propArrayInObj = {\n position: true,\n // background-position\n size: true // background-size\n\n /**\n * A scheme for parsing and building correct styles from passed objects.\n */\n\n};\nvar propObj = {\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n background: {\n attachment: null,\n color: null,\n image: null,\n position: null,\n repeat: null\n },\n border: {\n width: null,\n style: null,\n color: null\n },\n 'border-top': {\n width: null,\n style: null,\n color: null\n },\n 'border-right': {\n width: null,\n style: null,\n color: null\n },\n 'border-bottom': {\n width: null,\n style: null,\n color: null\n },\n 'border-left': {\n width: null,\n style: null,\n color: null\n },\n outline: {\n width: null,\n style: null,\n color: null\n },\n 'list-style': {\n type: null,\n position: null,\n image: null\n },\n transition: {\n property: null,\n duration: null,\n 'timing-function': null,\n timingFunction: null,\n // Needed for avoiding comilation issues with jss-plugin-camel-case\n delay: null\n },\n animation: {\n name: null,\n duration: null,\n 'timing-function': null,\n timingFunction: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n delay: null,\n 'iteration-count': null,\n iterationCount: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n direction: null,\n 'fill-mode': null,\n fillMode: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n 'play-state': null,\n playState: null // Needed to avoid compilation issues with jss-plugin-camel-case\n\n },\n 'box-shadow': {\n x: 0,\n y: 0,\n blur: 0,\n spread: 0,\n color: null,\n inset: null\n },\n 'text-shadow': {\n x: 0,\n y: 0,\n blur: null,\n color: null\n }\n /**\n * A scheme for converting non-standart properties inside object.\n * For e.g.: include 'border-radius' property inside 'border' object.\n */\n\n};\nvar customPropObj = {\n border: {\n radius: 'border-radius',\n image: 'border-image',\n width: 'border-width',\n style: 'border-style',\n color: 'border-color'\n },\n 'border-bottom': {\n width: 'border-bottom-width',\n style: 'border-bottom-style',\n color: 'border-bottom-color'\n },\n 'border-top': {\n width: 'border-top-width',\n style: 'border-top-style',\n color: 'border-top-color'\n },\n 'border-left': {\n width: 'border-left-width',\n style: 'border-left-style',\n color: 'border-left-color'\n },\n 'border-right': {\n width: 'border-right-width',\n style: 'border-right-style',\n color: 'border-right-color'\n },\n background: {\n size: 'background-size',\n image: 'background-image'\n },\n font: {\n style: 'font-style',\n variant: 'font-variant',\n weight: 'font-weight',\n stretch: 'font-stretch',\n size: 'font-size',\n family: 'font-family',\n lineHeight: 'line-height',\n // Needed to avoid compilation issues with jss-plugin-camel-case\n 'line-height': 'line-height'\n },\n flex: {\n grow: 'flex-grow',\n basis: 'flex-basis',\n direction: 'flex-direction',\n wrap: 'flex-wrap',\n flow: 'flex-flow',\n shrink: 'flex-shrink'\n },\n align: {\n self: 'align-self',\n items: 'align-items',\n content: 'align-content'\n },\n grid: {\n 'template-columns': 'grid-template-columns',\n templateColumns: 'grid-template-columns',\n 'template-rows': 'grid-template-rows',\n templateRows: 'grid-template-rows',\n 'template-areas': 'grid-template-areas',\n templateAreas: 'grid-template-areas',\n template: 'grid-template',\n 'auto-columns': 'grid-auto-columns',\n autoColumns: 'grid-auto-columns',\n 'auto-rows': 'grid-auto-rows',\n autoRows: 'grid-auto-rows',\n 'auto-flow': 'grid-auto-flow',\n autoFlow: 'grid-auto-flow',\n row: 'grid-row',\n column: 'grid-column',\n 'row-start': 'grid-row-start',\n rowStart: 'grid-row-start',\n 'row-end': 'grid-row-end',\n rowEnd: 'grid-row-end',\n 'column-start': 'grid-column-start',\n columnStart: 'grid-column-start',\n 'column-end': 'grid-column-end',\n columnEnd: 'grid-column-end',\n area: 'grid-area',\n gap: 'grid-gap',\n 'row-gap': 'grid-row-gap',\n rowGap: 'grid-row-gap',\n 'column-gap': 'grid-column-gap',\n columnGap: 'grid-column-gap'\n }\n};\n\n/* eslint-disable no-use-before-define */\n\n/**\n * Map values by given prop.\n *\n * @param {Array} array of values\n * @param {String} original property\n * @param {String} original rule\n * @return {String} mapped values\n */\nfunction mapValuesByProp(value, prop, rule) {\n return value.map(function (item) {\n return objectToArray(item, prop, rule, false, true);\n });\n}\n/**\n * Convert array to nested array, if needed\n */\n\n\nfunction processArray(value, prop, scheme, rule) {\n if (scheme[prop] == null) return value;\n if (value.length === 0) return [];\n if (Array.isArray(value[0])) return processArray(value[0], prop, scheme, rule);\n\n if (typeof value[0] === 'object') {\n return mapValuesByProp(value, prop, rule);\n }\n\n return [value];\n}\n/**\n * Convert object to array.\n */\n\n\nfunction objectToArray(value, prop, rule, isFallback, isInArray) {\n if (!(propObj[prop] || customPropObj[prop])) return [];\n var result = []; // Check if exists any non-standard property\n\n if (customPropObj[prop]) {\n // eslint-disable-next-line no-param-reassign\n value = customPropsToStyle(value, rule, customPropObj[prop], isFallback);\n } // Pass throught all standart props\n\n\n if (Object.keys(value).length) {\n for (var baseProp in propObj[prop]) {\n if (value[baseProp]) {\n if (Array.isArray(value[baseProp])) {\n result.push(propArrayInObj[baseProp] === null ? value[baseProp] : value[baseProp].join(' '));\n } else result.push(value[baseProp]);\n\n continue;\n } // Add default value from props config.\n\n\n if (propObj[prop][baseProp] != null) {\n result.push(propObj[prop][baseProp]);\n }\n }\n }\n\n if (!result.length || isInArray) return result;\n return [result];\n}\n/**\n * Convert custom properties values to styles adding them to rule directly\n */\n\n\nfunction customPropsToStyle(value, rule, customProps, isFallback) {\n for (var prop in customProps) {\n var propName = customProps[prop]; // If current property doesn't exist already in rule - add new one\n\n if (typeof value[prop] !== 'undefined' && (isFallback || !rule.prop(propName))) {\n var _styleDetector;\n\n var appendedValue = styleDetector((_styleDetector = {}, _styleDetector[propName] = value[prop], _styleDetector), rule)[propName]; // Add style directly in rule\n\n if (isFallback) rule.style.fallbacks[propName] = appendedValue;else rule.style[propName] = appendedValue;\n } // Delete converted property to avoid double converting\n\n\n delete value[prop];\n }\n\n return value;\n}\n/**\n * Detect if a style needs to be converted.\n */\n\n\nfunction styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}\n/**\n * Adds possibility to write expanded styles.\n */\n\n\nfunction jssExpand() {\n function onProcessStyle(style, rule) {\n if (!style || rule.type !== 'style') return style;\n\n if (Array.isArray(style)) {\n // Pass rules one by one and reformat them\n for (var index = 0; index < style.length; index++) {\n style[index] = styleDetector(style[index], rule);\n }\n\n return style;\n }\n\n return styleDetector(style, rule);\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssExpand;\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import isInBrowser from 'is-in-browser';\nimport _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';\n\n// Export javascript style and css style vendor prefixes.\nvar js = '';\nvar css = '';\nvar vendor = '';\nvar browser = '';\nvar isTouch = isInBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.\n\nif (isInBrowser) {\n // Order matters. We need to check Webkit the last one because\n // other vendors use to add Webkit prefixes to some properties\n var jsCssMap = {\n Moz: '-moz-',\n ms: '-ms-',\n O: '-o-',\n Webkit: '-webkit-'\n };\n\n var _document$createEleme = document.createElement('p'),\n style = _document$createEleme.style;\n\n var testProp = 'Transform';\n\n for (var key in jsCssMap) {\n if (key + testProp in style) {\n js = key;\n css = jsCssMap[key];\n break;\n }\n } // Correctly detect the Edge browser.\n\n\n if (js === 'Webkit' && 'msHyphens' in style) {\n js = 'ms';\n css = jsCssMap.ms;\n browser = 'edge';\n } // Correctly detect the Safari browser.\n\n\n if (js === 'Webkit' && '-apple-trailing-word' in style) {\n vendor = 'apple';\n }\n}\n/**\n * Vendor prefix string for the current browser.\n *\n * @type {{js: String, css: String, vendor: String, browser: String}}\n * @api public\n */\n\n\nvar prefix = {\n js: js,\n css: css,\n vendor: vendor,\n browser: browser,\n isTouch: isTouch\n};\n\n/**\n * Test if a keyframe at-rule should be prefixed or not\n *\n * @param {String} vendor prefix string for the current browser.\n * @return {String}\n * @api public\n */\n\nfunction supportedKeyframes(key) {\n // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'\n if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.\n // https://caniuse.com/#search=keyframes\n\n if (prefix.js === 'ms') return key;\n return \"@\" + prefix.css + \"keyframes\" + key.substr(10);\n}\n\n// https://caniuse.com/#search=appearance\n\nvar appearence = {\n noPrefill: ['appearance'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'appearance') return false;\n if (prefix.js === 'ms') return \"-webkit-\" + prop;\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=color-adjust\n\nvar colorAdjust = {\n noPrefill: ['color-adjust'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'color-adjust') return false;\n if (prefix.js === 'Webkit') return prefix.css + \"print-\" + prop;\n return prop;\n }\n};\n\nvar regExp = /[-\\s]+(.)?/g;\n/**\n * Replaces the letter with the capital letter\n *\n * @param {String} match\n * @param {String} c\n * @return {String}\n * @api private\n */\n\nfunction toUpper(match, c) {\n return c ? c.toUpperCase() : '';\n}\n/**\n * Convert dash separated strings to camel-cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\n\nfunction camelize(str) {\n return str.replace(regExp, toUpper);\n}\n\n/**\n * Convert dash separated strings to pascal cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction pascalize(str) {\n return camelize(\"-\" + str);\n}\n\n// but we can use a longhand property instead.\n// https://caniuse.com/#search=mask\n\nvar mask = {\n noPrefill: ['mask'],\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^mask/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var longhand = 'mask-image';\n\n if (camelize(longhand) in style) {\n return prop;\n }\n\n if (prefix.js + pascalize(longhand) in style) {\n return prefix.css + prop;\n }\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=text-orientation\n\nvar textOrientation = {\n noPrefill: ['text-orientation'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'text-orientation') return false;\n\n if (prefix.vendor === 'apple' && !prefix.isTouch) {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=transform\n\nvar transform = {\n noPrefill: ['transform'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transform') return false;\n\n if (options.transform) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=transition\n\nvar transition = {\n noPrefill: ['transition'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transition') return false;\n\n if (options.transition) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=writing-mode\n\nvar writingMode = {\n noPrefill: ['writing-mode'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'writing-mode') return false;\n\n if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=user-select\n\nvar userSelect = {\n noPrefill: ['user-select'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'user-select') return false;\n\n if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=multicolumn\n// https://github.com/postcss/autoprefixer/issues/491\n// https://github.com/postcss/autoprefixer/issues/177\n\nvar breakPropsOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^break-/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var jsProp = \"WebkitColumn\" + pascalize(prop);\n return jsProp in style ? prefix.css + \"column-\" + prop : false;\n }\n\n if (prefix.js === 'Moz') {\n var _jsProp = \"page\" + pascalize(prop);\n\n return _jsProp in style ? \"page-\" + prop : false;\n }\n\n return false;\n }\n};\n\n// See https://github.com/postcss/autoprefixer/issues/324.\n\nvar inlineLogicalOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^(border|margin|padding)-inline/.test(prop)) return false;\n if (prefix.js === 'Moz') return prop;\n var newProp = prop.replace('-inline', '');\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\n// Camelization is required because we can't test using.\n// CSS syntax for e.g. in FF.\n\nvar unprefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n return camelize(prop) in style ? prop : false;\n }\n};\n\nvar prefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.\n\n if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.\n\n if (prop[0] === '-' && prop[1] === '-') return prop;\n if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback.\n\n if (prefix.js !== 'Webkit' && \"Webkit\" + pascalized in style) return \"-webkit-\" + prop;\n return false;\n }\n};\n\n// https://caniuse.com/#search=scroll-snap\n\nvar scrollSnap = {\n supportedProperty: function supportedProperty(prop) {\n if (prop.substring(0, 11) !== 'scroll-snap') return false;\n\n if (prefix.js === 'ms') {\n return \"\" + prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=overscroll-behavior\n\nvar overscrollBehavior = {\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'overscroll-behavior') return false;\n\n if (prefix.js === 'ms') {\n return prefix.css + \"scroll-chaining\";\n }\n\n return prop;\n }\n};\n\nvar propMap = {\n 'flex-grow': 'flex-positive',\n 'flex-shrink': 'flex-negative',\n 'flex-basis': 'flex-preferred-size',\n 'justify-content': 'flex-pack',\n order: 'flex-order',\n 'align-items': 'flex-align',\n 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.\n\n}; // Support old flex spec from 2012.\n\nvar flex2012 = {\n supportedProperty: function supportedProperty(prop, style) {\n var newProp = propMap[prop];\n if (!newProp) return false;\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\nvar propMap$1 = {\n flex: 'box-flex',\n 'flex-grow': 'box-flex',\n 'flex-direction': ['box-orient', 'box-direction'],\n order: 'box-ordinal-group',\n 'align-items': 'box-align',\n 'flex-flow': ['box-orient', 'box-direction'],\n 'justify-content': 'box-pack'\n};\nvar propKeys = Object.keys(propMap$1);\n\nvar prefixCss = function prefixCss(p) {\n return prefix.css + p;\n}; // Support old flex spec from 2009.\n\n\nvar flex2009 = {\n supportedProperty: function supportedProperty(prop, style, _ref) {\n var multiple = _ref.multiple;\n\n if (propKeys.indexOf(prop) > -1) {\n var newProp = propMap$1[prop];\n\n if (!Array.isArray(newProp)) {\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n\n if (!multiple) return false;\n\n for (var i = 0; i < newProp.length; i++) {\n if (!(prefix.js + pascalize(newProp[0]) in style)) {\n return false;\n }\n }\n\n return newProp.map(prefixCss);\n }\n\n return false;\n }\n};\n\n// plugins = [\n// ...plugins,\n// breakPropsOld,\n// inlineLogicalOld,\n// unprefixed,\n// prefixed,\n// scrollSnap,\n// flex2012,\n// flex2009\n// ]\n// Plugins without 'noPrefill' value, going last.\n// 'flex-*' plugins should be at the bottom.\n// 'flex2009' going after 'flex2012'.\n// 'prefixed' going after 'unprefixed'\n\nvar plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];\nvar propertyDetectors = plugins.filter(function (p) {\n return p.supportedProperty;\n}).map(function (p) {\n return p.supportedProperty;\n});\nvar noPrefill = plugins.filter(function (p) {\n return p.noPrefill;\n}).reduce(function (a, p) {\n a.push.apply(a, _toConsumableArray(p.noPrefill));\n return a;\n}, []);\n\nvar el;\nvar cache = {};\n\nif (isInBrowser) {\n el = document.createElement('p'); // We test every property on vendor prefix requirement.\n // Once tested, result is cached. It gives us up to 70% perf boost.\n // http://jsperf.com/element-style-object-access-vs-plain-object\n //\n // Prefill cache with known css properties to reduce amount of\n // properties we need to feature test at runtime.\n // http://davidwalsh.name/vendor-prefix\n\n var computed = window.getComputedStyle(document.documentElement, '');\n\n for (var key$1 in computed) {\n // eslint-disable-next-line no-restricted-globals\n if (!isNaN(key$1)) cache[computed[key$1]] = computed[key$1];\n } // Properties that cannot be correctly detected using the\n // cache prefill method.\n\n\n noPrefill.forEach(function (x) {\n return delete cache[x];\n });\n}\n/**\n * Test if a property is supported, returns supported property with vendor\n * prefix if required. Returns `false` if not supported.\n *\n * @param {String} prop dash separated\n * @param {Object} [options]\n * @return {String|Boolean}\n * @api public\n */\n\n\nfunction supportedProperty(prop, options) {\n if (options === void 0) {\n options = {};\n }\n\n // For server-side rendering.\n if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache[prop] != null) {\n return cache[prop];\n } // Check if 'transition' or 'transform' natively supported in browser.\n\n\n if (prop === 'transition' || prop === 'transform') {\n options[prop] = prop in el.style;\n } // Find a plugin for current prefix property.\n\n\n for (var i = 0; i < propertyDetectors.length; i++) {\n cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.\n\n if (cache[prop]) break;\n } // Reset styles for current property.\n // Firefox can even throw an error for invalid properties, e.g., \"0\".\n\n\n try {\n el.style[prop] = '';\n } catch (err) {\n return false;\n }\n\n return cache[prop];\n}\n\nvar cache$1 = {};\nvar transitionProperties = {\n transition: 1,\n 'transition-property': 1,\n '-webkit-transition': 1,\n '-webkit-transition-property': 1\n};\nvar transPropsRegExp = /(^\\s*[\\w-]+)|, (\\s*[\\w-]+)(?![^()]*\\))/g;\nvar el$1;\n/**\n * Returns prefixed value transition/transform if needed.\n *\n * @param {String} match\n * @param {String} p1\n * @param {String} p2\n * @return {String}\n * @api private\n */\n\nfunction prefixTransitionCallback(match, p1, p2) {\n if (p1 === 'var') return 'var';\n if (p1 === 'all') return 'all';\n if (p2 === 'all') return ', all';\n var prefixedValue = p1 ? supportedProperty(p1) : \", \" + supportedProperty(p2);\n if (!prefixedValue) return p1 || p2;\n return prefixedValue;\n}\n\nif (isInBrowser) el$1 = document.createElement('p');\n/**\n * Returns prefixed value if needed. Returns `false` if value is not supported.\n *\n * @param {String} property\n * @param {String} value\n * @return {String|Boolean}\n * @api public\n */\n\nfunction supportedValue(property, value) {\n // For server-side rendering.\n var prefixedValue = value;\n if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.\n // We want only prefixable values here.\n // eslint-disable-next-line no-restricted-globals\n\n if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {\n return prefixedValue;\n } // Create cache key for current value.\n\n\n var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache$1[cacheKey] != null) {\n return cache$1[cacheKey];\n } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.\n\n\n try {\n // Test value as it is.\n el$1.style[property] = prefixedValue;\n } catch (err) {\n // Return false if value not supported.\n cache$1[cacheKey] = false;\n return false;\n } // If 'transition' or 'transition-property' property.\n\n\n if (transitionProperties[property]) {\n prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);\n } else if (el$1.style[property] === '') {\n // Value with a vendor prefix.\n prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert \"flex\" to \"-ms-flexbox\" for IE10.\n\n if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.\n\n el$1.style[property] = prefixedValue; // Return false if value not supported.\n\n if (el$1.style[property] === '') {\n cache$1[cacheKey] = false;\n return false;\n }\n } // Reset styles for current property.\n\n\n el$1.style[property] = ''; // Write current value to cache.\n\n cache$1[cacheKey] = prefixedValue;\n return cache$1[cacheKey];\n}\n\nexport { prefix, supportedKeyframes, supportedProperty, supportedValue };\n","import { supportedKeyframes, supportedValue, supportedProperty } from 'css-vendor';\nimport { toCssValue } from 'jss';\n\n/**\n * Add vendor prefix to a property name when needed.\n *\n * @api public\n */\n\nfunction jssVendorPrefixer() {\n function onProcessRule(rule) {\n if (rule.type === 'keyframes') {\n var atRule = rule;\n atRule.at = supportedKeyframes(atRule.at);\n }\n }\n\n function prefixStyle(style) {\n for (var prop in style) {\n var value = style[prop];\n\n if (prop === 'fallbacks' && Array.isArray(value)) {\n style[prop] = value.map(prefixStyle);\n continue;\n }\n\n var changeProp = false;\n var supportedProp = supportedProperty(prop);\n if (supportedProp && supportedProp !== prop) changeProp = true;\n var changeValue = false;\n var supportedValue$1 = supportedValue(supportedProp, toCssValue(value));\n if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;\n\n if (changeProp || changeValue) {\n if (changeProp) delete style[prop];\n style[supportedProp || prop] = supportedValue$1 || value;\n }\n }\n\n return style;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n return prefixStyle(style);\n }\n\n function onChangeValue(value, prop) {\n return supportedValue(prop, toCssValue(value)) || value;\n }\n\n return {\n onProcessRule: onProcessRule,\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default jssVendorPrefixer;\n","/**\n * Sort props by length.\n */\nfunction jssPropsSort() {\n var sort = function sort(prop0, prop1) {\n if (prop0.length === prop1.length) {\n return prop0 > prop1 ? 1 : -1;\n }\n\n return prop0.length - prop1.length;\n };\n\n return {\n onProcessStyle: function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n\n for (var i = 0; i < props.length; i++) {\n newStyle[props[i]] = style[props[i]];\n }\n\n return newStyle;\n }\n };\n}\n\nexport default jssPropsSort;\n","import functions from 'jss-plugin-rule-value-function';\nimport observable from 'jss-plugin-rule-value-observable';\nimport template from 'jss-plugin-template';\nimport global from 'jss-plugin-global';\nimport extend from 'jss-plugin-extend';\nimport nested from 'jss-plugin-nested';\nimport compose from 'jss-plugin-compose';\nimport camelCase from 'jss-plugin-camel-case';\nimport defaultUnit from 'jss-plugin-default-unit';\nimport expand from 'jss-plugin-expand';\nimport vendorPrefixer from 'jss-plugin-vendor-prefixer';\nimport propsSort from 'jss-plugin-props-sort';\n\nvar create = function create(options) {\n if (options === void 0) {\n options = {};\n }\n\n return {\n plugins: [functions(), observable(options.observable), template(), global(), extend(), nested(), compose(), camelCase(), defaultUnit(options.defaultUnit), expand(), vendorPrefixer(), propsSort()]\n };\n};\n\nexport default create;\n","function shallowEqualObjects(objA, objB) {\n if (objA === objB) {\n return true;\n }\n\n if (!objA || !objB) {\n return false;\n }\n\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n var len = aKeys.length;\n\n if (bKeys.length !== len) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n var key = aKeys[i];\n\n if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction shallowEqualArrays(arrA, arrB) {\n if (arrA === arrB) {\n return true;\n }\n\n if (!arrA || !arrB) {\n return false;\n }\n\n var len = arrA.length;\n\n if (arrB.length !== len) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n if (arrA[i] !== arrB[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport { shallowEqualArrays, shallowEqualObjects };\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import { create } from 'jss';\nimport preset from 'jss-preset-default';\n\n// I have been trying to benchmark and I have seen a slow down after about 10k rules.\n// Since we are in a single sheet mode, user shouldn't care about this.\nvar MAX_RULES_PER_SHEET = 10000;\nvar defaultJss = create(preset());\n\nvar createCss = function createCss(jss) {\n if (jss === void 0) {\n jss = defaultJss;\n }\n\n var cache = new Map();\n var ruleIndex = 0;\n var sheet;\n\n var getSheet = function getSheet() {\n if (!sheet || sheet.rules.index.length > MAX_RULES_PER_SHEET) {\n sheet = jss.createStyleSheet().attach();\n }\n\n return sheet;\n };\n\n function css() {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments; // We can avoid the need for stringification with a babel plugin,\n // which could generate a hash at build time and add it to the object.\n\n var argsStr = JSON.stringify(args);\n var cached = cache.get(argsStr);\n if (cached) return cached.className;\n var flatArgs = []; // Flatten arguments which can be\n // - style objects\n // - array of style objects\n // - arrays of style objects\n\n for (var argIndex in args) {\n var arg = args[argIndex];\n\n if (!Array.isArray(arg)) {\n flatArgs.push(arg);\n continue;\n }\n\n for (var innerArgIndex = 0; innerArgIndex < arg.length; innerArgIndex++) {\n flatArgs.push(arg[innerArgIndex]);\n }\n }\n\n var mergedStyle = {};\n var labels = [];\n\n for (var i = 0; i < flatArgs.length; i++) {\n var style = flatArgs[i];\n if (!style) continue;\n var styleObject = style; // It can be a class name that css() has previously generated.\n\n if (typeof style === 'string') {\n // eslint-disable-next-line no-shadow\n var _cached = cache.get(style);\n\n if (_cached) {\n // eslint-disable-next-line prefer-spread\n if (_cached.labels.length) labels.push.apply(labels, _cached.labels);\n styleObject = _cached.style;\n }\n }\n\n if (styleObject.label && labels.indexOf(styleObject.label) === -1) labels.push(styleObject.label);\n Object.assign(mergedStyle, styleObject);\n }\n\n delete mergedStyle.label;\n var label = labels.length === 0 ? 'css' : labels.join('-');\n var key = label + \"-\" + ruleIndex++;\n getSheet().addRule(key, mergedStyle);\n var className = getSheet().classes[key];\n var cacheValue = {\n style: mergedStyle,\n labels: labels,\n className: className\n };\n cache.set(argsStr, cacheValue);\n cache.set(className, cacheValue);\n return className;\n } // For testing only.\n\n\n css.getSheet = getSheet;\n return css;\n};\n\nvar css = createCss();\n\nexport default css;\nexport { createCss as create };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport { createContext, forwardRef, createElement as createElement$1, Component, useRef, useContext, useMemo, useDebugValue, useEffect, useLayoutEffect } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { ThemeContext } from 'theming';\nexport { ThemeProvider, createTheming, useTheme, withTheme } from 'theming';\nimport warning from 'tiny-warning';\nimport defaultJss, { SheetsManager, create as create$1, getDynamicStyles, createGenerateId, SheetsRegistry } from 'jss';\nexport { SheetsRegistry, createGenerateId } from 'jss';\nimport preset from 'jss-preset-default';\nimport isInBrowser from 'is-in-browser';\nimport PropTypes from 'prop-types';\nimport { shallowEqualObjects } from 'shallow-equal';\nimport isPropValid from '@emotion/is-prop-valid';\nimport defaultCss from 'css-jss';\n\n// eslint-disable-next-line no-unused-vars\nvar getDisplayName = function getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component';\n};\n\nvar memoize = function memoize(fn) {\n var lastArgs;\n var lastResult;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (Array.isArray(lastArgs) && args.length === lastArgs.length) {\n var isSame = true;\n\n for (var i = 0; i < args.length; i++) {\n if (args[i] !== lastArgs[i]) {\n isSame = false;\n }\n }\n\n if (isSame) {\n return lastResult;\n }\n }\n\n lastArgs = args;\n lastResult = fn.apply(void 0, args);\n return lastResult;\n };\n};\n\nvar mergeClasses = function mergeClasses(baseClasses, additionalClasses) {\n var combinedClasses = _extends({}, baseClasses);\n\n for (var name in additionalClasses) {\n combinedClasses[name] = name in combinedClasses ? combinedClasses[name] + \" \" + additionalClasses[name] : additionalClasses[name];\n }\n\n return combinedClasses;\n};\n\nvar JssContext = createContext({\n classNamePrefix: '',\n disableStylesGeneration: false\n});\n\n/**\n * Global index counter to preserve source order.\n * As we create the style sheet during componentWillMount lifecycle,\n * children are handled after the parents, so the order of style elements would\n * be parent->child. It is a problem though when a parent passes a className\n * which needs to override any childs styles. StyleSheet of the child has a higher\n * specificity, because of the source order.\n * So our solution is to render sheets them in the reverse order child->sheet, so\n * that parent has a higher specificity.\n *\n * We start at [Number.MIN_SAFE_INTEGER] to always insert sheets from react-jss first before any\n * sheet which might be inserted manually by the user.\n */\nvar index = Number.MIN_SAFE_INTEGER || -1e9;\n\nvar getSheetIndex = function getSheetIndex() {\n return index++;\n};\n\nvar defaultManagers = new Map();\nvar getManager = function getManager(context, managerId) {\n // If `managers` map is present in the context, we use it in order to\n // let JssProvider reset them when new response has to render server-side.\n if (context.managers) {\n if (!context.managers[managerId]) {\n context.managers[managerId] = new SheetsManager();\n }\n\n return context.managers[managerId];\n }\n\n var manager = defaultManagers.get(managerId);\n\n if (!manager) {\n manager = new SheetsManager();\n defaultManagers.set(managerId, manager);\n }\n\n return manager;\n};\nvar manageSheet = function manageSheet(options) {\n var sheet = options.sheet,\n context = options.context,\n index = options.index,\n theme = options.theme;\n\n if (!sheet) {\n return;\n }\n\n var manager = getManager(context, index);\n manager.manage(theme);\n\n if (context.registry) {\n context.registry.add(sheet);\n }\n};\nvar unmanageSheet = function unmanageSheet(options) {\n if (!options.sheet) {\n return;\n }\n\n var manager = getManager(options.context, options.index);\n manager.unmanage(options.theme);\n};\n\nvar jss = create$1(preset());\n\nvar sheetsMeta = new WeakMap();\nvar getMeta = function getMeta(sheet) {\n return sheetsMeta.get(sheet);\n};\nvar addMeta = function addMeta(sheet, meta) {\n sheetsMeta.set(sheet, meta);\n};\n\n// eslint-disable-next-line no-unused-vars\nvar getStyles = function getStyles(options) {\n var styles = options.styles;\n\n if (typeof styles !== 'function') {\n return styles;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(styles.length !== 0, \"[JSS] <\" + (options.name || 'Hook') + \" />'s styles function doesn't rely on the \\\"theme\\\" argument. We recommend declaring styles as an object instead.\") : void 0;\n return styles(options.theme);\n};\n\nfunction getSheetOptions(options, link) {\n var minify;\n\n if (options.context.id && options.context.id.minify != null) {\n minify = options.context.id.minify;\n }\n\n var classNamePrefix = options.context.classNamePrefix || '';\n\n if (options.name && !minify) {\n classNamePrefix += options.name.replace(/\\s/g, '-') + \"-\";\n }\n\n var meta = '';\n if (options.name) meta = options.name + \", \";\n meta += typeof options.styles === 'function' ? 'Themed' : 'Unthemed';\n return _extends({}, options.sheetOptions, {\n index: options.index,\n meta: meta,\n classNamePrefix: classNamePrefix,\n link: link,\n generateId: options.sheetOptions.generateId || options.context.generateId\n });\n}\n\n// eslint-disable-next-line no-unused-vars\nvar createStyleSheet = function createStyleSheet(options) {\n if (options.context.disableStylesGeneration) {\n return undefined;\n }\n\n var manager = getManager(options.context, options.index);\n var existingSheet = manager.get(options.theme);\n\n if (existingSheet) {\n return existingSheet;\n }\n\n var jss$1 = options.context.jss || jss;\n var styles = getStyles(options);\n var dynamicStyles = getDynamicStyles(styles);\n var sheet = jss$1.createStyleSheet(styles, getSheetOptions(options, dynamicStyles !== null));\n addMeta(sheet, {\n dynamicStyles: dynamicStyles,\n styles: styles\n });\n manager.add(options.theme, sheet);\n return sheet;\n};\nvar removeDynamicRules = function removeDynamicRules(sheet, rules) {\n // Loop over each dynamic rule and remove the dynamic rule\n // We can't just remove the whole sheet as this has all of the rules for every component instance\n for (var key in rules) {\n sheet.deleteRule(rules[key]);\n }\n};\nvar updateDynamicRules = function updateDynamicRules(data, sheet, rules) {\n // Loop over each dynamic rule and update it\n // We can't just update the whole sheet as this has all of the rules for every component instance\n for (var key in rules) {\n sheet.updateOne(rules[key], data);\n }\n};\nvar addDynamicRules = function addDynamicRules(sheet, data) {\n var meta = getMeta(sheet);\n\n if (!meta) {\n return undefined;\n }\n\n var rules = {}; // Loop over each dynamic rule and add it to the stylesheet\n\n for (var key in meta.dynamicStyles) {\n var initialRuleCount = sheet.rules.index.length;\n var originalRule = sheet.addRule(key, meta.dynamicStyles[key]); // Loop through all created rules, fixes updating dynamic rules\n\n for (var i = initialRuleCount; i < sheet.rules.index.length; i++) {\n var rule = sheet.rules.index[i];\n sheet.updateOne(rule, data); // If it's the original rule, we need to add it by the correct key so the hook and hoc\n // can correctly concat the dynamic class with the static one\n\n rules[originalRule === rule ? key : rule.key] = rule;\n }\n }\n\n return rules;\n};\n\nvar getSheetClasses = function getSheetClasses(sheet, dynamicRules) {\n if (!dynamicRules) {\n return sheet.classes;\n }\n\n var classes = {};\n var meta = getMeta(sheet);\n\n if (!meta) {\n return sheet.classes;\n }\n\n for (var key in meta.styles) {\n classes[key] = sheet.classes[key];\n\n if (key in dynamicRules) {\n classes[key] += \" \" + sheet.classes[dynamicRules[key].key];\n }\n }\n\n return classes;\n};\n\nvar NoRenderer = function NoRenderer(props) {\n return props.children || null;\n};\n\nvar noTheme = {};\n\n/**\n * HOC creator function that wrapps the user component.\n *\n * `withStyles(styles, [options])(Component)`\n */\nvar createWithStyles = function createWithStyles(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$index = _options.index,\n index = _options$index === void 0 ? getSheetIndex() : _options$index,\n theming = _options.theming,\n injectTheme = _options.injectTheme,\n sheetOptions = _objectWithoutPropertiesLoose(_options, [\"index\", \"theming\", \"injectTheme\"]);\n\n var isThemingEnabled = typeof styles === 'function';\n var ThemeConsumer = theming && theming.context.Consumer || ThemeContext.Consumer;\n return function (InnerComponent) {\n if (InnerComponent === void 0) {\n InnerComponent = NoRenderer;\n }\n\n var displayName = getDisplayName(InnerComponent);\n\n var getTheme = function getTheme(props) {\n return isThemingEnabled ? props.theme : noTheme;\n };\n\n var WithStyles =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(WithStyles, _React$Component);\n\n // $FlowFixMe[prop-missing]\n WithStyles.createState = function createState(props) {\n var sheet = createStyleSheet({\n styles: styles,\n theme: getTheme(props),\n index: index,\n name: displayName,\n context: props.jssContext,\n sheetOptions: sheetOptions\n });\n\n if (!sheet) {\n return {\n classes: {},\n dynamicRules: undefined,\n sheet: undefined\n };\n }\n\n var dynamicRules = addDynamicRules(sheet, props);\n return {\n sheet: sheet,\n dynamicRules: dynamicRules,\n classes: getSheetClasses(sheet, dynamicRules)\n };\n };\n\n WithStyles.manage = function manage(props, state) {\n var sheet = state.sheet;\n\n if (sheet) {\n manageSheet({\n sheet: sheet,\n index: index,\n context: props.jssContext,\n theme: getTheme(props)\n });\n }\n };\n\n WithStyles.unmanage = function unmanage(props, state) {\n var sheet = state.sheet,\n dynamicRules = state.dynamicRules;\n\n if (sheet) {\n unmanageSheet({\n context: props.jssContext,\n index: index,\n sheet: sheet,\n theme: getTheme(props)\n });\n\n if (dynamicRules) {\n removeDynamicRules(sheet, dynamicRules);\n }\n }\n };\n\n function WithStyles(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.mergeClassesProp = memoize(function (sheetClasses, classesProp) {\n return classesProp ? mergeClasses(sheetClasses, classesProp) : sheetClasses;\n });\n _this.state = WithStyles.createState(props);\n var registry = props.jssContext.registry;\n var sheet = _this.state.sheet;\n\n if (sheet && registry) {\n registry.add(sheet);\n }\n\n return _this;\n }\n\n var _proto = WithStyles.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var props = this.props,\n state = this.state;\n\n if (props && state) {\n WithStyles.manage(props, state);\n }\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (isThemingEnabled && this.props.theme !== prevProps.theme) {\n var newState = WithStyles.createState(this.props);\n WithStyles.manage(this.props, newState);\n WithStyles.unmanage(prevProps, prevState); // eslint-disable-next-line react/no-did-update-set-state\n\n this.setState(newState);\n } else if (this.state.sheet && this.state.dynamicRules) {\n // Only update the rules when we don't generate a new sheet\n updateDynamicRules(this.props, this.state.sheet, this.state.dynamicRules);\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n WithStyles.unmanage(this.props, this.state);\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n innerRef = _this$props.innerRef,\n jssContext = _this$props.jssContext,\n theme = _this$props.theme,\n classes = _this$props.classes,\n rest = _objectWithoutPropertiesLoose(_this$props, [\"innerRef\", \"jssContext\", \"theme\", \"classes\"]);\n\n var sheetClasses = this.state.classes;\n\n var props = _extends({}, rest, {\n classes: this.mergeClassesProp(sheetClasses, classes)\n });\n\n if (innerRef) props.ref = innerRef;\n if (injectTheme) props.theme = theme;\n return createElement$1(InnerComponent, props);\n };\n\n return WithStyles;\n }(Component);\n\n WithStyles.displayName = \"WithStyles(\" + displayName + \")\";\n WithStyles.defaultProps = _extends({}, InnerComponent.defaultProps);\n var JssContextSubscriber = forwardRef(function (props, ref) {\n return createElement$1(JssContext.Consumer, null, function (context) {\n if (isThemingEnabled || injectTheme) {\n return createElement$1(ThemeConsumer, null, function (theme) {\n return createElement$1(WithStyles, _extends({\n innerRef: ref,\n theme: theme\n }, props, {\n jssContext: context\n }));\n });\n }\n\n return createElement$1(WithStyles, _extends({\n innerRef: ref\n }, props, {\n jssContext: context,\n theme: noTheme\n }));\n });\n });\n JssContextSubscriber.displayName = \"JssContextSubscriber(\" + displayName + \")\"; // $FlowFixMe[prop-missing] - React's types should allow custom static properties on component.\n\n JssContextSubscriber.InnerComponent = InnerComponent;\n return hoistNonReactStatics(JssContextSubscriber, InnerComponent);\n };\n};\n\nvar useEffectOrLayoutEffect = isInBrowser ? useLayoutEffect : useEffect;\nvar noTheme$1 = {};\n\nvar createUseStyles = function createUseStyles(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$index = _options.index,\n index = _options$index === void 0 ? getSheetIndex() : _options$index,\n theming = _options.theming,\n name = _options.name,\n sheetOptions = _objectWithoutPropertiesLoose(_options, [\"index\", \"theming\", \"name\"]);\n\n var ThemeContext$1 = theming && theming.context || ThemeContext;\n var useTheme = typeof styles === 'function' ? // $FlowFixMe[incompatible-return]\n function () {\n return useContext(ThemeContext$1) || noTheme$1;\n } : // $FlowFixMe[incompatible-return]\n function () {\n return noTheme$1;\n };\n return function useStyles(data) {\n var isFirstMount = useRef(true);\n var context = useContext(JssContext);\n var theme = useTheme();\n\n var _React$useMemo = useMemo(function () {\n var newSheet = createStyleSheet({\n context: context,\n styles: styles,\n name: name,\n theme: theme,\n index: index,\n sheetOptions: sheetOptions\n });\n var newDynamicRules = newSheet ? addDynamicRules(newSheet, data) : null;\n\n if (newSheet) {\n manageSheet({\n index: index,\n context: context,\n sheet: newSheet,\n theme: theme\n });\n }\n\n return [newSheet, newDynamicRules];\n }, [context, theme]),\n sheet = _React$useMemo[0],\n dynamicRules = _React$useMemo[1];\n\n useEffectOrLayoutEffect(function () {\n // We only need to update the rules on a subsequent update and not in the first mount\n if (sheet && dynamicRules && !isFirstMount.current) {\n updateDynamicRules(data, sheet, dynamicRules);\n }\n }, [data]);\n useEffectOrLayoutEffect(function () {\n return (// cleanup only\n function () {\n if (sheet) {\n unmanageSheet({\n index: index,\n context: context,\n sheet: sheet,\n theme: theme\n });\n }\n\n if (sheet && dynamicRules) {\n removeDynamicRules(sheet, dynamicRules);\n }\n }\n );\n }, [sheet]);\n var classes = sheet && dynamicRules ? getSheetClasses(sheet, dynamicRules) : {};\n useDebugValue(classes);\n useDebugValue(theme === noTheme$1 ? 'No theme' : theme);\n useEffect(function () {\n isFirstMount.current = false;\n });\n return classes;\n };\n};\n\nvar initialContext = {};\n\nvar JssProvider =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(JssProvider, _React$Component);\n\n function JssProvider() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.managers = {};\n\n _this.createContext = function (parentContext, prevContext) {\n if (prevContext === void 0) {\n prevContext = initialContext;\n }\n\n var _this$props = _this.props,\n registry = _this$props.registry,\n classNamePrefix = _this$props.classNamePrefix,\n jss = _this$props.jss,\n generateId = _this$props.generateId,\n disableStylesGeneration = _this$props.disableStylesGeneration,\n media = _this$props.media,\n id = _this$props.id;\n\n var context = _extends({}, parentContext);\n\n if (registry) {\n context.registry = registry; // This way we identify a new request on the server, because user will create\n // a new Registry instance for each.\n\n if (registry !== _this.registry) {\n // We reset managers because we have to regenerate all sheets for the new request.\n _this.managers = {};\n _this.registry = registry;\n }\n }\n\n context.managers = _this.managers;\n\n if (id !== undefined) {\n context.id = id;\n }\n\n if (generateId !== undefined) {\n context.generateId = generateId;\n } else if (!context.generateId || !prevContext || context.id !== prevContext.id) {\n context.generateId = createGenerateId(context.id);\n }\n\n if (classNamePrefix) {\n context.classNamePrefix = (context.classNamePrefix || '') + classNamePrefix;\n }\n\n if (media !== undefined) {\n context.media = media;\n }\n\n if (jss) {\n context.jss = jss;\n }\n\n if (disableStylesGeneration !== undefined) {\n context.disableStylesGeneration = disableStylesGeneration;\n }\n\n if (prevContext && shallowEqualObjects(prevContext, context)) {\n return prevContext;\n }\n\n return context;\n };\n\n _this.prevContext = void 0;\n _this.generateId = void 0;\n _this.registry = void 0;\n\n _this.renderProvider = function (parentContext) {\n var children = _this.props.children;\n\n var context = _this.createContext(parentContext, _this.prevContext);\n\n _this.prevContext = context;\n return createElement$1(JssContext.Provider, {\n value: context\n }, children);\n };\n\n return _this;\n }\n\n var _proto = JssProvider.prototype;\n\n _proto.render = function render() {\n return createElement$1(JssContext.Consumer, null, this.renderProvider);\n };\n\n return JssProvider;\n}(Component);\n\nJssProvider.propTypes = {\n registry: PropTypes.instanceOf(SheetsRegistry),\n jss: PropTypes.instanceOf(defaultJss.constructor),\n generateId: PropTypes.func,\n classNamePrefix: PropTypes.string,\n disableStylesGeneration: PropTypes.bool,\n children: PropTypes.node.isRequired,\n media: PropTypes.string,\n id: PropTypes.shape({\n minify: PropTypes.bool\n })\n};\n\n// eslint-disable-next-line no-unused-vars\nvar parseStyles = function parseStyles(args) {\n var dynamicStyles = [];\n var staticStyle;\n var labels = []; // Not using ...rest to optimize perf.\n\n for (var key in args) {\n var style = args[key];\n if (!style) continue;\n\n if (typeof style === 'function') {\n dynamicStyles.push(style);\n } else {\n if (!staticStyle) staticStyle = {};\n Object.assign(staticStyle, style);\n\n if (staticStyle.label) {\n if (labels.indexOf(staticStyle.label) === -1) labels.push(staticStyle.label);\n }\n }\n }\n\n var styles = {};\n var label = labels.length === 0 ? 'sc' : labels.join('-');\n\n if (staticStyle) {\n // Label should not leak to the core.\n if ('label' in staticStyle) delete staticStyle.label;\n styles[label] = staticStyle;\n } // When there is only one function rule, we don't need to wrap it.\n\n\n if (dynamicStyles.length === 1) {\n styles['scd'] = dynamicStyles[0];\n } // We create a new function rule which will call all other function rules\n // and merge the styles they return.\n\n\n if (dynamicStyles.length > 1) {\n styles['scd'] = function (props) {\n var merged = {};\n\n for (var i = 0; i < dynamicStyles.length; i++) {\n var dynamicStyle = dynamicStyles[i](props);\n if (dynamicStyle) Object.assign(merged, dynamicStyle);\n }\n\n return merged;\n };\n }\n\n return {\n styles: styles,\n label: label\n };\n};\n\nvar shouldForwardPropSymbol = Symbol('react-jss-styled');\n\nvar getShouldForwardProp = function getShouldForwardProp(tagOrComponent, options) {\n var shouldForwardProp = options.shouldForwardProp; // $FlowFixMe[invalid-computed-prop]\n // $FlowFixMe[incompatible-type]\n\n var childShouldForwardProp = tagOrComponent[shouldForwardPropSymbol];\n var finalShouldForwardProp = shouldForwardProp || childShouldForwardProp;\n\n if (shouldForwardProp && childShouldForwardProp) {\n finalShouldForwardProp = function finalShouldForwardProp(prop) {\n return childShouldForwardProp(prop) && shouldForwardProp(prop);\n };\n }\n\n return finalShouldForwardProp;\n};\n\nvar getChildProps = function getChildProps(props, shouldForwardProp, isTag) {\n var childProps = {};\n\n for (var prop in props) {\n if (shouldForwardProp) {\n if (shouldForwardProp(prop) === true) {\n childProps[prop] = props[prop];\n }\n\n continue;\n } // We don't want to pass non-dom props to the DOM.\n\n\n if (isTag) {\n if (isPropValid(prop)) {\n childProps[prop] = props[prop];\n }\n\n continue;\n }\n\n childProps[prop] = props[prop];\n }\n\n return childProps;\n};\n\n// eslint-disable-next-line no-unused-vars\nvar configureStyled = function configureStyled(tagOrComponent, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n theming = _options.theming;\n var isTag = typeof tagOrComponent === 'string';\n var ThemeContext$1 = theming ? theming.context : ThemeContext;\n var shouldForwardProp = getShouldForwardProp(tagOrComponent, options);\n\n var _options2 = options,\n _ = _options2.shouldForwardProp,\n hookOptions = _objectWithoutPropertiesLoose(_options2, [\"shouldForwardProp\"]);\n\n return function createStyledComponent() {\n // eslint-disable-next-line prefer-rest-params\n var _parseStyles = parseStyles(arguments),\n styles = _parseStyles.styles,\n label = _parseStyles.label;\n\n var useStyles = createUseStyles(styles, hookOptions);\n\n var Styled = function Styled(props) {\n var as = props.as,\n className = props.className;\n var theme = useContext(ThemeContext$1);\n var propsWithTheme = Object.assign({\n theme: theme\n }, props);\n var classes = useStyles(propsWithTheme);\n var childProps = getChildProps(props, shouldForwardProp, isTag);\n var classNames = ((classes[label] || classes.sc || '') + \" \" + (classes.scd || '')).trim();\n childProps.className = className ? className + \" \" + classNames : classNames;\n\n if (!isTag && shouldForwardProp) {\n // $FlowFixMe[invalid-computed-prop] we are not supposed to attach random properties to component functions.\n // $FlowFixMe[incompatible-use]\n tagOrComponent[shouldForwardPropSymbol] = shouldForwardProp;\n }\n\n if (isTag && as) {\n return createElement$1(as, childProps);\n }\n\n return createElement$1(tagOrComponent, childProps);\n };\n\n return Styled;\n };\n};\n\n/* eslint-disable prefer-rest-params, prefer-spread */\nvar create = function create(css) {\n if (css === void 0) {\n css = defaultCss;\n }\n\n return function createElement(type, props\n /* :: , ..._args: any */\n ) {\n var args = arguments;\n\n if (props && props.css) {\n var className = css(props.css);\n var newProps = Object.assign({}, props);\n newProps.className = props.className ? props.className + \" \" + className : className;\n delete newProps.css;\n args[1] = newProps;\n } // $FlowFixMe[missing-arg]\n\n\n return createElement$1.apply(undefined, args);\n };\n};\nvar createElement = create();\n\nexport default createWithStyles;\nexport { JssContext, JssProvider, create as createJsx, createUseStyles, jss, createElement as jsx, configureStyled as styled, createWithStyles as withStyles };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","export var COMMON_MIME_TYPES = new Map([\n ['avi', 'video/avi'],\n ['gif', 'image/gif'],\n ['ico', 'image/x-icon'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['mp4', 'video/mp4'],\n ['pdf', 'application/pdf'],\n ['png', 'image/png'],\n ['zip', 'application/zip'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']\n]);\nexport function toFileWithPath(file, path) {\n var f = withMimeType(file);\n if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path\n var webkitRelativePath = file.webkitRelativePath;\n Object.defineProperty(f, 'path', {\n value: typeof path === 'string'\n ? path\n // If is set,\n // the File will have a {webkitRelativePath} property\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n : typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0\n ? webkitRelativePath\n : file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return f;\n}\nfunction withMimeType(file) {\n var name = file.name;\n var hasExtension = name && name.lastIndexOf('.') !== -1;\n if (hasExtension && !file.type) {\n var ext = name.split('.')\n .pop().toLowerCase();\n var type = COMMON_MIME_TYPES.get(ext);\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n return file;\n}\n//# sourceMappingURL=file.js.map","import { __awaiter, __generator, __read, __spread } from \"tslib\";\nimport { toFileWithPath } from './file';\nvar FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store',\n 'Thumbs.db' // Windows\n];\n/**\n * Convert a DragEvent's DataTrasfer object to a list of File objects\n * NOTE: If some of the items are folders,\n * everything will be flattened and placed in the same list but the paths will be kept as a {path} property.\n * @param evt\n */\nexport function fromEvent(evt) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, isDragEvt(evt) && evt.dataTransfer\n ? getDataTransferFiles(evt.dataTransfer, evt.type)\n : getInputFiles(evt)];\n });\n });\n}\nfunction isDragEvt(value) {\n return !!value.dataTransfer;\n}\nfunction getInputFiles(evt) {\n var files = isInput(evt.target)\n ? evt.target.files\n ? fromList(evt.target.files)\n : []\n : [];\n return files.map(function (file) { return toFileWithPath(file); });\n}\nfunction isInput(value) {\n return value !== null;\n}\nfunction getDataTransferFiles(dt, type) {\n return __awaiter(this, void 0, void 0, function () {\n var items, files;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!dt.items) return [3 /*break*/, 2];\n items = fromList(dt.items)\n .filter(function (item) { return item.kind === 'file'; });\n // According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,\n // only 'dragstart' and 'drop' has access to the data (source node)\n if (type !== 'drop') {\n return [2 /*return*/, items];\n }\n return [4 /*yield*/, Promise.all(items.map(toFilePromises))];\n case 1:\n files = _a.sent();\n return [2 /*return*/, noIgnoredFiles(flatten(files))];\n case 2: return [2 /*return*/, noIgnoredFiles(fromList(dt.files)\n .map(function (file) { return toFileWithPath(file); }))];\n }\n });\n });\n}\nfunction noIgnoredFiles(files) {\n return files.filter(function (file) { return FILES_TO_IGNORE.indexOf(file.name) === -1; });\n}\n// IE11 does not support Array.from()\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility\n// https://developer.mozilla.org/en-US/docs/Web/API/FileList\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList\nfunction fromList(items) {\n var files = [];\n // tslint:disable: prefer-for-of\n for (var i = 0; i < items.length; i++) {\n var file = items[i];\n files.push(file);\n }\n return files;\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem\nfunction toFilePromises(item) {\n if (typeof item.webkitGetAsEntry !== 'function') {\n return fromDataTransferItem(item);\n }\n var entry = item.webkitGetAsEntry();\n // Safari supports dropping an image node from a different window and can be retrieved using\n // the DataTransferItem.getAsFile() API\n // NOTE: FileSystemEntry.file() throws if trying to get the file\n if (entry && entry.isDirectory) {\n return fromDirEntry(entry);\n }\n return fromDataTransferItem(item);\n}\nfunction flatten(items) {\n return items.reduce(function (acc, files) { return __spread(acc, (Array.isArray(files) ? flatten(files) : [files])); }, []);\n}\nfunction fromDataTransferItem(item) {\n var file = item.getAsFile();\n if (!file) {\n return Promise.reject(item + \" is not a File\");\n }\n var fwp = toFileWithPath(file);\n return Promise.resolve(fwp);\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry\nfunction fromEntry(entry) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)];\n });\n });\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry\nfunction fromDirEntry(entry) {\n var reader = entry.createReader();\n return new Promise(function (resolve, reject) {\n var entries = [];\n function readEntries() {\n var _this = this;\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries\n reader.readEntries(function (batch) { return __awaiter(_this, void 0, void 0, function () {\n var files, err_1, items;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!batch.length) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Promise.all(entries)];\n case 2:\n files = _a.sent();\n resolve(files);\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n reject(err_1);\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n items = Promise.all(batch.map(fromEntry));\n entries.push(items);\n // Continue reading\n readEntries();\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n }); }, function (err) {\n reject(err);\n });\n }\n readEntries();\n });\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry\nfunction fromFileEntry(entry) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve, reject) {\n entry.file(function (file) {\n var fwp = toFileWithPath(file, entry.fullPath);\n resolve(fwp);\n }, function (err) {\n reject(err);\n });\n })];\n });\n });\n}\n//# sourceMappingURL=file-selector.js.map","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport accepts from 'attr-accept'; // Error codes\n\nexport var FILE_INVALID_TYPE = 'file-invalid-type';\nexport var FILE_TOO_LARGE = 'file-too-large';\nexport var FILE_TOO_SMALL = 'file-too-small';\nexport var TOO_MANY_FILES = 'too-many-files'; // File Errors\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {\n accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;\n var messageSuffix = Array.isArray(accept) ? \"one of \".concat(accept.join(', ')) : accept;\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(messageSuffix)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" bytes\")\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" bytes\")\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: 'Too many files'\n}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === 'application/x-moz-file' || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n return accepted && sizeMatch;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === 'function') {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== 'undefined') {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === 'Files' || type === 'application/x-moz-file';\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === 'object' && item !== null && item.kind === 'file';\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf('MSIE') !== -1 || userAgent.indexOf('Trident/') !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf('Edge/') !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { fromEvent } from 'file-selector';\nimport { allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, isEvtWithFiles, isIeOrEdge, isPropagationStopped, onDocumentDragOver, TOO_MANY_FILES_REJECTION } from './utils/index';\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n *
\n * \n *

Drag 'n' drop some files here, or click to select files

\n *
\n * )}\n *
\n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, [\"children\"]);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, [\"open\"]);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = 'Dropzone'; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.draggedFiles Files in active drag\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n */\n accept: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Custom validation function \n * @param {File} file\n * @returns {FileError|FileError[]}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise)}\n */\n\n/**\n * An object with the current dropzone state and some helper functions.\n *\n * @typedef {object} DropzoneState\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} draggedFiles Files in active drag\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n draggedFiles: [],\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n *
\n * \n *

Drag and drop some files here, or click to select files

\n *
\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {string|string[]} [props.accept] Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n *\n * @returns {DropzoneState}\n */\n\nexport function useDropzone() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$options = _objectSpread(_objectSpread({}, defaultProps), options),\n accept = _defaultProps$options.accept,\n disabled = _defaultProps$options.disabled,\n getFilesFromEvent = _defaultProps$options.getFilesFromEvent,\n maxSize = _defaultProps$options.maxSize,\n minSize = _defaultProps$options.minSize,\n multiple = _defaultProps$options.multiple,\n maxFiles = _defaultProps$options.maxFiles,\n onDragEnter = _defaultProps$options.onDragEnter,\n onDragLeave = _defaultProps$options.onDragLeave,\n onDragOver = _defaultProps$options.onDragOver,\n onDrop = _defaultProps$options.onDrop,\n onDropAccepted = _defaultProps$options.onDropAccepted,\n onDropRejected = _defaultProps$options.onDropRejected,\n onFileDialogCancel = _defaultProps$options.onFileDialogCancel,\n preventDropOnDocument = _defaultProps$options.preventDropOnDocument,\n noClick = _defaultProps$options.noClick,\n noKeyboard = _defaultProps$options.noKeyboard,\n noDrag = _defaultProps$options.noDrag,\n noDragEventsBubbling = _defaultProps$options.noDragEventsBubbling,\n validator = _defaultProps$options.validator;\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive,\n draggedFiles = state.draggedFiles; // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n if (inputRef.current) {\n dispatch({\n type: 'openDialog'\n });\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch]); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: 'closeDialog'\n });\n\n if (typeof onFileDialogCancel === 'function') {\n onFileDialogCancel();\n }\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener('focus', onWindowFocus, false);\n return function () {\n window.removeEventListener('focus', onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancel]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, inputRef]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: 'focus'\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: 'blur'\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [inputRef, noClick]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener('dragover', onDocumentDragOver, false);\n document.addEventListener('drop', onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', onDocumentDragOver);\n document.removeEventListener('drop', onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (draggedFiles) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n dispatch({\n draggedFiles: draggedFiles,\n isDragActive: true,\n type: 'setDraggedFiles'\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n });\n }\n }, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = 'copy';\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n isDragActive: false,\n type: 'setDraggedFiles',\n draggedFiles: []\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: 'setFiles'\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n });\n }\n\n dispatch({\n type: 'reset'\n });\n }, [multiple, accept, minSize, maxSize, maxFiles, getFilesFromEvent, onDrop, onDropAccepted, onDropRejected, noDragEventsBubbling]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, [\"refKey\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"]);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb))\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, [\"refKey\", \"onChange\", \"onClick\"]);\n\n var inputProps = _defineProperty({\n accept: accept,\n multiple: multiple,\n type: 'file',\n style: {\n display: 'none'\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n autoComplete: 'off',\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n var fileCount = draggedFiles.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: draggedFiles,\n accept: accept,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case 'focus':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case 'blur':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case 'openDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: true\n });\n\n case 'closeDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case 'setDraggedFiles':\n /* eslint no-case-declarations: 0 */\n var isDragActive = action.isDragActive,\n draggedFiles = action.draggedFiles;\n return _objectSpread(_objectSpread({}, state), {}, {\n draggedFiles: draggedFiles,\n isDragActive: isDragActive\n });\n\n case 'setFiles':\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case 'reset':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false,\n isDragActive: false,\n draggedFiles: [],\n acceptedFiles: [],\n fileRejections: []\n });\n\n default:\n return state;\n }\n}","import escapeStringRegexp from 'escape-string-regexp';\n\nconst regexpCache = new Map();\n\nconst sanitizeArray = (input, inputName) => {\n\tif (!Array.isArray(input)) {\n\t\tswitch (typeof input) {\n\t\t\tcase 'string':\n\t\t\t\tinput = [input];\n\t\t\t\tbreak;\n\t\t\tcase 'undefined':\n\t\t\t\tinput = [];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new TypeError(`Expected '${inputName}' to be a string or an array, but got a type of '${typeof input}'`);\n\t\t}\n\t}\n\n\treturn input.filter(string => {\n\t\tif (typeof string !== 'string') {\n\t\t\tif (typeof string === 'undefined') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthrow new TypeError(`Expected '${inputName}' to be an array of strings, but found a type of '${typeof string}' in the array`);\n\t\t}\n\n\t\treturn true;\n\t});\n};\n\nconst makeRegexp = (pattern, options) => {\n\toptions = {\n\t\tcaseSensitive: false,\n\t\t...options,\n\t};\n\n\tconst cacheKey = pattern + JSON.stringify(options);\n\n\tif (regexpCache.has(cacheKey)) {\n\t\treturn regexpCache.get(cacheKey);\n\t}\n\n\tconst negated = pattern[0] === '!';\n\n\tif (negated) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tpattern = escapeStringRegexp(pattern).replace(/\\\\\\*/g, '[\\\\s\\\\S]*');\n\n\tconst regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i');\n\tregexp.negated = negated;\n\tregexpCache.set(cacheKey, regexp);\n\n\treturn regexp;\n};\n\nconst baseMatcher = (inputs, patterns, options, firstMatchOnly) => {\n\tinputs = sanitizeArray(inputs, 'inputs');\n\tpatterns = sanitizeArray(patterns, 'patterns');\n\n\tif (patterns.length === 0) {\n\t\treturn [];\n\t}\n\n\tpatterns = patterns.map(pattern => makeRegexp(pattern, options));\n\n\tconst {allPatterns} = options || {};\n\tconst result = [];\n\n\tfor (const input of inputs) {\n\t\t// String is included only if it matches at least one non-negated pattern supplied.\n\t\t// Note: the `allPatterns` option requires every non-negated pattern to be matched once.\n\t\t// Matching a negated pattern excludes the string.\n\t\tlet matches;\n\t\tconst didFit = [...patterns].fill(false);\n\n\t\tfor (const [index, pattern] of patterns.entries()) {\n\t\t\tif (pattern.test(input)) {\n\t\t\t\tdidFit[index] = true;\n\t\t\t\tmatches = !pattern.negated;\n\n\t\t\t\tif (!matches) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!(\n\t\t\t\tmatches === false\n\t\t\t\t|| (matches === undefined && patterns.some(pattern => !pattern.negated))\n\t\t\t\t|| (allPatterns && didFit.some((yes, index) => !yes && !patterns[index].negated))\n\t\t\t)\n\t\t) {\n\t\t\tresult.push(input);\n\n\t\t\tif (firstMatchOnly) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n};\n\nexport function matcher(inputs, patterns, options) {\n\treturn baseMatcher(inputs, patterns, options, false);\n}\n\nexport function isMatch(inputs, patterns, options) {\n\treturn baseMatcher(inputs, patterns, options, true).length > 0;\n}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/Resources/Public/Assets/main.bundle.css b/Resources/Public/Assets/main.bundle.css index 7ab21c91d..a8b3aeb61 100644 --- a/Resources/Public/Assets/main.bundle.css +++ b/Resources/Public/Assets/main.bundle.css @@ -1,6 +1,6 @@ -._reset_da866{font-family:Noto Sans,sans-serif;font-weight:400;color:#fff;margin:0;padding:0}._reset_da866,._reset_da866:after,._reset_da866:before{box-sizing:border-box}._reset_da866 button,._reset_da866 input,._reset_da866 select,._reset_da866 textarea{font-size:14px;margin:0}._reset_da866 ul{padding:0}._reset_da866 li{display:block}._reset_da866 input::-webkit-search-cancel-button{display:none}._reset_da866 input{-webkit-appearance:none;-moz-appearance:none;appearance:none}._badge_fe12d{display:inline-block;padding:2px 4px;font-size:12px;line-height:14px;font-weight:700;color:#ff8700;white-space:nowrap;background-color:#fff;border-radius:3px}._bar_ea9af{position:fixed;left:0;z-index:1;width:100%;background-color:#222;height:41px;border-bottom:1px solid #3f3f3f}._bar--top_ea9af{top:0}._bar--bottom_ea9af{bottom:0}._btn_dd3de{position:relative;display:inline-block;height:40px;min-width:40px;padding:0 16px;border:0;-webkit-font-smoothing:antialiased;vertical-align:middle;width:auto;color:#fff;cursor:pointer;background-color:#323232;font-size:14px}._btn_dd3de:focus{outline:1px solid #00adee}._btn_dd3de[disabled]{opacity:.5;cursor:not-allowed}._btn_dd3de[disabled]._btn--isPressed_dd3de,._btn_dd3de[disabled]:hover,._btn_dd3de[disabled]:hover i,._btn_dd3de[disabled] i{color:#fff}._btn--size-small_dd3de{height:32px;font-size:13px;padding:0 8px}._btn--clean_dd3de{background-color:#222}._btn--lighter_dd3de,._btn--lighter_dd3de i{background-color:#3f3f3f}._btn--neutral_dd3de,._btn--neutral_dd3de i{background-color:#323232}._btn--transparent_dd3de{background:0}._btn--brand_dd3de,._btn--brand_dd3de i{background-color:#00adee;color:#fff!important}._btn--success_dd3de,._btn--success_dd3de i{background-color:#00a338;color:#fff!important}._btn--warn_dd3de,._btn--warn_dd3de i{background-color:#ff8700}._btn--error_dd3de,._btn--error_dd3de i{background-color:#ff460d;color:#fff!important}._btn--brandActive_dd3de{background-color:#00adee}._btn--brandActive_dd3de svg{color:#fff}._btn--brandHover_dd3de._btn--isPressed_dd3de,._btn--brandHover_dd3de._btn--isPressed_dd3de i,._btn--brandHover_dd3de:hover:enabled,._btn--brandHover_dd3de:hover:enabled i{background-color:#00adee}._btn--cleanHover_dd3de._btn--isPressed_dd3de,._btn--cleanHover_dd3de._btn--isPressed_dd3de i,._btn--cleanHover_dd3de._btn--isPressed_dd3de i svg,._btn--cleanHover_dd3de._btn--isPressed_dd3de svg,._btn--cleanHover_dd3de:hover:enabled,._btn--cleanHover_dd3de:hover:enabled i,._btn--cleanHover_dd3de:hover:enabled i svg,._btn--cleanHover_dd3de:hover:enabled svg{color:#00adee}._btn--darkenHover_dd3de._btn--isPressed_dd3de,._btn--darkenHover_dd3de._btn--isPressed_dd3de i,._btn--darkenHover_dd3de:hover:enabled,._btn--darkenHover_dd3de:hover:enabled i{background-color:rgba(0,0,0,.1)}._btn--successHover_dd3de._btn--isPressed_dd3de,._btn--successHover_dd3de._btn--isPressed_dd3de i,._btn--successHover_dd3de:hover:enabled,._btn--successHover_dd3de:hover:enabled i{background-color:#0bb344}._btn--warnHover_dd3de._btn--isPressed_dd3de,._btn--warnHover_dd3de._btn--isPressed_dd3de i,._btn--warnHover_dd3de:hover:enabled,._btn--warnHover_dd3de:hover:enabled i{background-color:#fda23d}._btn--errorHover_dd3de._btn--isPressed_dd3de,._btn--errorHover_dd3de._btn--isPressed_dd3de i,._btn--errorHover_dd3de:hover:enabled,._btn--errorHover_dd3de:hover:enabled i{background-color:#ff6a3c}._buttonGroup_5b6c0{display:block}.svg-inline--fa,svg:not(:root).svg-inline--fa{overflow:visible}.svg-inline--fa{display:inline-block;font-size:inherit;height:1em;vertical-align:-.125em}.svg-inline--fa.fa-lg{vertical-align:-.225em}.svg-inline--fa.fa-w-1{width:.0625em}.svg-inline--fa.fa-w-2{width:.125em}.svg-inline--fa.fa-w-3{width:.1875em}.svg-inline--fa.fa-w-4{width:.25em}.svg-inline--fa.fa-w-5{width:.3125em}.svg-inline--fa.fa-w-6{width:.375em}.svg-inline--fa.fa-w-7{width:.4375em}.svg-inline--fa.fa-w-8{width:.5em}.svg-inline--fa.fa-w-9{width:.5625em}.svg-inline--fa.fa-w-10{width:.625em}.svg-inline--fa.fa-w-11{width:.6875em}.svg-inline--fa.fa-w-12{width:.75em}.svg-inline--fa.fa-w-13{width:.8125em}.svg-inline--fa.fa-w-14{width:.875em}.svg-inline--fa.fa-w-15{width:.9375em}.svg-inline--fa.fa-w-16{width:1em}.svg-inline--fa.fa-w-17{width:1.0625em}.svg-inline--fa.fa-w-18{width:1.125em}.svg-inline--fa.fa-w-19{width:1.1875em}.svg-inline--fa.fa-w-20{width:1.25em}.svg-inline--fa.fa-pull-left{margin-right:.3em;width:auto}.svg-inline--fa.fa-pull-right{margin-left:.3em;width:auto}.svg-inline--fa.fa-border{height:1.5em}.svg-inline--fa.fa-li{width:2em}.svg-inline--fa.fa-fw{width:1.25em}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.fa-layers{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers-text{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter{background-color:#ff253a;border-radius:1em;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;height:1.5em;line-height:1;max-width:5em;min-width:1.5em;overflow:hidden;padding:.25em;right:0;text-overflow:ellipsis;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:0;right:0;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:0;left:0;right:auto;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{right:0;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:0;right:auto;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top left;transform-origin:top left}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;position:relative;width:2.5em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.svg-inline--fa.fa-stack-1x{height:1em;width:1.25em}.svg-inline--fa.fa-stack-2x{height:2em;width:2.5em}.fa-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:1;opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor)}.svg-inline--fa .fa-secondary,.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:1;opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}.fad.fa-inverse{color:#fff}._icon_db7f1{display:inline-block;font:normal normal normal FontAwesome;font-size:14px/1;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}._icon--paddedLeft_db7f1{margin-left:.75em}._icon--paddedRight_db7f1{margin-right:.75em}._icon--color-warn_db7f1{color:#ff8700}._icon--color-error_db7f1{color:#ff460d}._icon--color-primaryBlue_db7f1{color:#00adee}._checkbox_1b95c{position:relative;display:inline-block;margin-right:8px;vertical-align:middle}._checkbox__input_1b95c{position:absolute;top:50%;left:0;z-index:1;transform:translateY(-50%);width:20px;height:20px;opacity:0;cursor:pointer}._checkbox__icon_1b95c{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);opacity:.2}._checkbox__inputMirror_1b95c{display:inline-block;width:20px;height:20px;border-radius:2px;vertical-align:text-bottom;background:#3f3f3f;font-size:20px;font-weight:700}._checkbox__inputMirror--active_1b95c{background:#00adee}._checkbox__checked_1b95c ._checkbox__icon_1b95c{opacity:1}._checkbox__disabled_1b95c{opacity:.65;cursor:not-allowed}._checkbox__disabled_1b95c ._checkbox__input_1b95c{cursor:not-allowed} -._calendarInputWrapper_55f08{display:table;width:100%}._calendarInputWrapper--highlight_55f08{outline:2px solid #00a338}._calendarInputWrapper--invalid_55f08{outline:2px solid #ff460d!important;color:#ff460d!important}._calendarIconBtn_55f08,._closeCalendarIconBtn_55f08{position:relative;display:table-cell;vertical-align:top;padding:10px;height:40px;min-width:41px;border:none;background:#323232;text-align:center;font-size:14px;cursor:pointer}._calendarIconBtn_55f08{border-top-left-radius:2px;border-bottom-left-radius:2px}._closeCalendarIconBtn_55f08{border-top-right-radius:2px;border-bottom-right-radius:2px}._calendarIconBtn_55f08:hover,._closeCalendarIconBtn_55f08:hover{background:#00adee}._closeCalendarIconBtn_55f08{border-left:1px solid #222}._calendarIconBtn_55f08{border-right:1px solid #222}._calendarFakeInputWrapper_55f08{display:table-cell;position:relative;width:100%}._calendarFakeInputMirror_55f08{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;cursor:pointer}._calendarFakeInput_55f08{display:inline-block;vertical-align:top;width:100%;height:40px;border:2px solid #323232;background:#323232;font-size:14px;padding:0 14px;margin:0;box-shadow:none;transition:none}._calendarFakeInput_55f08:focus{outline:0}._selectTodayBtn_55f08{width:calc(100% - 2px);height:40px;line-height:40px;text-align:center;border:1px solid #323232;border-top:0;font-size:14px;cursor:pointer;background:#141414;color:#fff}._selectTodayBtn_55f08:hover{background:#00adee!important}._applyBtn_55f08{width:calc(100% - 2px);height:40px;line-height:40px;text-align:center;border:1px solid #323232;border-top:0;font-size:14px}._wrapper_55f08 input[type=text]{display:none} +._reset_cd800{font-family:Noto Sans,sans-serif;font-weight:400;color:#fff;margin:0;padding:0}._reset_cd800,._reset_cd800:after,._reset_cd800:before{box-sizing:border-box}._reset_cd800 button,._reset_cd800 input,._reset_cd800 select,._reset_cd800 textarea{font-size:14px;margin:0}._reset_cd800 ul{padding:0}._reset_cd800 li{display:block}._reset_cd800 input::-webkit-search-cancel-button{display:none}._reset_cd800 input{-webkit-appearance:none;-moz-appearance:none;appearance:none}._badge_ec05c{display:inline-block;padding:2px 4px;font-size:12px;line-height:14px;font-weight:700;color:#ff8700;white-space:nowrap;background-color:#fff;border-radius:3px}._bar_f4e9a{position:fixed;left:0;z-index:1;width:100%;background-color:#222;height:41px;border-bottom:1px solid #3f3f3f}._bar--top_f4e9a{top:0}._bar--bottom_f4e9a{bottom:0}._btn_640ba{position:relative;display:inline-block;height:40px;min-width:40px;padding:0 16px;border:0;-webkit-font-smoothing:antialiased;vertical-align:middle;width:auto;color:#fff;cursor:pointer;background-color:#323232;font-size:14px}._btn_640ba:focus{outline:1px solid #00adee}._btn_640ba[disabled]{opacity:.5;cursor:not-allowed}._btn_640ba[disabled]._btn--isPressed_640ba,._btn_640ba[disabled]:hover,._btn_640ba[disabled]:hover i,._btn_640ba[disabled] i{color:#fff}._btn--size-small_640ba{height:32px;font-size:13px;padding:0 8px}._btn--clean_640ba{background-color:#222}._btn--lighter_640ba,._btn--lighter_640ba i{background-color:#3f3f3f}._btn--neutral_640ba,._btn--neutral_640ba i{background-color:#323232}._btn--transparent_640ba{background:0}._btn--brand_640ba,._btn--brand_640ba i{background-color:#00adee;color:#fff!important}._btn--success_640ba,._btn--success_640ba i{background-color:#00a338;color:#fff!important}._btn--warn_640ba,._btn--warn_640ba i{background-color:#ff8700}._btn--error_640ba,._btn--error_640ba i{background-color:#ff460d;color:#fff!important}._btn--brandActive_640ba{background-color:#00adee}._btn--brandActive_640ba svg{color:#fff}._btn--brandHover_640ba._btn--isPressed_640ba,._btn--brandHover_640ba._btn--isPressed_640ba i,._btn--brandHover_640ba:hover:enabled,._btn--brandHover_640ba:hover:enabled i{background-color:#00adee}._btn--cleanHover_640ba._btn--isPressed_640ba,._btn--cleanHover_640ba._btn--isPressed_640ba i,._btn--cleanHover_640ba._btn--isPressed_640ba i svg,._btn--cleanHover_640ba._btn--isPressed_640ba svg,._btn--cleanHover_640ba:hover:enabled,._btn--cleanHover_640ba:hover:enabled i,._btn--cleanHover_640ba:hover:enabled i svg,._btn--cleanHover_640ba:hover:enabled svg{color:#00adee}._btn--darkenHover_640ba._btn--isPressed_640ba,._btn--darkenHover_640ba._btn--isPressed_640ba i,._btn--darkenHover_640ba:hover:enabled,._btn--darkenHover_640ba:hover:enabled i{background-color:rgba(0,0,0,.1)}._btn--successHover_640ba._btn--isPressed_640ba,._btn--successHover_640ba._btn--isPressed_640ba i,._btn--successHover_640ba:hover:enabled,._btn--successHover_640ba:hover:enabled i{background-color:#0bb344}._btn--warnHover_640ba._btn--isPressed_640ba,._btn--warnHover_640ba._btn--isPressed_640ba i,._btn--warnHover_640ba:hover:enabled,._btn--warnHover_640ba:hover:enabled i{background-color:#fda23d}._btn--errorHover_640ba._btn--isPressed_640ba,._btn--errorHover_640ba._btn--isPressed_640ba i,._btn--errorHover_640ba:hover:enabled,._btn--errorHover_640ba:hover:enabled i{background-color:#ff6a3c}._buttonGroup_5cdce{display:block}.svg-inline--fa,svg:not(:root).svg-inline--fa{overflow:visible}.svg-inline--fa{display:inline-block;font-size:inherit;height:1em;vertical-align:-.125em}.svg-inline--fa.fa-lg{vertical-align:-.225em}.svg-inline--fa.fa-w-1{width:.0625em}.svg-inline--fa.fa-w-2{width:.125em}.svg-inline--fa.fa-w-3{width:.1875em}.svg-inline--fa.fa-w-4{width:.25em}.svg-inline--fa.fa-w-5{width:.3125em}.svg-inline--fa.fa-w-6{width:.375em}.svg-inline--fa.fa-w-7{width:.4375em}.svg-inline--fa.fa-w-8{width:.5em}.svg-inline--fa.fa-w-9{width:.5625em}.svg-inline--fa.fa-w-10{width:.625em}.svg-inline--fa.fa-w-11{width:.6875em}.svg-inline--fa.fa-w-12{width:.75em}.svg-inline--fa.fa-w-13{width:.8125em}.svg-inline--fa.fa-w-14{width:.875em}.svg-inline--fa.fa-w-15{width:.9375em}.svg-inline--fa.fa-w-16{width:1em}.svg-inline--fa.fa-w-17{width:1.0625em}.svg-inline--fa.fa-w-18{width:1.125em}.svg-inline--fa.fa-w-19{width:1.1875em}.svg-inline--fa.fa-w-20{width:1.25em}.svg-inline--fa.fa-pull-left{margin-right:.3em;width:auto}.svg-inline--fa.fa-pull-right{margin-left:.3em;width:auto}.svg-inline--fa.fa-border{height:1.5em}.svg-inline--fa.fa-li{width:2em}.svg-inline--fa.fa-fw{width:1.25em}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.fa-layers{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers-text{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter{background-color:#ff253a;border-radius:1em;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;height:1.5em;line-height:1;max-width:5em;min-width:1.5em;overflow:hidden;padding:.25em;right:0;text-overflow:ellipsis;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:0;right:0;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:0;left:0;right:auto;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{right:0;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:0;right:auto;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top left;transform-origin:top left}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;position:relative;width:2.5em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.svg-inline--fa.fa-stack-1x{height:1em;width:1.25em}.svg-inline--fa.fa-stack-2x{height:2em;width:2.5em}.fa-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:1;opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor)}.svg-inline--fa .fa-secondary,.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:1;opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}.fad.fa-inverse{color:#fff}._icon_7bee5{display:inline-block;font:normal normal normal FontAwesome;font-size:14px/1;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}._icon--paddedLeft_7bee5{margin-left:.75em}._icon--paddedRight_7bee5{margin-right:.75em}._icon--color-warn_7bee5{color:#ff8700}._icon--color-error_7bee5{color:#ff460d}._icon--color-primaryBlue_7bee5{color:#00adee}._checkbox_fdd07{position:relative;display:inline-block;margin-right:8px;vertical-align:middle}._checkbox__input_fdd07{position:absolute;top:50%;left:0;z-index:1;transform:translateY(-50%);width:20px;height:20px;opacity:0;cursor:pointer}._checkbox__icon_fdd07{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);opacity:.2}._checkbox__inputMirror_fdd07{display:inline-block;width:20px;height:20px;border-radius:2px;vertical-align:text-bottom;background:#3f3f3f;font-size:20px;font-weight:700}._checkbox__inputMirror--active_fdd07{background:#00adee}._checkbox__checked_fdd07 ._checkbox__icon_fdd07{opacity:1}._checkbox__disabled_fdd07{opacity:.65;cursor:not-allowed}._checkbox__disabled_fdd07 ._checkbox__input_fdd07{cursor:not-allowed} +._calendarInputWrapper_33f91{display:table;width:100%}._calendarInputWrapper--highlight_33f91{outline:2px solid #00a338}._calendarInputWrapper--invalid_33f91{outline:2px solid #ff460d!important;color:#ff460d!important}._calendarIconBtn_33f91,._closeCalendarIconBtn_33f91{position:relative;display:table-cell;vertical-align:top;padding:10px;height:40px;min-width:41px;border:none;background:#323232;text-align:center;font-size:14px;cursor:pointer}._calendarIconBtn_33f91{border-top-left-radius:2px;border-bottom-left-radius:2px}._closeCalendarIconBtn_33f91{border-top-right-radius:2px;border-bottom-right-radius:2px}._calendarIconBtn_33f91:hover,._closeCalendarIconBtn_33f91:hover{background:#00adee}._closeCalendarIconBtn_33f91{border-left:1px solid #222}._calendarIconBtn_33f91{border-right:1px solid #222}._calendarFakeInputWrapper_33f91{display:table-cell;position:relative;width:100%}._calendarFakeInputMirror_33f91{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;cursor:pointer}._calendarFakeInput_33f91{display:inline-block;vertical-align:top;width:100%;height:40px;border:2px solid #323232;background:#323232;font-size:14px;padding:0 14px;margin:0;box-shadow:none;transition:none}._calendarFakeInput_33f91:focus{outline:0}._selectTodayBtn_33f91{width:calc(100% - 2px);height:40px;line-height:40px;text-align:center;border:1px solid #323232;border-top:0;font-size:14px;cursor:pointer;background:#141414;color:#fff}._selectTodayBtn_33f91:hover{background:#00adee!important}._applyBtn_33f91{width:calc(100% - 2px);height:40px;line-height:40px;text-align:center;border:1px solid #323232;border-top:0;font-size:14px}._wrapper_33f91 input[type=text]{display:none} /*! * https://github.com/arqex/react-datetime - */._wrapper_55f08 .rdt{position:relative}._wrapper_55f08 .rdtPicker{display:none;width:250px;padding:4px;margin-top:1px;z-index:1;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1)}._wrapper_55f08 .rdtOpen .rdtPicker{display:block}._wrapper_55f08 .rdtStatic .rdtPicker{box-shadow:none;position:static}._wrapper_55f08 .rdtPicker .rdtTimeToggle{text-align:center}._wrapper_55f08 .rdtPicker table{width:100%;margin:0}._wrapper_55f08 .rdtPicker td,._wrapper_55f08 .rdtPicker th{text-align:center;height:28px}._wrapper_55f08 .rdtPicker td{cursor:pointer}._wrapper_55f08 .rdtPicker .rdtTimeToggle:hover,._wrapper_55f08 .rdtPicker td.rdtHour:hover,._wrapper_55f08 .rdtPicker td.rdtMinute:hover,._wrapper_55f08 .rdtPicker td.rdtSecond:hover,._wrapper_55f08 .rdtPicker td.rdtToday:hover{background:#eee;cursor:pointer}._wrapper_55f08 .rdtPicker td.rdtNew,._wrapper_55f08 .rdtPicker td.rdtOld{color:#999}._wrapper_55f08 .rdtPicker td.rdtToday{position:relative}._wrapper_55f08 .rdtPicker td.rdtToday:before{content:"";display:inline-block;border-left:7px solid transparent;border-bottom:7px solid #428bca;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:4px;right:4px}._wrapper_55f08 .rdtPicker td.rdtActive,._wrapper_55f08 .rdtPicker td.rdtActive:hover{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}._wrapper_55f08 .rdtPicker td.rdtActive.rdtToday:before{border-bottom-color:#fff}._wrapper_55f08 .rdtPicker td.rdtDisabled,._wrapper_55f08 .rdtPicker td.rdtDisabled:hover{background:none;color:#999;cursor:not-allowed}._wrapper_55f08 .rdtPicker td span.rdtOld{color:#999}._wrapper_55f08 .rdtPicker td span.rdtDisabled,._wrapper_55f08 .rdtPicker td span.rdtDisabled:hover{background:none;color:#999;cursor:not-allowed}._wrapper_55f08 .rdtPicker .dow{width:14.2857%;border-bottom:none}._wrapper_55f08 .rdtPicker th.rdtSwitch{width:100px}._wrapper_55f08 .rdtPicker th.rdtNext,._wrapper_55f08 .rdtPicker th.rdtPrev{font-size:21px;vertical-align:top}._wrapper_55f08 .rdtNext span,._wrapper_55f08 .rdtPrev span{display:block;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._wrapper_55f08 .rdtPicker th.rdtDisabled,._wrapper_55f08 .rdtPicker th.rdtDisabled:hover{background:none;color:#999;cursor:not-allowed}._wrapper_55f08 .rdtPicker thead tr:first-child th{cursor:pointer}._wrapper_55f08 .rdtPicker thead tr:first-child th:hover{background:#eee}._wrapper_55f08 .rdtPicker tfoot{border-top:1px solid #323232}._wrapper_55f08 .rdtPicker button{border:none;background:none;cursor:pointer}._wrapper_55f08 .rdtPicker button:hover{background-color:#eee}._wrapper_55f08 .rdtPicker thead button{width:100%;height:100%}._wrapper_55f08 td.rdtMonth,._wrapper_55f08 td.rdtYear{height:50px;width:25%;cursor:pointer}._wrapper_55f08 td.rdtMonth:hover,._wrapper_55f08 td.rdtYear:hover{background:#eee}._wrapper_55f08 .rdtCounters{display:inline-block}._wrapper_55f08 .rdtCounters>div{float:left}._wrapper_55f08 .rdtCounter{height:100px;width:40px}._wrapper_55f08 .rdtCounterSeparator{line-height:100px}._wrapper_55f08 .rdtCounter .rdtBtn{height:40%;line-height:40px;cursor:pointer;display:block;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._wrapper_55f08 .rdtCounter .rdtBtn:hover{color:#00adee}._wrapper_55f08 .rdtCounter .rdtCount{height:20%;font-size:1.2em}._wrapper_55f08 .rdtMilli{vertical-align:middle;padding-left:8px;width:48px}._wrapper_55f08 .rdtMilli input{width:100%;font-size:1.2em;margin-top:37px}._wrapper_55f08 .rdtDayPart{margin-top:43px}._wrapper_55f08 .rdtPicker{position:relative;width:calc(100% - 4px);background:#141414;padding:0;border:1px solid #323232;border-top:0;margin:0;box-shadow:none}._wrapper_55f08 .rdtPicker table{border-collapse:collapse}._wrapper_55f08 .rdtPicker th{width:37px;height:40px;line-height:40px;font-weight:400;font-size:14px;border:0;border-left:1px solid #323232;border-right:1px solid #323232;border-bottom:1px solid #323232}._wrapper_55f08 .rdtPicker th.rdtNext:hover,._wrapper_55f08 .rdtPicker th.rdtPrev:hover,._wrapper_55f08 .rdtPicker th.rdtSwitch:hover{background:#00adee!important}._wrapper_55f08 .rdtPicker th.dow{width:40px;background:#323232;text-align:center}._wrapper_55f08 td.rdtDay,._wrapper_55f08 td.rdtMonth,._wrapper_55f08 td.rdtTimeToggle{width:40px;height:40px;line-height:40px;border:1px solid #323232}._wrapper_55f08 td.rdtDay:hover,._wrapper_55f08 td.rdtMonth:hover,._wrapper_55f08 td.rdtTimeToggle:hover{background:#00adee!important}._wrapper_55f08 td.rdtDay.rdtNew,._wrapper_55f08 td.rdtDay.rdtOld{color:#5b5b5b}._wrapper_55f08 td.rdtToday:before{border-bottom-color:#00adee!important}._wrapper_55f08 td.rdtActive{background:#00adee!important;color:#fff}._wrapper_55f08 td.rdtActive:before{display:none!important}._disabled_55f08{opacity:.5}._disabled-cursor_55f08{cursor:not-allowed}@-webkit-keyframes _slideDialogContents_acf40{0%{opacity:0;transform:translateX(-50%) translateY(-50%) scale(.9)}}@keyframes _slideDialogContents_acf40{0%{opacity:0;transform:translateX(-50%) translateY(-50%) scale(.9)}}._dialog_acf40{position:fixed;top:0;left:0;z-index:1;width:100vw;height:100vh;background:rgba(0,0,0,.8)}._dialog__contentsPosition_acf40{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%) scale(1);background:#222;box-shadow:0 20px 40px rgba(0,0,0,.4);border-radius:0;outline:none;opacity:1;-webkit-animation:_slideDialogContents_acf40 .3s ease-in-out;animation:_slideDialogContents_acf40 .3s ease-in-out}._dialog__contents_acf40{position:relative;width:calc(100vw - 80px);max-width:640px;border:2px solid #3f3f3f;transition:max-width .25s ease}._dialog--wide_acf40 ._dialog__contents_acf40{max-width:960px}@media(max-width:576px){._dialog--wide_acf40 ._dialog__contents_acf40{max-width:100vw;width:100vw}}._dialog--jumbo_acf40 ._dialog__contents_acf40{max-width:1440px;width:90vw}@media(max-width:576px){._dialog--jumbo_acf40 ._dialog__contents_acf40{max-width:100vw;width:100vw}}._dialog--narrow_acf40 ._dialog__contents_acf40{max-width:400px}._dialog--success_acf40 ._dialog__contents_acf40{border-color:#00a338}._dialog--warn_acf40 ._dialog__contents_acf40{border-color:#ff8700}._dialog--error_acf40 ._dialog__contents_acf40{border-color:#ff460d}._dialog__title_acf40{font-size:20px;line-height:1.2;padding:16px 40px 16px 16px}._dialog__body_acf40{max-height:65vh;overflow-y:auto}@media(max-width:576px){._dialog__body_acf40{max-height:55vh}}._dialog__actions_acf40{text-align:right;margin-top:16px}._dialog__closeBtn_acf40{position:absolute;top:0;right:0;background:#3f3f3f}._dialog__backDrop_acf40{position:absolute;height:100%;width:100%}._dropDown_ee3ed{position:relative;display:inline-block;width:100%}._dropDown__btn_ee3ed{display:block;width:100%;height:40px;text-align:left;color:#fff;cursor:pointer;font-size:14px;padding:0 16px;border:0;border-radius:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:40px;background:#323232}._dropDown__btn_ee3ed:focus{outline:1px solid #00adee}._dropDown__btn--withChevron_ee3ed{padding-right:40px}._dropDown__btnLabel_ee3ed{margin-right:.5em}._dropDown__chevron_ee3ed{position:absolute;right:16px;top:50%;transform:translateY(-50%)}._dropDown__contents_ee3ed{position:absolute;top:100%;left:0;z-index:1;display:none;width:100%;margin:0;list-style:none;background:#323232;box-shadow:0 5px 5px rgba(0,0,0,.2)}._dropDown__contents--scrollable_ee3ed{position:fixed;top:auto;overflow-y:auto}._dropDown__contents--isOpen_ee3ed{display:block}._dropDown--darker_ee3ed>._dropDown__btn--open_ee3ed,._dropDown--darker_ee3ed>._dropDown__contents_ee3ed{background-color:#222}._dropDown--darkest_ee3ed>._dropDown__btn--open_ee3ed,._dropDown--darkest_ee3ed>._dropDown__contents_ee3ed{background-color:#141414}._dropDown--padded_ee3ed>._dropDown__contents_ee3ed{padding:16px}._heading_4dfaa{font-size:14px;text-rendering:optimizelegibility}._heading--h1_4dfaa{font-size:16px}._iconButton_7f752{vertical-align:top;width:40px;padding-left:0;padding-right:0}._iconButton--disabled_7f752{opacity:.65;cursor:not-allowed}._size-small_7f752{width:32px!important;min-width:32px!important}._wrapper_90478{position:relative;display:inline-block}._wrapper__btn_90478{position:relative;width:40px}._wrapper__btnModeIcon_90478{position:absolute;right:4px;bottom:4px;color:#00adee}[disabled]>._wrapper__btnModeIcon_90478{opacity:0}._wrapper_90478:hover ._wrapper__btnIcon_90478{color:#00adee}._wrapper__dropDown_90478{position:absolute;top:100%;left:0;z-index:1;display:none;background:#222;border:1px solid #3f3f3f;border-top:0}._wrapper__dropDown--isOpen_90478{display:block}._wrapper__dropDownItem_90478{position:relative;display:block;width:38px;height:38px;text-align:center;vertical-align:middle;cursor:pointer}._wrapper__dropDownItem_90478:hover,._wrapper__dropDownItem_90478:hover>*{color:#00adee}._wrapper__dropDownItem_90478>*{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}._label_585df{display:block;-webkit-font-smoothing:antialiased;font-size:14px;cursor:pointer;padding:0;margin-bottom:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._label_585df,._label_585df span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%}._logo_d1810{height:24px;width:auto}._selectBox__list_2cd1c{padding:0}._selectBox_2cd1c{position:relative;display:inline-block;line-height:0}._selectBox__btn_2cd1c{position:relative;display:inline-block;text-overflow:clip;height:auto;min-height:40px;line-height:40px;padding-left:0;border:0;background:#323232;min-width:160px}._selectBox__btn--noRightPadding_2cd1c{padding-right:0}._selectBox__contents_2cd1c{min-width:160px;box-shadow:0 5px 5px rgba(0,0,0,.2);z-index:4;padding:2px!important;margin-top:-2px}._selectBox__item_2cd1c{border-top:1px solid #222;background:#141414}._selectBox__item_2cd1c div{padding:5px 14px}._selectBox__groupHeader_2cd1c{background-color:#222;font-weight:700;padding-left:16px;line-height:30px;text-transform:uppercase}._selectBox--disabled_2cd1c{filter:opacity(50%);cursor:not-allowed}._listPreviewElement_8a2c9{cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:30px;padding:5px 16px}._listPreviewElement--isDisabled_8a2c9{color:#999;cursor:not-allowed}._listPreviewElement--isHighlighted_8a2c9{background:#00adee}._listPreviewElement--isHighlighted_8a2c9>span{color:#fff}._listPreviewElement__icon_8a2c9{margin-right:.5em}._listPreviewElement__iconWrapper_8a2c9{padding:0!important;width:2em;display:inline-block;text-align:center}._selectBoxHeader_f8389{display:flex;width:100%}._selectBoxHeader__innerPreview_f8389{overflow:hidden;width:100%}._selectBoxHeader__icon_f8389{line-height:40px;height:100%}._selectBoxHeader__label_f8389,._selectBoxHeader__wrapperIconWrapper_f8389{padding:0 16px}._selectBoxHeader__wrapperPlaceholderIconWrapper_f8389{padding:0 8px 0 0}._selectBoxHeader--disabled_f8389{cursor:not-allowed}._selectBoxHeaderWithSearchInput_e9cda{display:flex;padding-left:16px}._selectBoxHeaderWithSearchInput__inputContainer_e9cda{width:100%}._selectBoxHeaderWithSearchInput__input_e9cda{width:100%;color:#fff;font-size:14px}._selectBoxHeaderWithSearchInput__input_e9cda:focus{background:transparent!important;color:#fff!important}._selectBoxHeaderWithSearchInput__icon_e9cda{height:40px}._textInput_0dcba{font-size:14px;width:100%;height:40px;padding:0 14px;border:0;border-radius:2px;background:#323232;color:#fff}._textInput_0dcba:focus{outline:0;background:#fff;color:#141414}._textInput_0dcba::-webkit-input-placeholder{font-family:Noto Sans,sans-serif;font-weight:400;color:#999}._textInput--disabled_0dcba{opacity:.65;cursor:not-allowed}._sideBar_548f4{position:fixed;width:320px;height:100%;background:#222}._sideBar--left_548f4{left:0}._sideBar--right_548f4{right:0}._tabs_8bfec{height:100%}._tabs__content_8bfec{height:calc(100% - 141px);overflow-y:auto}._tabNavigation_8bfec{display:block;margin:0;padding:0;list-style:none;background:#141414;border-bottom:1px solid #3f3f3f}._tabNavigation_8bfec:after,._tabNavigation_8bfec:before{content:"";display:table}._tabNavigation_8bfec:after{clear:both}._tabNavigation__item_8bfec{position:relative;float:left;border-top:1px solid #3f3f3f;border-right:1px solid #3f3f3f;color:#fff}._tabNavigation__item--isActive_8bfec{background-color:#222;cursor:default;border-bottom:1px solid #222;margin-bottom:-1px}._tabNavigation__item--isActive_8bfec:after{display:block;content:" ";position:absolute;top:-1px;left:0;right:0;height:2px;width:100%;background:#00adee}._tabNavigation__item--isActive_8bfec>._tabNavigation__itemBtn_8bfec{color:#00adee}._tabNavigation__itemBtn_8bfec{display:inline-block;height:40px;padding:0 16px;line-height:40px;cursor:pointer;border:0;background:0}._tabNavigation__itemBtn_8bfec:hover{color:#00adee}._tabNavigation__itemBtn_8bfec:focus{outline:0}._tabNavigation__itemBtnIcon_8bfec{color:currentColor}._tabNavigation__itemBtnIcon--hasLabel_8bfec{margin-right:8px}._panel_8bfec{overflow-y:auto}._textArea_e32fe{width:100%;height:40px;padding:10px 14px;border:0;border-radius:2px;background:#323232;resize:vertical;transition:height .3s}._textArea_e32fe:focus{outline:0;background:#fff;color:#141414}._textArea_e32fe::-webkit-input-placeholder{font-family:Noto Sans,sans-serif;color:#999}._textArea--invalid_e32fe{outline:2px solid #ff460d!important}._textArea--highlight_e32fe{outline:2px solid #00a338}._textArea--disabled_e32fe{opacity:.65;cursor:not-allowed}._panel_3e6b9{position:relative}._panel__headline_3e6b9{cursor:pointer;height:40px;margin:0;padding:0 16px;line-height:40px;font-weight:700;font-size:14px}._panel__headline--noPadding_3e6b9{padding:0}._panel__toggleBtn_3e6b9{position:absolute;top:0;right:0}._panel__contents_3e6b9{padding:0 16px;transition:padding .25s ease}._panel--isOpen_3e6b9 ._panel__contents_3e6b9{padding-top:5px;padding-bottom:5px}._panel--condensed_3e6b9._panel--isOpen_3e6b9 ._panel__contents_3e6b9{padding-top:0;padding-bottom:0}._panel__contents--noPadding_3e6b9{padding:0}._tooltip_8f4ae{position:absolute}._tooltip_8f4ae ul{margin:0}._tooltip--inline_8f4ae{position:relative!important;margin-bottom:8px}._tooltip--arrow_8f4ae{position:relative;top:0;left:50%;width:0;height:0;margin-left:-var(--spacing-Half);border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #141414}._tooltip--asError_8f4ae ._tooltip--arrow_8f4ae{border-bottom:8px solid #ff460d}._tooltip--inner_8f4ae{position:relative;padding:8px;background:#141414;color:#fff;box-shadow:0 0 10px hsla(0,0%,49%,.2)}._tooltip--asError_8f4ae ._tooltip--inner_8f4ae{background:#ff460d}._treeWrapper_63f1e{padding:5px 0}._treeWrapper_63f1e:focus{outline:0}._header_b4555{margin:0;position:relative;line-height:20px}._header__chevron_b4555{position:absolute;top:0;left:0;height:100%;width:18px;color:#adadad;line-height:20px;text-align:center;cursor:pointer}._header__chevron_b4555:hover{color:#00adee}._header__chevron--isCollapsed_b4555>svg{transform:translateY(3px) translateX(-2px) rotate(-90deg)}._header__chevron--isHiddenInIndex_b4555{opacity:.5}._header__chevron--isLoading_b4555,._header__chevron--isLoading_b4555:hover{color:#adadad!important}._header__chevron--isLoading_b4555>svg{margin-top:6px}._header__iconWrapper_b4555{width:2em;display:inline-block;position:absolute;text-align:center}._header__data_b4555{position:relative;display:inline-block;min-width:100%;padding:.1em 0;border-left:2px solid transparent;white-space:nowrap;cursor:pointer}._header__data--isHiddenInIndex_b4555{opacity:.5}._header__data--isHidden_b4555{text-decoration:line-through}._header__data--isDragging_b4555{opacity:.2}._header__data--isDirty_b4555{border-left:2px solid #ff8700}._header__data--isFocused_b4555{background:#323232}._header__data--isFocused_b4555._header__data--isHidden_b4555,._header__data--isFocused_b4555._header__data--isHiddenInIndex_b4555{opacity:.8}._header__data--acceptsDrop_b4555{background-color:#00adee}._header__data--acceptsDrop_b4555 *,._header__data--deniesDrop_b4555 *{pointer-events:none}._header__labelWrapper_b4555{max-width:264px;overflow:hidden;text-overflow:ellipsis;display:inline-block;line-height:1.5;vertical-align:middle}._header__label_b4555{margin-left:2em}._header__data--isActive_b4555 ._header__label_b4555{color:#00adee}._dropTarget_b4555{position:absolute;left:0;right:0;padding-left:15px;height:2px}._dropTarget--before_b4555{top:-5px;z-index:1;padding-top:4px;padding-bottom:4px}._dropTarget--after_b4555{bottom:1px;z-index:2;padding-top:6px;padding-bottom:0}._dropTarget__inner_b4555{visibility:hidden;margin-top:-8px;height:0}._dropTarget__inner--acceptsDrop_b4555{z-index:100000;visibility:visible}._dropTarget__inner_b4555 svg{fill:#00adee}._layer_44112{position:fixed;pointer-events:none;z-index:2147483646;left:0;top:0;width:100%;height:100%}._dragWrapper_44112{display:inline-block;position:relative;opacity:.7;left:0}._count_44112{z-index:2147483646;position:absolute;top:-10px;left:5px;width:20px;height:20px;color:#fff;background-color:#ff460d;border-radius:50%;padding:1px;font-size:12px;font-weight:700;text-align:center}._node_44112{position:absolute;width:280px;background-color:#323232;border:1px solid #3f3f3f}._selectedOptions_01b25{position:relative;width:100%;list-style:none;padding-left:0}._selectedOptions__item_dff2b{display:flex;width:100%;position:relative;background:#141414;border-bottom:1px solid #222;border-radius:2px}._selectedOptions__item_dff2b:hover ._selectedOptions__itemIcon_dff2b{display:none}._selectedOptions__item_dff2b:hover ._selectedOptions__itemIcon--onHover_dff2b{display:inline}._selectedOptions__item--draggable_dff2b{cursor:move}._selectedOptions__innerPreview_dff2b{border-right:1px solid #222;overflow:hidden;width:100%}._selectedOptions__innerPreview_dff2b>div{box-shadow:none!important}._selectedOption__removeButton_dff2b{height:auto;background:#323232;border-top-right-radius:2px;border-bottom-right-radius:2px}._selectedOption__moveButton_dff2b{cursor:move;height:auto;width:20px;min-width:20px;color:#3f3f3f;border-top-left-radius:2px;border-bottom-left-radius:2px;border-right:1px solid #222}._selectedOption__moveButton_dff2b svg{color:#3f3f3f}._selectedOption__moveButton_dff2b:focus,._selectedOption__moveButton_dff2b:hover{background:#3f3f3f;color:#999!important}._selectedOption__moveButton_dff2b:focus svg,._selectedOption__moveButton_dff2b:hover svg{color:#999!important}._multiLineWithThumbnail__item_b2851{box-sizing:content-box;line-height:20px;background:#141414}._multiLineWithThumbnail__secondaryLabel_b2851,._multiLineWithThumbnail__tertiaryLabel_b2851{color:#999;display:block;font-size:12px;text-overflow:ellipsis;overflow:hidden}._multiLineWithThumbnail__image_b2851{width:74.48px;height:56px;-o-object-fit:contain;object-fit:contain;background-color:#fff;background-size:10px 10px;background-position:0 0,25px 25px;background-image:linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);margin-right:.75em;display:inline-block;vertical-align:middle;margin-left:-var(--spacing-Full);margin-top:-var(--spacing-Half);margin-bottom:-var(--spacing-Half)}._multiLineWithThumbnail__item_b2851:hover ._multiLineWithThumbnail__secondaryLabel_b2851,._multiLineWithThumbnail__item_b2851:hover ._multiLineWithThumbnail__tertiaryLabel_b2851{color:#fff}@keyframes closeWindow{0%{opacity:1}to{opacity:0}}.ril__outer{background-color:rgba(0,0,0,.85);outline:none;top:0;left:0;right:0;bottom:0;z-index:1000;width:100%;height:100%;-ms-content-zooming:none;-ms-user-select:none;-ms-touch-select:none;touch-action:none}.ril__outerClosing{opacity:0}.ril__image,.ril__imageNext,.ril__imagePrev,.ril__inner{position:absolute;top:0;left:0;right:0;bottom:0}.ril__image,.ril__imageNext,.ril__imagePrev{margin:auto;max-width:none;-ms-content-zooming:none;-ms-user-select:none;-ms-touch-select:none;touch-action:none}.ril__imageDiscourager{background-repeat:no-repeat;background-position:50%;background-size:contain}.ril__navButtons{border:none;position:absolute;top:0;bottom:0;width:20px;height:34px;padding:40px 30px;margin:auto;cursor:pointer;opacity:.7}.ril__navButtons:hover{opacity:1}.ril__navButtons:active{opacity:.7}.ril__navButtonPrev{left:0;background:rgba(0,0,0,.2) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIzNCI+PHBhdGggZD0iTTE5IDNsLTItMkwxIDE3bDE2IDE2IDEtMUwzIDE3IDE4IDJ6IiBmaWxsPSIjRkZGIi8+PC9zdmc+") no-repeat 50%}.ril__navButtonNext{right:0;background:rgba(0,0,0,.2) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIzNCI+PHBhdGggZD0iTTEgM2wyLTIgMTYgMTZMMyAzM2wtMS0xIDE1LTE1TDIgMnoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=") no-repeat 50%}.ril__downloadBlocker{position:absolute;top:0;left:0;right:0;bottom:0;background-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");background-size:cover}.ril__caption,.ril__toolbar{background-color:rgba(0,0,0,.5);position:absolute;left:0;right:0;display:flex;justify-content:space-between}.ril__caption{bottom:0;max-height:150px;overflow:auto}.ril__captionContent{padding:10px 20px;color:#fff}.ril__toolbar{top:0;height:50px}.ril__toolbarSide{height:50px;margin:0}.ril__toolbarLeftSide{padding-left:20px;padding-right:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis}.ril__toolbarRightSide{padding-left:0;padding-right:20px;flex:0 0 auto}.ril__toolbarItem{display:inline-block;line-height:50px;padding:0;color:#fff;font-size:120%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ril__toolbarItemChild{vertical-align:middle}.ril__builtinButton{width:40px;height:35px;cursor:pointer;border:none;opacity:.7}.ril__builtinButton:hover{opacity:1}.ril__builtinButton:active{outline:none}.ril__builtinButtonDisabled{cursor:default;opacity:.5}.ril__builtinButtonDisabled:hover{opacity:.5}.ril__closeButton{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PHBhdGggZD0iTTEgM2wxLjI1LTEuMjUgNy41IDcuNSA3LjUtNy41TDE4LjUgMyAxMSAxMC41bDcuNSA3LjUtMS4yNSAxLjI1LTcuNS03LjUtNy41IDcuNUwxIDE4bDcuNS03LjVMMSAzeiIgZmlsbD0iI0ZGRiIvPjwvc3ZnPg==") no-repeat 50%}.ril__zoomInButton{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02TTkgOGg2TTEyIDV2NiIvPjwvZz48Y2lyY2xlIGN4PSIxMiIgY3k9IjgiIHI9IjciIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+") no-repeat 50%}.ril__zoomOutButton{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02TTkgOGg2Ii8+PC9nPjxjaXJjbGUgY3g9IjEyIiBjeT0iOCIgcj0iNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=") no-repeat 50%}.ril__outerAnimating{animation-name:closeWindow}@keyframes pointFade{0%,19.999%,to{opacity:0}20%{opacity:1}}.ril__loadingCircle{width:60px;height:60px;position:relative}.ril__loadingCirclePoint{width:100%;height:100%;position:absolute;left:0;top:0}.ril__loadingCirclePoint:before{content:"";display:block;margin:0 auto;width:11%;height:30%;background-color:#fff;border-radius:30%;animation:pointFade .8s ease-in-out infinite both}.ril__loadingCirclePoint:first-of-type{transform:rotate(0deg)}.ril__loadingCirclePoint:first-of-type:before,.ril__loadingCirclePoint:nth-of-type(7):before{animation-delay:-.8s}.ril__loadingCirclePoint:nth-of-type(2){transform:rotate(30deg)}.ril__loadingCirclePoint:nth-of-type(8){transform:rotate(210deg)}.ril__loadingCirclePoint:nth-of-type(2):before,.ril__loadingCirclePoint:nth-of-type(8):before{animation-delay:-666ms}.ril__loadingCirclePoint:nth-of-type(3){transform:rotate(60deg)}.ril__loadingCirclePoint:nth-of-type(9){transform:rotate(240deg)}.ril__loadingCirclePoint:nth-of-type(3):before,.ril__loadingCirclePoint:nth-of-type(9):before{animation-delay:-533ms}.ril__loadingCirclePoint:nth-of-type(4){transform:rotate(90deg)}.ril__loadingCirclePoint:nth-of-type(10){transform:rotate(270deg)}.ril__loadingCirclePoint:nth-of-type(4):before,.ril__loadingCirclePoint:nth-of-type(10):before{animation-delay:-.4s}.ril__loadingCirclePoint:nth-of-type(5){transform:rotate(120deg)}.ril__loadingCirclePoint:nth-of-type(11){transform:rotate(300deg)}.ril__loadingCirclePoint:nth-of-type(5):before,.ril__loadingCirclePoint:nth-of-type(11):before{animation-delay:-266ms}.ril__loadingCirclePoint:nth-of-type(6){transform:rotate(150deg)}.ril__loadingCirclePoint:nth-of-type(12){transform:rotate(330deg)}.ril__loadingCirclePoint:nth-of-type(6):before,.ril__loadingCirclePoint:nth-of-type(12):before{animation-delay:-133ms}.ril__loadingCirclePoint:nth-of-type(7){transform:rotate(180deg)}.ril__loadingCirclePoint:nth-of-type(13){transform:rotate(1turn)}.ril__loadingCirclePoint:nth-of-type(7):before,.ril__loadingCirclePoint:nth-of-type(13):before{animation-delay:0ms}.ril__loadingContainer{position:absolute;top:0;right:0;bottom:0;left:0}.ril__imageNext .ril__loadingContainer,.ril__imagePrev .ril__loadingContainer{display:none}.ril__errorContainer{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:#fff}.ril__imageNext .ril__errorContainer,.ril__imagePrev .ril__errorContainer{display:none}.ril__loadingContainer__icon{color:#fff;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)} + */._wrapper_33f91 .rdt{position:relative}._wrapper_33f91 .rdtPicker{display:none;width:250px;padding:4px;margin-top:1px;z-index:1;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1)}._wrapper_33f91 .rdtOpen .rdtPicker{display:block}._wrapper_33f91 .rdtStatic .rdtPicker{box-shadow:none;position:static}._wrapper_33f91 .rdtPicker .rdtTimeToggle{text-align:center}._wrapper_33f91 .rdtPicker table{width:100%;margin:0}._wrapper_33f91 .rdtPicker td,._wrapper_33f91 .rdtPicker th{text-align:center;height:28px}._wrapper_33f91 .rdtPicker td{cursor:pointer}._wrapper_33f91 .rdtPicker .rdtTimeToggle:hover,._wrapper_33f91 .rdtPicker td.rdtHour:hover,._wrapper_33f91 .rdtPicker td.rdtMinute:hover,._wrapper_33f91 .rdtPicker td.rdtSecond:hover,._wrapper_33f91 .rdtPicker td.rdtToday:hover{background:#eee;cursor:pointer}._wrapper_33f91 .rdtPicker td.rdtNew,._wrapper_33f91 .rdtPicker td.rdtOld{color:#999}._wrapper_33f91 .rdtPicker td.rdtToday{position:relative}._wrapper_33f91 .rdtPicker td.rdtToday:before{content:"";display:inline-block;border-left:7px solid transparent;border-bottom:7px solid #428bca;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:4px;right:4px}._wrapper_33f91 .rdtPicker td.rdtActive,._wrapper_33f91 .rdtPicker td.rdtActive:hover{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}._wrapper_33f91 .rdtPicker td.rdtActive.rdtToday:before{border-bottom-color:#fff}._wrapper_33f91 .rdtPicker td.rdtDisabled,._wrapper_33f91 .rdtPicker td.rdtDisabled:hover{background:none;color:#999;cursor:not-allowed}._wrapper_33f91 .rdtPicker td span.rdtOld{color:#999}._wrapper_33f91 .rdtPicker td span.rdtDisabled,._wrapper_33f91 .rdtPicker td span.rdtDisabled:hover{background:none;color:#999;cursor:not-allowed}._wrapper_33f91 .rdtPicker .dow{width:14.2857%;border-bottom:none}._wrapper_33f91 .rdtPicker th.rdtSwitch{width:100px}._wrapper_33f91 .rdtPicker th.rdtNext,._wrapper_33f91 .rdtPicker th.rdtPrev{font-size:21px;vertical-align:top}._wrapper_33f91 .rdtNext span,._wrapper_33f91 .rdtPrev span{display:block;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._wrapper_33f91 .rdtPicker th.rdtDisabled,._wrapper_33f91 .rdtPicker th.rdtDisabled:hover{background:none;color:#999;cursor:not-allowed}._wrapper_33f91 .rdtPicker thead tr:first-child th{cursor:pointer}._wrapper_33f91 .rdtPicker thead tr:first-child th:hover{background:#eee}._wrapper_33f91 .rdtPicker tfoot{border-top:1px solid #323232}._wrapper_33f91 .rdtPicker button{border:none;background:none;cursor:pointer}._wrapper_33f91 .rdtPicker button:hover{background-color:#eee}._wrapper_33f91 .rdtPicker thead button{width:100%;height:100%}._wrapper_33f91 td.rdtMonth,._wrapper_33f91 td.rdtYear{height:50px;width:25%;cursor:pointer}._wrapper_33f91 td.rdtMonth:hover,._wrapper_33f91 td.rdtYear:hover{background:#eee}._wrapper_33f91 .rdtCounters{display:inline-block}._wrapper_33f91 .rdtCounters>div{float:left}._wrapper_33f91 .rdtCounter{height:100px;width:40px}._wrapper_33f91 .rdtCounterSeparator{line-height:100px}._wrapper_33f91 .rdtCounter .rdtBtn{height:40%;line-height:40px;cursor:pointer;display:block;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._wrapper_33f91 .rdtCounter .rdtBtn:hover{color:#00adee}._wrapper_33f91 .rdtCounter .rdtCount{height:20%;font-size:1.2em}._wrapper_33f91 .rdtMilli{vertical-align:middle;padding-left:8px;width:48px}._wrapper_33f91 .rdtMilli input{width:100%;font-size:1.2em;margin-top:37px}._wrapper_33f91 .rdtDayPart{margin-top:43px}._wrapper_33f91 .rdtPicker{position:relative;width:calc(100% - 4px);background:#141414;padding:0;border:1px solid #323232;border-top:0;margin:0;box-shadow:none}._wrapper_33f91 .rdtPicker table{border-collapse:collapse}._wrapper_33f91 .rdtPicker th{width:37px;height:40px;line-height:40px;font-weight:400;font-size:14px;border:0;border-left:1px solid #323232;border-right:1px solid #323232;border-bottom:1px solid #323232}._wrapper_33f91 .rdtPicker th.rdtNext:hover,._wrapper_33f91 .rdtPicker th.rdtPrev:hover,._wrapper_33f91 .rdtPicker th.rdtSwitch:hover{background:#00adee!important}._wrapper_33f91 .rdtPicker th.dow{width:40px;background:#323232;text-align:center}._wrapper_33f91 td.rdtDay,._wrapper_33f91 td.rdtMonth,._wrapper_33f91 td.rdtTimeToggle{width:40px;height:40px;line-height:40px;border:1px solid #323232}._wrapper_33f91 td.rdtDay:hover,._wrapper_33f91 td.rdtMonth:hover,._wrapper_33f91 td.rdtTimeToggle:hover{background:#00adee!important}._wrapper_33f91 td.rdtDay.rdtNew,._wrapper_33f91 td.rdtDay.rdtOld{color:#5b5b5b}._wrapper_33f91 td.rdtToday:before{border-bottom-color:#00adee!important}._wrapper_33f91 td.rdtActive{background:#00adee!important;color:#fff}._wrapper_33f91 td.rdtActive:before{display:none!important}._disabled_33f91{opacity:.5}._disabled-cursor_33f91{cursor:not-allowed}@-webkit-keyframes _slideDialogContents_b9a66{0%{opacity:0;transform:translateX(-50%) translateY(-50%) scale(.9)}}@keyframes _slideDialogContents_b9a66{0%{opacity:0;transform:translateX(-50%) translateY(-50%) scale(.9)}}._dialog_b9a66{position:fixed;top:0;left:0;z-index:1;width:100vw;height:100vh;background:rgba(0,0,0,.8)}._dialog__contentsPosition_b9a66{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%) scale(1);background:#222;box-shadow:0 20px 40px rgba(0,0,0,.4);border-radius:0;outline:none;opacity:1;-webkit-animation:_slideDialogContents_b9a66 .3s ease-in-out;animation:_slideDialogContents_b9a66 .3s ease-in-out}._dialog__contents_b9a66{position:relative;width:calc(100vw - 80px);max-width:640px;border:2px solid #3f3f3f;transition:max-width .25s ease}._dialog--wide_b9a66 ._dialog__contents_b9a66{max-width:960px}@media(max-width:576px){._dialog--wide_b9a66 ._dialog__contents_b9a66{max-width:100vw;width:100vw}}._dialog--jumbo_b9a66 ._dialog__contents_b9a66{max-width:1440px;width:90vw}@media(max-width:576px){._dialog--jumbo_b9a66 ._dialog__contents_b9a66{max-width:100vw;width:100vw}}._dialog--narrow_b9a66 ._dialog__contents_b9a66{max-width:400px}._dialog--success_b9a66 ._dialog__contents_b9a66{border-color:#00a338}._dialog--warn_b9a66 ._dialog__contents_b9a66{border-color:#ff8700}._dialog--error_b9a66 ._dialog__contents_b9a66{border-color:#ff460d}._dialog__title_b9a66{font-size:20px;line-height:1.2;padding:16px 40px 16px 16px}._dialog__body_b9a66{max-height:65vh;overflow-y:auto}@media(max-width:576px){._dialog__body_b9a66{max-height:55vh}}._dialog__actions_b9a66{text-align:right;margin-top:16px}._dialog__closeBtn_b9a66{position:absolute;top:0;right:0;background:#3f3f3f}._dialog__backDrop_b9a66{position:absolute;height:100%;width:100%}._dropDown_ec9f0{position:relative;display:inline-block;width:100%}._dropDown__btn_ec9f0{display:block;width:100%;height:40px;text-align:left;color:#fff;cursor:pointer;font-size:14px;padding:0 16px;border:0;border-radius:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:40px;background:#323232}._dropDown__btn_ec9f0:focus{outline:1px solid #00adee}._dropDown__btn--withChevron_ec9f0{padding-right:40px}._dropDown__btnLabel_ec9f0{margin-right:.5em}._dropDown__chevron_ec9f0{position:absolute;right:16px;top:50%;transform:translateY(-50%)}._dropDown__contents_ec9f0{position:absolute;top:100%;left:0;z-index:1;display:none;width:100%;margin:0;list-style:none;background:#323232;box-shadow:0 5px 5px rgba(0,0,0,.2)}._dropDown__contents--scrollable_ec9f0{position:fixed;top:auto;overflow-y:auto}._dropDown__contents--isOpen_ec9f0{display:block}._dropDown--darker_ec9f0>._dropDown__btn--open_ec9f0,._dropDown--darker_ec9f0>._dropDown__contents_ec9f0{background-color:#222}._dropDown--darkest_ec9f0>._dropDown__btn--open_ec9f0,._dropDown--darkest_ec9f0>._dropDown__contents_ec9f0{background-color:#141414}._dropDown--padded_ec9f0>._dropDown__contents_ec9f0{padding:16px}._heading_29624{font-size:14px;text-rendering:optimizelegibility}._heading--h1_29624{font-size:16px}._iconButton_29f29{vertical-align:top;width:40px;padding-left:0;padding-right:0}._iconButton--disabled_29f29{opacity:.65;cursor:not-allowed}._size-small_29f29{width:32px!important;min-width:32px!important}._wrapper_db5fa{position:relative;display:inline-block}._wrapper__btn_db5fa{position:relative;width:40px}._wrapper__btnModeIcon_db5fa{position:absolute;right:4px;bottom:4px;color:#00adee}[disabled]>._wrapper__btnModeIcon_db5fa{opacity:0}._wrapper_db5fa:hover ._wrapper__btnIcon_db5fa{color:#00adee}._wrapper__dropDown_db5fa{position:absolute;top:100%;left:0;z-index:1;display:none;background:#222;border:1px solid #3f3f3f;border-top:0}._wrapper__dropDown--isOpen_db5fa{display:block}._wrapper__dropDownItem_db5fa{position:relative;display:block;width:38px;height:38px;text-align:center;vertical-align:middle;cursor:pointer}._wrapper__dropDownItem_db5fa:hover,._wrapper__dropDownItem_db5fa:hover>*{color:#00adee}._wrapper__dropDownItem_db5fa>*{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}._label_3d57b{display:block;-webkit-font-smoothing:antialiased;font-size:14px;cursor:pointer;padding:0;margin-bottom:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._label_3d57b,._label_3d57b span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%}._logo_e7616{height:24px;width:auto}._selectBox__list_28309{padding:0}._selectBox_28309{position:relative;display:inline-block;line-height:0}._selectBox__btn_28309{position:relative;display:inline-block;text-overflow:clip;height:auto;min-height:40px;line-height:40px;padding-left:0;border:0;background:#323232;min-width:160px}._selectBox__btn--noRightPadding_28309{padding-right:0}._selectBox__contents_28309{min-width:160px;box-shadow:0 5px 5px rgba(0,0,0,.2);z-index:4;padding:2px!important;margin-top:-2px}._selectBox__item_28309{border-top:1px solid #222;background:#141414}._selectBox__item_28309 div{padding:5px 14px}._selectBox__groupHeader_28309{background-color:#222;font-weight:700;padding-left:16px;line-height:30px;text-transform:uppercase}._selectBox--disabled_28309{filter:opacity(50%);cursor:not-allowed}._listPreviewElement_ab405{cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:30px;padding:5px 16px}._listPreviewElement--isDisabled_ab405{color:#999;cursor:not-allowed}._listPreviewElement--isHighlighted_ab405{background:#00adee}._listPreviewElement--isHighlighted_ab405>span{color:#fff}._listPreviewElement__icon_ab405{margin-right:.5em}._listPreviewElement__iconWrapper_ab405{padding:0!important;width:2em;display:inline-block;text-align:center}._selectBoxHeader_610bb{display:flex;width:100%}._selectBoxHeader__innerPreview_610bb{overflow:hidden;width:100%}._selectBoxHeader__icon_610bb{line-height:40px;height:100%}._selectBoxHeader__label_610bb,._selectBoxHeader__wrapperIconWrapper_610bb{padding:0 16px}._selectBoxHeader__wrapperPlaceholderIconWrapper_610bb{padding:0 8px 0 0}._selectBoxHeader--disabled_610bb{cursor:not-allowed}._selectBoxHeaderWithSearchInput_e6e9a{display:flex;padding-left:16px}._selectBoxHeaderWithSearchInput__inputContainer_e6e9a{width:100%}._selectBoxHeaderWithSearchInput__input_e6e9a{width:100%;color:#fff;font-size:14px}._selectBoxHeaderWithSearchInput__input_e6e9a:focus{background:transparent!important;color:#fff!important}._selectBoxHeaderWithSearchInput__icon_e6e9a{height:40px}._textInput_d2a64{font-size:14px;width:100%;height:40px;padding:0 14px;border:0;border-radius:2px;background:#323232;color:#fff}._textInput_d2a64:focus{outline:0;background:#fff;color:#141414}._textInput_d2a64::-webkit-input-placeholder{font-family:Noto Sans,sans-serif;font-weight:400;color:#999}._textInput--disabled_d2a64{opacity:.65;cursor:not-allowed}._sideBar_de190{position:fixed;width:320px;height:100%;background:#222}._sideBar--left_de190{left:0}._sideBar--right_de190{right:0}._tabs_21fdc{height:100%}._tabs__content_21fdc{height:calc(100% - 141px);overflow-y:auto}._tabNavigation_21fdc{display:block;margin:0;padding:0;list-style:none;background:#141414;border-bottom:1px solid #3f3f3f}._tabNavigation_21fdc:after,._tabNavigation_21fdc:before{content:"";display:table}._tabNavigation_21fdc:after{clear:both}._tabNavigation__item_21fdc{position:relative;float:left;border-top:1px solid #3f3f3f;border-right:1px solid #3f3f3f;color:#fff}._tabNavigation__item--isActive_21fdc{background-color:#222;cursor:default;border-bottom:1px solid #222;margin-bottom:-1px}._tabNavigation__item--isActive_21fdc:after{display:block;content:" ";position:absolute;top:-1px;left:0;right:0;height:2px;width:100%;background:#00adee}._tabNavigation__item--isActive_21fdc>._tabNavigation__itemBtn_21fdc{color:#00adee}._tabNavigation__itemBtn_21fdc{display:inline-block;height:40px;padding:0 16px;line-height:40px;cursor:pointer;border:0;background:0}._tabNavigation__itemBtn_21fdc:hover{color:#00adee}._tabNavigation__itemBtn_21fdc:focus{outline:0}._tabNavigation__itemBtnIcon_21fdc{color:currentColor}._tabNavigation__itemBtnIcon--hasLabel_21fdc{margin-right:8px}._panel_21fdc{overflow-y:auto}._textArea_14296{width:100%;height:40px;padding:10px 14px;border:0;border-radius:2px;background:#323232;resize:vertical;transition:height .3s}._textArea_14296:focus{outline:0;background:#fff;color:#141414}._textArea_14296::-webkit-input-placeholder{font-family:Noto Sans,sans-serif;color:#999}._textArea--invalid_14296{outline:2px solid #ff460d!important}._textArea--highlight_14296{outline:2px solid #00a338}._textArea--disabled_14296{opacity:.65;cursor:not-allowed}._panel_d6f8c{position:relative}._panel__headline_d6f8c{cursor:pointer;height:40px;margin:0;padding:0 16px;line-height:40px;font-weight:700;font-size:14px}._panel__headline--noPadding_d6f8c{padding:0}._panel__toggleBtn_d6f8c{position:absolute;top:0;right:0}._panel__contents_d6f8c{padding:0 16px;transition:padding .25s ease}._panel--isOpen_d6f8c ._panel__contents_d6f8c{padding-top:5px;padding-bottom:5px}._panel--condensed_d6f8c._panel--isOpen_d6f8c ._panel__contents_d6f8c{padding-top:0;padding-bottom:0}._panel__contents--noPadding_d6f8c{padding:0}._tooltip_7e67a{position:absolute}._tooltip_7e67a ul{margin:0}._tooltip--inline_7e67a{position:relative!important;margin-bottom:8px}._tooltip--arrow_7e67a{position:relative;top:0;left:50%;width:0;height:0;margin-left:-var(--spacing-Half);border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #141414}._tooltip--asError_7e67a ._tooltip--arrow_7e67a{border-bottom:8px solid #ff460d}._tooltip--inner_7e67a{position:relative;padding:8px;background:#141414;color:#fff;box-shadow:0 0 10px hsla(0,0%,49%,.2)}._tooltip--asError_7e67a ._tooltip--inner_7e67a{background:#ff460d}._treeWrapper_1a196{padding:5px 0}._treeWrapper_1a196:focus{outline:0}._header_3eaaa{margin:0;position:relative;line-height:20px}._header__chevron_3eaaa{position:absolute;top:0;left:0;height:100%;width:18px;color:#adadad;line-height:20px;text-align:center;cursor:pointer}._header__chevron_3eaaa:hover{color:#00adee}._header__chevron--isCollapsed_3eaaa>svg{transform:translateY(3px) translateX(-2px) rotate(-90deg)}._header__chevron--isHiddenInIndex_3eaaa{opacity:.5}._header__chevron--isLoading_3eaaa,._header__chevron--isLoading_3eaaa:hover{color:#adadad!important}._header__chevron--isLoading_3eaaa>svg{margin-top:6px}._header__iconWrapper_3eaaa{width:2em;display:inline-block;position:absolute;text-align:center}._header__data_3eaaa{position:relative;display:inline-block;min-width:100%;padding:.1em 0;border-left:2px solid transparent;white-space:nowrap;cursor:pointer}._header__data--isHiddenInIndex_3eaaa{opacity:.5}._header__data--isHidden_3eaaa{text-decoration:line-through}._header__data--isDragging_3eaaa{opacity:.2}._header__data--isDirty_3eaaa{border-left:2px solid #ff8700}._header__data--isFocused_3eaaa{background:#323232}._header__data--isFocused_3eaaa._header__data--isHidden_3eaaa,._header__data--isFocused_3eaaa._header__data--isHiddenInIndex_3eaaa{opacity:.8}._header__data--acceptsDrop_3eaaa{background-color:#00adee}._header__data--acceptsDrop_3eaaa *,._header__data--deniesDrop_3eaaa *{pointer-events:none}._header__labelWrapper_3eaaa{max-width:264px;overflow:hidden;text-overflow:ellipsis;display:inline-block;line-height:1.5;vertical-align:middle}._header__label_3eaaa{margin-left:2em}._header__data--isActive_3eaaa ._header__label_3eaaa{color:#00adee}._dropTarget_3eaaa{position:absolute;left:0;right:0;padding-left:15px;height:2px}._dropTarget--before_3eaaa{top:-5px;z-index:1;padding-top:4px;padding-bottom:4px}._dropTarget--after_3eaaa{bottom:1px;z-index:2;padding-top:6px;padding-bottom:0}._dropTarget__inner_3eaaa{visibility:hidden;margin-top:-8px;height:0}._dropTarget__inner--acceptsDrop_3eaaa{z-index:100000;visibility:visible}._dropTarget__inner_3eaaa svg{fill:#00adee}._layer_86dbb{position:fixed;pointer-events:none;z-index:2147483646;left:0;top:0;width:100%;height:100%}._dragWrapper_86dbb{display:inline-block;position:relative;opacity:.7;left:0}._count_86dbb{z-index:2147483646;position:absolute;top:-10px;left:5px;width:20px;height:20px;color:#fff;background-color:#ff460d;border-radius:50%;padding:1px;font-size:12px;font-weight:700;text-align:center}._node_86dbb{position:absolute;width:280px;background-color:#323232;border:1px solid #3f3f3f}._selectedOptions_6b7fe{position:relative;width:100%;list-style:none;padding-left:0}._selectedOptions__item_2d953{display:flex;width:100%;position:relative;background:#141414;border-bottom:1px solid #222;border-radius:2px}._selectedOptions__item_2d953:hover ._selectedOptions__itemIcon_2d953{display:none}._selectedOptions__item_2d953:hover ._selectedOptions__itemIcon--onHover_2d953{display:inline}._selectedOptions__item--draggable_2d953{cursor:move}._selectedOptions__innerPreview_2d953{border-right:1px solid #222;overflow:hidden;width:100%}._selectedOptions__innerPreview_2d953>div{box-shadow:none!important}._selectedOption__removeButton_2d953{height:auto;background:#323232;border-top-right-radius:2px;border-bottom-right-radius:2px}._selectedOption__moveButton_2d953{cursor:move;height:auto;width:20px;min-width:20px;color:#3f3f3f;border-top-left-radius:2px;border-bottom-left-radius:2px;border-right:1px solid #222}._selectedOption__moveButton_2d953 svg{color:#3f3f3f}._selectedOption__moveButton_2d953:focus,._selectedOption__moveButton_2d953:hover{background:#3f3f3f;color:#999!important}._selectedOption__moveButton_2d953:focus svg,._selectedOption__moveButton_2d953:hover svg{color:#999!important}._multiLineWithThumbnail__item_d31b3{box-sizing:content-box;line-height:20px;background:#141414}._multiLineWithThumbnail__secondaryLabel_d31b3,._multiLineWithThumbnail__tertiaryLabel_d31b3{color:#999;display:block;font-size:12px;text-overflow:ellipsis;overflow:hidden}._multiLineWithThumbnail__image_d31b3{width:74.48px;height:56px;-o-object-fit:contain;object-fit:contain;background-color:#fff;background-size:10px 10px;background-position:0 0,25px 25px;background-image:linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);margin-right:.75em;display:inline-block;vertical-align:middle;margin-left:-var(--spacing-Full);margin-top:-var(--spacing-Half);margin-bottom:-var(--spacing-Half)}._multiLineWithThumbnail__item_d31b3:hover ._multiLineWithThumbnail__secondaryLabel_d31b3,._multiLineWithThumbnail__item_d31b3:hover ._multiLineWithThumbnail__tertiaryLabel_d31b3{color:#fff}@keyframes closeWindow{0%{opacity:1}to{opacity:0}}.ril__outer{background-color:rgba(0,0,0,.85);outline:none;top:0;left:0;right:0;bottom:0;z-index:1000;width:100%;height:100%;-ms-content-zooming:none;-ms-user-select:none;-ms-touch-select:none;touch-action:none}.ril__outerClosing{opacity:0}.ril__image,.ril__imageNext,.ril__imagePrev,.ril__inner{position:absolute;top:0;left:0;right:0;bottom:0}.ril__image,.ril__imageNext,.ril__imagePrev{margin:auto;max-width:none;-ms-content-zooming:none;-ms-user-select:none;-ms-touch-select:none;touch-action:none}.ril__imageDiscourager{background-repeat:no-repeat;background-position:50%;background-size:contain}.ril__navButtons{border:none;position:absolute;top:0;bottom:0;width:20px;height:34px;padding:40px 30px;margin:auto;cursor:pointer;opacity:.7}.ril__navButtons:hover{opacity:1}.ril__navButtons:active{opacity:.7}.ril__navButtonPrev{left:0;background:rgba(0,0,0,.2) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIzNCI+PHBhdGggZD0iTTE5IDNsLTItMkwxIDE3bDE2IDE2IDEtMUwzIDE3IDE4IDJ6IiBmaWxsPSIjRkZGIi8+PC9zdmc+") no-repeat 50%}.ril__navButtonNext{right:0;background:rgba(0,0,0,.2) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIzNCI+PHBhdGggZD0iTTEgM2wyLTIgMTYgMTZMMyAzM2wtMS0xIDE1LTE1TDIgMnoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=") no-repeat 50%}.ril__downloadBlocker{position:absolute;top:0;left:0;right:0;bottom:0;background-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");background-size:cover}.ril__caption,.ril__toolbar{background-color:rgba(0,0,0,.5);position:absolute;left:0;right:0;display:flex;justify-content:space-between}.ril__caption{bottom:0;max-height:150px;overflow:auto}.ril__captionContent{padding:10px 20px;color:#fff}.ril__toolbar{top:0;height:50px}.ril__toolbarSide{height:50px;margin:0}.ril__toolbarLeftSide{padding-left:20px;padding-right:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis}.ril__toolbarRightSide{padding-left:0;padding-right:20px;flex:0 0 auto}.ril__toolbarItem{display:inline-block;line-height:50px;padding:0;color:#fff;font-size:120%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ril__toolbarItemChild{vertical-align:middle}.ril__builtinButton{width:40px;height:35px;cursor:pointer;border:none;opacity:.7}.ril__builtinButton:hover{opacity:1}.ril__builtinButton:active{outline:none}.ril__builtinButtonDisabled{cursor:default;opacity:.5}.ril__builtinButtonDisabled:hover{opacity:.5}.ril__closeButton{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PHBhdGggZD0iTTEgM2wxLjI1LTEuMjUgNy41IDcuNSA3LjUtNy41TDE4LjUgMyAxMSAxMC41bDcuNSA3LjUtMS4yNSAxLjI1LTcuNS03LjUtNy41IDcuNUwxIDE4bDcuNS03LjVMMSAzeiIgZmlsbD0iI0ZGRiIvPjwvc3ZnPg==") no-repeat 50%}.ril__zoomInButton{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02TTkgOGg2TTEyIDV2NiIvPjwvZz48Y2lyY2xlIGN4PSIxMiIgY3k9IjgiIHI9IjciIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+") no-repeat 50%}.ril__zoomOutButton{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02TTkgOGg2Ii8+PC9nPjxjaXJjbGUgY3g9IjEyIiBjeT0iOCIgcj0iNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=") no-repeat 50%}.ril__outerAnimating{animation-name:closeWindow}@keyframes pointFade{0%,19.999%,to{opacity:0}20%{opacity:1}}.ril__loadingCircle{width:60px;height:60px;position:relative}.ril__loadingCirclePoint{width:100%;height:100%;position:absolute;left:0;top:0}.ril__loadingCirclePoint:before{content:"";display:block;margin:0 auto;width:11%;height:30%;background-color:#fff;border-radius:30%;animation:pointFade .8s ease-in-out infinite both}.ril__loadingCirclePoint:first-of-type{transform:rotate(0deg)}.ril__loadingCirclePoint:first-of-type:before,.ril__loadingCirclePoint:nth-of-type(7):before{animation-delay:-.8s}.ril__loadingCirclePoint:nth-of-type(2){transform:rotate(30deg)}.ril__loadingCirclePoint:nth-of-type(8){transform:rotate(210deg)}.ril__loadingCirclePoint:nth-of-type(2):before,.ril__loadingCirclePoint:nth-of-type(8):before{animation-delay:-666ms}.ril__loadingCirclePoint:nth-of-type(3){transform:rotate(60deg)}.ril__loadingCirclePoint:nth-of-type(9){transform:rotate(240deg)}.ril__loadingCirclePoint:nth-of-type(3):before,.ril__loadingCirclePoint:nth-of-type(9):before{animation-delay:-533ms}.ril__loadingCirclePoint:nth-of-type(4){transform:rotate(90deg)}.ril__loadingCirclePoint:nth-of-type(10){transform:rotate(270deg)}.ril__loadingCirclePoint:nth-of-type(4):before,.ril__loadingCirclePoint:nth-of-type(10):before{animation-delay:-.4s}.ril__loadingCirclePoint:nth-of-type(5){transform:rotate(120deg)}.ril__loadingCirclePoint:nth-of-type(11){transform:rotate(300deg)}.ril__loadingCirclePoint:nth-of-type(5):before,.ril__loadingCirclePoint:nth-of-type(11):before{animation-delay:-266ms}.ril__loadingCirclePoint:nth-of-type(6){transform:rotate(150deg)}.ril__loadingCirclePoint:nth-of-type(12){transform:rotate(330deg)}.ril__loadingCirclePoint:nth-of-type(6):before,.ril__loadingCirclePoint:nth-of-type(12):before{animation-delay:-133ms}.ril__loadingCirclePoint:nth-of-type(7){transform:rotate(180deg)}.ril__loadingCirclePoint:nth-of-type(13){transform:rotate(1turn)}.ril__loadingCirclePoint:nth-of-type(7):before,.ril__loadingCirclePoint:nth-of-type(13):before{animation-delay:0ms}.ril__loadingContainer{position:absolute;top:0;right:0;bottom:0;left:0}.ril__imageNext .ril__loadingContainer,.ril__imagePrev .ril__loadingContainer{display:none}.ril__errorContainer{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:#fff}.ril__imageNext .ril__errorContainer,.ril__imagePrev .ril__errorContainer{display:none}.ril__loadingContainer__icon{color:#fff;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)} /*# sourceMappingURL=main.bundle.css.map */ \ No newline at end of file diff --git a/Resources/Public/Assets/main.bundle.js b/Resources/Public/Assets/main.bundle.js index 5e25e02ac..09111dfae 100644 --- a/Resources/Public/Assets/main.bundle.js +++ b/Resources/Public/Assets/main.bundle.js @@ -867,7 +867,7 @@ var t;!function(r,n){"use strict";var e={};r.PubSub=e,function(t){var r={},n=-1, },{"@apollo/client":"xxBS","../mutations":"VJTq"}],"g1AJ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"useAssetCollectionsQuery",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"useAssetCountQuery",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"useAssetQuery",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"useAssetSourcesQuery",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"useAssetsQuery",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"useConfigQuery",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"useCreateAssetCollection",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"useCreateTag",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"useDeleteAsset",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"useDeleteAssetCollection",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"useDeleteTag",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"useEvent",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"useImportAsset",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(exports,"useSelectAsset",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"useSelectAssetCollection",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(exports,"useSelectAssetSource",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(exports,"useSelectTag",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(exports,"useSelectedAsset",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(exports,"useSelectedAssetCollection",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(exports,"useSelectedTag",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(exports,"useSetAssetCollections",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(exports,"useSetAssetTags",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(exports,"useTagsQuery",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(exports,"useUntagAsset",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(exports,"useUpdateAsset",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(exports,"useUpdateAssetCollection",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(exports,"useUpdateTag",{enumerable:!0,get:function(){return Q.default}});var e=T(require("./useAssetCollectionsQuery")),t=T(require("./useAssetCountQuery")),r=T(require("./useAssetQuery")),u=T(require("./useAssetSourcesQuery")),s=T(require("./useAssetsQuery")),n=T(require("./useConfigQuery")),o=T(require("./useCreateAssetCollection")),l=T(require("./useCreateTag")),i=T(require("./useDeleteAsset")),c=T(require("./useDeleteAssetCollection")),f=T(require("./useDeleteTag")),a=T(require("./useEvent")),d=T(require("./useImportAsset")),p=T(require("./useSelectAsset")),b=T(require("./useSelectAssetCollection")),g=T(require("./useSelectAssetSource")),y=T(require("./useSelectTag")),A=T(require("./useSelectedAsset")),m=T(require("./useSelectedAssetCollection")),j=T(require("./useSelectedTag")),x=T(require("./useSetAssetCollections")),O=T(require("./useSetAssetTags")),P=T(require("./useTagsQuery")),q=T(require("./useUntagAsset")),C=T(require("./useUpdateAsset")),S=T(require("./useUpdateAssetCollection")),Q=T(require("./useUpdateTag"));function T(e){return e&&e.__esModule?e:{default:e}} },{"./useAssetCollectionsQuery":"opHt","./useAssetCountQuery":"wpmw","./useAssetQuery":"n5TT","./useAssetSourcesQuery":"PaCB","./useAssetsQuery":"aIkm","./useConfigQuery":"MqR5","./useCreateAssetCollection":"Ruzq","./useCreateTag":"GCaf","./useDeleteAsset":"jDj4","./useDeleteAssetCollection":"M97n","./useDeleteTag":"XIkM","./useEvent":"v4y3","./useImportAsset":"SnrW","./useSelectAsset":"gEJJ","./useSelectAssetCollection":"mokJ","./useSelectAssetSource":"ucf2","./useSelectTag":"EyMc","./useSelectedAsset":"yOkq","./useSelectedAssetCollection":"WPgu","./useSelectedTag":"vJvA","./useSetAssetCollections":"aQ3v","./useSetAssetTags":"QSCx","./useTagsQuery":"km67","./useUntagAsset":"FZmP","./useUpdateAsset":"CMi2","./useUpdateAssetCollection":"wPGd","./useUpdateTag":"xVNm"}],"iChU":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MediaUiProvider=v,exports.useMediaUi=exports.MediaUiContext=void 0;var e=u(require("react")),t=require("@apollo/client"),s=require("recoil"),r=require("matcher"),a=require("@media-ui/core/src"),n=require("../hooks"),o=require("./Notify"),i=require("../state"),l=require("../fragments/asset");function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(c=function(e){return e?s:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var s=c(t);if(s&&s.has(e))return s.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,s&&s.set(e,r),r}var d=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},f=(0,e.createContext)({});exports.MediaUiContext=f;var p,y=function(){return(0,e.useContext)(f)};function v(c){var u=c.children,y=c.dummyImage,v=c.selectionMode,m=void 0!==v&&v,A=c.isInNodeCreationDialog,g=void 0!==A&&A,h=c.onAssetSelection,b=void 0===h?null:h,M=c.containerRef,w=c.featureFlags,P=c.constraints,I=void 0===P?{}:P,S=c.assetType,T=void 0===S?"all":S,O=(0,a.useIntl)().translate,j=(0,o.useNotify)(),q=(0,t.useApolloClient)(),x=(0,n.useDeleteAsset)().deleteAsset,C=(0,n.useImportAsset)().importAsset,D=(0,n.useAssetsQuery)(),k=D.assets,_=D.refetch,N=(0,s.useRecoilState)(i.selectedMediaTypeState),U=(N[0],N[1]);(0,e.useEffect)(function(){T&&U(T)},[T,U]);var E=(0,e.useCallback)(function(e){return window.confirm(O("action.deleteAsset.confirm","Do you really want to delete the asset "+e.label,[e.label]))?x({assetId:e.id,assetSourceId:e.assetSource.id}).then(function(){return j.ok(O("action.deleteAsset.success","The asset has been deleted")),!0}).catch(function(e){var t=e.message;return j.error(O("action.deleteAsset.error","Error while trying to delete the asset"),t),!1}):new Promise(function(){return!1})},[j,O,x]),F=(0,e.useCallback)(function(e){var t,s;return!((null===(t=I.mediaTypes)||void 0===t?void 0:t.length)>0&&!(0,r.isMatch)(e.file.mediaType,I.mediaTypes))&&!((null===(s=I.assetSources)||void 0===s?void 0:s.length)>0&&!(0,r.isMatch)(e.assetSource.id,I.assetSources))},[I]),R=(0,e.useCallback)(function(e){if(b&&e){var s=q.readFragment({fragment:(0,t.gql)(p||(p=d(["\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ","\n "],["\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ","\n "])),l.ASSET_FRAGMENT),fragmentName:"LocalAssetData",variables:{includeUsage:!1},id:q.cache.identify({__typename:"Asset",id:e.assetId})});F(s)?s.localId?b(s.localId):C(e).then(function(e){var t=e.data;b(t.importAsset.localId)}):j.notice(O("action.selectAsset.invalidType.message","You can only select any of the following types: {types}",{types:I.mediaTypes.join(", ")}))}},[q,C,b,F,O,j,I.mediaTypes]);return e.createElement(f.Provider,{value:{containerRef:M,dummyImage:y,handleDeleteAsset:E,handleSelectAsset:R,selectionMode:m,isInNodeCreationDialog:g,assets:k,refetchAssets:_,featureFlags:w,constraints:I,assetType:T,isAssetSelectable:F}},u)}exports.useMediaUi=y; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MediaUiProvider=v,exports.useMediaUi=exports.MediaUiContext=void 0;var e=u(require("react")),t=require("@apollo/client"),s=require("recoil"),r=require("matcher"),a=require("@media-ui/core/src"),n=require("../hooks"),o=require("./Notify"),i=require("../state"),l=require("../fragments/asset");function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(c=function(e){return e?s:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var s=c(t);if(s&&s.has(e))return s.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,s&&s.set(e,r),r}var d=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},f=(0,e.createContext)({});exports.MediaUiContext=f;var p,y=function(){return(0,e.useContext)(f)};function v(c){var u=c.children,y=c.dummyImage,v=c.selectionMode,m=void 0!==v&&v,A=c.isInNodeCreationDialog,g=void 0!==A&&A,h=c.onAssetSelection,b=void 0===h?null:h,M=c.containerRef,w=c.featureFlags,P=c.constraints,S=void 0===P?{}:P,I=c.assetType,T=void 0===I?"all":I,O=(0,a.useIntl)().translate,j=(0,o.useNotify)(),q=(0,t.useApolloClient)(),x=(0,n.useDeleteAsset)().deleteAsset,C=(0,n.useImportAsset)().importAsset,D=(0,n.useAssetsQuery)(),k=D.assets,_=D.refetch,N=(0,s.useSetRecoilState)(i.selectedMediaTypeState);(0,e.useEffect)(function(){T&&N(T)},[T,N]);var U=(0,e.useCallback)(function(e){return window.confirm(O("action.deleteAsset.confirm","Do you really want to delete the asset "+e.label,[e.label]))?x({assetId:e.id,assetSourceId:e.assetSource.id}).then(function(){return j.ok(O("action.deleteAsset.success","The asset has been deleted")),!0}).catch(function(e){var t=e.message;return j.error(O("action.deleteAsset.error","Error while trying to delete the asset"),t),!1}):new Promise(function(){return!1})},[j,O,x]),E=(0,e.useCallback)(function(e){var t,s;return!((null===(t=S.mediaTypes)||void 0===t?void 0:t.length)>0&&!(0,r.isMatch)(e.file.mediaType,S.mediaTypes))&&!((null===(s=S.assetSources)||void 0===s?void 0:s.length)>0&&!(0,r.isMatch)(e.assetSource.id,S.assetSources))},[S]),F=(0,e.useCallback)(function(e){if(b&&e){var s=q.readFragment({fragment:(0,t.gql)(p||(p=d(["\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ","\n "],["\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ","\n "])),l.ASSET_FRAGMENT),fragmentName:"LocalAssetData",variables:{includeUsage:!1},id:q.cache.identify({__typename:"Asset",id:e.assetId})});E(s)?s.localId?b(s.localId):C(e).then(function(e){var t=e.data;b(t.importAsset.localId)}):j.notice(O("action.selectAsset.invalidType.message","You can only select any of the following types: {types}",{types:S.mediaTypes.join(", ")}))}},[q,C,b,E,O,j,S.mediaTypes]);return e.createElement(f.Provider,{value:{containerRef:M,dummyImage:y,handleDeleteAsset:U,handleSelectAsset:F,selectionMode:m,isInNodeCreationDialog:g,assets:k,refetchAssets:_,featureFlags:w,constraints:S,assetType:T,isAssetSelectable:E}},u)}exports.useMediaUi=y; },{"react":"d6ZO","@apollo/client":"xxBS","recoil":"ejzu","matcher":"xWUK","@media-ui/core/src":"GGOe","../hooks":"g1AJ","./Notify":"td9R","../state":"nstW","../fragments/asset":"y6Uq"}],"Mfcw":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IntlProvider=u,exports.useIntl=exports.IntlContext=void 0;var e=r(require("react"));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}function r(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var l=u?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(o,a,l):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}var n=(0,e.createContext)(null);exports.IntlContext=n;var o=function(){return(0,e.useContext)(n)};function u(t){var r=t.children,o=t.translate;return e.createElement(n.Provider,{value:{translate:o}},r)}exports.useIntl=o; },{"react":"d6ZO"}],"HlGC":[function(require,module,exports) { @@ -981,15 +981,15 @@ var e;!function(){"use strict";var t={}.hasOwnProperty;function r(){for(var e=[] },{}],"hsJu":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=u(require("classnames")),r=a(require("react"));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var a={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=u?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(a,s,o):a[s]=e[s]}return a.default=e,r&&r.set(e,a),a}function u(e){return e&&e.__esModule?e:{default:e}}class s extends r.PureComponent{render(){const n=this.props,{className:a,theme:u,label:s}=n,o=(0,e.__rest)(n,["className","theme","label"]),l=(0,t.default)(u.badge,a);return r.default.createElement("div",Object.assign({},o,{className:l}),s)}}var o=s;exports.default=o; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO"}],"Wuot":[function(require,module,exports) { -module.exports={reset:"_reset_da866"}; +module.exports={reset:"_reset_cd800"}; },{}],"gPwI":[function(require,module,exports) { -module.exports={badge:"_badge_fe12d _reset_da866"}; +module.exports={badge:"_badge_ec05c _reset_cd800"}; },{"./../reset.css":"Wuot"}],"hzJB":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=s(require("../identifiers")),t=s(require("./badge")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var d=(0,e.themr)(r.default.badge,u.default)(t.default);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./badge":"hsJu","./style.css":"gPwI"}],"bme7":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=a(require("classnames")),r=o(require("react"));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var u=a?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(o,s,u):o[s]=e[s]}return o.default=e,r&&r.set(e,o),o}function a(e){return e&&e.__esModule?e:{default:e}}class s extends r.PureComponent{render(){const n=this.props,{position:o,className:a,theme:s,children:u}=n,i=(0,e.__rest)(n,["position","className","theme","children"]),l=(0,t.default)(a,s.bar,{[s["bar--top"]]:"top"===o,[s["bar--bottom"]]:"bottom"===o});return r.default.createElement("div",Object.assign({className:l},i),u)}}var u=s;exports.default=u; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO"}],"e3zu":[function(require,module,exports) { -module.exports={bar:"_bar_ea9af _reset_da866","bar--top":"_bar--top_ea9af","bar--bottom":"_bar--bottom_ea9af"}; +module.exports={bar:"_bar_f4e9a _reset_cd800","bar--top":"_bar--top_f4e9a","bar--bottom":"_bar--bottom_f4e9a"}; },{"./../reset.css":"Wuot"}],"H9Qz":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=s(require("../identifiers")),t=s(require("./bar")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var a=(0,e.themr)(r.default.bar,u.default)(t.default);exports.default=a; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./bar":"bme7","./style.css":"e3zu"}],"wCAH":[function(require,module,exports) { @@ -997,7 +997,7 @@ module.exports={bar:"_bar_ea9af _reset_da866","bar--top":"_bar--top_ea9af","bar- },{}],"Xy5r":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=void 0;var e=require("tslib"),s=i(require("classnames")),t=i(require("react")),r=require("../_lib/focusNode");function i(e){return e&&e.__esModule?e:{default:e}}const d={_refHandler:r.makeFocusNode,hoverStyle:"brand",isActive:!1,disabled:!1,isFocused:!1,size:"regular",style:"lighter",type:"button"};exports.defaultProps=d;class o extends t.default.PureComponent{getDisabled(){return void 0!==this.props.isDisabled&&console.error("`isDisabled` prop on Button component is DEPRECATED, use `disabled instead`"),Boolean(this.props.disabled||this.props.isDisabled)}render(){const r=this.props,{children:i,className:d,isPressed:o,isFocused:l,isActive:a,style:n,hoverStyle:u,size:b,theme:c,type:p,_refHandler:f}=r,h=(0,e.__rest)(r,["children","className","isPressed","isFocused","isActive","style","hoverStyle","size","theme","type","_refHandler"]),v=this.getDisabled(),y=a?"brand":n,m=a?"brand":u,_=(0,s.default)(c.btn,c[`btn--size-${b}`],c[`btn--${y}`],c[`btn--${m}Hover`],{[c["btn--brandActive"]]:a,[c["btn--isPressed"]]:o},d);return t.default.createElement("button",Object.assign({},h,{disabled:v,type:p,className:_,role:"button",ref:f&&f(l)}),i)}}o.defaultProps=d;var l=o;exports.default=l; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO","../_lib/focusNode":"wCAH"}],"at46":[function(require,module,exports) { -module.exports={btn:"_btn_dd3de _reset_da866","btn--isPressed":"_btn--isPressed_dd3de","btn--size-small":"_btn--size-small_dd3de","btn--clean":"_btn--clean_dd3de","btn--lighter":"_btn--lighter_dd3de","btn--neutral":"_btn--neutral_dd3de","btn--transparent":"_btn--transparent_dd3de","btn--brand":"_btn--brand_dd3de","btn--success":"_btn--success_dd3de","btn--warn":"_btn--warn_dd3de","btn--error":"_btn--error_dd3de","btn--brandActive":"_btn--brandActive_dd3de","btn--brandHover":"_btn--brandHover_dd3de","btn--cleanHover":"_btn--cleanHover_dd3de","btn--darkenHover":"_btn--darkenHover_dd3de","btn--successHover":"_btn--successHover_dd3de","btn--warnHover":"_btn--warnHover_dd3de","btn--errorHover":"_btn--errorHover_dd3de"}; +module.exports={btn:"_btn_640ba _reset_cd800","btn--isPressed":"_btn--isPressed_640ba","btn--size-small":"_btn--size-small_640ba","btn--clean":"_btn--clean_640ba","btn--lighter":"_btn--lighter_640ba","btn--neutral":"_btn--neutral_640ba","btn--transparent":"_btn--transparent_640ba","btn--brand":"_btn--brand_640ba","btn--success":"_btn--success_640ba","btn--warn":"_btn--warn_640ba","btn--error":"_btn--error_640ba","btn--brandActive":"_btn--brandActive_640ba","btn--brandHover":"_btn--brandHover_640ba","btn--cleanHover":"_btn--cleanHover_640ba","btn--darkenHover":"_btn--darkenHover_640ba","btn--successHover":"_btn--successHover_640ba","btn--warnHover":"_btn--warnHover_640ba","btn--errorHover":"_btn--errorHover_640ba"}; },{"./../reset.css":"Wuot"}],"rl1D":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),t=s(require("../identifiers")),r=s(require("./button")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var d=(0,e.themr)(t.default.button,u.default)(r.default);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./button":"Xy5r","./style.css":"at46"}],"FhEW":[function(require,module,exports) { @@ -1005,7 +1005,7 @@ module.exports={btn:"_btn_dd3de _reset_da866","btn--isPressed":"_btn--isPressed_ },{"tslib":"y3QC","react":"d6ZO"}],"wns4":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=o(require("classnames")),r=u(require("react")),n=o(require("./buttonGroupItem"));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=u?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function o(e){return e&&e.__esModule?e:{default:e}}class s extends r.PureComponent{render(){const a=this.props,{children:u,className:o,theme:s,value:l,onSelect:c}=a,i=(0,e.__rest)(a,["children","className","theme","value","onSelect"]),p=(0,t.default)(s.buttonGroup,o);return r.default.createElement("div",Object.assign({},i,{className:p}),u.map((e,t)=>r.default.createElement(n.default,Object.assign({},e.props,{key:t,onClick:c,isPressed:l===e.props.id,element:e}))))}}var l=s;exports.default=l; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO","./buttonGroupItem":"FhEW"}],"OBCm":[function(require,module,exports) { -module.exports={buttonGroup:"_buttonGroup_5b6c0"}; +module.exports={buttonGroup:"_buttonGroup_5cdce"}; },{}],"eycw":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=s(require("../identifiers")),t=s(require("./buttonGroup")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var o=(0,e.themr)(r.default.buttonGroup,u.default)(t.default);exports.default=o; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./buttonGroup":"wns4","./style.css":"OBCm"}],"Ayxr":[function(require,module,exports) { @@ -1018,13 +1018,13 @@ var t=arguments[3];function n(t){return(n="function"==typeof Symbol&&"symbol"==t },{}],"BHwd":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=void 0;var e=require("tslib"),r=require("@fortawesome/react-fontawesome"),t=u(require("classnames")),o=s(require("react")),n=u(require("./mapper"));function a(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(a=function(e){return e?t:r})(e)}function s(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a(r);if(t&&t.has(e))return t.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var u=n?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(o,s,u):o[s]=e[s]}return o.default=e,t&&t.set(e,o),o}function u(e){return e&&e.__esModule?e:{default:e}}const c={color:"default",padded:"none"};exports.defaultProps=c;class l extends o.PureComponent{constructor(){super(...arguments),this.getIconProp=(e=>{const r=(0,n.default)(e),t=r.split(" ");if(t.length>1){return[t[0],t[1].startsWith("fa-")?t[1].substr(3):t[1]]}return["fas",r]})}render(){const n=this.props,{padded:a,theme:s,label:u,icon:c,className:l,color:i}=n,p=(0,e.__rest)(n,["padded","theme","label","icon","className","color"]),f=c,d=(0,t.default)(s.icon,f,l,{[s["icon--paddedLeft"]]:"left"===a,[s["icon--paddedRight"]]:"right"===a,[s["icon--color-warn"]]:"warn"===i,[s["icon--color-error"]]:"error"===i,[s["icon--color-primaryBlue"]]:"primaryBlue"===i});return o.default.createElement(r.FontAwesomeIcon,Object.assign({icon:c?this.getIconProp(c):"question","aria-label":u,className:d},p))}}l.defaultProps=c;var i=l;exports.default=i; },{"tslib":"y3QC","@fortawesome/react-fontawesome":"NiAn","classnames":"GGB8","react":"d6ZO","./mapper":"WO6x"}],"oVas":[function(require,module,exports) { -module.exports={icon:"_icon_db7f1 _reset_da866","icon--paddedLeft":"_icon--paddedLeft_db7f1","icon--paddedRight":"_icon--paddedRight_db7f1","icon--color-warn":"_icon--color-warn_db7f1","icon--color-error":"_icon--color-error_db7f1","icon--color-primaryBlue":"_icon--color-primaryBlue_db7f1"}; +module.exports={icon:"_icon_7bee5 _reset_cd800","icon--paddedLeft":"_icon--paddedLeft_7bee5","icon--paddedRight":"_icon--paddedRight_7bee5","icon--color-warn":"_icon--color-warn_7bee5","icon--color-error":"_icon--color-error_7bee5","icon--color-primaryBlue":"_icon--color-primaryBlue_7bee5"}; },{"./../reset.css":"Wuot"}],"i1Sb":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@fortawesome/fontawesome-svg-core");require("@fortawesome/fontawesome-svg-core/styles.css");var r=require("@friendsofreactjs/react-css-themr"),s=i(require("../identifiers")),t=i(require("./icon")),o=i(require("./style.css"));function i(e){return e&&e.__esModule?e:{default:e}}e.config.autoAddCss=!1,e.config.familyPrefix="neos-fa",e.config.replacementClass="neos-svg-inline--fa";var a=(0,r.themr)(s.default.icon,o.default)(t.default);exports.default=a; },{"@fortawesome/fontawesome-svg-core":"Ayxr","@fortawesome/fontawesome-svg-core/styles.css":"jvU7","@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./icon":"BHwd","./style.css":"oVas"}],"dJFX":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=s(require("classnames")),r=n(require("react")),c=s(require("./../Icon"));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function n(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var c={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(c,s,o):c[s]=e[s]}return c.default=e,r&&r.set(e,c),c}function s(e){return e&&e.__esModule?e:{default:e}}class o extends r.PureComponent{constructor(){super(...arguments),this.handleChange=(()=>{const{onChange:e,isChecked:t}=this.props;e&&e(!t)})}render(){const a=this.props,{isChecked:n,disabled:s,className:o,theme:i}=a,u=(0,e.__rest)(a,["isChecked","disabled","className","theme"]),l=(0,t.default)(o,i.checkbox,{[i.checkbox__checked]:n,[i.checkbox__disabled]:s}),d=(0,t.default)(i.checkbox__inputMirror,{[i["checkbox__inputMirror--active"]]:n});return r.default.createElement("div",{className:l},r.default.createElement("input",Object.assign({},u,{className:i.checkbox__input,type:"checkbox",checked:n,"aria-checked":n,onChange:this.handleChange,disabled:s})),r.default.createElement(c.default,{className:i.checkbox__icon,icon:"check"}),r.default.createElement("div",{className:d}))}}var i=o;exports.default=i; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO","./../Icon":"i1Sb"}],"tp7A":[function(require,module,exports) { -module.exports={checkbox:"_checkbox_1b95c _reset_da866",checkbox__input:"_checkbox__input_1b95c _reset_da866",checkbox__icon:"_checkbox__icon_1b95c",checkbox__inputMirror:"_checkbox__inputMirror_1b95c _reset_da866","checkbox__inputMirror--active":"_checkbox__inputMirror--active_1b95c",checkbox__checked:"_checkbox__checked_1b95c",checkbox__disabled:"_checkbox__disabled_1b95c"}; +module.exports={checkbox:"_checkbox_fdd07 _reset_cd800",checkbox__input:"_checkbox__input_fdd07 _reset_cd800",checkbox__icon:"_checkbox__icon_fdd07",checkbox__inputMirror:"_checkbox__inputMirror_fdd07 _reset_cd800","checkbox__inputMirror--active":"_checkbox__inputMirror--active_fdd07",checkbox__checked:"_checkbox__checked_fdd07",checkbox__disabled:"_checkbox__disabled_fdd07"}; },{"./../reset.css":"Wuot"}],"l4k0":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=s(require("../identifiers")),t=s(require("./checkBox")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var d=(0,e.themr)(r.default.checkBox,u.default)(t.default);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./checkBox":"dJFX","./style.css":"tp7A"}],"lsjP":[function(require,module,exports) { @@ -1095,7 +1095,7 @@ for(var e=arguments[3],n=require("performance-now"),t="undefined"==typeof window },{"object-assign":"PJI5","prop-types":"IaRT","create-react-class":"mGdE","moment":"lsjP","react":"d6ZO","./src/CalendarContainer":"EjdR","react-onclickoutside":"iR93"}],"fvXp":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.DateInput=void 0;var e=u(require("react")),t=d(require("../enhanceWithClickOutside/index")),a=u(require("moment")),l=d(require("classnames")),n=d(require("react-collapse")),s=d(require("react-datetime")),r=d(require("../Button")),i=d(require("../Icon"));function d(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(o=function(e){return e?a:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=o(t);if(a&&a.has(e))return a.get(e);var l={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var r=n?Object.getOwnPropertyDescriptor(e,s):null;r&&(r.get||r.set)?Object.defineProperty(l,s,r):l[s]=e[s]}return l.default=e,a&&a.set(e,l),l}const c={labelFormat:"DD-MM-YYYY hh:mm",timeConstraints:{minutes:{min:0,max:59,step:5}}},p={isOpen:!1,transientDate:null};class h extends e.PureComponent{constructor(){super(...arguments),this.state=p,this.handleClick=(()=>{this.props.disabled||this.toggle()}),this.handleFocus=(()=>{this.props.disabled||this.open()}),this.handleClearValueClick=(()=>{this.props.disabled||this.setState({isOpen:!1},()=>{this.props.onChange(null)})}),this.handleApply=(()=>{this.setState({isOpen:!1},()=>{this.props.onChange(this.state.transientDate)})}),this.handleChange=(e=>{const t=(0,a.isMoment)(e)?e:(0,a.default)(e);this.setState({transientDate:t.toDate()})}),this.handleSelectTodayBtnClick=(()=>{this.setState({isOpen:!1},()=>{let e=(0,a.default)().toDate();this.props.dateOnly&&(e=(0,a.default)().utc().startOf("day").toDate()),this.props.onChange(e)})}),this.handleClickOutside=(()=>this.close()),this.toggle=(()=>{this.setState({isOpen:!this.state.isOpen})}),this.open=(()=>{this.setState({isOpen:!0})}),this.close=(()=>{this.setState({isOpen:!1})})}render(){const{placeholder:t,theme:d,value:o,className:u,id:c,todayLabel:p,applyLabel:h,labelFormat:f,dateOnly:m,timeOnly:C,locale:O,disabled:y}=this.props,b=o?(0,a.default)(o).format(f):"",k=(0,l.default)(d.wrapper,{[d.disabled]:y}),v=(0,l.default)(u,d.calendarInputWrapper),g=(0,l.default)(d.calendarFakeInputMirror,{[d["disabled-cursor"]]:y}),E=(0,l.default)(d.calendarIconBtn,{[d["disabled-cursor"]]:y}),D=(0,l.default)(d.closeCalendarIconBtn,{[d["disabled-cursor"]]:y});return e.default.createElement("div",{className:k},e.default.createElement("div",{className:v},e.default.createElement("button",{onClick:this.handleClick,className:E},e.default.createElement(i.default,{icon:"far calendar-alt"})),e.default.createElement("div",{className:d.calendarFakeInputWrapper},e.default.createElement("div",{role:"presentation",onClick:this.handleClick,className:g}),e.default.createElement("input",{id:c,onFocus:this.handleFocus,type:"datetime",placeholder:t,className:d.calendarFakeInput,value:b,readOnly:!0})),e.default.createElement("button",{onClick:this.handleClearValueClick,className:D},e.default.createElement(i.default,{icon:"times"}))),e.default.createElement(n.default,{isOpened:this.state.isOpen},e.default.createElement("button",{className:d.selectTodayBtn,onClick:this.handleSelectTodayBtnClick},p),e.default.createElement(s.default,{open:!0,defaultValue:o,dateFormat:!C,utc:m,locale:O,timeFormat:!m,onChange:this.handleChange,timeConstraints:this.props.timeConstraints}),e.default.createElement(r.default,{onClick:this.handleApply,className:d.applyBtn,style:"brand"},h)))}}exports.DateInput=h,h.defaultProps=c;const f=(0,t.default)(h);var m=f;exports.default=m; },{"react":"d6ZO","../enhanceWithClickOutside/index":"NLwD","moment":"lsjP","classnames":"GGB8","react-collapse":"jAd2","react-datetime":"XmHw","../Button":"rl1D","../Icon":"i1Sb"}],"GER1":[function(require,module,exports) { -module.exports={calendarInputWrapper:"_calendarInputWrapper_55f08","calendarInputWrapper--highlight":"_calendarInputWrapper--highlight_55f08","calendarInputWrapper--invalid":"_calendarInputWrapper--invalid_55f08",closeCalendarIconBtn:"_closeCalendarIconBtn_55f08 _reset_da866",calendarIconBtn:"_calendarIconBtn_55f08 _reset_da866",calendarFakeInputWrapper:"_calendarFakeInputWrapper_55f08 _reset_da866",calendarFakeInputMirror:"_calendarFakeInputMirror_55f08",calendarFakeInput:"_calendarFakeInput_55f08 _reset_da866",selectTodayBtn:"_selectTodayBtn_55f08",applyBtn:"_applyBtn_55f08",wrapper:"_wrapper_55f08 _reset_da866",disabled:"_disabled_55f08","disabled-cursor":"_disabled-cursor_55f08"}; +module.exports={calendarInputWrapper:"_calendarInputWrapper_33f91","calendarInputWrapper--highlight":"_calendarInputWrapper--highlight_33f91","calendarInputWrapper--invalid":"_calendarInputWrapper--invalid_33f91",closeCalendarIconBtn:"_closeCalendarIconBtn_33f91 _reset_cd800",calendarIconBtn:"_calendarIconBtn_33f91 _reset_cd800",calendarFakeInputWrapper:"_calendarFakeInputWrapper_33f91 _reset_cd800",calendarFakeInputMirror:"_calendarFakeInputMirror_33f91",calendarFakeInput:"_calendarFakeInput_33f91 _reset_cd800",selectTodayBtn:"_selectTodayBtn_33f91",applyBtn:"_applyBtn_33f91",wrapper:"_wrapper_33f91 _reset_cd800",disabled:"_disabled_33f91","disabled-cursor":"_disabled-cursor_33f91"}; },{"./../reset.css":"Wuot"}],"PZ0c":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),t=s(require("../identifiers")),r=s(require("./dateInput")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var d=(0,e.themr)(t.default.dateInput,u.default)(r.default);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./dateInput":"fvXp","./style.css":"GER1"}],"uORK":[function(require,module,exports) { @@ -1115,7 +1115,7 @@ module.exports={calendarInputWrapper:"_calendarInputWrapper_55f08","calendarInpu },{"./PortalCompat":"rWO1","./PortalWithState":"KCBM"}],"h26b":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.DialogWithoutEscape=void 0;var e=require("tslib"),t=i(require("classnames")),s=l(require("react")),r=i(require("../enhanceWithClickOutside/index")),n=i(require("react-close-on-escape")),a=require("react-portal");function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(o=function(e){return e?s:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var s=o(t);if(s&&s.has(e))return s.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,s&&s.set(e,r),r}function i(e){return e&&e.__esModule?e:{default:e}}class c extends s.PureComponent{constructor(){super(...arguments),this.handleReference=(e=>{this.ref=e}),this.handleClickOutside=(()=>{this.props.onRequestClose()}),this.componentDidMount=(()=>{document.addEventListener("keydown",e=>this.handleKeyPress(e));const{autoFocus:e}=this.props;this.ref&&e&&this.ref.focus()}),this.componentWillUnmount=(()=>{document.removeEventListener("keydown",e=>this.handleKeyPress(e))}),this.handleKeyPress=(e=>{"Escape"===e.key&&this.props.onRequestClose()})}render(){const{title:e,children:r,actions:n,theme:a,type:o}=this.props,l=(0,t.default)(a.dialog__body,{[a["dialog--success"]]:"success"===o,[a["dialog--warn"]]:"warn"===o,[a["dialog--error"]]:"error"===o},"dialog__body");return s.default.createElement("div",{ref:this.handleReference,className:a.dialog__contentsPosition,tabIndex:0},s.default.createElement("div",{className:a.dialog__contents},s.default.createElement("div",{className:a.dialog__title},e),s.default.createElement("div",{className:l},r),n&&n.length?s.default.createElement("div",{className:a.dialog__actions},s.default.Children.map(n,(e,t)=>s.default.createElement("span",{key:t},e))):null))}}exports.DialogWithoutEscape=c;const u=(0,r.default)(c);class d extends s.PureComponent{constructor(){super(...arguments),this.onEscape=(()=>{this.props.onRequestClose()})}render(){const r=this.props,{className:o,title:l,style:i,children:c,isOpen:d,actions:p,theme:f,type:h,onRequestClose:m}=r,g=(0,e.__rest)(r,["className","title","style","children","isOpen","actions","theme","type","onRequestClose"]),y=(0,t.default)(f.dialog,{[f["dialog--wide"]]:"wide"===i,[f["dialog--jumbo"]]:"jumbo"===i,[f["dialog--narrow"]]:"narrow"===i},{[f["dialog--success"]]:"success"===h,[f["dialog--warn"]]:"warn"===h,[f["dialog--error"]]:"error"===h},o);return this.props.isOpen?s.default.createElement(n.default,{onEscape:this.onEscape},s.default.createElement(a.Portal,null,s.default.createElement("section",Object.assign({},g,{className:y,role:"dialog",tabIndex:0}),s.default.createElement(u,Object.assign({},this.props))))):null}}var p=d;exports.default=p; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO","../enhanceWithClickOutside/index":"NLwD","react-close-on-escape":"uORK","react-portal":"GOKd"}],"vltw":[function(require,module,exports) { -module.exports={dialog:"_dialog_acf40 _reset_da866",dialog__contentsPosition:"_dialog__contentsPosition_acf40 _reset_da866",slideDialogContents:"_slideDialogContents_acf40",dialog__contents:"_dialog__contents_acf40 _reset_da866","dialog--wide":"_dialog--wide_acf40","dialog--jumbo":"_dialog--jumbo_acf40","dialog--narrow":"_dialog--narrow_acf40","dialog--success":"_dialog--success_acf40","dialog--warn":"_dialog--warn_acf40","dialog--error":"_dialog--error_acf40",dialog__title:"_dialog__title_acf40 _reset_da866",dialog__body:"_dialog__body_acf40",dialog__actions:"_dialog__actions_acf40 _reset_da866",dialog__closeBtn:"_dialog__closeBtn_acf40 _reset_da866",dialog__backDrop:"_dialog__backDrop_acf40 _reset_da866"}; +module.exports={dialog:"_dialog_b9a66 _reset_cd800",dialog__contentsPosition:"_dialog__contentsPosition_b9a66 _reset_cd800",slideDialogContents:"_slideDialogContents_b9a66",dialog__contents:"_dialog__contents_b9a66 _reset_cd800","dialog--wide":"_dialog--wide_b9a66","dialog--jumbo":"_dialog--jumbo_b9a66","dialog--narrow":"_dialog--narrow_b9a66","dialog--success":"_dialog--success_b9a66","dialog--warn":"_dialog--warn_b9a66","dialog--error":"_dialog--error_b9a66",dialog__title:"_dialog__title_b9a66 _reset_cd800",dialog__body:"_dialog__body_b9a66",dialog__actions:"_dialog__actions_b9a66 _reset_cd800",dialog__closeBtn:"_dialog__closeBtn_b9a66 _reset_cd800",dialog__backDrop:"_dialog__backDrop_b9a66 _reset_cd800"}; },{"./../reset.css":"Wuot"}],"nSU1":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=s(require("../identifiers")),t=s(require("./dialog")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var d=(0,e.themr)(r.default.dialog,u.default)(t.default);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./dialog":"h26b","./style.css":"vltw"}],"T5hg":[function(require,module,exports) { @@ -1140,7 +1140,7 @@ var n,t=arguments[3],r=require("buffer").Buffer;(function(){var r,e=200,u="Unsup },{"react":"d6ZO","react-dom":"RklN","classnames":"GGB8"}],"xcqN":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ContextDropDownContents=exports.ContextDropDownHeader=exports.default=exports.DropDownWrapper=exports.StatelessDropDownWrapper=exports.defaultProps=void 0;var e=require("tslib"),t=d(require("react")),r=require("lodash"),s=a(require("classnames")),o=a(require("../enhanceWithClickOutside/index")),n=a(require("./header")),p=a(require("./contents")),i=a(require("prop-types"));function a(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var s={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var p=o?Object.getOwnPropertyDescriptor(e,n):null;p&&(p.get||p.set)?Object.defineProperty(s,n,p):s[n]=e[n]}return s.default=e,r&&r.set(e,s),s}const u={isOpen:!1,style:"default"};exports.defaultProps=u;class c extends t.PureComponent{constructor(){super(...arguments),this.ref=t.default.createRef(),this.getChildContext=(()=>({toggleDropDown:this.handleToggle,closeDropDown:this.handleClose,wrapperRef:this.ref})),this.handleClickOutside=(()=>{this.props.isOpen&&this.handleClose()}),this.handleToggle=(e=>{e&&e.stopPropagation(),this.props.onToggle(e)}),this.handleClose=(e=>{e&&e.stopPropagation(),this.props.onClose(e)})}render(){const o=this.props,{children:n,className:p,theme:i,style:a,padded:l}=o,d=(0,e.__rest)(o,["children","className","theme","style","padded"]),u=(0,r.omit)(d,["isOpen","onToggle","onClose"]),c=a?`dropDown--${a}`:"",f=(0,s.default)({[i[c]]:c,[i["dropDown--padded"]]:l},i.dropDown,p);return t.default.createElement("div",Object.assign({ref:this.ref},u,{className:f}),t.default.Children.map(n,e=>"string"==typeof e.type?e:t.default.createElement(e.type,Object.assign({},e.props,{isDropdownOpen:this.props.isOpen}))))}}c.defaultProps=u,c.childContextTypes={toggleDropDown:i.default.func.isRequired,closeDropDown:i.default.func.isRequired,wrapperRef:i.default.object.isRequired};const f=(0,o.default)(c);exports.StatelessDropDownWrapper=f;class h extends t.PureComponent{constructor(e){super(e),this.handleToggle=(e=>{this.props.onToggle&&this.props.onToggle(e),this.setState({isOpen:!this.state.isOpen})}),this.handleClose=(()=>{this.setState({isOpen:!1})}),this.state={isOpen:e.isOpen}}render(){return t.default.createElement(f,Object.assign({},this.props,{isOpen:this.state.isOpen,onToggle:this.handleToggle,onClose:this.handleClose}))}}exports.DropDownWrapper=h,h.defaultProps=u;var D=h;exports.default=D;class g extends t.PureComponent{render(){const r=this.props,{isDropdownOpen:s}=r,o=(0,e.__rest)(r,["isDropdownOpen"]);return t.default.createElement(n.default,Object.assign({isOpen:s},o,this.context))}}exports.ContextDropDownHeader=g,g.contextTypes={toggleDropDown:i.default.func.isRequired};class w extends t.PureComponent{render(){const r=this.props,{isDropdownOpen:s,wrapperRef:o}=r,n=(0,e.__rest)(r,["isDropdownOpen","wrapperRef"]);return t.default.createElement(p.default,Object.assign({isOpen:s},n,this.context,{wrapperRef:o||this.context.wrapperRef}))}}exports.ContextDropDownContents=w,w.contextTypes={closeDropDown:i.default.func.isRequired,wrapperRef:i.default.object.isRequired}; },{"tslib":"y3QC","react":"d6ZO","lodash":"VDNz","classnames":"GGB8","../enhanceWithClickOutside/index":"NLwD","./header":"jeG8","./contents":"gLfM","prop-types":"IaRT"}],"UF9A":[function(require,module,exports) { -module.exports={dropDown:"_dropDown_ee3ed _reset_da866",dropDown__btn:"_dropDown__btn_ee3ed _reset_da866","dropDown__btn--withChevron":"_dropDown__btn--withChevron_ee3ed",dropDown__btnLabel:"_dropDown__btnLabel_ee3ed _reset_da866",dropDown__chevron:"_dropDown__chevron_ee3ed _reset_da866",dropDown__contents:"_dropDown__contents_ee3ed _reset_da866","dropDown__contents--scrollable":"_dropDown__contents--scrollable_ee3ed","dropDown__contents--isOpen":"_dropDown__contents--isOpen_ee3ed","dropDown--darker":"_dropDown--darker_ee3ed","dropDown__btn--open":"_dropDown__btn--open_ee3ed","dropDown--darkest":"_dropDown--darkest_ee3ed","dropDown--padded":"_dropDown--padded_ee3ed"}; +module.exports={dropDown:"_dropDown_ec9f0 _reset_cd800",dropDown__btn:"_dropDown__btn_ec9f0 _reset_cd800","dropDown__btn--withChevron":"_dropDown__btn--withChevron_ec9f0",dropDown__btnLabel:"_dropDown__btnLabel_ec9f0 _reset_cd800",dropDown__chevron:"_dropDown__chevron_ec9f0 _reset_cd800",dropDown__contents:"_dropDown__contents_ec9f0 _reset_cd800","dropDown__contents--scrollable":"_dropDown__contents--scrollable_ec9f0","dropDown__contents--isOpen":"_dropDown__contents--isOpen_ec9f0","dropDown--darker":"_dropDown--darker_ec9f0","dropDown__btn--open":"_dropDown__btn--open_ec9f0","dropDown--darkest":"_dropDown--darkest_ec9f0","dropDown--padded":"_dropDown--padded_ec9f0"}; },{"./../reset.css":"Wuot"}],"ACRJ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),t=u(require("../identifiers")),r=a(require("./wrapper")),n=u(require("./style.css"));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var f=a?Object.getOwnPropertyDescriptor(e,u):null;f&&(f.get||f.set)?Object.defineProperty(n,u,f):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}function u(e){return e&&e.__esModule?e:{default:e}}const f=(0,e.themr)(t.default.dropDown,n.default)(r.default),d=(0,e.themr)(t.default.dropDown,n.default)(r.StatelessDropDownWrapper),l=(0,e.themr)(t.default.dropDownHeader,n.default)(r.ContextDropDownHeader),p=(0,e.themr)(t.default.dropDownContents,n.default)(r.ContextDropDownContents);f.Header=l,f.Contents=p,f.Stateless=d;var s=f;exports.default=s; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./wrapper":"xcqN","./style.css":"UF9A"}],"pMxI":[function(require,module,exports) { @@ -1150,13 +1150,13 @@ module.exports={dropDown:"_dropDown_ee3ed _reset_da866",dropDown__btn:"_dropDown },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./frame":"pMxI"}],"TlOI":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=void 0;var e=require("tslib"),t=n(require("classnames")),r=s(require("react"));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var s={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if("default"!==c&&Object.prototype.hasOwnProperty.call(e,c)){var u=n?Object.getOwnPropertyDescriptor(e,c):null;u&&(u.get||u.set)?Object.defineProperty(s,c,u):s[c]=e[c]}return s.default=e,r&&r.set(e,s),s}function n(e){return e&&e.__esModule?e:{default:e}}const c={type:"h1"};exports.defaultProps=c;class u extends r.PureComponent{render(){const a=this.props,{type:s,className:n,children:c,theme:u}=a,l=(0,e.__rest)(a,["type","className","children","theme"]),o=(0,t.default)(u.heading,n);switch(s){case"h1":return r.default.createElement("h1",Object.assign({},l,{className:o}),c);case"h2":return r.default.createElement("h2",Object.assign({},l,{className:o}),c);case"h3":return r.default.createElement("h3",Object.assign({},l,{className:o}),c);case"h4":return r.default.createElement("h4",Object.assign({},l,{className:o}),c);case"h5":return r.default.createElement("h5",Object.assign({},l,{className:o}),c);default:return r.default.createElement("h6",Object.assign({},l,{className:o}),c)}}}u.defaultProps=c;var l=u;exports.default=l; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO"}],"Iyji":[function(require,module,exports) { -module.exports={heading:"_heading_4dfaa _reset_da866","heading--h1":"_heading--h1_4dfaa"}; +module.exports={heading:"_heading_29624 _reset_cd800","heading--h1":"_heading--h1_29624"}; },{"./../reset.css":"Wuot"}],"KoLU":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=s(require("../identifiers")),t=s(require("./headline")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var d=(0,e.themr)(r.default.headline,u.default)(t.default);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./headline":"TlOI","./style.css":"Iyji"}],"JiOs":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=void 0;var e=require("tslib"),t=u(require("classnames")),r=o(require("react")),n=u(require("../Button")),a=u(require("../Icon"));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=a?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function u(e){return e&&e.__esModule?e:{default:e}}const i={hoverStyle:"brand",size:"regular",style:"transparent"};exports.defaultProps=i;class l extends r.PureComponent{render(){const s=this.props,{className:o,theme:u,icon:i,size:l,disabled:c}=s,d=(0,e.__rest)(s,["className","theme","icon","size","disabled"]),f=(0,t.default)(o,u.iconButton,u[`size-${l}`],{[u["iconButton--disabled"]]:c});return r.default.createElement(n.default,Object.assign({},d,{size:l,className:f,disabled:c}),r.default.createElement(a.default,{icon:i}))}}l.defaultProps=i;var c=l;exports.default=c; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO","../Button":"rl1D","../Icon":"i1Sb"}],"m26Y":[function(require,module,exports) { -module.exports={iconButton:"_iconButton_7f752 _reset_da866","iconButton--disabled":"_iconButton--disabled_7f752","size-small":"_size-small_7f752"}; +module.exports={iconButton:"_iconButton_29f29 _reset_cd800","iconButton--disabled":"_iconButton--disabled_29f29","size-small":"_size-small_29f29"}; },{"./../reset.css":"Wuot"}],"yn5u":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),t=s(require("../identifiers")),r=s(require("./iconButton")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var i=(0,e.themr)(t.default.iconButton,u.default)(r.default);exports.default=i; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./iconButton":"JiOs","./style.css":"m26Y"}],"EgmE":[function(require,module,exports) { @@ -1164,19 +1164,19 @@ module.exports={iconButton:"_iconButton_7f752 _reset_da866","iconButton--disable },{"tslib":"y3QC","react":"d6ZO"}],"gOMV":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=void 0;var e=require("tslib"),t=l(require("classnames")),o=a(require("react")),r=l(require("../Button")),s=l(require("../Icon")),i=l(require("./dropDownItem"));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(n=function(e){return e?o:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=n(t);if(o&&o.has(e))return o.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,o&&o.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}const u={directButtonProps:{children:void 0,size:"regular"},disabled:!1,modeIcon:"long-arrow-right"};exports.defaultProps=u;const c={isOpen:!1};class d extends o.PureComponent{constructor(e){super(e),this.createHoldTimeout=(()=>{this.cancelHoldTimeout(),this._timeouts.hold=window.setTimeout(()=>this.openDropDown(),200)}),this.cancelHoldTimeout=(()=>{window.clearTimeout(this._timeouts.hold)}),this.createHoverTimeout=(()=>{this.cancelHoverTimeout(),this._timeouts.hover=window.setTimeout(()=>this.openDropDown(),700)}),this.cancelHoverTimeout=(()=>{window.clearTimeout(this._timeouts.hover)}),this.handleHoverTimeout=(()=>this.createHoverTimeout()),this.handleHoldTimeout=(()=>this.createHoldTimeout()),this.handleClick=(()=>{const{isOpen:e}=this.state;this.cancelHoldTimeout(),this.cancelHoverTimeout(),e||this.props.onClick()}),this.handleMouseLeave=(()=>{this.cancelHoldTimeout(),this.cancelHoverTimeout(),this.closeDropDown()}),this.createItemSelectedHandler=(e=>()=>{this.props.onItemSelect(e),this.closeDropDown()}),this.openDropDown=(()=>{this.setState({isOpen:!0})}),this.closeDropDown=(()=>{this.setState({isOpen:!1})}),this.state=c,this._timeouts={hold:void 0,hover:void 0}}render(){const{className:n,disabled:a,icon:l,modeIcon:u,theme:c,directButtonProps:d,children:p}=this.props,{isOpen:h}=this.state,m=(0,t.default)(n,c.wrapper),f=(0,t.default)(c.wrapper__dropDown,{[c["wrapper__dropDown--isOpen"]]:h}),{size:w}=d,v=(0,e.__rest)(d,["size"]);return o.default.createElement("div",{className:m,onMouseLeave:this.handleMouseLeave},o.default.createElement(r.default,Object.assign({},v,{style:"clean",hoverStyle:"clean","aria-haspopup":"true",className:c.wrapper__btn,disabled:a,onMouseDown:this.handleHoldTimeout,onMouseEnter:this.handleHoverTimeout,onFocus:this.handleHoverTimeout,onClick:this.handleClick,size:w}),o.default.createElement(s.default,{icon:u,className:c.wrapper__btnModeIcon}),o.default.createElement(s.default,{icon:l,className:c.wrapper__btnIcon})),o.default.createElement("div",{className:f,"aria-hidden":h?"false":"true"},p.map((e,t)=>o.default.createElement(i.default,{key:t,className:c.wrapper__dropDownItem,onClick:this.createItemSelectedHandler(e.props.dropDownId),id:e.props.dropDownId},e))))}}exports.default=d,d.defaultProps=u; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO","../Button":"rl1D","../Icon":"i1Sb","./dropDownItem":"EgmE"}],"IXJ1":[function(require,module,exports) { -module.exports={wrapper:"_wrapper_90478 _reset_da866",wrapper__btn:"_wrapper__btn_90478 _reset_da866",wrapper__btnModeIcon:"_wrapper__btnModeIcon_90478 _reset_da866",wrapper__btnIcon:"_wrapper__btnIcon_90478",wrapper__dropDown:"_wrapper__dropDown_90478 _reset_da866","wrapper__dropDown--isOpen":"_wrapper__dropDown--isOpen_90478",wrapper__dropDownItem:"_wrapper__dropDownItem_90478 _reset_da866"}; +module.exports={wrapper:"_wrapper_db5fa _reset_cd800",wrapper__btn:"_wrapper__btn_db5fa _reset_cd800",wrapper__btnModeIcon:"_wrapper__btnModeIcon_db5fa _reset_cd800",wrapper__btnIcon:"_wrapper__btnIcon_db5fa",wrapper__dropDown:"_wrapper__dropDown_db5fa _reset_cd800","wrapper__dropDown--isOpen":"_wrapper__dropDown--isOpen_db5fa",wrapper__dropDownItem:"_wrapper__dropDownItem_db5fa _reset_cd800"}; },{"./../reset.css":"Wuot"}],"v9oy":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=o(require("../identifiers")),t=o(require("./iconButtonDropDown")),u=o(require("./style.css"));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,e.themr)(r.default.iconButtonDropDown,u.default)(t.default);exports.default=s; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./iconButtonDropDown":"gOMV","./style.css":"IXJ1"}],"pwV6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=l(require("classnames")),r=l(require("react"));function l(e){return e&&e.__esModule?e:{default:e}}const a=l=>{var{children:a,className:s,htmlFor:u,theme:c}=l,o=(0,e.__rest)(l,["children","className","htmlFor","theme"]);const n=(0,t.default)(c.label,s);return r.default.createElement("label",Object.assign({},o,{htmlFor:u,className:n}),a)};var s=a;exports.default=s; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO"}],"iKe3":[function(require,module,exports) { -module.exports={label:"_label_585df _reset_da866"}; +module.exports={label:"_label_3d57b _reset_cd800"}; },{"./../reset.css":"Wuot"}],"ytFO":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=s(require("../identifiers")),t=s(require("./label")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var l=(0,e.themr)(r.default.label,u.default)(t.default);exports.default=l; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./label":"pwV6","./style.css":"iKe3"}],"k6JT":[function(require,module,exports) { module.exports="logo.ab70d12a.svg"; },{}],"RWwo":[function(require,module,exports) { -module.exports={logo:"_logo_d1810"}; +module.exports={logo:"_logo_e7616"}; },{}],"Z1zC":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),t=n(require("./logo.svg")),r=n(require("./style.css"));function n(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(n,a,l):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}class a extends e.PureComponent{render(){return e.default.createElement("div",null,e.default.createElement("img",{className:r.default.logo,src:t.default,alt:"Neos"}))}}exports.default=a; },{"react":"d6ZO","./logo.svg":"k6JT","./style.css":"RWwo"}],"fHN2":[function(require,module,exports) { @@ -1208,7 +1208,7 @@ Array.from||(Array.from=function(){var r=Object.prototype.toString,n=function(n) },{"./class_decorator":"KjWo","./method_decorator":"zSxT","./method_decorator_scoped":"BTCU"}],"xWOE":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"keydownScoped",{enumerable:!0,get:function(){return e.keydownScoped}}),Object.defineProperty(exports,"setBinding",{enumerable:!0,get:function(){return r.setBinding}}),Object.defineProperty(exports,"Keys",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"ALL_KEYS",{enumerable:!0,get:function(){return t.ALL_KEYS}}),Object.defineProperty(exports,"ALL_PRINTABLE_KEYS",{enumerable:!0,get:function(){return t.ALL_PRINTABLE_KEYS}}),require("./lib/array.from");var e=o(require("./decorators")),r=require("./store"),t=o(require("./lib/keys"));function n(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(n=function(e){return e?t:r})(e)}function o(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n(r);if(t&&t.has(e))return t.get(e);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var f=u?Object.getOwnPropertyDescriptor(e,i):null;f&&(f.get||f.set)?Object.defineProperty(o,i,f):o[i]=e[i]}return o.default=e,t&&t.set(e,o),o} },{"./lib/array.from":"fHN2","./decorators":"Jyyr","./store":"VdWG","./lib/keys":"KY2K"}],"xnNW":[function(require,module,exports) { -module.exports={selectBox__list:"_selectBox__list_2cd1c",selectBox:"_selectBox_2cd1c undefined undefined undefined _dropDown_ee3ed _reset_da866",selectBox__btn:"_selectBox__btn_2cd1c undefined undefined undefined _dropDown__btn_ee3ed _reset_da866","selectBox__btn--noRightPadding":"_selectBox__btn--noRightPadding_2cd1c",selectBox__contents:"_selectBox__contents_2cd1c",selectBox__item:"_selectBox__item_2cd1c",selectBox__groupHeader:"_selectBox__groupHeader_2cd1c","selectBox--disabled":"_selectBox--disabled_2cd1c"}; +module.exports={selectBox__list:"_selectBox__list_28309",selectBox:"_selectBox_28309 undefined undefined undefined _dropDown_ec9f0 _reset_cd800",selectBox__btn:"_selectBox__btn_28309 undefined undefined undefined _dropDown__btn_ec9f0 _reset_cd800","selectBox__btn--noRightPadding":"_selectBox__btn--noRightPadding_28309",selectBox__contents:"_selectBox__contents_28309",selectBox__item:"_selectBox__item_28309",selectBox__groupHeader:"_selectBox__groupHeader_28309","selectBox--disabled":"_selectBox--disabled_28309"}; },{"./../DropDown/style.css":"UF9A"}],"AHeG":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.keys=void 0;var e=require("react-keydown");const{ENTER:r,UP:s,DOWN:t,ESC:o}=e.Keys,y=[r,s,t,o];exports.keys=y; },{"react-keydown":"xWOE"}],"DgmR":[function(require,module,exports) { @@ -1216,7 +1216,7 @@ var define; var global = arguments[3]; var n,t=arguments[3];!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof n&&n.amd?n(["exports"],r):r(t.plow=t.plow||{})}(this,function(n){"use strict";var t=function(n){return function(t){return n.every(function(n){return n(t)})}},r=function(n){return function(){for(var t=arguments.length,r=Array(t),e=0;e{};return e.default.createElement("div",{onMouseEnter:n?f:u,onClick:n?f:s,className:c,role:"button"},Boolean(t)&&e.default.createElement("div",{className:o.listPreviewElement__iconWrapper},e.default.createElement(d,{className:o.listPreviewElement__icon,icon:t})),l)}}s.propTypes={icon:t.default.string,className:t.default.string,disabled:t.default.bool,children:t.default.node.isRequired,onClick:t.default.func,isHighlighted:t.default.bool,onMouseEnter:t.default.func,theme:t.default.shape({listPreviewElement:t.default.string.isRequired,"listPreviewElement--isHighlighted":t.default.string.isRequired,"listPreviewElement--isDisabled":t.default.string.isRequired,listPreviewElement__icon:t.default.string.isRequired}).isRequired,Icon:t.default.any.isRequired};var a=s;exports.default=a; },{"react":"d6ZO","prop-types":"IaRT","classnames":"GGB8"}],"mMvf":[function(require,module,exports) { @@ -1234,7 +1234,7 @@ var t=arguments[3],e=200,r="__lodash_hash_undefined__",n=1,o=2,i=900719925474099 },{}],"M1yf":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("react")),t=r(require("prop-types")),s=require("plow-js"),a=r(require("../SelectBox_Option_SingleLine")),o=r(require("classnames")),n=r(require("lodash.isequal"));function r(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(l=function(e){return e?s:t})(e)}function i(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var s=l(t);if(s&&s.has(e))return s.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var r=o?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}return a.default=e,s&&s.set(e,a),a}class d extends e.PureComponent{constructor(){super(...arguments),this.state={searchTerm:"",isExpanded:!1,focusedValue:""},this.handleChange=(e=>{const t=this.getOptionValueAccessor();this.props.onValueChange(t(e)),this.setState({searchTerm:""})}),this.handleDeleteClick=(e=>{e&&e.stopPropagation(),this.props.onValueChange("")}),this.handleToggleExpanded=(()=>{if(this.props.disabled)return;let e;e=this.props.displaySearchBox?!!this.props.value||(!this.props.showDropDownToggle||!this.state.isExpanded):!this.state.isExpanded,this.setState({isExpanded:e})}),this.handleClose=(()=>{this.setState({isExpanded:!1})}),this.handleOptionFocusChange=(e=>{const t=this.getOptionValueAccessor();this.setState({focusedValue:t(e)})}),this.handleSearchTermChange=(e=>{e.length>=this.props.threshold?this.props.onSearchTermChange(e):this.props.onSearchTermChange(""),this.setState({isExpanded:Boolean(e),searchTerm:e}),this.props.onSearchTermChange(e)}),this.handleKeyDown=(e=>{const{options:t,onSearchTermKeyPress:s}=this.props;if("function"==typeof s&&s(e),this.state.isExpanded&&e&&["ArrowDown","ArrowUp","Enter","Escape"].includes(e.key)){e.preventDefault();const s=this.getOptionValueAccessor(),a=t.findIndex(e=>s(e)===this.state.focusedValue);if("ArrowDown"===e.key){const e=a+1>=t.length?a:a+1;this.setState({focusedValue:s(t[e])})}else if("ArrowUp"===e.key){const e=a-1<0?0:a-1;this.setState({focusedValue:s(t[e])})}else"Enter"===e.key?(a=0&&this.handleChange(t[a]),this.setState({isExpanded:!1})):"Escape"===e.key&&this.setState({focusedValue:"",isExpanded:!1})}})}getOptionValueAccessor(){return(0,s.$get)([this.props.optionValueField])}getSearchTerm(){return this.props.searchTerm||this.state.searchTerm}render(){const{options:t,theme:s,showDropDownToggle:a,threshold:n,displaySearchBox:r,displayLoadingIndicator:l,ListPreviewElement:i,plainInputMode:d,disabled:u,className:h,DropDown:p,SelectBox_ListPreview:c}=this.props,f=this.getSearchTerm(),{focusedValue:g}=this.state,m=!u&&this.state.isExpanded,y=(0,o.default)({[h]:!0,[s.selectBox__btn]:!0,[s["selectBox__btn--noRightPadding"]]:!a,[s["selectBox--disabled"]]:u}),w=this.getOptionValueAccessor(),b=r?n-f.length:0,S=!(b>0||l)&&!t.length;return e.default.createElement(p.Stateless,{className:s.selectBox,isOpen:m,onToggle:this.handleToggleExpanded,onClose:this.handleClose},e.default.createElement(p.Header,{className:y,shouldKeepFocusState:!1,showDropDownToggle:a&&Boolean(t.length)},this.renderHeader()),e.default.createElement(p.Contents,{className:s.selectBox__contents,scrollable:!0},!d&&e.default.createElement("ul",{className:s.selectBox__list},e.default.createElement(c,Object.assign({},this.props,{theme:s,optionValueAccessor:w,ListPreviewElement:i,focusedValue:g,onChange:this.handleChange,onOptionFocus:this.handleOptionFocusChange,searchTermLeftToType:b,noMatchesFound:S,searchTerm:f})))))}renderHeader(){const{displaySearchBox:t,displayLoadingIndicator:s,options:a,value:o,allowEmpty:r,plainInputMode:l,disabled:i,SelectBox_HeaderWithSearchInput:d,SelectBox_Header:u}=this.props,h=this.getSearchTerm(),p=this.getOptionValueAccessor(),c=a.find(e=>p(e)==o||(0,n.default)(p(e),o));if(t&&(!o||this.state.isExpanded||l))return e.default.createElement(d,Object.assign({},this.props,{disabled:i,onSearchTermChange:this.handleSearchTermChange,searchTerm:h,onKeyDown:this.handleKeyDown}));const f=Boolean(r&&!s&&o);return e.default.createElement(u,Object.assign({},this.props,{option:c,showResetButton:f,onReset:this.handleDeleteClick}))}UNSAFE_componentWillReceiveProps({keydown:e}){this.handleKeyDown(e.event)}}exports.default=d,d.defaultProps={options:[],optionValueField:"value",withoutGroupLabel:"Without group",scrollable:!0,showDropDownToggle:!0,threshold:2,ListPreviewElement:a.default},d.propTypes={options:t.default.arrayOf(t.default.shape({icon:t.default.string,label:t.default.oneOfType([t.default.string,t.default.object]).isRequired,disabled:t.default.bool})),className:t.default.string,optionValueField:t.default.string,value:t.default.any,onValueChange:t.default.func.isRequired,placeholder:t.default.string,placeholderIcon:t.default.string,withoutGroupLabel:t.default.string,allowEmpty:t.default.bool,showDropDownToggle:t.default.bool,scrollable:t.default.bool,ListPreviewElement:t.default.any,loadingLabel:t.default.string,displayLoadingIndicator:t.default.bool,displaySearchBox:t.default.bool,onSearchTermChange:t.default.func,onSearchTermKeyPress:t.default.func,threshold:t.default.number,searchTerm:t.default.string,searchBoxLeftToTypeLabel:t.default.string,noMatchesFoundLabel:t.default.string,plainInputMode:t.default.bool,setFocus:t.default.bool,onCreateNew:t.default.func,createNewLabel:t.default.string,theme:t.default.shape({"selectBox__btn--noRightPadding":t.default.string}).isRequired,DropDown:t.default.any.isRequired,SelectBox_Header:t.default.any.isRequired,SelectBox_HeaderWithSearchInput:t.default.any.isRequired,SelectBox_ListPreview:t.default.any.isRequired}; },{"react":"d6ZO","prop-types":"IaRT","plow-js":"DgmR","../SelectBox_Option_SingleLine":"g7rK","classnames":"GGB8","lodash.isequal":"Z1Lj"}],"dRcK":[function(require,module,exports) { -module.exports={selectBoxHeader:"_selectBoxHeader_f8389",selectBoxHeader__innerPreview:"_selectBoxHeader__innerPreview_f8389",selectBoxHeader__icon:"_selectBoxHeader__icon_f8389 _reset_da866",selectBoxHeader__label:"_selectBoxHeader__label_f8389",selectBoxHeader__wrapperIconWrapper:"_selectBoxHeader__wrapperIconWrapper_f8389",selectBoxHeader__wrapperPlaceholderIconWrapper:"_selectBoxHeader__wrapperPlaceholderIconWrapper_f8389","selectBoxHeader--disabled":"_selectBoxHeader--disabled_f8389"}; +module.exports={selectBoxHeader:"_selectBoxHeader_610bb",selectBoxHeader__innerPreview:"_selectBoxHeader__innerPreview_610bb",selectBoxHeader__icon:"_selectBoxHeader__icon_610bb _reset_cd800",selectBoxHeader__label:"_selectBoxHeader__label_610bb",selectBoxHeader__wrapperIconWrapper:"_selectBoxHeader__wrapperIconWrapper_610bb",selectBoxHeader__wrapperPlaceholderIconWrapper:"_selectBoxHeader__wrapperPlaceholderIconWrapper_610bb","selectBoxHeader--disabled":"_selectBoxHeader--disabled_610bb"}; },{"./../reset.css":"Wuot"}],"ADgd":[function(require,module,exports) { var global = arguments[3]; var t=arguments[3],r=200,n="__lodash_hash_undefined__",e=1/0,o=9007199254740991,u="[object Arguments]",i="[object Function]",a="[object GeneratorFunction]",c="[object Symbol]",f=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,h="object"==typeof t&&t&&t.Object===Object&&t,p="object"==typeof self&&self&&self.Object===Object&&self,_=h||p||Function("return this")();function v(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}function y(t,r){return!!(t?t.length:0)&&O(t,r,0)>-1}function g(t,r,n){for(var e=-1,o=t?t.length:0;++e-1}function ot(t,r){var n=this.__data__,e=vt(n,t);return e<0?n.push([t,r]):n[e][1]=r,this}function ut(t){var r=-1,n=t?t.length:0;for(this.clear();++r=r&&(i=A,a=!1,n=new st(n));t:for(;++u0&&n(a)?r>1?gt(a,r-1,n,e,o):b(o,a):e||(o[o.length]=a)}return o}function dt(t,r,n){var e=r(t);return zt(t)?e:b(e,n(t))}function bt(t){return!(!Kt(t)||Ct(t))&&(Ht(t)||P(t)?T:l).test(Gt(t))}function jt(t){if(!Kt(t))return Mt(t);var r=It(t),n=[];for(var e in t)("constructor"!=e||!r&&R.call(t,e))&&n.push(e);return n}function Ot(t,r){return mt(t=Object(t),r,function(r,n){return n in t})}function mt(t,r,n){for(var e=-1,o=r.length,u={};++e-1&&t%1==0&&t-1&&t%1==0&&t<=o}function Kt(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function Lt(t){return!!t&&"object"==typeof t}function Nt(t){return"symbol"==typeof t||Lt(t)&&G.call(t)==c}function Qt(t){return Bt(t)?_t(t,!0):jt(t)}var Ut=wt(function(t,r){return null==t?{}:(r=d(gt(r,1),Rt),Ot(t,yt(St(t),r)))});function Vt(){return[]}module.exports=Ut; @@ -1243,13 +1243,13 @@ var t=arguments[3],r=200,n="__lodash_hash_undefined__",e=1/0,o=9007199254740991, },{"react":"d6ZO","prop-types":"IaRT","lodash.omit":"ADgd"}],"YwDh":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=i(require("../identifiers")),t=i(require("./style.css")),u=i(require("./selectBox_Header")),o=i(require("./../_lib/injectProps")),s=i(require("./../Icon")),d=i(require("./../IconButton"));function i(e){return e&&e.__esModule?e:{default:e}}const a=(0,e.themr)(r.default.selectBox_Header,t.default)(u.default);var l=(0,o.default)({Icon:s.default,IconButton:d.default})(a);exports.default=l; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./style.css":"dRcK","./selectBox_Header":"eXEi","./../_lib/injectProps":"mMvf","./../Icon":"i1Sb","./../IconButton":"yn5u"}],"XOT9":[function(require,module,exports) { -module.exports={selectBoxHeaderWithSearchInput:"_selectBoxHeaderWithSearchInput_e9cda",selectBoxHeaderWithSearchInput__inputContainer:"_selectBoxHeaderWithSearchInput__inputContainer_e9cda",selectBoxHeaderWithSearchInput__input:"_selectBoxHeaderWithSearchInput__input_e9cda",selectBoxHeaderWithSearchInput__icon:"_selectBoxHeaderWithSearchInput__icon_e9cda _reset_da866"}; +module.exports={selectBoxHeaderWithSearchInput:"_selectBoxHeaderWithSearchInput_e6e9a",selectBoxHeaderWithSearchInput__inputContainer:"_selectBoxHeaderWithSearchInput__inputContainer_e6e9a",selectBoxHeaderWithSearchInput__input:"_selectBoxHeaderWithSearchInput__input_e6e9a",selectBoxHeaderWithSearchInput__icon:"_selectBoxHeaderWithSearchInput__icon_e6e9a _reset_cd800"}; },{"./../reset.css":"Wuot"}],"HjPu":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("react")),t=r(require("prop-types"));function r(e){return e&&e.__esModule?e:{default:e}}function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function n(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if("default"!==c&&Object.prototype.hasOwnProperty.call(e,c)){var i=o?Object.getOwnPropertyDescriptor(e,c):null;i&&(i.get||i.set)?Object.defineProperty(n,c,i):n[c]=e[c]}return n.default=e,r&&r.set(e,n),n}class o extends e.PureComponent{constructor(){super(...arguments),this.clearSearch=(e=>{e.stopPropagation(),this.props.onSearchTermChange("")})}render(){const{searchTerm:t,onSearchTermChange:r,onKeyDown:a,placeholder:n,placeholderIcon:o,displayLoadingIndicator:c,setFocus:i,theme:u,Icon:l,TextInput:s,IconButton:d,disabled:p}=this.props;return e.default.createElement("div",{className:u.selectBoxHeaderWithSearchInput},e.default.createElement(l,{icon:o,className:u.selectBoxHeaderWithSearchInput__icon}),e.default.createElement(s,{containerClassName:u.selectBoxHeaderWithSearchInput__inputContainer,className:u.selectBoxHeaderWithSearchInput__input,value:t,onChange:r,onKeyDown:a,placeholder:n,setFocus:i,type:"search",disabled:p}),c&&e.default.createElement(l,{className:u.selectBoxHeaderWithSearchInput__icon,spin:!0,icon:"spinner"}),t&&e.default.createElement(d,{className:u.selectBoxHeaderWithSearchInput__icon,icon:"times",onClick:this.clearSearch}))}}o.propTypes={placeholder:t.default.string,placeholderIcon:t.default.string,displayLoadingIndicator:t.default.bool,searchTerm:t.default.string.isRequired,onSearchTermChange:t.default.func.isRequired,setFocus:t.default.bool,disabled:t.default.bool,onKeyDown:t.default.func,theme:t.default.shape({selectBoxHeaderWithSearchInput:t.default.string.isRequired,selectBoxHeaderWithSearchInput__inputContainer:t.default.string.isRequired,selectBoxHeaderWithSearchInput__icon:t.default.string.isRequired,selectBoxHeaderWithSearchInput__input:t.default.string.isRequired}).isRequired,Icon:t.default.any.isRequired,TextInput:t.default.any.isRequired,IconButton:t.default.any.isRequired},o.defaultProps={placeholder:"",placeholderIcon:"search"};var c=o;exports.default=c; },{"react":"d6ZO","prop-types":"IaRT"}],"Z2l3":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=o(require("react")),r=a(require("classnames")),s=require("lodash");function a(e){return e&&e.__esModule?e:{default:e}}function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(s,o,i):s[o]=e[o]}return s.default=e,r&&r.set(e,s),s}class i extends t.PureComponent{constructor(e){super(e),this.componentDidMount=(()=>{this.ref&&this.ref.current&&(this.props.setFocus||this.props.autoFocus)&&this.ref.current.focus()}),this.handleKeyPress=(e=>{const t=e.keyCode||e.which,{onEnterKey:r}=this.props;13===t&&"function"==typeof r&&r()}),this.handleValueChange=(e=>{const{onChange:t}=this.props;t&&t(e.target.value)}),this.ref=t.default.createRef()}render(){const a=this.props,{placeholder:n,className:o,theme:i,containerClassName:l,disabled:u,type:c}=a,p=(0,e.__rest)(a,["placeholder","className","theme","containerClassName","disabled","type"]),d=(0,s.omit)(p,["onEnterKey","setFocus"]),f=(0,r.default)(i.textInput,o,{[i["textInput--disabled"]]:u});return t.default.createElement("div",{className:l},t.default.createElement("input",Object.assign({},d,{className:f,role:"textbox","aria-multiline":"false","aria-disabled":u?"true":"false",type:c,placeholder:n,disabled:u,onChange:this.handleValueChange,onKeyPress:this.handleKeyPress,ref:this.ref})))}}var l=i;exports.default=l; },{"tslib":"y3QC","react":"d6ZO","classnames":"GGB8","lodash":"VDNz"}],"Ioom":[function(require,module,exports) { -module.exports={textInput:"_textInput_0dcba _reset_da866","textInput--disabled":"_textInput--disabled_0dcba"}; +module.exports={textInput:"_textInput_d2a64 _reset_cd800","textInput--disabled":"_textInput--disabled_d2a64"}; },{"./../reset.css":"Wuot"}],"FEXc":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),t=s(require("../identifiers")),r=s(require("./textInput")),u=s(require("./style.css"));function s(e){return e&&e.__esModule?e:{default:e}}var d=(0,e.themr)(t.default.textInput,u.default)(r.default);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./textInput":"Z2l3","./style.css":"Ioom"}],"eMe1":[function(require,module,exports) { @@ -1275,11 +1275,11 @@ module.exports={textInput:"_textInput_0dcba _reset_da866","textInput--disabled": },{"@friendsofreactjs/react-css-themr":"sXs8","react-keydown":"xWOE","../identifiers":"hmBe","./style.css":"xnNW","./config":"AHeG","./selectBox":"M1yf","./../_lib/injectProps":"mMvf","./../DropDown":"ACRJ","./../SelectBox_Header":"YwDh","./../SelectBox_HeaderWithSearchInput":"eMe1","./../SelectBox_ListPreview":"RXuT"}],"UvnW":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=s(require("classnames")),r=a(require("react"));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var a={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(a,i,o):a[i]=e[i]}return a.default=e,r&&r.set(e,a),a}function s(e){return e&&e.__esModule?e:{default:e}}class i extends r.PureComponent{render(){const n=this.props,{position:a,className:s,children:i,theme:o}=n,u=(0,e.__rest)(n,["position","className","children","theme"]),l=(0,t.default)(s,o.sideBar,{[o["sideBar--left"]]:"left"===a,[o["sideBar--right"]]:"right"===a});return r.default.createElement("div",Object.assign({},u,{className:l}),i)}}var o=i;exports.default=o; },{"tslib":"y3QC","classnames":"GGB8","react":"d6ZO"}],"CG5B":[function(require,module,exports) { -module.exports={sideBar:"_sideBar_548f4 _reset_da866","sideBar--left":"_sideBar--left_548f4","sideBar--right":"_sideBar--right_548f4"}; +module.exports={sideBar:"_sideBar_de190 _reset_cd800","sideBar--left":"_sideBar--left_de190","sideBar--right":"_sideBar--right_de190"}; },{"./../reset.css":"Wuot"}],"txhL":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=u(require("../identifiers")),t=u(require("./sideBar")),s=u(require("./style.css"));function u(e){return e&&e.__esModule?e:{default:e}}var d=(0,e.themr)(r.default.sideBar,s.default)(t.default);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./sideBar":"UvnW","./style.css":"CG5B"}],"ph4q":[function(require,module,exports) { -module.exports={tabs:"_tabs_8bfec _reset_da866",tabs__content:"_tabs__content_8bfec _reset_da866",tabNavigation:"_tabNavigation_8bfec _reset_da866",tabNavigation__item:"_tabNavigation__item_8bfec _reset_da866","tabNavigation__item--isActive":"_tabNavigation__item--isActive_8bfec",tabNavigation__itemBtn:"_tabNavigation__itemBtn_8bfec _reset_da866",tabNavigation__itemBtnIcon:"_tabNavigation__itemBtnIcon_8bfec","tabNavigation__itemBtnIcon--hasLabel":"_tabNavigation__itemBtnIcon--hasLabel_8bfec",panel:"_panel_8bfec _reset_da866"}; +module.exports={tabs:"_tabs_21fdc _reset_cd800",tabs__content:"_tabs__content_21fdc _reset_cd800",tabNavigation:"_tabNavigation_21fdc _reset_cd800",tabNavigation__item:"_tabNavigation__item_21fdc _reset_cd800","tabNavigation__item--isActive":"_tabNavigation__item--isActive_21fdc",tabNavigation__itemBtn:"_tabNavigation__itemBtn_21fdc _reset_cd800",tabNavigation__itemBtnIcon:"_tabNavigation__itemBtnIcon_21fdc","tabNavigation__itemBtnIcon--hasLabel":"_tabNavigation__itemBtnIcon--hasLabel_21fdc",panel:"_panel_21fdc _reset_cd800"}; },{"./../reset.css":"Wuot"}],"RrFO":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("react"));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}function r(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=o?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(a,u,l):a[u]=e[u]}return a.default=e,n&&n.set(e,a),a}class n extends e.PureComponent{render(){const{theme:t,children:r}=this.props;return e.default.createElement("div",{className:t.panel},r)}}exports.default=n,n.displayName="Panel"; },{"react":"d6ZO"}],"A2PY":[function(require,module,exports) { @@ -1289,7 +1289,7 @@ module.exports={tabs:"_tabs_8bfec _reset_da866",tabs__content:"_tabs__content_8b },{"react":"d6ZO","classnames":"GGB8","./panel.index":"A2PY","../Icon":"i1Sb"}],"QMqR":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=u(require("../identifiers")),t=u(require("./style.css")),s=u(require("./tabs"));function u(e){return e&&e.__esModule?e:{default:e}}var a=(0,e.themr)(r.default.tabs,t.default)(s.default);exports.default=a; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./style.css":"ph4q","./tabs":"xrwS"}],"sBZU":[function(require,module,exports) { -module.exports={textArea:"_textArea_e32fe _reset_da866","textArea--invalid":"_textArea--invalid_e32fe","textArea--highlight":"_textArea--highlight_e32fe","textArea--disabled":"_textArea--disabled_e32fe"}; +module.exports={textArea:"_textArea_14296 _reset_cd800","textArea--invalid":"_textArea--invalid_14296","textArea--highlight":"_textArea--highlight_14296","textArea--disabled":"_textArea--disabled_14296"}; },{"./../reset.css":"Wuot"}],"xP7t":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("react")),t=n(require("prop-types"));function n(e){return e&&e.__esModule?e:{default:e}}function o(){return(o=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var a="undefined"!=typeof window&&"undefined"!=typeof document,s=!!a&&!!document.documentElement.currentStyle,u=a&&document.createElement("textarea"),h={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},d=["letter-spacing","line-height","font-family","font-weight","font-size","font-style","tab-size","text-rendering","text-transform","width","text-indent","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","box-sizing"],l={};function p(e,t,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=null),void 0===i&&(i=null),null===u.parentNode&&document.body.appendChild(u);var r=c(e,t,n);if(null===r)return null;var a=r.paddingSize,s=r.borderSize,d=r.boxSizing,l=r.sizingStyle;Object.keys(l).forEach(function(e){u.style[e]=l[e]}),Object.keys(h).forEach(function(e){u.style.setProperty(e,h[e],"important")}),u.value=e.value||e.placeholder||"x";var p=-1/0,f=1/0,g=u.scrollHeight;"border-box"===d?g+=s:"content-box"===d&&(g-=a),u.value="x";var m=u.scrollHeight-a;return null===o&&null===i||(null!==o&&(p=m*o,"border-box"===d&&(p=p+a+s),g=Math.max(p,g)),null!==i&&(f=m*i,"border-box"===d&&(f=f+a+s),g=Math.min(f,g))),{height:g,minHeight:p,maxHeight:f,rowCount:Math.floor(g/m)}}function c(e,t,n){if(void 0===n&&(n=!1),n&&l[t])return l[t];var o=window.getComputedStyle(e);if(null===o)return null;var i=d.reduce(function(e,t){return e[t]=o.getPropertyValue(t),e},{}),r=i["box-sizing"];s&&"border-box"===r&&(i.width=parseFloat(i.width)+parseFloat(o["border-right-width"])+parseFloat(o["border-left-width"])+parseFloat(o["padding-right"])+parseFloat(o["padding-left"])+"px");var a={sizingStyle:i,paddingSize:parseFloat(i["padding-bottom"])+parseFloat(i["padding-top"]),borderSize:parseFloat(i["border-bottom-width"])+parseFloat(i["border-top-width"]),boxSizing:r};return n&&(l[t]=a),a}var f=function(e){return delete l[e]};function g(e){return void 0===e&&(e=0),function(){return++e}}var m=g(),b=function(){},v=a&&window.requestAnimationFrame?[window.requestAnimationFrame,window.cancelAnimationFrame]:[setTimeout,clearTimeout],w=v[0],x=v[1],y=function(t){function n(e){var n;return(n=t.call(this,e)||this)._resizeLock=!1,n._onRootDOMNode=function(e){n._rootDOMNode=e,n.props.inputRef&&n.props.inputRef(e)},n._onChange=function(e){n._controlled||n._resizeComponent(),n.props.onChange(e)},n._resizeComponent=function(e){if(void 0===e&&(e=b),void 0!==n._rootDOMNode){var t=p(n._rootDOMNode,n._uid,n.props.useCacheForDOMMeasurements,n.props.minRows,n.props.maxRows);if(null!==t){var o=t.height,i=t.minHeight,r=t.maxHeight,a=t.rowCount;n.rowCount=a,n.state.height===o&&n.state.minHeight===i&&n.state.maxHeight===r?e():n.setState({height:o,minHeight:i,maxHeight:r},e)}else e()}else e()},n.state={height:e.style&&e.style.height||0,minHeight:-1/0,maxHeight:1/0},n._uid=m(),n._controlled="string"==typeof e.value,n}i(n,t);var a=n.prototype;return a.render=function(){var t=this.props,n=(t.minRows,t.maxRows,t.onHeightChange,t.useCacheForDOMMeasurements,t.inputRef,r(t,["minRows","maxRows","onHeightChange","useCacheForDOMMeasurements","inputRef"]));return n.style=o({},n.style,{height:this.state.height}),Math.max(n.style.maxHeight||1/0,this.state.maxHeight){this.setState({isOpen:!this.state.isOpen})})}UNSAFE_componentWillReceiveProps(e){const{isOpen:n}=e,t=Boolean(e.onPanelToggle);n===this.state.isOpen||t||this.setState({isOpen:n})}render(){const e=Boolean(this.props.onPanelToggle),t=e?this.props.onPanelToggle:this.toggle,l=e?this.props.isOpen:this.state.isOpen;return n.default.createElement(p,Object.assign({},this.props,{isOpen:l,onPanelToggle:t}),this.props.children)}}exports.default=d,d.propTypes={isOpen:t.default.bool,closesToBottom:t.default.bool,children:t.default.any.isRequired,onPanelToggle:t.default.func},d.defaultProps={isOpen:!0};class p extends n.PureComponent{getChildContext(){return{onPanelToggle:this.props.onPanelToggle}}render(){const{children:e,className:t,theme:l,style:s,isOpen:a}=this.props,r=(0,o.default)({[t]:t&&t.length,[l.panel]:!0,[l["panel--isOpen"]]:a,[l[`panel--${s}`]]:i.includes(s)});return n.default.createElement("section",{className:r},n.default.Children.map(e,e=>e.type?n.default.createElement(e.type,Object.assign({},e.props,{isPanelOpen:a})):e))}}exports.StatelessToggablePanel=p,p.propTypes={isOpen:t.default.bool,closesToBottom:t.default.bool,className:t.default.string,children:t.default.any.isRequired,onPanelToggle:t.default.func.isRequired,theme:t.default.shape({panel:t.default.string,"panel--isOpen":t.default.string,"panel--condensed":t.default.string}).isRequired,style:t.default.oneOf(i)},p.defaultProps={isOpen:!1},p.childContextTypes={onPanelToggle:t.default.func.isRequired};class u extends n.PureComponent{render(){const t=this.props,{HeadlineComponent:l,IconButtonComponent:s,children:a,isPanelOpen:r,openedIcon:i,closedIcon:d,theme:p,noPadding:u,toggleButtonId:c}=t,f=(0,e.__rest)(t,["HeadlineComponent","IconButtonComponent","children","isPanelOpen","openedIcon","closedIcon","theme","noPadding","toggleButtonId"]),{onPanelToggle:g}=this.context,h=(0,o.default)([p.panel__headline],{[p["panel__headline--noPadding"]]:u});return n.default.createElement("div",Object.assign({role:"button","aria-expanded":r,onClick:g},f),n.default.createElement(l,{className:h,type:"h2"},a),n.default.createElement(s,{className:p.panel__toggleBtn,hoverStyle:"clean",icon:r?i:d,id:c}))}}exports.Header=u,u.propTypes={children:t.default.any.isRequired,isPanelOpen:t.default.bool,theme:t.default.shape({panel__headline:t.default.string,"panel__headline--noPadding":t.default.string,panel__toggleBtn:t.default.string}).isRequired,noPadding:t.default.bool,HeadlineComponent:t.default.any.isRequired,IconButtonComponent:t.default.any.isRequired,openedIcon:t.default.string,closedIcon:t.default.string,toggleButtonId:t.default.string},u.defaultProps={isPanelOpen:!0,openedIcon:"chevron-circle-up",closedIcon:"chevron-circle-down"},u.contextTypes={onPanelToggle:t.default.func.isRequired};class c extends n.PureComponent{render(){const{className:e,children:t,isPanelOpen:s,theme:a}=this.props,r=(0,o.default)(a.panel__contents,{[a["panel__contents--noPadding"]]:this.props.noPadding,[e]:e&&e.length});return n.default.createElement(l.default,{isOpened:s,springConfig:{stiffness:300,damping:30}},n.default.createElement("div",{className:r,"aria-hidden":s?"false":"true"},t))}}exports.Contents=c,c.propTypes={className:t.default.string,noPadding:t.default.bool,children:t.default.any.isRequired,isPanelOpen:t.default.bool,theme:t.default.shape({panel__contents:t.default.string,"panel__contents--noPadding":t.default.string}).isRequired},c.defaultProps={theme:{},isPanelOpen:!0}; },{"tslib":"y3QC","react":"d6ZO","prop-types":"IaRT","react-collapse":"jAd2","classnames":"GGB8"}],"ETLr":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),t=i(require("../identifiers")),r=i(require("./style.css")),n=f(require("./toggablePanel")),a=i(require("./../_lib/injectProps")),u=i(require("./../Headline")),o=i(require("./../IconButton"));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=a?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}function i(e){return e&&e.__esModule?e:{default:e}}const d=(0,e.themr)(t.default.toggablePanel,r.default)(n.default),s=(0,e.themr)(t.default.toggablePanelHeader,r.default)(n.Header),c=(0,e.themr)(t.default.toggablePanelContents,r.default)(n.Contents);d.Header=(0,a.default)({HeadlineComponent:u.default,IconButtonComponent:o.default})(s),d.Contents=c;var p=d;exports.default=p; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./style.css":"bY1I","./toggablePanel":"PL2N","./../_lib/injectProps":"mMvf","./../Headline":"KoLU","./../IconButton":"yn5u"}],"r7sd":[function(require,module,exports) { -module.exports={tooltip:"_tooltip_8f4ae","tooltip--inline":"_tooltip--inline_8f4ae","tooltip--arrow":"_tooltip--arrow_8f4ae","tooltip--asError":"_tooltip--asError_8f4ae","tooltip--inner":"_tooltip--inner_8f4ae"}; +module.exports={tooltip:"_tooltip_7e67a","tooltip--inline":"_tooltip--inline_7e67a","tooltip--arrow":"_tooltip--arrow_7e67a","tooltip--asError":"_tooltip--asError_7e67a","tooltip--inner":"_tooltip--inner_7e67a"}; },{}],"JMLr":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=void 0;var e=require("tslib"),t=a(require("react")),r=n(require("classnames"));function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var s=a?Object.getOwnPropertyDescriptor(e,l):null;s&&(s.get||s.set)?Object.defineProperty(n,l,s):n[l]=e[l]}return n.default=e,r&&r.set(e,n),n}const l={renderInline:!1};exports.defaultProps=l;class s extends t.PureComponent{render(){const n=this.props,{children:o,className:a,theme:l,renderInline:s,asError:i}=n,u=(0,e.__rest)(n,["children","className","theme","renderInline","asError"]),c=(0,r.default)(l.tooltip,{[l["tooltip--asError"]]:i,[l["tooltip--inline"]]:s},a);return t.default.createElement("div",Object.assign({},u,{className:c}),t.default.createElement("div",{className:l["tooltip--arrow"]}),t.default.createElement("div",{className:l["tooltip--inner"]},o))}}exports.default=s,s.defaultProps=l; },{"tslib":"y3QC","react":"d6ZO","classnames":"GGB8"}],"VdBJ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),t=s(require("../identifiers")),r=s(require("./style.css")),u=s(require("./tooltip"));function s(e){return e&&e.__esModule?e:{default:e}}var i=(0,e.themr)(t.default.tooltip,r.default)(u.default);exports.default=i; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./style.css":"r7sd","./tooltip":"JMLr"}],"GIju":[function(require,module,exports) { -module.exports={treeWrapper:"_treeWrapper_63f1e _reset_da866"}; +module.exports={treeWrapper:"_treeWrapper_1a196 _reset_cd800"}; },{"./../reset.css":"Wuot"}],"W3Uu":[function(require,module,exports) { -module.exports={header:"_header_b4555 _reset_da866",header__chevron:"_header__chevron_b4555 _reset_da866","header__chevron--isCollapsed":"_header__chevron--isCollapsed_b4555","header__chevron--isHiddenInIndex":"_header__chevron--isHiddenInIndex_b4555","header__chevron--isLoading":"_header__chevron--isLoading_b4555",header__iconWrapper:"_header__iconWrapper_b4555",header__data:"_header__data_b4555 _reset_da866","header__data--isHiddenInIndex":"_header__data--isHiddenInIndex_b4555","header__data--isHidden":"_header__data--isHidden_b4555","header__data--isDragging":"_header__data--isDragging_b4555","header__data--isDirty":"_header__data--isDirty_b4555","header__data--isFocused":"_header__data--isFocused_b4555","header__data--acceptsDrop":"_header__data--acceptsDrop_b4555","header__data--deniesDrop":"_header__data--deniesDrop_b4555",header__labelWrapper:"_header__labelWrapper_b4555",header__label:"_header__label_b4555 _reset_da866","header__data--isActive":"_header__data--isActive_b4555",contents:"_contents_b4555 _reset_da866",dropTarget:"_dropTarget_b4555","dropTarget--before":"_dropTarget--before_b4555","dropTarget--after":"_dropTarget--after_b4555",dropTarget__inner:"_dropTarget__inner_b4555","dropTarget__inner--acceptsDrop":"_dropTarget__inner--acceptsDrop_b4555"}; +module.exports={header:"_header_3eaaa _reset_cd800",header__chevron:"_header__chevron_3eaaa _reset_cd800","header__chevron--isCollapsed":"_header__chevron--isCollapsed_3eaaa","header__chevron--isHiddenInIndex":"_header__chevron--isHiddenInIndex_3eaaa","header__chevron--isLoading":"_header__chevron--isLoading_3eaaa",header__iconWrapper:"_header__iconWrapper_3eaaa",header__data:"_header__data_3eaaa _reset_cd800","header__data--isHiddenInIndex":"_header__data--isHiddenInIndex_3eaaa","header__data--isHidden":"_header__data--isHidden_3eaaa","header__data--isDragging":"_header__data--isDragging_3eaaa","header__data--isDirty":"_header__data--isDirty_3eaaa","header__data--isFocused":"_header__data--isFocused_3eaaa","header__data--acceptsDrop":"_header__data--acceptsDrop_3eaaa","header__data--deniesDrop":"_header__data--deniesDrop_3eaaa",header__labelWrapper:"_header__labelWrapper_3eaaa",header__label:"_header__label_3eaaa _reset_cd800","header__data--isActive":"_header__data--isActive_3eaaa",contents:"_contents_3eaaa _reset_cd800",dropTarget:"_dropTarget_3eaaa","dropTarget--before":"_dropTarget--before_3eaaa","dropTarget--after":"_dropTarget--after_3eaaa",dropTarget__inner:"_dropTarget__inner_3eaaa","dropTarget__inner--acceptsDrop":"_dropTarget__inner--acceptsDrop_3eaaa"}; },{"./../reset.css":"Wuot"}],"EX7S":[function(require,module,exports) { -module.exports={layer:"_layer_44112",dragWrapper:"_dragWrapper_44112",count:"_count_44112",node:"_node_44112"}; +module.exports={layer:"_layer_86dbb",dragWrapper:"_dragWrapper_86dbb",count:"_count_86dbb",node:"_node_86dbb"}; },{}],"SauI":[function(require,module,exports) { var global = arguments[3]; var t=arguments[3],n="Expected a function",e=NaN,i="[object Symbol]",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,f=/^0o[0-7]+$/i,a=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,s=c||l||Function("return this")(),v=Object.prototype,p=v.toString,y=Math.max,d=Math.min,m=function(){return s.Date.now()};function b(t,e,i){var r,o,u,f,a,c,l=0,s=!1,v=!1,p=!0;if("function"!=typeof t)throw new TypeError(n);function b(n){var e=r,i=o;return r=o=void 0,l=n,f=t.apply(i,e)}function g(t){var n=t-c;return void 0===c||n>=e||n<0||v&&t-l>=u}function h(){var t=m();if(g(t))return x(t);a=setTimeout(h,function(t){var n=e-(t-c);return v?d(n,u-(t-l)):n}(t))}function x(t){return a=void 0,p&&r?b(t):(r=o=void 0,f)}function T(){var t=m(),n=g(t);if(r=arguments,o=this,c=t,n){if(void 0===a)return function(t){return l=t,a=setTimeout(h,e),s?b(t):f}(c);if(v)return a=setTimeout(h,e),b(c)}return void 0===a&&(a=setTimeout(h,e)),f}return e=O(e)||0,j(i)&&(s=!!i.leading,u=(v="maxWait"in i)?y(O(i.maxWait)||0,e):u,p="trailing"in i?!!i.trailing:p),T.cancel=function(){void 0!==a&&clearTimeout(a),l=0,r=c=o=a=void 0},T.flush=function(){return void 0===a?f:x(m())},T}function g(t,e,i){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError(n);return j(i)&&(r="leading"in i?!!i.leading:r,o="trailing"in i?!!i.trailing:o),b(t,e,{leading:r,maxWait:e,trailing:o})}function j(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function h(t){return!!t&&"object"==typeof t}function x(t){return"symbol"==typeof t||h(t)&&p.call(t)==i}function O(t){if("number"==typeof t)return t;if(x(t))return e;if(j(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=j(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(r,"");var i=u.test(t);return i||f.test(t)?a(t.slice(2),i?2:8):o.test(t)?e:+t}module.exports=g; @@ -1328,11 +1328,11 @@ var t=arguments[3],n="Expected a function",e=NaN,i="[object Symbol]",r=/^\s+|\s+ },{"react":"d6ZO","prop-types":"IaRT","react-dnd":"JLJT"}],"ppbA":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),r=c(require("../identifiers")),t=c(require("./tree.css")),u=c(require("./node.css")),a=c(require("./dragLayer.css")),n=c(require("./tree")),o=s(require("./node")),d=c(require("./dragLayer")),f=c(require("./../_lib/injectProps")),i=c(require("./../Icon"));function l(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(l=function(e){return e?t:r})(e)}function s(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l(r);if(t&&t.has(e))return t.get(e);var u={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(u,n,o):u[n]=e[n]}return u.default=e,t&&t.set(e,u),u}function c(e){return e&&e.__esModule?e:{default:e}}const p=(0,e.themr)(r.default.tree,t.default)(n.default),y=(0,e.themr)(r.default.treeNode,u.default)(o.default),q=(0,e.themr)(r.default.treeNodeHeader,u.default)(o.Header),j=(0,e.themr)(r.default.treeNodeContents,u.default)(o.Contents),v=(0,e.themr)(r.default.treeDragLayer,a.default)(d.default),O=(0,f.default)({NodeComponent:y})(p);O.Node=y,O.Node.Header=(0,f.default)({IconComponent:i.default})(q),O.Node.Contents=j,O.DragLayer=v;var b=O;exports.default=b; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./tree.css":"GIju","./node.css":"W3Uu","./dragLayer.css":"EX7S","./tree":"qjDE","./node":"AjAT","./dragLayer":"LCoV","./../_lib/injectProps":"mMvf","./../Icon":"i1Sb"}],"MZ0u":[function(require,module,exports) { -module.exports={selectedOptions:"_selectedOptions_01b25 _reset_da866"}; +module.exports={selectedOptions:"_selectedOptions_6b7fe _reset_cd800"}; },{"./../reset.css":"Wuot"}],"UKlw":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("react")),t=i(require("prop-types")),a=require("plow-js"),l=i(require("classnames")),r=i(require("lodash.omit")),u=i(require("../SelectBox_Option_SingleLine"));function i(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(s=function(e){return e?a:t})(e)}function n(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=s(t);if(a&&a.has(e))return a.get(e);var l={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=r?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(l,u,i):l[u]=e[u]}return l.default=e,a&&a.set(e,l),l}class o extends e.PureComponent{constructor(){super(...arguments),this.getOptionValueAccessor=(()=>{const{optionValueField:e}=this.props;return(0,a.$get)([e])}),this.handleNewValueSelected=(e=>{const{onValuesChange:t}=this.props,a=this.props.values||[];let l;Array.isArray(a)?l=[...a,e]:(console.error("MultiSelectBox received an invalid value, invalid value will be discarded",a),l=[e]),t(l)})}render(){const{searchOptions:t,values:a,optionValueField:u,theme:i,SelectBox:s,MultiSelectBox_ListPreviewSortable:n,disabled:o,className:d}=this.props,f=(t||[]).filter(e=>!(a&&-1!==a.indexOf(e[u]))),c=(0,l.default)({[i.selectedOptions]:!0}),p=this.getOptionValueAccessor(),h=(0,l.default)({[d]:!0,[i.wrapper]:!0});return e.default.createElement("div",{className:h},e.default.createElement("ul",{className:c},e.default.createElement(n,Object.assign({},(0,r.default)(this.props,["theme"]),{optionValueAccessor:p,disabled:o}))),e.default.createElement(s,Object.assign({},(0,r.default)(this.props,["theme","className"]),{options:f,value:"",onValueChange:this.handleNewValueSelected,disabled:o})))}}o.propTypes={options:t.default.arrayOf(t.default.shape({icon:t.default.string,label:t.default.oneOfType([t.default.string,t.default.object]).isRequired})),className:t.default.string,optionValueField:t.default.string,values:t.default.arrayOf(t.default.string),onValuesChange:t.default.func.isRequired,placeholder:t.default.string,placeholderIcon:t.default.string,withoutGroupLabel:t.default.string,allowEmpty:t.default.bool,scrollable:t.default.bool,ListPreviewElement:t.default.any,loadingLabel:t.default.string,displayLoadingIndicator:t.default.bool,displaySearchBox:t.default.bool,searchTerm:t.default.string,onSearchTermChange:t.default.func,searchOptions:t.default.arrayOf(t.default.shape({icon:t.default.string,label:t.default.oneOfType([t.default.string,t.default.object]).isRequired})),setFocus:t.default.bool,onCreateNew:t.default.func,createNewLabel:t.default.string,dndType:t.default.string.isRequired,theme:t.default.shape({selectedOptions:t.default.string,selectedOptions__item:t.default.string}).isRequired,SelectBox:t.default.any.isRequired,IconComponent:t.default.any.isRequired,IconButtonComponent:t.default.any.isRequired,MultiSelectBox_ListPreviewSortable:t.default.any.isRequired},o.defaultProps={optionValueField:"value",dndType:"multiselect-box-value",allowEmpty:!0,ListPreviewElement:u.default};var d=o;exports.default=d; },{"react":"d6ZO","prop-types":"IaRT","plow-js":"DgmR","classnames":"GGB8","lodash.omit":"ADgd","../SelectBox_Option_SingleLine":"g7rK"}],"KxAQ":[function(require,module,exports) { -module.exports={selectedOptions__item:"_selectedOptions__item_dff2b",selectedOptions__itemIcon:"_selectedOptions__itemIcon_dff2b","selectedOptions__itemIcon--onHover":"_selectedOptions__itemIcon--onHover_dff2b","selectedOptions__item--draggable":"_selectedOptions__item--draggable_dff2b",selectedOptions__innerPreview:"_selectedOptions__innerPreview_dff2b",selectedOption__removeButton:"_selectedOption__removeButton_dff2b",selectedOption__moveButton:"_selectedOption__moveButton_dff2b"}; +module.exports={selectedOptions__item:"_selectedOptions__item_2d953",selectedOptions__itemIcon:"_selectedOptions__itemIcon_2d953","selectedOptions__itemIcon--onHover":"_selectedOptions__itemIcon--onHover_2d953","selectedOptions__item--draggable":"_selectedOptions__item--draggable_2d953",selectedOptions__innerPreview:"_selectedOptions__innerPreview_2d953",selectedOption__removeButton:"_selectedOption__removeButton_2d953",selectedOption__moveButton:"_selectedOption__moveButton_2d953"}; },{}],"OK1j":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=u(require("react")),n=o(require("prop-types")),r=o(require("classnames")),i=require("react-dnd");function o(e){return e&&e.__esModule?e:{default:e}}function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}const l={hover(e,t,n){const r=t.getItem().index,i=e.index;if(r===i)return;const o=n.node.getBoundingClientRect(),a=(o.bottom-o.top)/2,u=t.getClientOffset().y-o.top;ri&&u>a||(e.onMoveSelectedValue(r,i),t.getItem().index=i)},drop(e){e.onSelectedValueWasMoved()}};let d=class extends t.PureComponent{render(){const{option:e,connectDragSource:n,connectDropTarget:i,isDragging:o,InnerListPreviewElement:a,theme:u,values:l,onRemoveItem:d,index:s,IconButton:c}=this.props,f=l&&l.length>1,p=(0,r.default)({[u.selectedOptions__item]:!0,[u["selectedOptions__item--draggable"]]:f}),g=o?0:1;return n(i(t.default.createElement("li",{style:{opacity:g},ref:e=>{this.node=e}},t.default.createElement("div",{className:p},f&&t.default.createElement(c,{icon:"grip-lines-vertical",className:u.selectedOption__moveButton,hoverStyle:"clean"}),t.default.createElement("div",{className:u.selectedOptions__innerPreview},t.default.createElement(a,Object.assign({},this.props,{isHighlighted:!1,option:e}))),t.default.createElement(c,{icon:"close",onClick:()=>d(s),className:u.selectedOption__removeButton})))))}};d.propTypes={option:n.default.shape({}),values:n.default.arrayOf(n.default.string),dndType:n.default.string.isRequired,connectDragSource:n.default.func.isRequired,connectDropTarget:n.default.func.isRequired,isDragging:n.default.bool.isRequired,InnerListPreviewElement:n.default.any.isRequired,onMoveSelectedValue:n.default.func.isRequired,onSelectedValueWasMoved:n.default.func.isRequired,onRemoveItem:n.default.func.isRequired,index:n.default.number.isRequired,theme:n.default.shape({selectedOptions__item:n.default.string,"selectedOptions__item--draggable":n.default.string,selectedOption__removeButton:n.default.string,selectedOption__moveButton:n.default.string}).isRequired,Icon:n.default.any.isRequired,IconButton:n.default.any.isRequired};var s=d=(0,e.__decorate)([(0,i.DragSource)(({dndType:e})=>e,{beginDrag:e=>({index:e.index}),canDrag:({values:e})=>e&&e.length>1},(e,t)=>({connectDragSource:e.dragSource(),isDragging:t.isDragging()})),(0,i.DropTarget)(({dndType:e})=>e,l,e=>({connectDropTarget:e.dropTarget()}))],d);exports.default=s; },{"tslib":"y3QC","react":"d6ZO","prop-types":"IaRT","classnames":"GGB8","react-dnd":"JLJT"}],"kFh5":[function(require,module,exports) { @@ -1344,7 +1344,7 @@ module.exports={selectedOptions__item:"_selectedOptions__item_dff2b",selectedOpt },{"./multiSelectBox_ListPreviewSortable":"Cbn6"}],"ucZc":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@friendsofreactjs/react-css-themr"),t=a(require("../identifiers")),r=a(require("./style.css")),u=a(require("./multiSelectBox")),o=a(require("./../_lib/injectProps")),l=a(require("./../SelectBox")),i=a(require("./../MultiSelectBox_ListPreviewSortable")),c=a(require("./../Icon")),s=a(require("./../IconButton"));function a(e){return e&&e.__esModule?e:{default:e}}const n=(0,e.themr)(t.default.multiSelectBox,r.default)(u.default);var d=(0,o.default)({IconComponent:c.default,IconButtonComponent:s.default,SelectBox:l.default,MultiSelectBox_ListPreviewSortable:i.default})(n);exports.default=d; },{"@friendsofreactjs/react-css-themr":"sXs8","../identifiers":"hmBe","./style.css":"MZ0u","./multiSelectBox":"UKlw","./../_lib/injectProps":"mMvf","./../SelectBox":"OIiv","./../MultiSelectBox_ListPreviewSortable":"xhP0","./../Icon":"i1Sb","./../IconButton":"yn5u"}],"uRrx":[function(require,module,exports) { -module.exports={multiLineWithThumbnail__item:"_multiLineWithThumbnail__item_b2851",multiLineWithThumbnail__secondaryLabel:"_multiLineWithThumbnail__secondaryLabel_b2851",multiLineWithThumbnail__tertiaryLabel:"_multiLineWithThumbnail__tertiaryLabel_b2851",multiLineWithThumbnail__image:"_multiLineWithThumbnail__image_b2851"}; +module.exports={multiLineWithThumbnail__item:"_multiLineWithThumbnail__item_d31b3",multiLineWithThumbnail__secondaryLabel:"_multiLineWithThumbnail__secondaryLabel_d31b3",multiLineWithThumbnail__tertiaryLabel:"_multiLineWithThumbnail__tertiaryLabel_d31b3",multiLineWithThumbnail__image:"_multiLineWithThumbnail__image_d31b3"}; },{}],"W6fS":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("tslib"),t=u(require("react")),a=l(require("prop-types")),i=l(require("../ListPreviewElement")),r=l(require("classnames"));function l(e){return e&&e.__esModule?e:{default:e}}function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(n=function(e){return e?a:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=n(t);if(a&&a.has(e))return a.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var u=r?Object.getOwnPropertyDescriptor(e,l):null;u&&(u.get||u.set)?Object.defineProperty(i,l,u):i[l]=e[l]}return i.default=e,a&&a.set(e,i),i}class s extends t.PureComponent{render(){const a=this.props,{label:l,secondaryLabel:n,tertiaryLabel:u,imageUri:s,icon:o,className:c,theme:d}=a,f=(0,e.__rest)(a,["label","secondaryLabel","tertiaryLabel","imageUri","icon","className","theme"]),m=(0,r.default)({[d.multiLineWithThumbnail__item]:!0,[c]:c});return t.default.createElement(i.default,Object.assign({},f,{icon:o,className:m}),Boolean(s)&&t.default.createElement("img",{src:s,alt:l,className:d.multiLineWithThumbnail__image}),t.default.createElement("span",{title:l},l),Boolean(n)&&t.default.createElement("span",{className:d.multiLineWithThumbnail__secondaryLabel,title:n},n),Boolean(u)&&t.default.createElement("span",{className:d.multiLineWithThumbnail__tertiaryLabel,title:u},u))}}s.propTypes={label:a.default.string.isRequired,secondaryLabel:a.default.string,tertiaryLabel:a.default.string,imageUri:a.default.string,icon:a.default.string,className:a.default.string,theme:a.default.shape({multiLineWithThumbnail__item:a.default.string.isRequired,multiLineWithThumbnail__secondaryLabel:a.default.string.isRequired,multiLineWithThumbnail__tertiaryLabel:a.default.string.isRequired,multiLineWithThumbnail__image:a.default.string.isRequired}).isRequired};var o=s;exports.default=o; },{"tslib":"y3QC","react":"d6ZO","prop-types":"IaRT","../ListPreviewElement":"NTsP","classnames":"GGB8"}],"DmAp":[function(require,module,exports) { @@ -1533,7 +1533,7 @@ var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export },{"./components/AssetPreview":"HIfv","./state/selectedAssetForPreviewState":"qdPi"}],"nuZf":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),t=require("@media-ui/core/src");function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(r=function(e){return e?a:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=r(t);if(a&&a.has(e))return a.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=o?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(n,i,l):n[i]=e[i]}return n.default=e,a&&a.set(e,n),n}var n=(0,t.createUseMediaUiStyles)({assetLabel:{display:"inline-block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}),o=function(t){var r=t.label,a=n();return e.createElement("span",{className:a.assetLabel},r)},i=e.memo(o);exports.default=i; },{"react":"d6ZO","@media-ui/core/src":"GGOe"}],"sf5s":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var e=n(require("react")),r=require("@media-ui/core/src");function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}function n(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=i?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(o,u,a):o[u]=e[u]}return o.default=e,n&&n.set(e,o),o}var o=(0,r.createUseMediaUiStyles)(function(e){return{column:{display:"grid",gridAutoRows:"min-content",gridGap:e.spacing.full,overflowY:"auto",overflowX:"hidden",height:"100%"}}});function i(r){var t=r.children,n=o();return e.createElement("div",{className:n.column},t)} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var e=n(require("react")),r=require("@media-ui/core/src");function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}function n(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=i?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(o,u,a):o[u]=e[u]}return o.default=e,n&&n.set(e,o),o}var o=(0,r.createUseMediaUiStyles)(function(e){return{column:{display:"grid",gridAutoRows:"minmax(0, min-content)",gridGap:e.spacing.full,overflowY:"auto",overflowX:"hidden",height:"100%"}}});function i(r){var t=r.children,n=o();return e.createElement("div",{className:n.column},t)} },{"react":"d6ZO","@media-ui/core/src":"GGOe"}],"fiFH":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),t=require("@neos-project/react-ui-components"),r=require("@media-ui/core/src");function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var a={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var c=i?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(a,o,c):a[o]=e[o]}return a.default=e,r&&r.set(e,a),a}var i=(0,r.createUseMediaUiStyles)(function(e){return{iconWrap:{verticalAlign:"middle"},label:{fontWeight:"bold",lineHeight:e.spacing.goldenUnit,paddingLeft:e.spacing.half,userSelect:"none"},imgIcon:{width:"auto",height:"18px"}}}),o=function(r){var n=r.icon,a=void 0===n?"question":n,o=r.iconUri,c=void 0===o?"":o,l=r.label,u=void 0===l?"":l,s=r.className,p=void 0===s?"":s,d=r.children,f=void 0===d?null:d,m=i();return e.createElement("div",{className:p},e.createElement("span",{className:m.iconWrap},c?e.createElement("img",{src:c,alt:u,className:m.imgIcon}):e.createElement(t.Icon,{icon:a})),e.createElement("span",{className:m.label},f||u||""))},c=e.memo(o);exports.default=c; },{"react":"d6ZO","@neos-project/react-ui-components":"cH6v","@media-ui/core/src":"GGOe"}],"BGPv":[function(require,module,exports) { @@ -1564,15 +1564,27 @@ var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),r=require("./Tree"),t=require("./index"),n=require("../Presentation"),o=require("@media-ui/core/src"),u=require("@media-ui/feature-asset-upload/src/components");function i(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(i=function(e){return e?t:r})(e)}function a(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i(r);if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}var c=function(){var i=[!(0,o.useMediaUi)().selectionMode&&u.UploadButton,t.AssetSourceList,r.AssetCollectionTree,t.AssetSourceDescription].filter(Boolean);return e.createElement(n.Column,null,i.map(function(r,t){return e.createElement(r,{key:t})}))},s=e.memo(c);exports.default=s; },{"react":"d6ZO","./Tree":"N67f","./index":"ua9g","../Presentation":"HfS4","@media-ui/core/src":"GGOe","@media-ui/feature-asset-upload/src/components":"Nus1"}],"ua9g":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"AssetSourceList",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"AssetSourceDescription",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"SideBarLeft",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"AssetCollectionTree",{enumerable:!0,get:function(){return u.AssetCollectionTree}});var e=n(require("./AssetSourceList")),r=n(require("./AssetSourceDescription")),t=n(require("./SideBarLeft")),u=require("./Tree");function n(e){return e&&e.__esModule?e:{default:e}} -},{"./AssetSourceList":"i5z1","./AssetSourceDescription":"GRUc","./SideBarLeft":"FMdU","./Tree":"N67f"}],"oB0l":[function(require,module,exports) { +},{"./AssetSourceList":"i5z1","./AssetSourceDescription":"GRUc","./SideBarLeft":"FMdU","./Tree":"N67f"}],"N8E9":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n,e=require("@apollo/client"),r=function(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n},o=(0,e.gql)(n||(n=r(["\n fragment CropInformationProps on CropInformation {\n width\n height\n x\n y\n }\n"],["\n fragment CropInformationProps on CropInformation {\n width\n height\n x\n y\n }\n"]))),t=o;exports.default=t; +},{"@apollo/client":"xxBS"}],"jU9s":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@apollo/client"),n=r(require("../fragments/cropInformation"));function r(e){return e&&e.__esModule?e:{default:e}}var t,o=function(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e},s=(0,e.gql)(t||(t=o(["\n query ASSET_VARIANTS($id: AssetId!, $assetSourceId: AssetSourceId!) {\n assetVariants(id: $id, assetSourceId: $assetSourceId) {\n id\n width\n height\n presetIdentifier\n variantName\n hasCrop\n previewUrl\n cropInformation {\n ...CropInformationProps\n }\n }\n }\n ","\n"],["\n query ASSET_VARIANTS($id: AssetId!, $assetSourceId: AssetSourceId!) {\n assetVariants(id: $id, assetSourceId: $assetSourceId) {\n id\n width\n height\n presetIdentifier\n variantName\n hasCrop\n previewUrl\n cropInformation {\n ...CropInformationProps\n }\n }\n }\n ","\n"])),n.default),a=s;exports.default=a; +},{"@apollo/client":"xxBS","../fragments/cropInformation":"N8E9"}],"ZSIQ":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;var e=require("@apollo/client"),r=t(require("../queries/assetVariants"));function t(e){return e&&e.__esModule?e:{default:e}}function a(t){var a=(0,e.useQuery)(r.default,{variables:{id:null==t?void 0:t.assetId,assetSourceId:null==t?void 0:t.assetSourceId},skip:!t}),s=a.data,u=a.loading,l=a.refetch;return{variants:(null==s?void 0:s.assetVariants)||null,loading:u,refetch:l}} +},{"@apollo/client":"xxBS","../queries/assetVariants":"jU9s"}],"Lv46":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("react")),a=require("@media-ui/core/src");function t(e){return e&&e.__esModule?e:{default:e}}var n=(0,a.createUseMediaUiStyles)(function(e){return{variantContainer:{backgroundColor:e.colors.assetBackground},picture:{height:200,display:"flex",alignItems:"center",justifyContent:"center"},image:{maxHeight:"100%",objectFit:"contain",display:"block",backgroundImage:"repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)",backgroundPosition:"0 0, 10px 10px",backgroundSize:"20px 20px"},caption:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e.spacing.half,backgroundColor:e.colors.captionBackground},infoContainer:{display:"flex",flexDirection:"column",minWidth:0,maxWidth:e.size.sidebarWidth},info:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},variantSizes:{fontSize:e.fontSize.small}}}),i=function(a){var t=a.presetIdentifier,i=a.variantName,r=a.width,l=a.height,s=a.previewUrl,o=n();return e.default.createElement("div",{className:o.variantContainer},e.default.createElement("picture",{className:o.picture},e.default.createElement("img",{className:o.image,src:s,alt:i})),e.default.createElement("figcaption",{className:o.caption},e.default.createElement("div",{className:o.infoContainer},t?e.default.createElement("span",{className:o.info},"Preset: ",t):null,i?e.default.createElement("span",{className:o.info},"Variant: ",i):null,e.default.createElement("span",{className:o.variantSizes},"W: ",r," H: ",l))))},r=i;exports.default=r; +},{"react":"d6ZO","@media-ui/core/src":"GGOe"}],"D7D6":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("react")),t=require("@media-ui/core/src"),a=require("@media-ui/core/src/hooks"),r=l(require("../hooks/useAssetVariants")),n=l(require("./Variant"));function l(e){return e&&e.__esModule?e:{default:e}}var i=function(){return(i=Object.assign||function(e){for(var t,a=1,r=arguments.length;a0?null===(s=c.variants)||void 0===s?void 0:s.map(function(t){return e.default.createElement("li",{className:f.variantItem,key:"variant-"+t.id},e.default.createElement(n.default,i({},t)))}):e.default.createElement("li",null,d("assetVariants.noVariantsFound","No variants found")))))},d=s;exports.default=d; +},{"react":"d6ZO","@media-ui/core/src":"GGOe","@media-ui/core/src/hooks":"g1AJ","../hooks/useAssetVariants":"ZSIQ","./Variant":"Lv46"}],"oB0l":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),r=require("@neos-project/react-ui-components"),t=require("@media-ui/core/src");function n(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(n=function(e){return e?t:r})(e)}function o(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n(r);if(t&&t.has(e))return t.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(o,u,i):o[u]=e[u]}return o.default=e,t&&t.set(e,o),o}var a=(0,t.createUseMediaUiStyles)({propertyGroup:{}}),u=function(t){var n=t.children,o=t.label,u=a();return e.createElement("div",{className:u.propertyGroup},e.createElement(r.Label,null,o),n)},i=u;exports.default=i; },{"react":"d6ZO","@neos-project/react-ui-components":"cH6v","@media-ui/core/src":"GGOe"}],"aAzc":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),t=require("@neos-project/react-ui-components"),r=require("@media-ui/core/src");function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,r&&r.set(e,a),a}var o=(0,r.createUseMediaUiStyles)(function(e){return{actions:{display:"flex",position:"sticky",backgroundColor:e.colors.mainBackground,bottom:0,"& > *":{flex:1}}}}),i=function(n){var a=n.hasUnpublishedChanges,i=n.handleApply,s=n.handleDiscard,c=o(),l=(0,r.useIntl)().translate;return e.createElement("div",{className:c.actions},e.createElement(t.Button,{disabled:!a,size:"regular",style:"lighter",hoverStyle:"brand",onClick:s},l("inspector.actions.discard","Discard")),e.createElement(t.Button,{disabled:!a,size:"regular",style:"success",hoverStyle:"success",onClick:i},l("inspector.actions.apply","Apply")))},s=i;exports.default=s; },{"react":"d6ZO","@neos-project/react-ui-components":"cH6v","@media-ui/core/src":"GGOe"}],"RN7d":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("react")),r=require("@media-ui/core/src");function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}function n(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=a?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(i,u,o):i[u]=e[u]}return i.default=e,n&&n.set(e,i),i}var i=(0,r.createUseMediaUiStyles)(function(e){return{inspector:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridAutoRows:"auto",gridGap:e.spacing.full,"& input, & textarea":{width:"100%"}}}}),a=function(r){var t=r.children,n=i();return e.createElement("div",{className:n.inspector},t)},u=a;exports.default=u; -},{"react":"d6ZO","@media-ui/core/src":"GGOe"}],"WEjs":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=g(require("react")),t=require("@neos-project/react-ui-components"),a=require("@media-ui/feature-asset-usage/src"),r=require("@media-ui/core/src"),n=require("@media-ui/core/src/hooks"),s=require("@media-ui/core/src/state"),l=require("@media-ui/feature-similar-assets/src"),i=require("@media-ui/feature-asset-upload/src/components"),o=require("./index"),u=require("recoil"),c=f(require("./Property")),d=f(require("./Actions")),p=f(require("./InspectorContainer"));function f(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(m=function(e){return e?a:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=m(t);if(a&&a.has(e))return a.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=n?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(r,s,l):r[s]=e[s]}return r.default=e,a&&a.set(e,r),r}var h=(0,r.createUseMediaUiStyles)(function(e){return{textArea:{".neos textarea&":{padding:e.spacing.half}}}}),y=function(){var f=h(),m=(0,n.useSelectedAsset)(),g=(0,r.useNotify)(),y=(0,r.useIntl)().translate,b=(0,r.useMediaUi)().featureFlags,A=(0,e.useState)(null),E=A[0],v=A[1],x=(0,e.useState)(null),q=x[0],w=x[1],S=(0,e.useState)(null),C=S[0],O=S[1],M=(0,u.useRecoilValue)(s.selectedInspectorViewState),T=(0,n.useUpdateAsset)(),j=T.updateAsset,N=T.loading,k=(null==m?void 0:m.localId)&&!N,P=m&&(E!==m.label||q!==m.caption||C!==m.copyrightNotice),R=(0,e.useCallback)(function(){m&&(v(m.label),w(m.caption),O(m.copyrightNotice))},[m,v,w,O]),U=(0,e.useCallback)(function(){E===m.label&&q===m.caption&&C===m.copyrightNotice||j({asset:m,label:E,caption:q,copyrightNotice:C}).then(function(){g.ok(y("actions.updateAsset.success","The asset has been updated"))}).catch(function(e){var t=e.message;g.error(y("actions.deleteAsset.error","Error while updating the asset"),t)})},[g,y,q,C,E,m,j]);return(0,e.useEffect)(function(){R()},[null==m?void 0:m.id]),m&&"asset"===M?e.createElement(p.default,null,e.createElement(c.default,{label:y("inspector.title","Title")},e.createElement(t.TextInput,{disabled:!k,type:"text",value:E||"",onChange:v,onEnterKey:U})),e.createElement(c.default,{label:y("inspector.caption","Caption")},e.createElement(t.TextArea,{className:f.textArea,disabled:!k,minRows:3,expandedRows:6,value:q||"",onChange:w})),e.createElement(c.default,{label:y("inspector.copyrightNotice","Copyright notice")},e.createElement(t.TextArea,{className:f.textArea,disabled:!k,minRows:2,expandedRows:4,value:C||"",onChange:O})),k&&e.createElement(d.default,{handleApply:U,handleDiscard:R,hasUnpublishedChanges:P}),m.assetSource.supportsCollections&&e.createElement(o.CollectionSelectBox,null),m.assetSource.supportsTagging&&e.createElement(o.TagSelectBoxAsset,null),e.createElement(a.AssetUsagesToggleButton,null),b.showSimilarAssets&&e.createElement(l.SimilarAssetsToggleButton,null),!m.assetSource.readOnly&&e.createElement(i.AssetReplacementButton,null),e.createElement(o.MetadataView,null)):null},b=e.memo(y);exports.default=b; -},{"react":"d6ZO","@neos-project/react-ui-components":"cH6v","@media-ui/feature-asset-usage/src":"SqV5","@media-ui/core/src":"GGOe","@media-ui/core/src/hooks":"g1AJ","@media-ui/core/src/state":"nstW","@media-ui/feature-similar-assets/src":"ErJ0","@media-ui/feature-asset-upload/src/components":"Nus1","./index":"Qu6j","recoil":"ejzu","./Property":"oB0l","./Actions":"aAzc","./InspectorContainer":"RN7d"}],"tyGS":[function(require,module,exports) { +},{"react":"d6ZO","@media-ui/core/src":"GGOe"}],"B3b1":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=f(require("react")),t=require("@neos-project/react-ui-components"),a=require("@media-ui/feature-asset-usage/src"),r=require("@media-ui/core/src"),n=require("@media-ui/core/src/hooks"),s=require("@media-ui/feature-similar-assets/src"),l=require("@media-ui/feature-asset-upload/src/components"),o=require("./index"),i=p(require("./Property")),u=p(require("./Actions")),c=p(require("./InspectorContainer"));function p(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(d=function(e){return e?a:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=d(t);if(a&&a.has(e))return a.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=n?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(r,s,l):r[s]=e[s]}return r.default=e,a&&a.set(e,r),r}var m=(0,r.createUseMediaUiStyles)(function(e){return{textArea:{".neos textarea&":{padding:e.spacing.half}}}}),g=function(){var p=m(),d=(0,n.useSelectedAsset)(),f=(0,r.useNotify)(),g=(0,r.useIntl)().translate,h=(0,r.useMediaUi)().featureFlags,y=(0,e.useState)(null),b=y[0],A=y[1],E=(0,e.useState)(null),v=E[0],x=E[1],w=(0,e.useState)(null),S=w[0],q=w[1],C=(0,n.useUpdateAsset)(),O=C.updateAsset,M=C.loading,T=(null==d?void 0:d.localId)&&!M,j=d&&(b!==d.label||v!==d.caption||S!==d.copyrightNotice),N=(0,e.useCallback)(function(){d&&(A(d.label),x(d.caption),q(d.copyrightNotice))},[d,A,x,q]),k=(0,e.useCallback)(function(){b===d.label&&v===d.caption&&S===d.copyrightNotice||O({asset:d,label:b,caption:v,copyrightNotice:S}).then(function(){f.ok(g("actions.updateAsset.success","The asset has been updated"))}).catch(function(e){var t=e.message;f.error(g("actions.deleteAsset.error","Error while updating the asset"),t)})},[f,g,v,S,b,d,O]);return(0,e.useEffect)(function(){N()},[null==d?void 0:d.id]),e.createElement(c.default,null,e.createElement(i.default,{label:g("inspector.title","Title")},e.createElement(t.TextInput,{disabled:!T,type:"text",value:b||"",onChange:A,onEnterKey:k})),e.createElement(i.default,{label:g("inspector.caption","Caption")},e.createElement(t.TextArea,{className:p.textArea,disabled:!T,minRows:3,expandedRows:6,value:v||"",onChange:x})),e.createElement(i.default,{label:g("inspector.copyrightNotice","Copyright notice")},e.createElement(t.TextArea,{className:p.textArea,disabled:!T,minRows:2,expandedRows:4,value:S||"",onChange:q})),T&&e.createElement(u.default,{handleApply:k,handleDiscard:N,hasUnpublishedChanges:j}),d.assetSource.supportsCollections&&e.createElement(o.CollectionSelectBox,null),d.assetSource.supportsTagging&&e.createElement(o.TagSelectBoxAsset,null),e.createElement(a.AssetUsagesToggleButton,null),h.showSimilarAssets&&e.createElement(s.SimilarAssetsToggleButton,null),!d.assetSource.readOnly&&e.createElement(l.AssetReplacementButton,null),e.createElement(o.MetadataView,null))},h=e.memo(g);exports.default=h; +},{"react":"d6ZO","@neos-project/react-ui-components":"cH6v","@media-ui/feature-asset-usage/src":"SqV5","@media-ui/core/src":"GGOe","@media-ui/core/src/hooks":"g1AJ","@media-ui/feature-similar-assets/src":"ErJ0","@media-ui/feature-asset-upload/src/components":"Nus1","./index":"Qu6j","./Property":"oB0l","./Actions":"aAzc","./InspectorContainer":"RN7d"}],"WEjs":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("react")),t=require("@neos-project/react-ui-components"),r=require("@media-ui/core/src"),n=require("@media-ui/core/src/hooks"),a=require("@media-ui/core/src/state"),u=c(require("@media-ui/feature-asset-variants/src/components/VariantsInspector")),i=c(require("./PropertyInspector")),o=require("recoil");function c(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}var f=(0,r.createUseMediaUiStyles)(function(){return{tabContent:{height:"calc(100% - 42px)"}}}),d=function(){var c=f(),s=(0,n.useSelectedAsset)(),l=(0,r.useMediaUi)().featureFlags,d=(0,o.useRecoilValue)(a.selectedInspectorViewState);return s&&"asset"===d?l.showVariantsEditor?e.createElement(t.Tabs,{theme:{tabs__content:c.tabContent}},e.createElement(t.Tabs.Panel,{icon:"pencil",key:"editor",id:"editor"},e.createElement(i.default,null)),e.createElement(t.Tabs.Panel,{icon:"images"},e.createElement(u.default,null))):e.createElement(i.default,null):null},p=e.memo(d);exports.default=p; +},{"react":"d6ZO","@neos-project/react-ui-components":"cH6v","@media-ui/core/src":"GGOe","@media-ui/core/src/hooks":"g1AJ","@media-ui/core/src/state":"nstW","@media-ui/feature-asset-variants/src/components/VariantsInspector":"D7D6","./PropertyInspector":"B3b1","recoil":"ejzu"}],"tyGS":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=p(require("react")),t=require("@neos-project/react-ui-components"),r=require("@media-ui/core/src"),n=require("@media-ui/core/src/hooks"),l=require("@media-ui/core/src/state"),o=require("."),u=require("recoil"),i=s(require("./Actions")),a=s(require("./Property")),c=s(require("./InspectorContainer"));function s(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=l?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}var d=function(){var s=(0,n.useSelectedAssetCollection)(),f=(0,u.useRecoilValue)(l.selectedInspectorViewState),p=(0,r.useNotify)(),d=(0,r.useIntl)().translate,h=(0,e.useState)(null),y=h[0],v=h[1],C=(0,n.useUpdateAssetCollection)().updateAssetCollection,b=s&&y!==s.title,m=(0,e.useCallback)(function(){s&&v(s.title)},[s,v]),q=(0,e.useCallback)(function(){y!==s.title&&C({assetCollection:s,title:y}).then(function(){p.ok(d("actions.updateAssetCollection.success","The asset collection has been updated"))}).catch(function(e){var t=e.message;p.error(d("actions.deleteAssetCollection.error","Error while updating the asset collection"),t)})},[p,d,s,C,y]);return(0,e.useEffect)(function(){m()},[null==s?void 0:s.id]),s&&"assetCollection"===f?e.createElement(c.default,null,e.createElement(a.default,{label:d("inspector.title","Title")},e.createElement(t.TextInput,{type:"text",value:y||"",onChange:v,onEnterKey:q})),e.createElement(i.default,{handleApply:q,handleDiscard:m,hasUnpublishedChanges:b}),e.createElement(o.TagSelectBoxAssetCollection,null)):null},h=e.memo(d);exports.default=h; },{"react":"d6ZO","@neos-project/react-ui-components":"cH6v","@media-ui/core/src":"GGOe","@media-ui/core/src/hooks":"g1AJ","@media-ui/core/src/state":"nstW",".":"Qu6j","recoil":"ejzu","./Actions":"aAzc","./Property":"oB0l","./InspectorContainer":"RN7d"}],"Y949":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("react")),t=require("@neos-project/react-ui-components"),r=require("@media-ui/core/src"),o=require("@media-ui/core/src/hooks"),a=require("../../Presentation");function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function i(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var c=a?Object.getOwnPropertyDescriptor(e,i):null;c&&(c.get||c.set)?Object.defineProperty(o,i,c):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}var c=(0,r.createUseMediaUiStyles)(function(e){return{iptcData:{"& dl":{"& dt":{backgroundColor:e.colors.alternatingBackground,fontWeight:"bold",color:"white",padding:"8px 8px 0"},"& dd":{backgroundColor:e.colors.alternatingBackground,marginBottom:"1px",padding:"8px",color:e.colors.inactive}}}}}),l=function(){var n,i=c(),l=(0,o.useSelectedAsset)(),u=(0,r.useIntl)().translate;return(null===(n=null==l?void 0:l.iptcProperties)||void 0===n?void 0:n.length)?e.createElement("div",{className:i.iptcData},e.createElement(t.Headline,{type:"h2"},e.createElement(a.IconLabel,{icon:"camera",label:u("inspector.iptcMetadata","IPTC Metadata")})),e.createElement(a.PropertyList,null,l.iptcProperties.map(function(t){return e.createElement(a.PropertyListItem,{key:t.propertyName,label:t.propertyName,value:t.value})}))):null},u=e.memo(l);exports.default=u; @@ -1589,8 +1601,8 @@ var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export },{"react":"d6ZO","@media-ui/core/src":"GGOe","@media-ui/core/src/hooks":"g1AJ",".":"Qu6j"}],"Xv7V":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("react")),t=require("@neos-project/react-ui-components"),o=require("@media-ui/core/src"),n=require("@media-ui/core/src/hooks"),r=require("../../Presentation");function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(l=function(e){return e?o:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=l(t);if(o&&o.has(e))return o.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if("default"!==c&&Object.prototype.hasOwnProperty.call(e,c)){var s=r?Object.getOwnPropertyDescriptor(e,c):null;s&&(s.get||s.set)?Object.defineProperty(n,c,s):n[c]=e[c]}return n.default=e,o&&o.set(e,n),n}var s=function(){return(s=Object.assign||function(e){for(var t,o=1,n=arguments.length;o-1&&"+"!==t.substr(-1)){var s=t.split("+",2);this.subtype=s[0],this.subtypeFacets=s[0].split("."),this.suffix=s[1]}else this.subtypeFacets=t.split(".")},t.prototype.hasSuffix=function(){return!!this.suffix},t.prototype._firstSubtypeFacetEquals=function(t){return this.subtypeFacets.length>0&&this.subtypeFacets[0]===t},t.prototype.isVendor=function(){return this._firstSubtypeFacetEquals("vnd")},t.prototype.isPersonal=function(){return this._firstSubtypeFacetEquals("prs")},t.prototype.isExperimental=function(){return this._firstSubtypeFacetEquals("x")||"x-"===this.subtype.substring(0,2).toLowerCase()},t.prototype.asString=function(){var t="";if(this.isValid()){t=t+this.type+"/"+this.subtype,this.hasSuffix()&&(t=t+"+"+this.suffix);var e=Object.keys(this.parameters);if(e.length>0){var i=[],r=this;e.sort(function(t,s){return t.localeCompare(s)}).forEach(function(t){i.push(t+"="+s(r.parameters[t]))}),t=t+";"+i.join(";")}}return t};var s=function(t){return t.indexOf(";")>-1?'"'+t+'"':t},e=function(t){return'"'===t.substr(0,1)&&'"'===t.substr(-1)?t.substr(1,t.length-2):t},i=/^(application|audio|font|image|message|model|multipart|text|video|\*)\/([a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]{1,127})(;.*)?$/,r=/;(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/;exports.fromString=function(s){var u=new t;if(s){var n=s.match(i);!n||"*"===n[1]&&"*"!==n[2]||(u.type=n[1],u._setSubtypeAndSuffix(n[2]),n[3]&&n[3].substr(1).split(r).forEach(function(t){var s=t.split("=",2);2===s.length&&(u.parameters[s[0].toLowerCase().trim()]=e(s[1].trim()))}))}return u}; },{}],"Nawo":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("react")),t=require("recoil"),r=require("media-type"),l=require("@neos-project/react-ui-components"),i=require("@media-ui/core/src"),n=require("@media-ui/core/src/hooks"),a=require("@media-ui/core/src/state");function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var l={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var a=i?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(l,n,a):l[n]=e[n]}return l.default=e,r&&r.set(e,l),l}var u=(0,i.createUseMediaUiStyles)(function(e){return{currentSelection:{display:"flex",flexWrap:"wrap",alignItems:"center",overflow:"hidden"},headline:{userSelect:"none",flex:"1 1 100%",fontWeight:"bold",lineHeight:e.spacing.goldenUnit},label:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","& svg":{marginRight:e.spacing.half}}}}),s=function(){var o=u(),c=(0,n.useSelectedAsset)(),s=(0,n.useSelectedAssetCollection)(),d=(0,n.useSelectedTag)(),f=(0,t.useRecoilValue)(a.selectedInspectorViewState),p=(0,i.useIntl)().translate,v=(0,e.useMemo)(function(){var e="question",t=null;if("asset"===f){if(null==c?void 0:c.file.mediaType){var l=(0,r.fromString)(c.file.mediaType);"audio"===l.type&&(e="file-audio"),"video"===l.type&&(e="file-video"),"image"===l.type&&(e="file-image")}else e="file";t=null==c?void 0:c.label}else"assetCollection"===f?(e="folder",t=null==s?void 0:s.title):"tag"===f&&(e="tag",t=null==d?void 0:d.label);return{icon:e,label:t}},[c,d,s,f]);return v.label?e.createElement("div",{className:o.currentSelection},e.createElement(l.Headline,{type:"h2",className:o.headline},p("currentSelection.headline","Selected element")),e.createElement("div",{className:o.label,title:v.label},e.createElement(l.Icon,{icon:v.icon}),v.label)):null},d=e.memo(s);exports.default=d; @@ -1635,7 +1647,7 @@ var t=function(){this.type=null,this._setSubtypeAndSuffix(null),this.parameters= },{"react":"d6ZO","recoil":"ejzu","@media-ui/core/src":"GGOe","@media-ui/core/src/state":"nstW"}],"AtL5":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=f(require("react")),t=require("recoil"),r=require("@neos-project/react-ui-components"),i=require("@media-ui/core/src"),a=require("@media-ui/feature-clipboard/src"),n=require("@media-ui/feature-asset-usage/src"),s=require("../../hooks"),u=require("./index"),o=c(require("../LoadingLabel")),l=require("../../state");function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var s=a?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(i,n,s):i[n]=e[n]}return i.default=e,r&&r.set(e,i),i}var p=(0,i.createUseMediaUiStyles)({emptyStateWrapper:{display:"flex",alignItems:"center",justifyContent:"center",height:"inherit"}}),m=function(){var c=p(),d=(0,s.useViewModeSelection)()[0],f=(0,i.useMediaUi)().assets,m=(0,n.useUnusedAssetsQuery)().assets,S=(0,a.useClipboard)().clipboard,y=(0,t.useRecoilValue)(l.mainViewState),b=(0,t.useSetRecoilState)(a.clipboardVisibleState),v=(0,i.useIntl)().translate,M=(0,e.useState)([]),g=M[0],O=M[1],w=(0,e.useMemo)(function(){return f.filter(function(e){return null==e?void 0:e.id}).map(function(e){return{assetId:e.id,assetSourceId:e.assetSource.id}})},[f]),I=(0,e.useMemo)(function(){return m.filter(function(e){return null==e?void 0:e.id}).map(function(e){return{assetId:e.id,assetSourceId:e.assetSource.id}})},[m]);return(0,e.useEffect)(function(){y===l.MainViewState.CLIPBOARD?O(Object.values(S)):y===l.MainViewState.UNUSED_ASSETS?O(I):O(w)},[y,w,I,S,O]),g.length>0?d===s.VIEW_MODES.List?e.createElement(u.ListView,{assetIdentities:g}):e.createElement(u.ThumbnailView,{assetIdentities:g}):e.createElement("div",{className:c.emptyStateWrapper},y===l.MainViewState.CLIPBOARD?e.createElement(r.Button,{size:"regular",style:"brand",hoverStyle:"brand",onClick:function(){return b(!1)}},v("clipboard.close","Close clipboard")):e.createElement(o.default,{loadingText:v("assetList.loading","Loading assets"),emptyText:v("assetList.empty","No assets found")}))},S=e.memo(m);exports.default=S; },{"react":"d6ZO","recoil":"ejzu","@neos-project/react-ui-components":"cH6v","@media-ui/core/src":"GGOe","@media-ui/feature-clipboard/src":"uNVG","@media-ui/feature-asset-usage/src":"SqV5","../../hooks":"KoiM","./index":"zf9z","../LoadingLabel":"lcOK","../../state":"zANE"}],"mnV3":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=d(require("react")),t=require("recoil"),r=require("@neos-project/react-ui-components"),a=require("@media-ui/core/src"),n=require("@media-ui/core/src/hooks"),o=require("@media-ui/core/src/state"),i=require("./index"),l=require("../Presentation"),s=c(require("./MissingAssetActions"));function c(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(a,o,i):a[o]=e[o]}return a.default=e,r&&r.set(e,a),a}var p=(0,a.createUseMediaUiStyles)(function(e){return{thumbnail:{margin:"0",display:"flex",flexDirection:"column",position:"relative","&:hover $caption":{backgroundColor:e.colors.primary},"&:hover $toolBar":{pointerEvents:"all",backgroundColor:"rgba(0.15, 0.15, 0.15, 0.25)","& button":{opacity:1,"&[disabled]":{opacity:.5},"&.button--active":{"& svg":{color:"white"}}}}},picture:{cursor:"pointer",height:"250px",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"center",backgroundColor:e.colors.assetBackground,"& img":{display:"block",backgroundImage:"repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)",backgroundPosition:"0 0, 10px 10px",backgroundSize:"20px 20px",maxHeight:"250px"}},caption:{backgroundColor:e.colors.captionBackground,transition:"background-color "+e.transition.fast,padding:e.spacing.half,display:"flex",alignItems:"center",flex:1,"& img, & svg":{width:"1.3rem",height:"auto",marginRight:e.spacing.half}},selected:{backgroundColor:e.colors.primary},toolBar:{display:"flex",position:"absolute",top:e.spacing.quarter,right:e.spacing.quarter,pointerEvents:"none",backgroundColor:"transparent",transition:"background-color .1s ease-in","& button, & button[disabled]":{transition:"opacity .1s ease-in",opacity:0,"&.button--active":{opacity:1,"& svg":{color:e.colors.primary}}}},label:{position:"absolute",top:e.spacing.quarter,left:e.spacing.quarter,fontSize:e.fontSize.small,borderRadius:"3px",padding:"2px 4px",userSelect:"none"},disabled:{"& $picture":{filter:"grayscale(1)",cursor:"not-allowed"}}}}),g=function(c){var u=c.assetIdentity,d=c.onSelect,g=p(),f=(0,a.useIntl)().translate,m=(0,a.useMediaUi)(),b=m.dummyImage,y=m.isAssetSelectable,v=(0,n.useAssetQuery)(u),x=v.asset,h=v.loading,k=(0,t.useRecoilValue)(o.selectedAssetIdState),I=(null==k?void 0:k.assetId)===u.assetId,E=(0,e.useMemo)(function(){return y(x)},[x,y]);return e.createElement("figure",{className:[g.thumbnail,!E&&g.disabled].join(" "),title:null==x?void 0:x.label},(null==x?void 0:x.imported)&&e.createElement("span",{className:g.label},f("asset.label.imported","Imported")),e.createElement("picture",{onClick:function(){return d(u,I)},className:g.picture},e.createElement("img",{src:h||!x?b:x.thumbnailUrl,alt:null==x?void 0:x.label})),e.createElement("figcaption",{className:[g.caption,I?g.selected:""].join(" ")},x&&e.createElement(e.Fragment,null,E&&x.file?e.createElement("img",{src:x.file.typeIcon.url,alt:x.file.typeIcon.alt}):e.createElement(r.Icon,{icon:"ban",color:"error"}),e.createElement(l.AssetLabel,{label:x.label}))),e.createElement("div",{className:g.toolBar},!h&&(x?e.createElement(i.AssetActions,{asset:x}):e.createElement(s.default,{assetIdentity:u}))))},f=e.memo(g,function(e,t){return e.assetIdentity.assetId===t.assetIdentity.assetId});exports.default=f; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=d(require("react")),t=require("recoil"),r=require("@neos-project/react-ui-components"),a=require("@media-ui/core/src"),n=require("@media-ui/core/src/hooks"),o=require("@media-ui/core/src/state"),i=require("./index"),l=require("../Presentation"),s=c(require("./MissingAssetActions"));function c(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(a,o,i):a[o]=e[o]}return a.default=e,r&&r.set(e,a),a}var p=(0,a.createUseMediaUiStyles)(function(e){return{thumbnail:{margin:"0",display:"flex",flexDirection:"column",position:"relative","&:hover $caption":{backgroundColor:e.colors.primary},"&:hover $toolBar":{pointerEvents:"all",backgroundColor:"rgba(0.15, 0.15, 0.15, 0.25)","& button":{opacity:1,"&[disabled]":{opacity:.5},"&.button--active":{"& svg":{color:"white"}}}}},picture:{cursor:"pointer",height:"250px",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"center",backgroundColor:e.colors.assetBackground,"& img":{display:"block",backgroundImage:"repeating-linear-gradient(45deg, #999999 25%, transparent 25%, transparent 75%, #999999 75%, #999999), repeating-linear-gradient(45deg, #999999 25%, #e5e5f7 25%, #e5e5f7 75%, #999999 75%, #999999)",backgroundPosition:"0 0, 10px 10px",backgroundSize:"20px 20px",maxHeight:"250px",maxWidth:"100%"}},caption:{backgroundColor:e.colors.captionBackground,transition:"background-color "+e.transition.fast,padding:e.spacing.half,display:"flex",alignItems:"center",flex:1,"& img, & svg":{width:"1.3rem",height:"auto",marginRight:e.spacing.half}},selected:{backgroundColor:e.colors.primary},toolBar:{display:"flex",position:"absolute",top:e.spacing.quarter,right:e.spacing.quarter,pointerEvents:"none",backgroundColor:"transparent",transition:"background-color .1s ease-in","& button, & button[disabled]":{transition:"opacity .1s ease-in",opacity:0,"&.button--active":{opacity:1,"& svg":{color:e.colors.primary}}}},label:{position:"absolute",top:e.spacing.quarter,left:e.spacing.quarter,fontSize:e.fontSize.small,borderRadius:"3px",padding:"2px 4px",userSelect:"none"},disabled:{"& $picture":{filter:"grayscale(1)",cursor:"not-allowed"}}}}),g=function(c){var u=c.assetIdentity,d=c.onSelect,g=p(),f=(0,a.useIntl)().translate,m=(0,a.useMediaUi)(),b=m.dummyImage,y=m.isAssetSelectable,v=(0,n.useAssetQuery)(u),x=v.asset,h=v.loading,k=(0,t.useRecoilValue)(o.selectedAssetIdState),I=(null==k?void 0:k.assetId)===u.assetId,E=(0,e.useMemo)(function(){return y(x)},[x,y]);return e.createElement("figure",{className:[g.thumbnail,!E&&g.disabled].join(" "),title:null==x?void 0:x.label},(null==x?void 0:x.imported)&&e.createElement("span",{className:g.label},f("asset.label.imported","Imported")),e.createElement("picture",{onClick:function(){return d(u,I)},className:g.picture},e.createElement("img",{src:h||!x?b:x.thumbnailUrl,alt:null==x?void 0:x.label})),e.createElement("figcaption",{className:[g.caption,I?g.selected:""].join(" ")},x&&e.createElement(e.Fragment,null,E&&x.file?e.createElement("img",{src:x.file.typeIcon.url,alt:x.file.typeIcon.alt}):e.createElement(r.Icon,{icon:"ban",color:"error"}),e.createElement(l.AssetLabel,{label:x.label}))),e.createElement("div",{className:g.toolBar},!h&&(x?e.createElement(i.AssetActions,{asset:x}):e.createElement(s.default,{assetIdentity:u}))))},f=e.memo(g,function(e,t){return e.assetIdentity.assetId===t.assetIdentity.assetId});exports.default=f; },{"react":"d6ZO","recoil":"ejzu","@neos-project/react-ui-components":"cH6v","@media-ui/core/src":"GGOe","@media-ui/core/src/hooks":"g1AJ","@media-ui/core/src/state":"nstW","./index":"zf9z","../Presentation":"HfS4","./MissingAssetActions":"EbfR"}],"L839":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),t=require("recoil"),r=require("@media-ui/core/src"),i=require("@media-ui/core/src/hooks"),n=require("@media-ui/feature-asset-preview/src"),a=require("./index");function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(i,a,o):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}var s=(0,r.createUseMediaUiStyles)(function(e){return{thumbnailView:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridGap:e.spacing.full}}}),c=function(r){var u=r.assetIdentities,o=s(),c=(0,t.useSetRecoilState)(n.selectedAssetForPreviewState),l=(0,i.useSelectAsset)(),f=(0,e.useCallback)(function(e,t){void 0===t&&(t=!1),t?c(e):l(e)},[c,l]);return e.createElement("section",{className:o.thumbnailView},u.map(function(t,r){return e.createElement(a.Thumbnail,{key:r,assetIdentity:t,onSelect:f})}))},l=e.memo(c);exports.default=l; },{"react":"d6ZO","recoil":"ejzu","@media-ui/core/src":"GGOe","@media-ui/core/src/hooks":"g1AJ","@media-ui/feature-asset-preview/src":"MVsg","./index":"zf9z"}],"zf9z":[function(require,module,exports) { @@ -1704,6 +1716,10 @@ var t=function(){this.type=null,this._setSubtypeAndSuffix(null),this.parameters= "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="fas",t="grip-lines-vertical",i=256,r=512,o=[],s="f7a5",c="M96 496V16c0-8.8-7.2-16-16-16H48c-8.8 0-16 7.2-16 16v480c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16zm128 0V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v480c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16z";exports.definition={prefix:e,iconName:t,icon:[i,r,o,s,c]},exports.faGripLinesVertical=exports.definition,exports.prefix=e,exports.iconName=t,exports.width=i,exports.height=r,exports.ligatures=o,exports.unicode=s,exports.svgPathData=c; },{}],"qi2c":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="fas",t="info-circle",o=512,i=512,r=[],s="f05a",c="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z";exports.definition={prefix:e,iconName:t,icon:[o,i,r,s,c]},exports.faInfoCircle=exports.definition,exports.prefix=e,exports.iconName=t,exports.width=o,exports.height=i,exports.ligatures=r,exports.unicode=s,exports.svgPathData=c; +},{}],"kDKF":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="fas",t="images",s=576,o=512,i=[],r="f302",c="M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z";exports.definition={prefix:e,iconName:t,icon:[s,o,i,r,c]},exports.faImages=exports.definition,exports.prefix=e,exports.iconName=t,exports.width=s,exports.height=o,exports.ligatures=i,exports.unicode=r,exports.svgPathData=c; +},{}],"hQZ6":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="fas",t="pencil-alt",i=512,o=512,c=[],r="f303",s="M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z";exports.definition={prefix:e,iconName:t,icon:[i,o,c,r,s]},exports.faPencilAlt=exports.definition,exports.prefix=e,exports.iconName=t,exports.width=i,exports.height=o,exports.ligatures=c,exports.unicode=r,exports.svgPathData=s; },{}],"dBtH":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var a="fas",e="photo-video",o=640,t=512,i=[],h="f87c",r="M608 0H160a32 32 0 0 0-32 32v96h160V64h192v320h128a32 32 0 0 0 32-32V32a32 32 0 0 0-32-32zM232 103a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm352 208a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm-168 57H32a32 32 0 0 0-32 32v288a32 32 0 0 0 32 32h384a32 32 0 0 0 32-32V192a32 32 0 0 0-32-32zM96 224a32 32 0 1 1-32 32 32 32 0 0 1 32-32zm288 224H64v-32l64-64 32 32 128-128 96 96z";exports.definition={prefix:a,iconName:e,icon:[o,t,i,h,r]},exports.faPhotoVideo=exports.definition,exports.prefix=a,exports.iconName=e,exports.width=o,exports.height=t,exports.ligatures=i,exports.unicode=h,exports.svgPathData=r; },{}],"uvSr":[function(require,module,exports) { @@ -1739,8 +1755,8 @@ var t=function(){this.type=null,this._setSubtypeAndSuffix(null),this.parameters= },{}],"yq6X":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="fab",o="creative-commons-zero",t=496,r=512,i=[],s="f4f3",c="M247.6 8C389.4 8 496 118.1 496 256c0 147.1-118.5 248-248.4 248C113.6 504 0 394.5 0 256 0 123.1 104.7 8 247.6 8zm.8 44.7C130.2 52.7 44.7 150.6 44.7 256c0 109.8 91.2 202.8 203.7 202.8 103.2 0 202.8-81.1 202.8-202.8.1-113.8-90.2-203.3-202.8-203.3zm-.4 60.5c-81.9 0-102.5 77.3-102.5 142.8 0 65.5 20.6 142.8 102.5 142.8S350.5 321.5 350.5 256c0-65.5-20.6-142.8-102.5-142.8zm0 53.9c3.3 0 6.4.5 9.2 1.2 5.9 5.1 8.8 12.1 3.1 21.9l-54.5 100.2c-1.7-12.7-1.9-25.1-1.9-34.4 0-28.8 2-88.9 44.1-88.9zm40.8 46.2c2.9 15.4 3.3 31.4 3.3 42.7 0 28.9-2 88.9-44.1 88.9-13.5 0-32.6-7.7-20.1-26.4l60.9-105.2z";exports.definition={prefix:e,iconName:o,icon:[t,r,i,s,c]},exports.faCreativeCommonsZero=exports.definition,exports.prefix=e,exports.iconName=o,exports.width=t,exports.height=r,exports.ligatures=i,exports.unicode=s,exports.svgPathData=c; },{}],"GQne":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=M;var e=require("@fortawesome/fontawesome-svg-core"),o=require("@fortawesome/free-solid-svg-icons/faAngleLeft"),r=require("@fortawesome/free-solid-svg-icons/faAngleRight"),s=require("@fortawesome/free-solid-svg-icons/faBan"),i=require("@fortawesome/free-solid-svg-icons/faBox"),f=require("@fortawesome/free-solid-svg-icons/faCalendarAlt"),a=require("@fortawesome/free-solid-svg-icons/faCamera"),n=require("@fortawesome/free-solid-svg-icons/faCheck"),l=require("@fortawesome/free-solid-svg-icons/faChevronCircleDown"),t=require("@fortawesome/free-solid-svg-icons/faChevronCircleUp"),d=require("@fortawesome/free-solid-svg-icons/faChevronDown"),c=require("@fortawesome/free-solid-svg-icons/faChevronUp"),m=require("@fortawesome/free-solid-svg-icons/faClipboard"),u=require("@fortawesome/free-solid-svg-icons/faClipboardCheck"),g=require("@fortawesome/free-solid-svg-icons/faClipboardList"),v=require("@fortawesome/free-solid-svg-icons/faCloudDownloadAlt"),w=require("@fortawesome/free-solid-svg-icons/faDownload"),q=require("@fortawesome/free-solid-svg-icons/faExclamationCircle"),C=require("@fortawesome/free-solid-svg-icons/faExpandAlt"),p=require("@fortawesome/free-solid-svg-icons/faFile"),h=require("@fortawesome/free-solid-svg-icons/faFileAudio"),A=require("@fortawesome/free-solid-svg-icons/faFileImage"),F=require("@fortawesome/free-solid-svg-icons/faFileVideo"),T=require("@fortawesome/free-solid-svg-icons/faFolder"),D=require("@fortawesome/free-solid-svg-icons/faFolderOpen"),b=require("@fortawesome/free-solid-svg-icons/faFont"),x=require("@fortawesome/free-solid-svg-icons/faGripLinesVertical"),L=require("@fortawesome/free-solid-svg-icons/faInfoCircle"),S=require("@fortawesome/free-solid-svg-icons/faPhotoVideo"),U=require("@fortawesome/free-solid-svg-icons/faPlus"),P=require("@fortawesome/free-solid-svg-icons/faQuestion"),V=require("@fortawesome/free-solid-svg-icons/faSpinner"),k=require("@fortawesome/free-solid-svg-icons/faSortAmountDown"),B=require("@fortawesome/free-solid-svg-icons/faSortAmountUp"),E=require("@fortawesome/free-solid-svg-icons/faSortDown"),I=require("@fortawesome/free-solid-svg-icons/faTag"),y=require("@fortawesome/free-solid-svg-icons/faTags"),O=require("@fortawesome/free-solid-svg-icons/faTh"),G=require("@fortawesome/free-solid-svg-icons/faThList"),N=require("@fortawesome/free-solid-svg-icons/faTimes"),Q=require("@fortawesome/free-solid-svg-icons/faTimesCircle"),R=require("@fortawesome/free-solid-svg-icons/faTrashAlt"),Z=require("@fortawesome/free-solid-svg-icons/faUpload"),_=require("@fortawesome/free-brands-svg-icons/faNeos"),j=require("@fortawesome/free-brands-svg-icons/faCreativeCommonsZero");function M(){e.library.add(o.faAngleLeft,r.faAngleRight,s.faBan,i.faBox,f.faCalendarAlt,a.faCamera,n.faCheck,l.faChevronCircleDown,t.faChevronCircleUp,d.faChevronDown,c.faChevronUp,m.faClipboard,u.faClipboardCheck,g.faClipboardList,v.faCloudDownloadAlt,j.faCreativeCommonsZero,w.faDownload,q.faExclamationCircle,C.faExpandAlt,p.faFile,h.faFileAudio,A.faFileImage,F.faFileVideo,T.faFolder,D.faFolderOpen,b.faFont,x.faGripLinesVertical,L.faInfoCircle,_.faNeos,S.faPhotoVideo,U.faPlus,P.faQuestion,V.faSpinner,k.faSortAmountDown,B.faSortAmountUp,E.faSortDown,I.faTag,y.faTags,O.faTh,G.faThList,N.faTimes,Q.faTimesCircle,R.faTrashAlt,Z.faUpload)}e.config.familyPrefix="fa",e.config.replacementClass="svg-inline--fa"; -},{"@fortawesome/fontawesome-svg-core":"Ayxr","@fortawesome/free-solid-svg-icons/faAngleLeft":"uIbc","@fortawesome/free-solid-svg-icons/faAngleRight":"L4J7","@fortawesome/free-solid-svg-icons/faBan":"raJR","@fortawesome/free-solid-svg-icons/faBox":"wLRd","@fortawesome/free-solid-svg-icons/faCalendarAlt":"gqT3","@fortawesome/free-solid-svg-icons/faCamera":"KaYZ","@fortawesome/free-solid-svg-icons/faCheck":"LFJu","@fortawesome/free-solid-svg-icons/faChevronCircleDown":"EPuV","@fortawesome/free-solid-svg-icons/faChevronCircleUp":"MOCc","@fortawesome/free-solid-svg-icons/faChevronDown":"XT6w","@fortawesome/free-solid-svg-icons/faChevronUp":"J95p","@fortawesome/free-solid-svg-icons/faClipboard":"jqNd","@fortawesome/free-solid-svg-icons/faClipboardCheck":"hE4N","@fortawesome/free-solid-svg-icons/faClipboardList":"obEd","@fortawesome/free-solid-svg-icons/faCloudDownloadAlt":"qYlq","@fortawesome/free-solid-svg-icons/faDownload":"StAq","@fortawesome/free-solid-svg-icons/faExclamationCircle":"Yg4w","@fortawesome/free-solid-svg-icons/faExpandAlt":"Dsz4","@fortawesome/free-solid-svg-icons/faFile":"pNto","@fortawesome/free-solid-svg-icons/faFileAudio":"yklg","@fortawesome/free-solid-svg-icons/faFileImage":"E0Nk","@fortawesome/free-solid-svg-icons/faFileVideo":"s56d","@fortawesome/free-solid-svg-icons/faFolder":"HHDY","@fortawesome/free-solid-svg-icons/faFolderOpen":"irYH","@fortawesome/free-solid-svg-icons/faFont":"xDoW","@fortawesome/free-solid-svg-icons/faGripLinesVertical":"iPS5","@fortawesome/free-solid-svg-icons/faInfoCircle":"qi2c","@fortawesome/free-solid-svg-icons/faPhotoVideo":"dBtH","@fortawesome/free-solid-svg-icons/faPlus":"uvSr","@fortawesome/free-solid-svg-icons/faQuestion":"eJ7q","@fortawesome/free-solid-svg-icons/faSpinner":"hke6","@fortawesome/free-solid-svg-icons/faSortAmountDown":"sW8p","@fortawesome/free-solid-svg-icons/faSortAmountUp":"yHbj","@fortawesome/free-solid-svg-icons/faSortDown":"QDD1","@fortawesome/free-solid-svg-icons/faTag":"yNxy","@fortawesome/free-solid-svg-icons/faTags":"N5Tv","@fortawesome/free-solid-svg-icons/faTh":"DTmN","@fortawesome/free-solid-svg-icons/faThList":"JA7t","@fortawesome/free-solid-svg-icons/faTimes":"Acnw","@fortawesome/free-solid-svg-icons/faTimesCircle":"pgbV","@fortawesome/free-solid-svg-icons/faTrashAlt":"aFN6","@fortawesome/free-solid-svg-icons/faUpload":"HChR","@fortawesome/free-brands-svg-icons/faNeos":"VC8K","@fortawesome/free-brands-svg-icons/faCreativeCommonsZero":"yq6X"}],"zo2T":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=H;var e=require("@fortawesome/fontawesome-svg-core"),o=require("@fortawesome/free-solid-svg-icons/faAngleLeft"),r=require("@fortawesome/free-solid-svg-icons/faAngleRight"),s=require("@fortawesome/free-solid-svg-icons/faBan"),i=require("@fortawesome/free-solid-svg-icons/faBox"),f=require("@fortawesome/free-solid-svg-icons/faCalendarAlt"),a=require("@fortawesome/free-solid-svg-icons/faCamera"),l=require("@fortawesome/free-solid-svg-icons/faCheck"),n=require("@fortawesome/free-solid-svg-icons/faChevronCircleDown"),t=require("@fortawesome/free-solid-svg-icons/faChevronCircleUp"),d=require("@fortawesome/free-solid-svg-icons/faChevronDown"),c=require("@fortawesome/free-solid-svg-icons/faChevronUp"),m=require("@fortawesome/free-solid-svg-icons/faClipboard"),g=require("@fortawesome/free-solid-svg-icons/faClipboardCheck"),u=require("@fortawesome/free-solid-svg-icons/faClipboardList"),v=require("@fortawesome/free-solid-svg-icons/faCloudDownloadAlt"),w=require("@fortawesome/free-solid-svg-icons/faDownload"),q=require("@fortawesome/free-solid-svg-icons/faExclamationCircle"),C=require("@fortawesome/free-solid-svg-icons/faExpandAlt"),p=require("@fortawesome/free-solid-svg-icons/faFile"),h=require("@fortawesome/free-solid-svg-icons/faFileAudio"),A=require("@fortawesome/free-solid-svg-icons/faFileImage"),F=require("@fortawesome/free-solid-svg-icons/faFileVideo"),T=require("@fortawesome/free-solid-svg-icons/faFolder"),D=require("@fortawesome/free-solid-svg-icons/faFolderOpen"),b=require("@fortawesome/free-solid-svg-icons/faFont"),x=require("@fortawesome/free-solid-svg-icons/faGripLinesVertical"),L=require("@fortawesome/free-solid-svg-icons/faInfoCircle"),P=require("@fortawesome/free-solid-svg-icons/faImages"),S=require("@fortawesome/free-solid-svg-icons/faPencilAlt"),U=require("@fortawesome/free-solid-svg-icons/faPhotoVideo"),I=require("@fortawesome/free-solid-svg-icons/faPlus"),V=require("@fortawesome/free-solid-svg-icons/faQuestion"),k=require("@fortawesome/free-solid-svg-icons/faSpinner"),B=require("@fortawesome/free-solid-svg-icons/faSortAmountDown"),E=require("@fortawesome/free-solid-svg-icons/faSortAmountUp"),y=require("@fortawesome/free-solid-svg-icons/faSortDown"),O=require("@fortawesome/free-solid-svg-icons/faTag"),G=require("@fortawesome/free-solid-svg-icons/faTags"),N=require("@fortawesome/free-solid-svg-icons/faTh"),Q=require("@fortawesome/free-solid-svg-icons/faThList"),R=require("@fortawesome/free-solid-svg-icons/faTimes"),Z=require("@fortawesome/free-solid-svg-icons/faTimesCircle"),_=require("@fortawesome/free-solid-svg-icons/faTrashAlt"),j=require("@fortawesome/free-solid-svg-icons/faUpload"),M=require("@fortawesome/free-brands-svg-icons/faNeos"),z=require("@fortawesome/free-brands-svg-icons/faCreativeCommonsZero");function H(){e.library.add(o.faAngleLeft,r.faAngleRight,s.faBan,i.faBox,f.faCalendarAlt,a.faCamera,l.faCheck,n.faChevronCircleDown,t.faChevronCircleUp,d.faChevronDown,c.faChevronUp,m.faClipboard,g.faClipboardCheck,u.faClipboardList,v.faCloudDownloadAlt,z.faCreativeCommonsZero,w.faDownload,q.faExclamationCircle,C.faExpandAlt,p.faFile,h.faFileAudio,A.faFileImage,F.faFileVideo,T.faFolder,D.faFolderOpen,b.faFont,x.faGripLinesVertical,P.faImages,L.faInfoCircle,M.faNeos,S.faPencilAlt,U.faPhotoVideo,I.faPlus,V.faQuestion,k.faSpinner,B.faSortAmountDown,E.faSortAmountUp,y.faSortDown,O.faTag,G.faTags,N.faTh,Q.faThList,R.faTimes,Z.faTimesCircle,_.faTrashAlt,j.faUpload)}e.config.familyPrefix="fa",e.config.replacementClass="svg-inline--fa"; +},{"@fortawesome/fontawesome-svg-core":"Ayxr","@fortawesome/free-solid-svg-icons/faAngleLeft":"uIbc","@fortawesome/free-solid-svg-icons/faAngleRight":"L4J7","@fortawesome/free-solid-svg-icons/faBan":"raJR","@fortawesome/free-solid-svg-icons/faBox":"wLRd","@fortawesome/free-solid-svg-icons/faCalendarAlt":"gqT3","@fortawesome/free-solid-svg-icons/faCamera":"KaYZ","@fortawesome/free-solid-svg-icons/faCheck":"LFJu","@fortawesome/free-solid-svg-icons/faChevronCircleDown":"EPuV","@fortawesome/free-solid-svg-icons/faChevronCircleUp":"MOCc","@fortawesome/free-solid-svg-icons/faChevronDown":"XT6w","@fortawesome/free-solid-svg-icons/faChevronUp":"J95p","@fortawesome/free-solid-svg-icons/faClipboard":"jqNd","@fortawesome/free-solid-svg-icons/faClipboardCheck":"hE4N","@fortawesome/free-solid-svg-icons/faClipboardList":"obEd","@fortawesome/free-solid-svg-icons/faCloudDownloadAlt":"qYlq","@fortawesome/free-solid-svg-icons/faDownload":"StAq","@fortawesome/free-solid-svg-icons/faExclamationCircle":"Yg4w","@fortawesome/free-solid-svg-icons/faExpandAlt":"Dsz4","@fortawesome/free-solid-svg-icons/faFile":"pNto","@fortawesome/free-solid-svg-icons/faFileAudio":"yklg","@fortawesome/free-solid-svg-icons/faFileImage":"E0Nk","@fortawesome/free-solid-svg-icons/faFileVideo":"s56d","@fortawesome/free-solid-svg-icons/faFolder":"HHDY","@fortawesome/free-solid-svg-icons/faFolderOpen":"irYH","@fortawesome/free-solid-svg-icons/faFont":"xDoW","@fortawesome/free-solid-svg-icons/faGripLinesVertical":"iPS5","@fortawesome/free-solid-svg-icons/faInfoCircle":"qi2c","@fortawesome/free-solid-svg-icons/faImages":"kDKF","@fortawesome/free-solid-svg-icons/faPencilAlt":"hQZ6","@fortawesome/free-solid-svg-icons/faPhotoVideo":"dBtH","@fortawesome/free-solid-svg-icons/faPlus":"uvSr","@fortawesome/free-solid-svg-icons/faQuestion":"eJ7q","@fortawesome/free-solid-svg-icons/faSpinner":"hke6","@fortawesome/free-solid-svg-icons/faSortAmountDown":"sW8p","@fortawesome/free-solid-svg-icons/faSortAmountUp":"yHbj","@fortawesome/free-solid-svg-icons/faSortDown":"QDD1","@fortawesome/free-solid-svg-icons/faTag":"yNxy","@fortawesome/free-solid-svg-icons/faTags":"N5Tv","@fortawesome/free-solid-svg-icons/faTh":"DTmN","@fortawesome/free-solid-svg-icons/faThList":"JA7t","@fortawesome/free-solid-svg-icons/faTimes":"Acnw","@fortawesome/free-solid-svg-icons/faTimesCircle":"pgbV","@fortawesome/free-solid-svg-icons/faTrashAlt":"aFN6","@fortawesome/free-solid-svg-icons/faUpload":"HChR","@fortawesome/free-brands-svg-icons/faNeos":"VC8K","@fortawesome/free-brands-svg-icons/faCreativeCommonsZero":"yq6X"}],"zo2T":[function(require,module,exports) { "use strict";var e=g(require("react")),t=require("react-dom"),r=b(require("react-modal")),n=require("recoil"),a=require("react-dnd"),o=b(require("react-dnd-html5-backend")),i=require("@apollo/client"),l=require("react-hot-loader"),u=require("apollo-upload-client"),c=require("@media-ui/core/src"),d=b(require("@media-ui/core/schema.graphql")),s=b(require("@media-ui/feature-clipboard/schema.graphql")),f=b(require("@media-ui/feature-asset-usage/schema.graphql")),p=b(require("@media-ui/feature-clipboard/src/resolvers/mutation")),m=b(require("./resolvers/mutation")),v=require("./core"),h=b(require("./components/App")),y=b(require("./components/ErrorBoundary")),w=b(require("./lib/FontAwesome"));function b(e){return e&&e.__esModule?e:{default:e}}function q(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(q=function(e){return e?r:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=q(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}var P=function(e,t,r,n){return new(r||(r=Promise))(function(a,o){function i(e){try{u(n.next(e))}catch(t){o(t)}}function l(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,l)}u((n=n.apply(e,t||[])).next())})},M=function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=G};l=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0K(n,c))void 0!==r&&0>K(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>K(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function K(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var N=[],O=[],P=1,Q=null,R=3,S=!1,T=!1,U=!1;\nfunction V(a){for(var b=L(O);null!==b;){if(null===b.callback)M(O);else if(b.startTime<=a)M(O),b.sortIndex=b.expirationTime,J(N,b);else break;b=L(O)}}function W(a){U=!1;V(a);if(!T)if(null!==L(N))T=!0,f(X);else{var b=L(O);null!==b&&g(W,b.startTime-a)}}\nfunction X(a,b){T=!1;U&&(U=!1,h());S=!0;var c=R;try{V(b);for(Q=L(N);null!==Q&&(!(Q.expirationTime>b)||a&&!k());){var d=Q.callback;if(null!==d){Q.callback=null;R=Q.priorityLevel;var e=d(Q.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?Q.callback=e:Q===L(N)&&M(N);V(b)}else M(N);Q=L(N)}if(null!==Q)var m=!0;else{var n=L(O);null!==n&&g(W,n.startTime-b);m=!1}return m}finally{Q=null,R=c,S=!1}}\nfunction Y(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}var Z=l;exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){T||S||(T=!0,f(X))};\nexports.unstable_getCurrentPriorityLevel=function(){return R};exports.unstable_getFirstCallbackNode=function(){return L(N)};exports.unstable_next=function(a){switch(R){case 1:case 2:case 3:var b=3;break;default:b=R}var c=R;R=b;try{return a()}finally{R=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=Z;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=R;R=a;try{return b()}finally{R=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if(\"object\"===typeof c&&null!==c){var e=c.delay;e=\"number\"===typeof e&&0d?(a.sortIndex=e,J(O,a),null===L(N)&&a===L(O)&&(U?h():U=!0,g(W,e-d))):(a.sortIndex=c,J(N,a),T||S||(T=!0,f(X)));return a};\nexports.unstable_shouldYield=function(){var a=exports.unstable_now();V(a);var b=L(N);return b!==Q&&null!==Q&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTimeb}return!1}function v(a,b,c,d,e,f){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f}var C={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){C[a]=new v(a,0,!1,a,null,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];C[b]=new v(b,1,!1,a[1],null,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){C[a]=new v(a,2,!1,a.toLowerCase(),null,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){C[a]=new v(a,2,!1,a,null,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){C[a]=new v(a,3,!1,a.toLowerCase(),null,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){C[a]=new v(a,3,!0,a,null,!1)});[\"capture\",\"download\"].forEach(function(a){C[a]=new v(a,4,!1,a,null,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){C[a]=new v(a,6,!1,a,null,!1)});[\"rowSpan\",\"start\"].forEach(function(a){C[a]=new v(a,5,!1,a.toLowerCase(),null,!1)});var Ua=/[\\-:]([a-z])/g;function Va(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(Ua,\nVa);C[b]=new v(b,1,!1,a,null,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(Ua,Va);C[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(Ua,Va);C[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!1)});\nC.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!0)});var Wa=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Wa.hasOwnProperty(\"ReactCurrentDispatcher\")||(Wa.ReactCurrentDispatcher={current:null});Wa.hasOwnProperty(\"ReactCurrentBatchConfig\")||(Wa.ReactCurrentBatchConfig={suspense:null});\nfunction Xa(a,b,c,d){var e=C.hasOwnProperty(b)?C[b]:null;var f=null!==e?0===e.type:d?!1:!(2=c.length))throw Error(u(93));c=c[0]}b=c}null==b&&(b=\"\");c=b}a._wrapperState={initialValue:rb(c)}}\nfunction Kb(a,b){var c=rb(b.value),d=rb(b.defaultValue);null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\"\"+d)}function Lb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\"\"!==b&&null!==b&&(a.value=b)}var Mb={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction Nb(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";case \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function Ob(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?Nb(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar Pb,Qb=function(a){return\"undefined\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==Mb.svg||\"innerHTML\"in a)a.innerHTML=b;else{Pb=Pb||document.createElement(\"div\");Pb.innerHTML=\"\"+b.valueOf().toString()+\"\";for(b=Pb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction Rb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}function Sb(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c[\"Webkit\"+a]=\"webkit\"+b;c[\"Moz\"+a]=\"moz\"+b;return c}var Tb={animationend:Sb(\"Animation\",\"AnimationEnd\"),animationiteration:Sb(\"Animation\",\"AnimationIteration\"),animationstart:Sb(\"Animation\",\"AnimationStart\"),transitionend:Sb(\"Transition\",\"TransitionEnd\")},Ub={},Vb={};\nya&&(Vb=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Tb.animationend.animation,delete Tb.animationiteration.animation,delete Tb.animationstart.animation),\"TransitionEvent\"in window||delete Tb.transitionend.transition);function Wb(a){if(Ub[a])return Ub[a];if(!Tb[a])return a;var b=Tb[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Vb)return Ub[a]=b[c];return a}\nvar Xb=Wb(\"animationend\"),Yb=Wb(\"animationiteration\"),Zb=Wb(\"animationstart\"),$b=Wb(\"transitionend\"),ac=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),bc=new (\"function\"===typeof WeakMap?WeakMap:Map);function cc(a){var b=bc.get(a);void 0===b&&(b=new Map,bc.set(a,b));return b}\nfunction dc(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.effectTag&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function ec(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function fc(a){if(dc(a)!==a)throw Error(u(188));}\nfunction gc(a){var b=a.alternate;if(!b){b=dc(a);if(null===b)throw Error(u(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return fc(e),a;if(f===d)return fc(e),b;f=f.sibling}throw Error(u(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===\nc){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(u(189));}}if(c.alternate!==d)throw Error(u(190));}if(3!==c.tag)throw Error(u(188));return c.stateNode.current===c?a:b}function hc(a){a=gc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}\nfunction ic(a,b){if(null==b)throw Error(u(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function jc(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var kc=null;\nfunction lc(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;dpc.length&&pc.push(a)}\nfunction rc(a,b,c,d){if(pc.length){var e=pc.pop();e.topLevelType=a;e.eventSystemFlags=d;e.nativeEvent=b;e.targetInst=c;return e}return{topLevelType:a,eventSystemFlags:d,nativeEvent:b,targetInst:c,ancestors:[]}}\nfunction sc(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d=c;if(3===d.tag)d=d.stateNode.containerInfo;else{for(;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo}if(!d)break;b=c.tag;5!==b&&6!==b||a.ancestors.push(c);c=tc(d)}while(c);for(c=0;c=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=ud(c)}}\nfunction wd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?wd(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function xd(){for(var a=window,b=td();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=td(a.document)}return b}\nfunction yd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}var zd=\"$\",Ad=\"/$\",Bd=\"$?\",Cd=\"$!\",Dd=null,Ed=null;function Fd(a,b){switch(a){case \"button\":case \"input\":case \"select\":case \"textarea\":return!!b.autoFocus}return!1}\nfunction Gd(a,b){return\"textarea\"===a||\"option\"===a||\"noscript\"===a||\"string\"===typeof b.children||\"number\"===typeof b.children||\"object\"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var Hd=\"function\"===typeof setTimeout?setTimeout:void 0,Id=\"function\"===typeof clearTimeout?clearTimeout:void 0;function Jd(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}\nfunction Kd(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(c===zd||c===Cd||c===Bd){if(0===b)return a;b--}else c===Ad&&b++}a=a.previousSibling}return null}var Ld=Math.random().toString(36).slice(2),Md=\"__reactInternalInstance$\"+Ld,Nd=\"__reactEventHandlers$\"+Ld,Od=\"__reactContainere$\"+Ld;\nfunction tc(a){var b=a[Md];if(b)return b;for(var c=a.parentNode;c;){if(b=c[Od]||c[Md]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=Kd(a);null!==a;){if(c=a[Md])return c;a=Kd(a)}return b}a=c;c=a.parentNode}return null}function Nc(a){a=a[Md]||a[Od];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function Pd(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(u(33));}function Qd(a){return a[Nd]||null}\nfunction Rd(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}\nfunction Sd(a,b){var c=a.stateNode;if(!c)return null;var d=la(c);if(!d)return null;c=d[b];a:switch(b){case \"onClick\":case \"onClickCapture\":case \"onDoubleClick\":case \"onDoubleClickCapture\":case \"onMouseDown\":case \"onMouseDownCapture\":case \"onMouseMove\":case \"onMouseMoveCapture\":case \"onMouseUp\":case \"onMouseUpCapture\":case \"onMouseEnter\":(d=!d.disabled)||(a=a.type,d=!(\"button\"===a||\"input\"===a||\"select\"===a||\"textarea\"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&\"function\"!==typeof c)throw Error(u(231,\nb,typeof c));return c}function Td(a,b,c){if(b=Sd(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=ic(c._dispatchListeners,b),c._dispatchInstances=ic(c._dispatchInstances,a)}function Ud(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Rd(b);for(b=c.length;0this.eventPool.length&&this.eventPool.push(a)}function de(a){a.eventPool=[];a.getPooled=ee;a.release=fe}var ge=G.extend({data:null}),he=G.extend({data:null}),ie=[9,13,27,32],je=ya&&\"CompositionEvent\"in window,ke=null;ya&&\"documentMode\"in document&&(ke=document.documentMode);\nvar le=ya&&\"TextEvent\"in window&&!ke,me=ya&&(!je||ke&&8=ke),ne=String.fromCharCode(32),oe={beforeInput:{phasedRegistrationNames:{bubbled:\"onBeforeInput\",captured:\"onBeforeInputCapture\"},dependencies:[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]},compositionEnd:{phasedRegistrationNames:{bubbled:\"onCompositionEnd\",captured:\"onCompositionEndCapture\"},dependencies:\"blur compositionend keydown keypress keyup mousedown\".split(\" \")},compositionStart:{phasedRegistrationNames:{bubbled:\"onCompositionStart\",\ncaptured:\"onCompositionStartCapture\"},dependencies:\"blur compositionstart keydown keypress keyup mousedown\".split(\" \")},compositionUpdate:{phasedRegistrationNames:{bubbled:\"onCompositionUpdate\",captured:\"onCompositionUpdateCapture\"},dependencies:\"blur compositionupdate keydown keypress keyup mousedown\".split(\" \")}},pe=!1;\nfunction qe(a,b){switch(a){case \"keyup\":return-1!==ie.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"blur\":return!0;default:return!1}}function re(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var se=!1;function te(a,b){switch(a){case \"compositionend\":return re(b);case \"keypress\":if(32!==b.which)return null;pe=!0;return ne;case \"textInput\":return a=b.data,a===ne&&pe?null:a;default:return null}}\nfunction ue(a,b){if(se)return\"compositionend\"===a||!je&&qe(a,b)?(a=ae(),$d=Zd=Yd=null,se=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=document.documentMode,df={select:{phasedRegistrationNames:{bubbled:\"onSelect\",captured:\"onSelectCapture\"},dependencies:\"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange\".split(\" \")}},ef=null,ff=null,gf=null,hf=!1;\nfunction jf(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(hf||null==ef||ef!==td(c))return null;c=ef;\"selectionStart\"in c&&yd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return gf&&bf(gf,c)?null:(gf=c,a=G.getPooled(df.select,ff,a,b),a.type=\"select\",a.target=ef,Xd(a),a)}\nvar kf={eventTypes:df,extractEvents:function(a,b,c,d,e,f){e=f||(d.window===d?d.document:9===d.nodeType?d:d.ownerDocument);if(!(f=!e)){a:{e=cc(e);f=wa.onSelect;for(var g=0;gzf||(a.current=yf[zf],yf[zf]=null,zf--)}\nfunction I(a,b){zf++;yf[zf]=a.current;a.current=b}var Af={},J={current:Af},K={current:!1},Bf=Af;function Cf(a,b){var c=a.type.contextTypes;if(!c)return Af;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function L(a){a=a.childContextTypes;return null!==a&&void 0!==a}\nfunction Df(){H(K);H(J)}function Ef(a,b,c){if(J.current!==Af)throw Error(u(168));I(J,b);I(K,c)}function Ff(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(u(108,pb(b)||\"Unknown\",e));return n({},c,{},d)}function Gf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Af;Bf=J.current;I(J,a);I(K,K.current);return!0}\nfunction Hf(a,b,c){var d=a.stateNode;if(!d)throw Error(u(169));c?(a=Ff(a,b,Bf),d.__reactInternalMemoizedMergedChildContext=a,H(K),H(J),I(J,a)):H(K);I(K,c)}\nvar If=r.unstable_runWithPriority,Jf=r.unstable_scheduleCallback,Kf=r.unstable_cancelCallback,Lf=r.unstable_requestPaint,Mf=r.unstable_now,Nf=r.unstable_getCurrentPriorityLevel,Of=r.unstable_ImmediatePriority,Pf=r.unstable_UserBlockingPriority,Qf=r.unstable_NormalPriority,Rf=r.unstable_LowPriority,Sf=r.unstable_IdlePriority,Tf={},Uf=r.unstable_shouldYield,Vf=void 0!==Lf?Lf:function(){},Wf=null,Xf=null,Yf=!1,Zf=Mf(),$f=1E4>Zf?Mf:function(){return Mf()-Zf};\nfunction ag(){switch(Nf()){case Of:return 99;case Pf:return 98;case Qf:return 97;case Rf:return 96;case Sf:return 95;default:throw Error(u(332));}}function bg(a){switch(a){case 99:return Of;case 98:return Pf;case 97:return Qf;case 96:return Rf;case 95:return Sf;default:throw Error(u(332));}}function cg(a,b){a=bg(a);return If(a,b)}function dg(a,b,c){a=bg(a);return Jf(a,b,c)}function eg(a){null===Wf?(Wf=[a],Xf=Jf(Of,fg)):Wf.push(a);return Tf}function gg(){if(null!==Xf){var a=Xf;Xf=null;Kf(a)}fg()}\nfunction fg(){if(!Yf&&null!==Wf){Yf=!0;var a=0;try{var b=Wf;cg(99,function(){for(;a=b&&(rg=!0),a.firstContext=null)}\nfunction sg(a,b){if(mg!==a&&!1!==b&&0!==b){if(\"number\"!==typeof b||1073741823===b)mg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===lg){if(null===kg)throw Error(u(308));lg=b;kg.dependencies={expirationTime:0,firstContext:b,responders:null}}else lg=lg.next=b}return a._currentValue}var tg=!1;function ug(a){a.updateQueue={baseState:a.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}\nfunction vg(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,baseQueue:a.baseQueue,shared:a.shared,effects:a.effects})}function wg(a,b){a={expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null};return a.next=a}function xg(a,b){a=a.updateQueue;if(null!==a){a=a.shared;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}}\nfunction yg(a,b){var c=a.alternate;null!==c&&vg(c,a);a=a.updateQueue;c=a.baseQueue;null===c?(a.baseQueue=b.next=b,b.next=b):(b.next=c.next,c.next=b)}\nfunction zg(a,b,c,d){var e=a.updateQueue;tg=!1;var f=e.baseQueue,g=e.shared.pending;if(null!==g){if(null!==f){var h=f.next;f.next=g.next;g.next=h}f=g;e.shared.pending=null;h=a.alternate;null!==h&&(h=h.updateQueue,null!==h&&(h.baseQueue=g))}if(null!==f){h=f.next;var k=e.baseState,l=0,m=null,p=null,x=null;if(null!==h){var z=h;do{g=z.expirationTime;if(gl&&(l=g)}else{null!==x&&(x=x.next={expirationTime:1073741823,suspenseConfig:z.suspenseConfig,tag:z.tag,payload:z.payload,callback:z.callback,next:null});Ag(g,z.suspenseConfig);a:{var D=a,t=z;g=b;ca=c;switch(t.tag){case 1:D=t.payload;if(\"function\"===typeof D){k=D.call(ca,k,g);break a}k=D;break a;case 3:D.effectTag=D.effectTag&-4097|64;case 0:D=t.payload;g=\"function\"===typeof D?D.call(ca,k,g):D;if(null===g||void 0===g)break a;k=n({},k,g);break a;case 2:tg=!0}}null!==z.callback&&\n(a.effectTag|=32,g=e.effects,null===g?e.effects=[z]:g.push(z))}z=z.next;if(null===z||z===h)if(g=e.shared.pending,null===g)break;else z=f.next=g.next,g.next=h,e.baseQueue=f=g,e.shared.pending=null}while(1)}null===x?m=k:x.next=p;e.baseState=m;e.baseQueue=x;Bg(l);a.expirationTime=l;a.memoizedState=k}}\nfunction Cg(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;by?(A=m,m=null):A=m.sibling;var q=x(e,m,h[y],k);if(null===q){null===m&&(m=A);break}a&&\nm&&null===q.alternate&&b(e,m);g=f(q,g,y);null===t?l=q:t.sibling=q;t=q;m=A}if(y===h.length)return c(e,m),l;if(null===m){for(;yy?(A=t,t=null):A=t.sibling;var D=x(e,t,q.value,l);if(null===D){null===t&&(t=A);break}a&&t&&null===D.alternate&&b(e,t);g=f(D,g,y);null===m?k=D:m.sibling=D;m=D;t=A}if(q.done)return c(e,t),k;if(null===t){for(;!q.done;y++,q=h.next())q=p(e,q.value,l),null!==q&&(g=f(q,g,y),null===m?k=q:m.sibling=q,m=q);return k}for(t=d(e,t);!q.done;y++,q=h.next())q=z(t,e,y,q.value,l),null!==q&&(a&&null!==\nq.alternate&&t.delete(null===q.key?y:q.key),g=f(q,g,y),null===m?k=q:m.sibling=q,m=q);a&&t.forEach(function(a){return b(e,a)});return k}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===ab&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Za:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ab){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,\nk.sibling);d=e(k,f.props);d.ref=Pg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===ab?(d=Wg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ug(f.type,f.key,f.props,null,a.mode,h),h.ref=Pg(a,d,f),h.return=a,a=h)}return g(a);case $a:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=\nd.sibling}d=Vg(f,a.mode,h);d.return=a;a=d}return g(a)}if(\"string\"===typeof f||\"number\"===typeof f)return f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Tg(f,a.mode,h),d.return=a,a=d),g(a);if(Og(f))return ca(a,d,f,h);if(nb(f))return D(a,d,f,h);l&&Qg(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,Error(u(152,a.displayName||a.name||\"Component\"));}return c(a,d)}}var Xg=Rg(!0),Yg=Rg(!1),Zg={},$g={current:Zg},ah={current:Zg},bh={current:Zg};\nfunction ch(a){if(a===Zg)throw Error(u(174));return a}function dh(a,b){I(bh,b);I(ah,a);I($g,Zg);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Ob(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=Ob(b,a)}H($g);I($g,b)}function eh(){H($g);H(ah);H(bh)}function fh(a){ch(bh.current);var b=ch($g.current);var c=Ob(b,a.type);b!==c&&(I(ah,a),I($g,c))}function gh(a){ah.current===a&&(H($g),H(ah))}var M={current:0};\nfunction hh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||c.data===Bd||c.data===Cd))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.effectTag&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function ih(a,b){return{responder:a,props:b}}\nvar jh=Wa.ReactCurrentDispatcher,kh=Wa.ReactCurrentBatchConfig,lh=0,N=null,O=null,P=null,mh=!1;function Q(){throw Error(u(321));}function nh(a,b){if(null===b)return!1;for(var c=0;cf))throw Error(u(301));f+=1;P=O=null;b.updateQueue=null;jh.current=rh;a=c(d,e)}while(b.expirationTime===lh)}jh.current=sh;b=null!==O&&null!==O.next;lh=0;P=O=N=null;mh=!1;if(b)throw Error(u(300));return a}\nfunction th(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===P?N.memoizedState=P=a:P=P.next=a;return P}function uh(){if(null===O){var a=N.alternate;a=null!==a?a.memoizedState:null}else a=O.next;var b=null===P?N.memoizedState:P.next;if(null!==b)P=b,O=a;else{if(null===a)throw Error(u(310));O=a;a={memoizedState:O.memoizedState,baseState:O.baseState,baseQueue:O.baseQueue,queue:O.queue,next:null};null===P?N.memoizedState=P=a:P=P.next=a}return P}\nfunction vh(a,b){return\"function\"===typeof b?b(a):b}\nfunction wh(a){var b=uh(),c=b.queue;if(null===c)throw Error(u(311));c.lastRenderedReducer=a;var d=O,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.expirationTime;if(lN.expirationTime&&\n(N.expirationTime=l,Bg(l))}else null!==h&&(h=h.next={expirationTime:1073741823,suspenseConfig:k.suspenseConfig,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),Ag(l,k.suspenseConfig),d=k.eagerReducer===a?k.eagerState:a(d,k.action);k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;$e(d,b.memoizedState)||(rg=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d}return[b.memoizedState,c.dispatch]}\nfunction xh(a){var b=uh(),c=b.queue;if(null===c)throw Error(u(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);$e(f,b.memoizedState)||(rg=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}\nfunction yh(a){var b=th();\"function\"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={pending:null,dispatch:null,lastRenderedReducer:vh,lastRenderedState:a};a=a.dispatch=zh.bind(null,N,a);return[b.memoizedState,a]}function Ah(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=N.updateQueue;null===b?(b={lastEffect:null},N.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}\nfunction Bh(){return uh().memoizedState}function Ch(a,b,c,d){var e=th();N.effectTag|=a;e.memoizedState=Ah(1|b,c,void 0,void 0===d?null:d)}function Dh(a,b,c,d){var e=uh();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&nh(d,g.deps)){Ah(b,c,f,d);return}}N.effectTag|=a;e.memoizedState=Ah(1|b,c,f,d)}function Eh(a,b){return Ch(516,4,a,b)}function Fh(a,b){return Dh(516,4,a,b)}function Gh(a,b){return Dh(4,2,a,b)}\nfunction Hh(a,b){if(\"function\"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function Ih(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Dh(4,2,Hh.bind(null,b,a),c)}function Jh(){}function Kh(a,b){th().memoizedState=[a,void 0===b?null:b];return a}function Lh(a,b){var c=uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&nh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}\nfunction Mh(a,b){var c=uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&nh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function Nh(a,b,c){var d=ag();cg(98>d?98:d,function(){a(!0)});cg(97\\x3c/script>\",a=a.removeChild(a.firstChild)):\"string\"===typeof d.is?a=g.createElement(e,{is:d.is}):(a=g.createElement(e),\"select\"===e&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,e);a[Md]=b;a[Nd]=d;ni(a,b,!1,!1);b.stateNode=a;g=pd(e,d);switch(e){case \"iframe\":case \"object\":case \"embed\":F(\"load\",\na);h=d;break;case \"video\":case \"audio\":for(h=0;hd.tailExpiration&&1b)&&tj.set(a,b)))}}\nfunction xj(a,b){a.expirationTimea?c:a;return 2>=a&&b!==a?0:a}\nfunction Z(a){if(0!==a.lastExpiredTime)a.callbackExpirationTime=1073741823,a.callbackPriority=99,a.callbackNode=eg(yj.bind(null,a));else{var b=zj(a),c=a.callbackNode;if(0===b)null!==c&&(a.callbackNode=null,a.callbackExpirationTime=0,a.callbackPriority=90);else{var d=Gg();1073741823===b?d=99:1===b||2===b?d=95:(d=10*(1073741821-b)-10*(1073741821-d),d=0>=d?99:250>=d?98:5250>=d?97:95);if(null!==c){var e=a.callbackPriority;if(a.callbackExpirationTime===b&&e>=d)return;c!==Tf&&Kf(c)}a.callbackExpirationTime=\nb;a.callbackPriority=d;b=1073741823===b?eg(yj.bind(null,a)):dg(d,Bj.bind(null,a),{timeout:10*(1073741821-b)-$f()});a.callbackNode=b}}}\nfunction Bj(a,b){wj=0;if(b)return b=Gg(),Cj(a,b),Z(a),null;var c=zj(a);if(0!==c){b=a.callbackNode;if((W&(fj|gj))!==V)throw Error(u(327));Dj();a===T&&c===U||Ej(a,c);if(null!==X){var d=W;W|=fj;var e=Fj();do try{Gj();break}catch(h){Hj(a,h)}while(1);ng();W=d;cj.current=e;if(S===hj)throw b=kj,Ej(a,c),xi(a,c),Z(a),b;if(null===X)switch(e=a.finishedWork=a.current.alternate,a.finishedExpirationTime=c,d=S,T=null,d){case ti:case hj:throw Error(u(345));case ij:Cj(a,2=c){a.lastPingedTime=c;Ej(a,c);break}}f=zj(a);if(0!==f&&f!==c)break;if(0!==d&&d!==c){a.lastPingedTime=d;break}a.timeoutHandle=Hd(Jj.bind(null,a),e);break}Jj(a);break;case vi:xi(a,c);d=a.lastSuspendedTime;c===d&&(a.nextKnownPendingLevel=Ij(e));if(oj&&(e=a.lastPingedTime,0===e||e>=c)){a.lastPingedTime=c;Ej(a,c);break}e=zj(a);if(0!==e&&e!==c)break;if(0!==d&&d!==c){a.lastPingedTime=\nd;break}1073741823!==mj?d=10*(1073741821-mj)-$f():1073741823===lj?d=0:(d=10*(1073741821-lj)-5E3,e=$f(),c=10*(1073741821-c)-e,d=e-d,0>d&&(d=0),d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*bj(d/1960))-d,c=d?d=0:(e=g.busyDelayMs|0,f=$f()-(10*(1073741821-f)-(g.timeoutMs|0||5E3)),d=f<=e?0:e+d-f);if(10 component higher in the tree to provide a loading indicator or placeholder to display.\"+qb(g))}S!==\njj&&(S=ij);h=Ai(h,g);p=f;do{switch(p.tag){case 3:k=h;p.effectTag|=4096;p.expirationTime=b;var B=Xi(p,k,b);yg(p,B);break a;case 1:k=h;var w=p.type,ub=p.stateNode;if(0===(p.effectTag&64)&&(\"function\"===typeof w.getDerivedStateFromError||null!==ub&&\"function\"===typeof ub.componentDidCatch&&(null===aj||!aj.has(ub)))){p.effectTag|=4096;p.expirationTime=b;var vb=$i(p,k,b);yg(p,vb);break a}}p=p.return}while(null!==p)}X=Pj(X)}catch(Xc){b=Xc;continue}break}while(1)}\nfunction Fj(){var a=cj.current;cj.current=sh;return null===a?sh:a}function Ag(a,b){awi&&(wi=a)}function Kj(){for(;null!==X;)X=Qj(X)}function Gj(){for(;null!==X&&!Uf();)X=Qj(X)}function Qj(a){var b=Rj(a.alternate,a,U);a.memoizedProps=a.pendingProps;null===b&&(b=Pj(a));dj.current=null;return b}\nfunction Pj(a){X=a;do{var b=X.alternate;a=X.return;if(0===(X.effectTag&2048)){b=si(b,X,U);if(1===U||1!==X.childExpirationTime){for(var c=0,d=X.child;null!==d;){var e=d.expirationTime,f=d.childExpirationTime;e>c&&(c=e);f>c&&(c=f);d=d.sibling}X.childExpirationTime=c}if(null!==b)return b;null!==a&&0===(a.effectTag&2048)&&(null===a.firstEffect&&(a.firstEffect=X.firstEffect),null!==X.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=X.firstEffect),a.lastEffect=X.lastEffect),1a?b:a}function Jj(a){var b=ag();cg(99,Sj.bind(null,a,b));return null}\nfunction Sj(a,b){do Dj();while(null!==rj);if((W&(fj|gj))!==V)throw Error(u(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;a.finishedWork=null;a.finishedExpirationTime=0;if(c===a.current)throw Error(u(177));a.callbackNode=null;a.callbackExpirationTime=0;a.callbackPriority=90;a.nextKnownPendingLevel=0;var e=Ij(c);a.firstPendingTime=e;d<=a.lastSuspendedTime?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:d<=a.firstSuspendedTime&&(a.firstSuspendedTime=\nd-1);d<=a.lastPingedTime&&(a.lastPingedTime=0);d<=a.lastExpiredTime&&(a.lastExpiredTime=0);a===T&&(X=T=null,U=0);1h&&(l=h,h=g,g=l),l=vd(q,g),m=vd(q,h),l&&m&&(1!==w.rangeCount||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==m.node||w.focusOffset!==m.offset)&&(B=B.createRange(),B.setStart(l.node,l.offset),w.removeAllRanges(),g>h?(w.addRange(B),w.extend(m.node,m.offset)):(B.setEnd(m.node,m.offset),w.addRange(B))))));B=[];for(w=q;w=w.parentNode;)1===w.nodeType&&B.push({element:w,left:w.scrollLeft,\ntop:w.scrollTop});\"function\"===typeof q.focus&&q.focus();for(q=0;q=c)return ji(a,b,c);I(M,M.current&1);b=$h(a,b,c);return null!==b?b.sibling:null}I(M,M.current&1);break;case 19:d=b.childExpirationTime>=c;if(0!==(a.effectTag&64)){if(d)return mi(a,b,c);b.effectTag|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null);I(M,M.current);if(!d)return null}return $h(a,b,c)}rg=!1}}else rg=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Cf(b,J.current);qg(b,c);e=oh(null,\nb,d,a,e,c);b.effectTag|=1;if(\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(L(d)){var f=!0;Gf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;ug(b);var g=d.getDerivedStateFromProps;\"function\"===typeof g&&Fg(b,d,g,a);e.updater=Jg;b.stateNode=e;e._reactInternalFiber=b;Ng(b,d,a,c);b=gi(null,b,d,!0,f,c)}else b.tag=0,R(null,b,e,c),b=b.child;return b;case 16:a:{e=b.elementType;null!==a&&(a.alternate=\nnull,b.alternate=null,b.effectTag|=2);a=b.pendingProps;ob(e);if(1!==e._status)throw e._result;e=e._result;b.type=e;f=b.tag=Xj(e);a=ig(e,a);switch(f){case 0:b=di(null,b,e,a,c);break a;case 1:b=fi(null,b,e,a,c);break a;case 11:b=Zh(null,b,e,a,c);break a;case 14:b=ai(null,b,e,ig(e.type,a),d,c);break a}throw Error(u(306,e,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),di(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),fi(a,b,d,e,c);\ncase 3:hi(b);d=b.updateQueue;if(null===a||null===d)throw Error(u(282));d=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;vg(a,b);zg(b,d,null,c);d=b.memoizedState.element;if(d===e)Xh(),b=$h(a,b,c);else{if(e=b.stateNode.hydrate)Ph=Jd(b.stateNode.containerInfo.firstChild),Oh=b,e=Qh=!0;if(e)for(c=Yg(b,null,d,c),b.child=c;c;)c.effectTag=c.effectTag&-3|1024,c=c.sibling;else R(a,b,d,c),Xh();b=b.child}return b;case 5:return fh(b),null===a&&Uh(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:\nnull,g=e.children,Gd(d,e)?g=null:null!==f&&Gd(d,f)&&(b.effectTag|=16),ei(a,b),b.mode&4&&1!==c&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(R(a,b,g,c),b=b.child),b;case 6:return null===a&&Uh(b),null;case 13:return ji(a,b,c);case 4:return dh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Xg(b,null,d,c):R(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),Zh(a,b,d,e,c);case 7:return R(a,b,b.pendingProps,c),b.child;case 8:return R(a,\nb,b.pendingProps.children,c),b.child;case 12:return R(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;var h=b.type._context;I(jg,h._currentValue);h._currentValue=f;if(null!==g)if(h=g.value,f=$e(h,f)?0:(\"function\"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0,0===f){if(g.children===e.children&&!K.current){b=$h(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==\nk){g=h.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=wg(c,null),l.tag=2,xg(h,l));h.expirationTime=b&&a<=b}function xi(a,b){var c=a.firstSuspendedTime,d=a.lastSuspendedTime;cb||0===c)a.lastSuspendedTime=b;b<=a.lastPingedTime&&(a.lastPingedTime=0);b<=a.lastExpiredTime&&(a.lastExpiredTime=0)}\nfunction yi(a,b){b>a.firstPendingTime&&(a.firstPendingTime=b);var c=a.firstSuspendedTime;0!==c&&(b>=c?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:b>=a.lastSuspendedTime&&(a.lastSuspendedTime=b+1),b>a.nextKnownPendingLevel&&(a.nextKnownPendingLevel=b))}function Cj(a,b){var c=a.lastExpiredTime;if(0===c||c>b)a.lastExpiredTime=b}\nfunction bk(a,b,c,d){var e=b.current,f=Gg(),g=Dg.suspense;f=Hg(f,e,g);a:if(c){c=c._reactInternalFiber;b:{if(dc(c)!==c||1!==c.tag)throw Error(u(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(L(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return}while(null!==h);throw Error(u(171));}if(1===c.tag){var k=c.type;if(L(k)){c=Ff(c,k,h);break a}}c=h}else c=Af;null===b.context?b.context=c:b.pendingContext=c;b=wg(f,g);b.payload={element:a};d=void 0===\nd?null:d;null!==d&&(b.callback=d);xg(e,b);Ig(e,f);return f}function ck(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function dk(a,b){a=a.memoizedState;null!==a&&null!==a.dehydrated&&a.retryTime= 0) && focusable(element, !isTabIndexNaN);\n}\n\nfunction findTabbableDescendants(element) {\n return [].slice.call(element.querySelectorAll(\"*\"), 0).filter(tabbable);\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleBlur = handleBlur;\nexports.handleFocus = handleFocus;\nexports.markForFocusLater = markForFocusLater;\nexports.returnFocus = returnFocus;\nexports.popWithoutFocus = popWithoutFocus;\nexports.setupScopedFocus = setupScopedFocus;\nexports.teardownScopedFocus = teardownScopedFocus;\n\nvar _tabbable = require(\"../helpers/tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar focusLaterElements = [];\nvar modalElement = null;\nvar needToFocus = false;\n\nfunction handleBlur() {\n needToFocus = true;\n}\n\nfunction handleFocus() {\n if (needToFocus) {\n needToFocus = false;\n if (!modalElement) {\n return;\n }\n // need to see how jQuery shims document.on('focusin') so we don't need the\n // setTimeout, firefox doesn't support focusin, if it did, we could focus\n // the element outside of a setTimeout. Side-effect of this implementation\n // is that the document.body gets focus, and then we focus our element right\n // after, seems fine.\n setTimeout(function () {\n if (modalElement.contains(document.activeElement)) {\n return;\n }\n var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;\n el.focus();\n }, 0);\n }\n}\n\nfunction markForFocusLater() {\n focusLaterElements.push(document.activeElement);\n}\n\n/* eslint-disable no-console */\nfunction returnFocus() {\n var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var toFocus = null;\n try {\n if (focusLaterElements.length !== 0) {\n toFocus = focusLaterElements.pop();\n toFocus.focus({ preventScroll: preventScroll });\n }\n return;\n } catch (e) {\n console.warn([\"You tried to return focus to\", toFocus, \"but it is not in the DOM anymore\"].join(\" \"));\n }\n}\n/* eslint-enable no-console */\n\nfunction popWithoutFocus() {\n focusLaterElements.length > 0 && focusLaterElements.pop();\n}\n\nfunction setupScopedFocus(element) {\n modalElement = element;\n\n if (window.addEventListener) {\n window.addEventListener(\"blur\", handleBlur, false);\n document.addEventListener(\"focus\", handleFocus, true);\n } else {\n window.attachEvent(\"onBlur\", handleBlur);\n document.attachEvent(\"onFocus\", handleFocus);\n }\n}\n\nfunction teardownScopedFocus() {\n modalElement = null;\n\n if (window.addEventListener) {\n window.removeEventListener(\"blur\", handleBlur);\n document.removeEventListener(\"focus\", handleFocus);\n } else {\n window.detachEvent(\"onBlur\", handleBlur);\n document.detachEvent(\"onFocus\", handleFocus);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = scopeTab;\n\nvar _tabbable = require(\"./tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction scopeTab(node, event) {\n var tabbable = (0, _tabbable2.default)(node);\n\n if (!tabbable.length) {\n // Do nothing, since there are no elements that can receive focus.\n event.preventDefault();\n return;\n }\n\n var target = void 0;\n\n var shiftKey = event.shiftKey;\n var head = tabbable[0];\n var tail = tabbable[tabbable.length - 1];\n\n // proceed with default browser behavior on tab.\n // Focus on last element on shift + tab.\n if (node === document.activeElement) {\n if (!shiftKey) return;\n target = tail;\n }\n\n if (tail === document.activeElement && !shiftKey) {\n target = head;\n }\n\n if (head === document.activeElement && shiftKey) {\n target = tail;\n }\n\n if (target) {\n event.preventDefault();\n target.focus();\n return;\n }\n\n // Safari radio issue.\n //\n // Safari does not move the focus to the radio button,\n // so we need to force it to really walk through all elements.\n //\n // This is very error prone, since we are trying to guess\n // if it is a safari browser from the first occurence between\n // chrome or safari.\n //\n // The chrome user agent contains the first ocurrence\n // as the 'chrome/version' and later the 'safari/version'.\n var checkSafari = /(\\bChrome\\b|\\bSafari\\b)\\//.exec(navigator.userAgent);\n var isSafariDesktop = checkSafari != null && checkSafari[1] != \"Chrome\" && /\\biPod\\b|\\biPad\\b/g.exec(navigator.userAgent) == null;\n\n // If we are not in safari desktop, let the browser control\n // the focus\n if (!isSafariDesktop) return;\n\n var x = tabbable.indexOf(document.activeElement);\n\n if (x > -1) {\n x += shiftKey ? -1 : 1;\n }\n\n target = tabbable[x];\n\n // If the tabbable element does not exist,\n // focus head/tail based on shiftKey\n if (typeof target === \"undefined\") {\n event.preventDefault();\n target = shiftKey ? tail : head;\n target.focus();\n return;\n }\n\n event.preventDefault();\n\n target.focus();\n}\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\n}());\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;\n\nvar _exenv = require(\"exenv\");\n\nvar _exenv2 = _interopRequireDefault(_exenv);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar EE = _exenv2.default;\n\nvar SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};\n\nvar SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};\n\nvar SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};\n\nvar canUseDOM = exports.canUseDOM = EE.canUseDOM;\n\nexports.default = SafeHTMLElement;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.assertNodeList = assertNodeList;\nexports.setElement = setElement;\nexports.validateElement = validateElement;\nexports.hide = hide;\nexports.show = show;\nexports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;\nexports.resetForTesting = resetForTesting;\n\nvar _warning = require(\"warning\");\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _safeHTMLElement = require(\"./safeHTMLElement\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar globalElement = null;\n\nfunction assertNodeList(nodeList, selector) {\n if (!nodeList || !nodeList.length) {\n throw new Error(\"react-modal: No elements were found for selector \" + selector + \".\");\n }\n}\n\nfunction setElement(element) {\n var useElement = element;\n if (typeof useElement === \"string\" && _safeHTMLElement.canUseDOM) {\n var el = document.querySelectorAll(useElement);\n assertNodeList(el, useElement);\n useElement = el;\n }\n globalElement = useElement || globalElement;\n return globalElement;\n}\n\nfunction validateElement(appElement) {\n var el = appElement || globalElement;\n if (el) {\n return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];\n } else {\n (0, _warning2.default)(false, [\"react-modal: App element is not defined.\", \"Please use `Modal.setAppElement(el)` or set `appElement={el}`.\", \"This is needed so screen readers don't see main content\", \"when modal is opened. It is not recommended, but you can opt-out\", \"by setting `ariaHideApp={false}`.\"].join(\" \"));\n\n return [];\n }\n}\n\nfunction hide(appElement) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var el = _step.value;\n\n el.setAttribute(\"aria-hidden\", \"true\");\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\n\nfunction show(appElement) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var el = _step2.value;\n\n el.removeAttribute(\"aria-hidden\");\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n}\n\nfunction documentNotReadyOrSSRTesting() {\n globalElement = null;\n}\n\nfunction resetForTesting() {\n globalElement = null;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.dumpClassLists = dumpClassLists;\nvar htmlClassList = {};\nvar docBodyClassList = {};\n\nfunction dumpClassLists() {\n if (process.env.NODE_ENV !== \"production\") {\n var classes = document.getElementsByTagName(\"html\")[0].className;\n var buffer = \"Show tracked classes:\\n\\n\";\n\n buffer += \" (\" + classes + \"):\\n\";\n for (var x in htmlClassList) {\n buffer += \" \" + x + \" \" + htmlClassList[x] + \"\\n\";\n }\n\n classes = document.body.className;\n\n // eslint-disable-next-line max-len\n buffer += \"\\n\\ndoc.body (\" + classes + \"):\\n\";\n for (var _x in docBodyClassList) {\n buffer += \" \" + _x + \" \" + docBodyClassList[_x] + \"\\n\";\n }\n\n buffer += \"\\n\";\n\n // eslint-disable-next-line no-console\n console.log(buffer);\n }\n}\n\n/**\n * Track the number of reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar incrementReference = function incrementReference(poll, className) {\n if (!poll[className]) {\n poll[className] = 0;\n }\n poll[className] += 1;\n return className;\n};\n\n/**\n * Drop the reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar decrementReference = function decrementReference(poll, className) {\n if (poll[className]) {\n poll[className] -= 1;\n }\n return className;\n};\n\n/**\n * Track a class and add to the given class list.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be tracked.\n */\nvar trackClass = function trackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n incrementReference(poll, className);\n classListRef.add(className);\n });\n};\n\n/**\n * Untrack a class and remove from the given class list if the reference\n * reaches 0.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be untracked.\n */\nvar untrackClass = function untrackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n decrementReference(poll, className);\n poll[className] === 0 && classListRef.remove(className);\n });\n};\n\n/**\n * Public inferface to add classes to the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar add = exports.add = function add(element, classString) {\n return trackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};\n\n/**\n * Public inferface to remove classes from the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar remove = exports.remove = function remove(element, classString) {\n return untrackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// Tracks portals that are open and emits events to subscribers\n\nvar PortalOpenInstances = function PortalOpenInstances() {\n var _this = this;\n\n _classCallCheck(this, PortalOpenInstances);\n\n this.register = function (openInstance) {\n if (_this.openInstances.indexOf(openInstance) !== -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Cannot register modal instance that's already open\");\n }\n return;\n }\n _this.openInstances.push(openInstance);\n _this.emit(\"register\");\n };\n\n this.deregister = function (openInstance) {\n var index = _this.openInstances.indexOf(openInstance);\n if (index === -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Unable to deregister \" + openInstance + \" as \" + \"it was never registered\");\n }\n return;\n }\n _this.openInstances.splice(index, 1);\n _this.emit(\"deregister\");\n };\n\n this.subscribe = function (callback) {\n _this.subscribers.push(callback);\n };\n\n this.emit = function (eventType) {\n _this.subscribers.forEach(function (subscriber) {\n return subscriber(eventType,\n // shallow copy to avoid accidental mutation\n _this.openInstances.slice());\n });\n };\n\n this.openInstances = [];\n this.subscribers = [];\n};\n\nvar portalOpenInstances = new PortalOpenInstances();\n\nexports.default = portalOpenInstances;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _portalOpenInstances = require(\"./portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Body focus trap see Issue #742\n\nvar before = void 0,\n after = void 0,\n instances = [];\n\nfunction focusContent() {\n if (instances.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Open instances > 0 expected\");\n }\n return;\n }\n instances[instances.length - 1].focusContent();\n}\n\nfunction bodyTrap(eventType, openInstances) {\n if (!before || !after) {\n before = document.createElement(\"div\");\n before.setAttribute(\"data-react-modal-body-trap\", \"\");\n before.style.position = \"absolute\";\n before.style.opacity = \"0\";\n before.setAttribute(\"tabindex\", \"0\");\n before.addEventListener(\"focus\", focusContent);\n after = before.cloneNode();\n after.addEventListener(\"focus\", focusContent);\n }\n\n instances = openInstances;\n\n if (instances.length > 0) {\n // Add focus trap\n if (document.body.firstChild !== before) {\n document.body.insertBefore(before, document.body.firstChild);\n }\n if (document.body.lastChild !== after) {\n document.body.appendChild(after);\n }\n } else {\n // Remove focus trap\n if (before.parentElement) {\n before.parentElement.removeChild(before);\n }\n if (after.parentElement) {\n after.parentElement.removeChild(after);\n }\n }\n}\n\n_portalOpenInstances2.default.subscribe(bodyTrap);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _focusManager = require(\"../helpers/focusManager\");\n\nvar focusManager = _interopRequireWildcard(_focusManager);\n\nvar _scopeTab = require(\"../helpers/scopeTab\");\n\nvar _scopeTab2 = _interopRequireDefault(_scopeTab);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _classList = require(\"../helpers/classList\");\n\nvar classList = _interopRequireWildcard(_classList);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _portalOpenInstances = require(\"../helpers/portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nrequire(\"../helpers/bodyTrap\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// so that our CSS is statically analyzable\nvar CLASS_NAMES = {\n overlay: \"ReactModal__Overlay\",\n content: \"ReactModal__Content\"\n};\n\nvar TAB_KEY = 9;\nvar ESC_KEY = 27;\n\nvar ariaHiddenInstances = 0;\n\nvar ModalPortal = function (_Component) {\n _inherits(ModalPortal, _Component);\n\n function ModalPortal(props) {\n _classCallCheck(this, ModalPortal);\n\n var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));\n\n _this.setOverlayRef = function (overlay) {\n _this.overlay = overlay;\n _this.props.overlayRef && _this.props.overlayRef(overlay);\n };\n\n _this.setContentRef = function (content) {\n _this.content = content;\n _this.props.contentRef && _this.props.contentRef(content);\n };\n\n _this.afterClose = function () {\n var _this$props = _this.props,\n appElement = _this$props.appElement,\n ariaHideApp = _this$props.ariaHideApp,\n htmlOpenClassName = _this$props.htmlOpenClassName,\n bodyOpenClassName = _this$props.bodyOpenClassName;\n\n // Remove classes.\n\n bodyOpenClassName && classList.remove(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.remove(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n // Reset aria-hidden attribute if all modals have been removed\n if (ariaHideApp && ariaHiddenInstances > 0) {\n ariaHiddenInstances -= 1;\n\n if (ariaHiddenInstances === 0) {\n ariaAppHider.show(appElement);\n }\n }\n\n if (_this.props.shouldFocusAfterRender) {\n if (_this.props.shouldReturnFocusAfterClose) {\n focusManager.returnFocus(_this.props.preventScroll);\n focusManager.teardownScopedFocus();\n } else {\n focusManager.popWithoutFocus();\n }\n }\n\n if (_this.props.onAfterClose) {\n _this.props.onAfterClose();\n }\n\n _portalOpenInstances2.default.deregister(_this);\n };\n\n _this.open = function () {\n _this.beforeOpen();\n if (_this.state.afterOpen && _this.state.beforeClose) {\n clearTimeout(_this.closeTimer);\n _this.setState({ beforeClose: false });\n } else {\n if (_this.props.shouldFocusAfterRender) {\n focusManager.setupScopedFocus(_this.node);\n focusManager.markForFocusLater();\n }\n\n _this.setState({ isOpen: true }, function () {\n _this.setState({ afterOpen: true });\n\n if (_this.props.isOpen && _this.props.onAfterOpen) {\n _this.props.onAfterOpen({\n overlayEl: _this.overlay,\n contentEl: _this.content\n });\n }\n });\n }\n };\n\n _this.close = function () {\n if (_this.props.closeTimeoutMS > 0) {\n _this.closeWithTimeout();\n } else {\n _this.closeWithoutTimeout();\n }\n };\n\n _this.focusContent = function () {\n return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });\n };\n\n _this.closeWithTimeout = function () {\n var closesAt = Date.now() + _this.props.closeTimeoutMS;\n _this.setState({ beforeClose: true, closesAt: closesAt }, function () {\n _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());\n });\n };\n\n _this.closeWithoutTimeout = function () {\n _this.setState({\n beforeClose: false,\n isOpen: false,\n afterOpen: false,\n closesAt: null\n }, _this.afterClose);\n };\n\n _this.handleKeyDown = function (event) {\n if (event.keyCode === TAB_KEY) {\n (0, _scopeTab2.default)(_this.content, event);\n }\n\n if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) {\n event.stopPropagation();\n _this.requestClose(event);\n }\n };\n\n _this.handleOverlayOnClick = function (event) {\n if (_this.shouldClose === null) {\n _this.shouldClose = true;\n }\n\n if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {\n if (_this.ownerHandlesClose()) {\n _this.requestClose(event);\n } else {\n _this.focusContent();\n }\n }\n _this.shouldClose = null;\n };\n\n _this.handleContentOnMouseUp = function () {\n _this.shouldClose = false;\n };\n\n _this.handleOverlayOnMouseDown = function (event) {\n if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {\n event.preventDefault();\n }\n };\n\n _this.handleContentOnClick = function () {\n _this.shouldClose = false;\n };\n\n _this.handleContentOnMouseDown = function () {\n _this.shouldClose = false;\n };\n\n _this.requestClose = function (event) {\n return _this.ownerHandlesClose() && _this.props.onRequestClose(event);\n };\n\n _this.ownerHandlesClose = function () {\n return _this.props.onRequestClose;\n };\n\n _this.shouldBeClosed = function () {\n return !_this.state.isOpen && !_this.state.beforeClose;\n };\n\n _this.contentHasFocus = function () {\n return document.activeElement === _this.content || _this.content.contains(document.activeElement);\n };\n\n _this.buildClassName = function (which, additional) {\n var classNames = (typeof additional === \"undefined\" ? \"undefined\" : _typeof(additional)) === \"object\" ? additional : {\n base: CLASS_NAMES[which],\n afterOpen: CLASS_NAMES[which] + \"--after-open\",\n beforeClose: CLASS_NAMES[which] + \"--before-close\"\n };\n var className = classNames.base;\n if (_this.state.afterOpen) {\n className = className + \" \" + classNames.afterOpen;\n }\n if (_this.state.beforeClose) {\n className = className + \" \" + classNames.beforeClose;\n }\n return typeof additional === \"string\" && additional ? className + \" \" + additional : className;\n };\n\n _this.attributesFromObject = function (prefix, items) {\n return Object.keys(items).reduce(function (acc, name) {\n acc[prefix + \"-\" + name] = items[name];\n return acc;\n }, {});\n };\n\n _this.state = {\n afterOpen: false,\n beforeClose: false\n };\n\n _this.shouldClose = null;\n _this.moveFromContentToOverlay = null;\n return _this;\n }\n\n _createClass(ModalPortal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.isOpen) {\n this.open();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== \"production\") {\n if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"bodyOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"htmlOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n }\n\n if (this.props.isOpen && !prevProps.isOpen) {\n this.open();\n } else if (!this.props.isOpen && prevProps.isOpen) {\n this.close();\n }\n\n // Focus only needs to be set once when the modal is being opened\n if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {\n this.focusContent();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.state.isOpen) {\n this.afterClose();\n }\n clearTimeout(this.closeTimer);\n }\n }, {\n key: \"beforeOpen\",\n value: function beforeOpen() {\n var _props = this.props,\n appElement = _props.appElement,\n ariaHideApp = _props.ariaHideApp,\n htmlOpenClassName = _props.htmlOpenClassName,\n bodyOpenClassName = _props.bodyOpenClassName;\n\n // Add classes.\n\n bodyOpenClassName && classList.add(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.add(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n if (ariaHideApp) {\n ariaHiddenInstances += 1;\n ariaAppHider.hide(appElement);\n }\n\n _portalOpenInstances2.default.register(this);\n }\n\n // Don't steal focus from inner elements\n\n }, {\n key: \"render\",\n value: function render() {\n var _props2 = this.props,\n id = _props2.id,\n className = _props2.className,\n overlayClassName = _props2.overlayClassName,\n defaultStyles = _props2.defaultStyles,\n children = _props2.children;\n\n var contentStyles = className ? {} : defaultStyles.content;\n var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;\n\n if (this.shouldBeClosed()) {\n return null;\n }\n\n var overlayProps = {\n ref: this.setOverlayRef,\n className: this.buildClassName(\"overlay\", overlayClassName),\n style: _extends({}, overlayStyles, this.props.style.overlay),\n onClick: this.handleOverlayOnClick,\n onMouseDown: this.handleOverlayOnMouseDown\n };\n\n var contentProps = _extends({\n id: id,\n ref: this.setContentRef,\n style: _extends({}, contentStyles, this.props.style.content),\n className: this.buildClassName(\"content\", className),\n tabIndex: \"-1\",\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleContentOnMouseDown,\n onMouseUp: this.handleContentOnMouseUp,\n onClick: this.handleContentOnClick,\n role: this.props.role,\n \"aria-label\": this.props.contentLabel\n }, this.attributesFromObject(\"aria\", _extends({ modal: true }, this.props.aria)), this.attributesFromObject(\"data\", this.props.data || {}), {\n \"data-testid\": this.props.testId\n });\n\n var contentElement = this.props.contentElement(contentProps, children);\n return this.props.overlayElement(overlayProps, contentElement);\n }\n }]);\n\n return ModalPortal;\n}(_react.Component);\n\nModalPortal.defaultProps = {\n style: {\n overlay: {},\n content: {}\n },\n defaultStyles: {}\n};\nModalPortal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n defaultStyles: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n ariaHideApp: _propTypes2.default.bool,\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onAfterClose: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n children: _propTypes2.default.node,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func,\n testId: _propTypes2.default.string\n};\nexports.default = ModalPortal;\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n }\n // Binding \"this\" is important for shallow renderer support.\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(\n prevProps,\n prevState\n );\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n}\n\n// React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (\n typeof Component.getDerivedStateFromProps !== 'function' &&\n typeof prototype.getSnapshotBeforeUpdate !== 'function'\n ) {\n return Component;\n }\n\n // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n if (\n foundWillMountName !== null ||\n foundWillReceivePropsName !== null ||\n foundWillUpdateName !== null\n ) {\n var componentName = Component.displayName || Component.name;\n var newApiName =\n typeof Component.getDerivedStateFromProps === 'function'\n ? 'getDerivedStateFromProps()'\n : 'getSnapshotBeforeUpdate()';\n\n throw Error(\n 'Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' +\n componentName +\n ' uses ' +\n newApiName +\n ' but also contains the following legacy lifecycles:' +\n (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') +\n (foundWillReceivePropsName !== null\n ? '\\n ' + foundWillReceivePropsName\n : '') +\n (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') +\n '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' +\n 'https://fb.me/react-async-component-lifecycle-hooks'\n );\n }\n\n // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n }\n\n // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error(\n 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'\n );\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(\n prevProps,\n prevState,\n maybeSnapshot\n ) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag\n ? this.__reactInternalSnapshot\n : maybeSnapshot;\n\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.bodyOpenClassName = exports.portalClassName = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ModalPortal = require(\"./ModalPortal\");\n\nvar _ModalPortal2 = _interopRequireDefault(_ModalPortal);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar portalClassName = exports.portalClassName = \"ReactModalPortal\";\nvar bodyOpenClassName = exports.bodyOpenClassName = \"ReactModal__Body--open\";\n\nvar isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;\n\nvar getCreatePortal = function getCreatePortal() {\n return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;\n};\n\nfunction getParentElement(parentSelector) {\n return parentSelector();\n}\n\nvar Modal = function (_Component) {\n _inherits(Modal, _Component);\n\n function Modal() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Modal);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {\n !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);\n var parent = getParentElement(_this.props.parentSelector);\n if (parent && parent.contains(_this.node)) {\n parent.removeChild(_this.node);\n } else {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"parentSelector\" prop did not returned any DOM ' + \"element. Make sure that the parent element is unmounted to \" + \"avoid any memory leaks.\");\n }\n }, _this.portalRef = function (ref) {\n _this.portal = ref;\n }, _this.renderPortal = function (props) {\n var createPortal = getCreatePortal();\n var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node);\n _this.portalRef(portal);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Modal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!_safeHTMLElement.canUseDOM) return;\n\n if (!isReact16) {\n this.node = document.createElement(\"div\");\n }\n this.node.className = this.props.portalClassName;\n\n var parent = getParentElement(this.props.parentSelector);\n parent.appendChild(this.node);\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps) {\n var prevParent = getParentElement(prevProps.parentSelector);\n var nextParent = getParentElement(this.props.parentSelector);\n return { prevParent: prevParent, nextParent: nextParent };\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, _, snapshot) {\n if (!_safeHTMLElement.canUseDOM) return;\n var _props = this.props,\n isOpen = _props.isOpen,\n portalClassName = _props.portalClassName;\n\n\n if (prevProps.portalClassName !== portalClassName) {\n this.node.className = portalClassName;\n }\n\n var prevParent = snapshot.prevParent,\n nextParent = snapshot.nextParent;\n\n if (nextParent !== prevParent) {\n prevParent.removeChild(this.node);\n nextParent.appendChild(this.node);\n }\n\n // Stop unnecessary renders if modal is remaining closed\n if (!prevProps.isOpen && !isOpen) return;\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;\n\n var state = this.portal.state;\n var now = Date.now();\n var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);\n\n if (closesAt) {\n if (!state.beforeClose) {\n this.portal.closeWithTimeout();\n }\n\n setTimeout(this.removePortal, closesAt - now);\n } else {\n this.removePortal();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!_safeHTMLElement.canUseDOM || !isReact16) {\n return null;\n }\n\n if (!this.node && isReact16) {\n this.node = document.createElement(\"div\");\n }\n\n var createPortal = getCreatePortal();\n return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({\n ref: this.portalRef,\n defaultStyles: Modal.defaultStyles\n }, this.props)), this.node);\n }\n }], [{\n key: \"setAppElement\",\n value: function setAppElement(element) {\n ariaAppHider.setElement(element);\n }\n\n /* eslint-disable react/no-unused-prop-types */\n\n /* eslint-enable react/no-unused-prop-types */\n\n }]);\n\n return Modal;\n}(_react.Component);\n\nModal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n portalClassName: _propTypes2.default.string,\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n ariaHideApp: _propTypes2.default.bool,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n parentSelector: _propTypes2.default.func,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func\n};\nModal.defaultProps = {\n isOpen: false,\n portalClassName: portalClassName,\n bodyOpenClassName: bodyOpenClassName,\n role: \"dialog\",\n ariaHideApp: true,\n closeTimeoutMS: 0,\n shouldFocusAfterRender: true,\n shouldCloseOnEsc: true,\n shouldCloseOnOverlayClick: true,\n shouldReturnFocusAfterClose: true,\n preventScroll: false,\n parentSelector: function parentSelector() {\n return document.body;\n },\n overlayElement: function overlayElement(props, contentEl) {\n return _react2.default.createElement(\n \"div\",\n props,\n contentEl\n );\n },\n contentElement: function contentElement(props, children) {\n return _react2.default.createElement(\n \"div\",\n props,\n children\n );\n }\n};\nModal.defaultStyles = {\n overlay: {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(255, 255, 255, 0.75)\"\n },\n content: {\n position: \"absolute\",\n top: \"40px\",\n left: \"40px\",\n right: \"40px\",\n bottom: \"40px\",\n border: \"1px solid #ccc\",\n background: \"#fff\",\n overflow: \"auto\",\n WebkitOverflowScrolling: \"touch\",\n borderRadius: \"4px\",\n outline: \"none\",\n padding: \"20px\"\n }\n};\n\n\n(0, _reactLifecyclesCompat.polyfill)(Modal);\n\nexports.default = Modal;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Modal = require(\"./components/Modal\");\n\nvar _Modal2 = _interopRequireDefault(_Modal);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _Modal2.default;\nmodule.exports = exports[\"default\"];","import reactDom from 'react-dom';\nimport react from 'react';\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction nullthrows(x, message) {\n if (x != null) {\n return x;\n }\n\n throw new Error(message !== null && message !== void 0 ? message : 'Got unexpected null or undefined');\n}\n\nvar Recoil_nullthrows = nullthrows;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction recoverableViolation(message, projectName, {\n error\n} = {}) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(message, error);\n }\n\n return null;\n}\n\nvar recoverableViolation_1 = recoverableViolation;\n\n// @oss-only\n\n\nvar Recoil_recoverableViolation = recoverableViolation_1;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Utilities for working with built-in Maps and Sets without mutating them.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction setByAddingToSet(set, v) {\n const next = new Set(set);\n next.add(v);\n return next;\n}\n\nfunction setByDeletingFromSet(set, v) {\n const next = new Set(set);\n next.delete(v);\n return next;\n}\n\nfunction mapBySettingInMap(map, k, v) {\n const next = new Map(map);\n next.set(k, v);\n return next;\n}\n\nfunction mapByUpdatingInMap(map, k, updater) {\n const next = new Map(map);\n next.set(k, updater(next.get(k)));\n return next;\n}\n\nfunction mapByDeletingFromMap(map, k) {\n const next = new Map(map);\n next.delete(k);\n return next;\n}\n\nfunction mapByDeletingMultipleFromMap(map, ks) {\n const next = new Map(map);\n ks.forEach(k => next.delete(k));\n return next;\n}\n\nvar Recoil_CopyOnWrite = {\n setByAddingToSet,\n setByDeletingFromSet,\n mapBySettingInMap,\n mapByUpdatingInMap,\n mapByDeletingFromMap,\n mapByDeletingMultipleFromMap\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Creates a new iterable whose output is generated by passing the input\n * iterable's values through the filter function.\n */\n\nfunction* filterIterable(iterable, predicate) {\n // Use generator to create iterable/iterator\n let index = 0;\n\n for (const value of iterable) {\n if (predicate(value, index++)) {\n yield value;\n }\n }\n}\n\nvar Recoil_filterIterable = filterIterable;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst gks = new Map().set('recoil_hamt_2020', true);\n\nfunction Recoil_gkx(gk) {\n var _gks$get;\n\n return (_gks$get = gks.get(gk)) !== null && _gks$get !== void 0 ? _gks$get : false;\n}\n\nRecoil_gkx.setPass = gk => {\n gks.set(gk, true);\n};\n\nRecoil_gkx.setFail = gk => {\n gks.set(gk, false);\n};\n\nvar Recoil_gkx_1 = Recoil_gkx; // @oss-only\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Creates a new iterable whose output is generated by passing the input\n * iterable's values through the mapper function.\n */\n\nfunction mapIterable(iterable, callback) {\n // Use generator to create iterable/iterator\n return function* () {\n let index = 0;\n\n for (const value of iterable) {\n yield callback(value, index++);\n }\n }();\n}\n\nvar Recoil_mapIterable = mapIterable;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction sprintf(format, ...args) {\n let index = 0;\n return format.replace(/%s/g, () => String(args[index++]));\n}\n\nvar sprintf_1 = sprintf;\n\nfunction expectationViolation(format, ...args) {\n if (process.env.NODE_ENV !== \"production\") {\n const message = sprintf_1.call(null, format, ...args);\n const error = new Error(message);\n error.name = 'Expectation Violation';\n console.error(error);\n }\n}\n\nvar expectationViolation_1 = expectationViolation;\n\n// @oss-only\n\n\nvar Recoil_expectationViolation = expectationViolation_1;\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n// eslint-disable-next-line no-unused-vars\nclass AbstractRecoilValue {\n constructor(newKey) {\n _defineProperty(this, \"key\", void 0);\n\n this.key = newKey;\n }\n\n}\n\nclass RecoilState extends AbstractRecoilValue {}\n\nclass RecoilValueReadOnly extends AbstractRecoilValue {}\n\nfunction isRecoilValue(x) {\n return x instanceof RecoilState || x instanceof RecoilValueReadOnly;\n}\n\nvar Recoil_RecoilValue = {\n AbstractRecoilValue,\n RecoilState,\n RecoilValueReadOnly,\n isRecoilValue\n};\n\nvar Recoil_RecoilValue_1 = Recoil_RecoilValue.AbstractRecoilValue;\nvar Recoil_RecoilValue_2 = Recoil_RecoilValue.RecoilState;\nvar Recoil_RecoilValue_3 = Recoil_RecoilValue.RecoilValueReadOnly;\nvar Recoil_RecoilValue_4 = Recoil_RecoilValue.isRecoilValue;\n\nvar Recoil_RecoilValue$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n AbstractRecoilValue: Recoil_RecoilValue_1,\n RecoilState: Recoil_RecoilValue_2,\n RecoilValueReadOnly: Recoil_RecoilValue_3,\n isRecoilValue: Recoil_RecoilValue_4\n});\n\nclass DefaultValue {}\n\nconst DEFAULT_VALUE = new DefaultValue();\n\nclass RecoilValueNotReady extends Error {\n constructor(key) {\n super(`Tried to set the value of Recoil selector ${key} using an updater function, but it is an async selector in a pending or error state; this is not supported.`);\n }\n\n}\n\n// flowlint-next-line unclear-type:off\nconst nodes = new Map(); // flowlint-next-line unclear-type:off\n\nconst recoilValues = new Map();\n/* eslint-disable no-redeclare */\n\nfunction recoilValuesForKeys(keys) {\n return Recoil_mapIterable(keys, key => Recoil_nullthrows(recoilValues.get(key)));\n}\n\nfunction registerNode(node) {\n if (nodes.has(node.key)) {\n const message = `Duplicate atom key \"${node.key}\". This is a FATAL ERROR in\n production. But it is safe to ignore this warning if it occurred because of\n hot module replacement.`; // TODO Need to figure out if there is a standard/open-source equivalent to see if hot module replacement is happening:\n // prettier-ignore\n // @fb-only: if (__DEV__) {\n // @fb-only: const isAcceptingUpdate = require('__debug').isAcceptingUpdate;\n // prettier-ignore\n // @fb-only: if (typeof isAcceptingUpdate !== 'function' || !isAcceptingUpdate()) {\n // @fb-only: expectationViolation(message, 'recoil');\n // @fb-only: }\n // prettier-ignore\n // @fb-only: } else {\n // @fb-only: recoverableViolation(message, 'recoil');\n // @fb-only: }\n\n console.warn(message); // @oss-only\n }\n\n nodes.set(node.key, node);\n const recoilValue = node.set == null ? new Recoil_RecoilValue$1.RecoilValueReadOnly(node.key) : new Recoil_RecoilValue$1.RecoilState(node.key);\n recoilValues.set(node.key, recoilValue);\n return recoilValue;\n}\n/* eslint-enable no-redeclare */\n\n\nclass NodeMissingError extends Error {} // flowlint-next-line unclear-type:off\n\n\nfunction getNode(key) {\n const node = nodes.get(key);\n\n if (node == null) {\n throw new NodeMissingError(`Missing definition for RecoilValue: \"${key}\"\"`);\n }\n\n return node;\n} // flowlint-next-line unclear-type:off\n\n\nfunction getNodeMaybe(key) {\n return nodes.get(key);\n}\n\nconst configDeletionHandlers = new Map();\n\nfunction deleteNodeConfigIfPossible(key) {\n var _node$shouldDeleteCon;\n\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const node = nodes.get(key);\n\n if (node === null || node === void 0 ? void 0 : (_node$shouldDeleteCon = node.shouldDeleteConfigOnRelease) === null || _node$shouldDeleteCon === void 0 ? void 0 : _node$shouldDeleteCon.call(node)) {\n var _getConfigDeletionHan;\n\n nodes.delete(key);\n (_getConfigDeletionHan = getConfigDeletionHandler(key)) === null || _getConfigDeletionHan === void 0 ? void 0 : _getConfigDeletionHan();\n configDeletionHandlers.delete(key);\n }\n}\n\nfunction setConfigDeletionHandler(key, fn) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n if (fn === undefined) {\n configDeletionHandlers.delete(key);\n } else {\n configDeletionHandlers.set(key, fn);\n }\n}\n\nfunction getConfigDeletionHandler(key) {\n return configDeletionHandlers.get(key);\n}\n\nvar Recoil_Node = {\n nodes,\n recoilValues,\n registerNode,\n getNode,\n getNodeMaybe,\n deleteNodeConfigIfPossible,\n setConfigDeletionHandler,\n getConfigDeletionHandler,\n recoilValuesForKeys,\n NodeMissingError,\n DefaultValue,\n DEFAULT_VALUE,\n RecoilValueNotReady\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nclass RetentionZone {}\n\nfunction retentionZone() {\n return new RetentionZone();\n}\n\nvar Recoil_RetentionZone = {\n RetentionZone,\n retentionZone\n};\n\nconst {\n setByAddingToSet: setByAddingToSet$1\n} = Recoil_CopyOnWrite;\n\n\n\n\n\n\n\nconst {\n getNode: getNode$1,\n getNodeMaybe: getNodeMaybe$1,\n recoilValuesForKeys: recoilValuesForKeys$1\n} = Recoil_Node;\n\nconst {\n RetentionZone: RetentionZone$1\n} = Recoil_RetentionZone; // flowlint-next-line unclear-type:off\n\n\nconst emptySet = Object.freeze(new Set());\n\nclass ReadOnlyRecoilValueError extends Error {}\n\nfunction initializeRetentionForNode(store, nodeKey, retainedBy) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return () => undefined;\n }\n\n const {\n nodesRetainedByZone\n } = store.getState().retention;\n\n function addToZone(zone) {\n let set = nodesRetainedByZone.get(zone);\n\n if (!set) {\n nodesRetainedByZone.set(zone, set = new Set());\n }\n\n set.add(nodeKey);\n }\n\n if (retainedBy instanceof RetentionZone$1) {\n addToZone(retainedBy);\n } else if (Array.isArray(retainedBy)) {\n for (const zone of retainedBy) {\n addToZone(zone);\n }\n }\n\n return () => {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const nodesRetainedByZone = store.getState().retention.nodesRetainedByZone;\n\n function deleteFromZone(zone) {\n const set = nodesRetainedByZone.get(zone);\n\n if (set) {\n set.delete(nodeKey);\n }\n\n if (set && set.size === 0) {\n nodesRetainedByZone.delete(zone);\n }\n }\n\n if (retainedBy instanceof RetentionZone$1) {\n deleteFromZone(retainedBy);\n } else if (Array.isArray(retainedBy)) {\n for (const zone of retainedBy) {\n deleteFromZone(zone);\n }\n }\n };\n}\n\nfunction initializeNodeIfNewToStore(store, treeState, key, trigger) {\n const storeState = store.getState();\n\n if (storeState.nodeCleanupFunctions.has(key)) {\n return;\n }\n\n const config = getNode$1(key);\n const retentionCleanup = initializeRetentionForNode(store, key, config.retainedBy);\n const nodeCleanup = config.init(store, treeState, trigger);\n storeState.nodeCleanupFunctions.set(key, () => {\n nodeCleanup();\n retentionCleanup();\n });\n}\n\nfunction cleanUpNode(store, key) {\n var _state$nodeCleanupFun;\n\n const state = store.getState();\n (_state$nodeCleanupFun = state.nodeCleanupFunctions.get(key)) === null || _state$nodeCleanupFun === void 0 ? void 0 : _state$nodeCleanupFun();\n state.nodeCleanupFunctions.delete(key);\n} // Get the current value loadable of a node and update the state.\n// Update dependencies and subscriptions for selectors.\n// Update saved value validation for atoms.\n\n\nfunction getNodeLoadable(store, state, key) {\n initializeNodeIfNewToStore(store, state, key, 'get');\n return getNode$1(key).get(store, state);\n} // Peek at the current value loadable for a node without any evaluation or state change\n\n\nfunction peekNodeLoadable(store, state, key) {\n return getNode$1(key).peek(store, state);\n} // Write value directly to state bypassing the Node interface as the node\n// definitions may not have been loaded yet when processing the initial snapshot.\n\n\nfunction setUnvalidatedAtomValue_DEPRECATED(state, key, newValue) {\n var _node$invalidate;\n\n const node = getNodeMaybe$1(key);\n node === null || node === void 0 ? void 0 : (_node$invalidate = node.invalidate) === null || _node$invalidate === void 0 ? void 0 : _node$invalidate.call(node, state);\n return { ...state,\n atomValues: state.atomValues.clone().delete(key),\n nonvalidatedAtoms: state.nonvalidatedAtoms.clone().set(key, newValue),\n dirtyAtoms: setByAddingToSet$1(state.dirtyAtoms, key)\n };\n} // Return the discovered dependencies and values to be written by setting\n// a node value. (Multiple values may be written due to selectors getting to\n// set upstreams; deps may be discovered because of reads in updater functions.)\n\n\nfunction setNodeValue(store, state, key, newValue) {\n const node = getNode$1(key);\n\n if (node.set == null) {\n throw new ReadOnlyRecoilValueError(`Attempt to set read-only RecoilValue: ${key}`);\n }\n\n const set = node.set; // so flow doesn't lose the above refinement.\n\n initializeNodeIfNewToStore(store, state, key, 'set');\n return set(store, state, newValue);\n}\n\nfunction peekNodeInfo(store, state, key) {\n var _graph$nodeDeps$get, _storeState$nodeToCom, _storeState$nodeToCom2;\n\n const storeState = store.getState();\n const graph = store.getGraph(state.version);\n const type = storeState.knownAtoms.has(key) ? 'atom' : storeState.knownSelectors.has(key) ? 'selector' : undefined;\n const downstreamNodes = Recoil_filterIterable(getDownstreamNodes(store, state, new Set([key])), nodeKey => nodeKey !== key);\n return {\n loadable: peekNodeLoadable(store, state, key),\n isActive: storeState.knownAtoms.has(key) || storeState.knownSelectors.has(key),\n isSet: type === 'selector' ? false : state.atomValues.has(key),\n isModified: state.dirtyAtoms.has(key),\n type,\n // Report current dependencies. If the node hasn't been evaluated, then\n // dependencies may be missing based on the current state.\n deps: recoilValuesForKeys$1((_graph$nodeDeps$get = graph.nodeDeps.get(key)) !== null && _graph$nodeDeps$get !== void 0 ? _graph$nodeDeps$get : []),\n // Reportsall \"current\" subscribers. Evaluating other nodes or\n // previous in-progress async evaluations may introduce new subscribers.\n subscribers: {\n nodes: recoilValuesForKeys$1(downstreamNodes),\n components: Recoil_mapIterable((_storeState$nodeToCom = (_storeState$nodeToCom2 = storeState.nodeToComponentSubscriptions.get(key)) === null || _storeState$nodeToCom2 === void 0 ? void 0 : _storeState$nodeToCom2.values()) !== null && _storeState$nodeToCom !== void 0 ? _storeState$nodeToCom : [], ([name]) => ({\n name\n }))\n }\n };\n} // Find all of the recursively dependent nodes\n\n\nfunction getDownstreamNodes(store, state, keys) {\n const visitedNodes = new Set();\n const visitingNodes = Array.from(keys);\n const graph = store.getGraph(state.version);\n\n for (let key = visitingNodes.pop(); key; key = visitingNodes.pop()) {\n var _graph$nodeToNodeSubs;\n\n visitedNodes.add(key);\n const subscribedNodes = (_graph$nodeToNodeSubs = graph.nodeToNodeSubscriptions.get(key)) !== null && _graph$nodeToNodeSubs !== void 0 ? _graph$nodeToNodeSubs : emptySet;\n\n for (const downstreamNode of subscribedNodes) {\n if (!visitedNodes.has(downstreamNode)) {\n visitingNodes.push(downstreamNode);\n }\n }\n }\n\n return visitedNodes;\n}\n\nvar Recoil_FunctionalCore = {\n getNodeLoadable,\n peekNodeLoadable,\n setNodeValue,\n cleanUpNode,\n setUnvalidatedAtomValue_DEPRECATED,\n peekNodeInfo,\n getDownstreamNodes,\n initializeNodeIfNewToStore\n};\n\nconst {\n getDownstreamNodes: getDownstreamNodes$1,\n getNodeLoadable: getNodeLoadable$1,\n setNodeValue: setNodeValue$1\n} = Recoil_FunctionalCore;\n\nconst {\n getNodeMaybe: getNodeMaybe$2\n} = Recoil_Node;\n\nconst {\n DefaultValue: DefaultValue$1,\n RecoilValueNotReady: RecoilValueNotReady$1\n} = Recoil_Node;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$1,\n RecoilState: RecoilState$1,\n RecoilValueReadOnly: RecoilValueReadOnly$1,\n isRecoilValue: isRecoilValue$1\n} = Recoil_RecoilValue$1;\n\nfunction getRecoilValueAsLoadable(store, {\n key\n}, treeState = store.getState().currentTree) {\n var _storeState$nextTree, _storeState$previousT;\n\n // Reading from an older tree can cause bugs because the dependencies that we\n // discover during the read are lost.\n const storeState = store.getState();\n\n if (!(treeState.version === storeState.currentTree.version || treeState.version === ((_storeState$nextTree = storeState.nextTree) === null || _storeState$nextTree === void 0 ? void 0 : _storeState$nextTree.version) || treeState.version === ((_storeState$previousT = storeState.previousTree) === null || _storeState$previousT === void 0 ? void 0 : _storeState$previousT.version))) {\n Recoil_recoverableViolation('Tried to read from a discarded tree');\n }\n\n const loadable = getNodeLoadable$1(store, treeState, key);\n return loadable;\n}\n\nfunction applyAtomValueWrites(atomValues, writes) {\n const result = atomValues.clone();\n writes.forEach((v, k) => {\n if (v.state === 'hasValue' && v.contents instanceof DefaultValue$1) {\n result.delete(k);\n } else {\n result.set(k, v);\n }\n });\n return result;\n}\n\nfunction valueFromValueOrUpdater(store, state, {\n key\n}, valueOrUpdater) {\n if (typeof valueOrUpdater === 'function') {\n // Updater form: pass in the current value. Throw if the current value\n // is unavailable (namely when updating an async selector that's\n // pending or errored):\n const current = getNodeLoadable$1(store, state, key);\n\n if (current.state === 'loading') {\n throw new RecoilValueNotReady$1(key);\n } else if (current.state === 'hasError') {\n throw current.contents;\n } // T itself may be a function, so our refinement is not sufficient:\n\n\n return valueOrUpdater(current.contents); // flowlint-line unclear-type:off\n } else {\n return valueOrUpdater;\n }\n}\n\nfunction applyAction(store, state, action) {\n if (action.type === 'set') {\n const {\n recoilValue,\n valueOrUpdater\n } = action;\n const newValue = valueFromValueOrUpdater(store, state, recoilValue, valueOrUpdater);\n const writes = setNodeValue$1(store, state, recoilValue.key, newValue);\n\n for (const [key, loadable] of writes.entries()) {\n writeLoadableToTreeState(state, key, loadable);\n }\n } else if (action.type === 'setLoadable') {\n const {\n recoilValue: {\n key\n },\n loadable\n } = action;\n writeLoadableToTreeState(state, key, loadable);\n } else if (action.type === 'markModified') {\n const {\n recoilValue: {\n key\n }\n } = action;\n state.dirtyAtoms.add(key);\n } else if (action.type === 'setUnvalidated') {\n var _node$invalidate;\n\n // Write value directly to state bypassing the Node interface as the node\n // definitions may not have been loaded yet when processing the initial snapshot.\n const {\n recoilValue: {\n key\n },\n unvalidatedValue\n } = action;\n const node = getNodeMaybe$2(key);\n node === null || node === void 0 ? void 0 : (_node$invalidate = node.invalidate) === null || _node$invalidate === void 0 ? void 0 : _node$invalidate.call(node, state);\n state.atomValues.delete(key);\n state.nonvalidatedAtoms.set(key, unvalidatedValue);\n state.dirtyAtoms.add(key);\n } else {\n Recoil_recoverableViolation(`Unknown action ${action.type}`);\n }\n}\n\nfunction writeLoadableToTreeState(state, key, loadable) {\n if (loadable.state === 'hasValue' && loadable.contents instanceof DefaultValue$1) {\n state.atomValues.delete(key);\n } else {\n state.atomValues.set(key, loadable);\n }\n\n state.dirtyAtoms.add(key);\n state.nonvalidatedAtoms.delete(key);\n}\n\nfunction applyActionsToStore(store, actions) {\n store.replaceState(state => {\n const newState = copyTreeState(state);\n\n for (const action of actions) {\n applyAction(store, newState, action);\n }\n\n invalidateDownstreams(store, newState);\n return newState;\n });\n}\n\nfunction queueOrPerformStateUpdate(store, action) {\n if (batchStack.length) {\n const actionsByStore = batchStack[batchStack.length - 1];\n let actions = actionsByStore.get(store);\n\n if (!actions) {\n actionsByStore.set(store, actions = []);\n }\n\n actions.push(action);\n } else {\n applyActionsToStore(store, [action]);\n }\n}\n\nconst batchStack = [];\n\nfunction batchStart() {\n const actionsByStore = new Map();\n batchStack.push(actionsByStore);\n return () => {\n for (const [store, actions] of actionsByStore) {\n applyActionsToStore(store, actions);\n }\n\n const popped = batchStack.pop();\n\n if (popped !== actionsByStore) {\n Recoil_recoverableViolation('Incorrect order of batch popping');\n }\n };\n}\n\nfunction copyTreeState(state) {\n return { ...state,\n atomValues: state.atomValues.clone(),\n nonvalidatedAtoms: state.nonvalidatedAtoms.clone(),\n dirtyAtoms: new Set(state.dirtyAtoms)\n };\n}\n\nfunction invalidateDownstreams(store, state) {\n // Inform any nodes that were changed or downstream of changes so that they\n // can clear out any caches as needed due to the update:\n const downstreams = getDownstreamNodes$1(store, state, state.dirtyAtoms);\n\n for (const key of downstreams) {\n var _getNodeMaybe, _getNodeMaybe$invalid;\n\n (_getNodeMaybe = getNodeMaybe$2(key)) === null || _getNodeMaybe === void 0 ? void 0 : (_getNodeMaybe$invalid = _getNodeMaybe.invalidate) === null || _getNodeMaybe$invalid === void 0 ? void 0 : _getNodeMaybe$invalid.call(_getNodeMaybe, state);\n }\n}\n\nfunction setRecoilValue(store, recoilValue, valueOrUpdater) {\n queueOrPerformStateUpdate(store, {\n type: 'set',\n recoilValue,\n valueOrUpdater\n });\n}\n\nfunction setRecoilValueLoadable(store, recoilValue, loadable) {\n if (loadable instanceof DefaultValue$1) {\n return setRecoilValue(store, recoilValue, loadable);\n }\n\n queueOrPerformStateUpdate(store, {\n type: 'setLoadable',\n recoilValue,\n loadable\n });\n}\n\nfunction markRecoilValueModified(store, recoilValue) {\n queueOrPerformStateUpdate(store, {\n type: 'markModified',\n recoilValue\n });\n}\n\nfunction setUnvalidatedRecoilValue(store, recoilValue, unvalidatedValue) {\n queueOrPerformStateUpdate(store, {\n type: 'setUnvalidated',\n recoilValue,\n unvalidatedValue\n });\n}\n\nlet subscriptionID = 0;\n\nfunction subscribeToRecoilValue(store, {\n key\n}, callback, componentDebugName = null) {\n const subID = subscriptionID++;\n const storeState = store.getState();\n\n if (!storeState.nodeToComponentSubscriptions.has(key)) {\n storeState.nodeToComponentSubscriptions.set(key, new Map());\n }\n\n Recoil_nullthrows(storeState.nodeToComponentSubscriptions.get(key)).set(subID, [componentDebugName !== null && componentDebugName !== void 0 ? componentDebugName : '', callback]);\n return {\n release: () => {\n const storeState = store.getState();\n const subs = storeState.nodeToComponentSubscriptions.get(key);\n\n if (subs === undefined || !subs.has(subID)) {\n Recoil_recoverableViolation(`Subscription missing at release time for atom ${key}. This is a bug in Recoil.`);\n return;\n }\n\n subs.delete(subID);\n\n if (subs.size === 0) {\n storeState.nodeToComponentSubscriptions.delete(key);\n }\n }\n };\n}\n\nvar Recoil_RecoilValueInterface = {\n RecoilValueReadOnly: RecoilValueReadOnly$1,\n AbstractRecoilValue: AbstractRecoilValue$1,\n RecoilState: RecoilState$1,\n getRecoilValueAsLoadable,\n setRecoilValue,\n setRecoilValueLoadable,\n markRecoilValueModified,\n setUnvalidatedRecoilValue,\n subscribeToRecoilValue,\n isRecoilValue: isRecoilValue$1,\n applyAtomValueWrites,\n // TODO Remove export when deprecating initialStoreState_DEPRECATED in RecoilRoot\n batchStart,\n invalidateDownstreams_FOR_TESTING: invalidateDownstreams\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is to export esstiential functions from react-dom\n * for our web build\n */\nconst {\n unstable_batchedUpdates\n} = reactDom;\n\nvar ReactBatchedUpdates = {\n unstable_batchedUpdates\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is to export esstiential functions from react-dom\n * for our web build\n */\n// @fb-only: const {unstable_batchedUpdates} = require('ReactDOMComet');\nconst {\n unstable_batchedUpdates: unstable_batchedUpdates$1\n} = ReactBatchedUpdates; // @oss-only\n\n\nvar Recoil_ReactBatchedUpdates = {\n unstable_batchedUpdates: unstable_batchedUpdates$1\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\nconst {\n batchStart: batchStart$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n unstable_batchedUpdates: unstable_batchedUpdates$2\n} = Recoil_ReactBatchedUpdates;\n\nlet batcher = unstable_batchedUpdates$2; // flowlint-next-line unclear-type:off\n\n/**\n * Sets the provided batcher function as the batcher function used by Recoil.\n *\n * Set the batcher to a custom batcher for your renderer,\n * if you use a renderer other than React DOM or React Native.\n */\nconst setBatcher = newBatcher => {\n batcher = newBatcher;\n};\n/**\n * Returns the current batcher function.\n */\n\n\nconst getBatcher = () => batcher;\n/**\n * Calls the current batcher function and passes the\n * provided callback function.\n */\n\n\nconst batchUpdates = callback => {\n batcher(() => {\n let batchEnd = () => undefined;\n\n try {\n batchEnd = batchStart$1();\n callback();\n } finally {\n batchEnd();\n }\n });\n};\n\nvar Recoil_Batching = {\n getBatcher,\n setBatcher,\n batchUpdates\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction enqueueExecution(s, f) {\n f();\n}\n\nvar Recoil_Queue = {\n enqueueExecution\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a set containing all of the values from the first set that are not\n * present in any of the subsequent sets.\n *\n * Note: this is written procedurally (i.e., without filterSet) for performant\n * use in tight loops.\n */\n\nfunction differenceSets(set, ...setsWithValuesToRemove) {\n const ret = new Set();\n\n FIRST: for (const value of set) {\n for (const otherSet of setsWithValuesToRemove) {\n if (otherSet.has(value)) {\n continue FIRST;\n }\n }\n\n ret.add(value);\n }\n\n return ret;\n}\n\nvar Recoil_differenceSets = differenceSets;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a new Map object with the same keys as the original, but with the\n * values replaced with the output of the given callback function.\n */\n\nfunction mapMap(map, callback) {\n const result = new Map();\n map.forEach((value, key) => {\n result.set(key, callback(value, key));\n });\n return result;\n}\n\nvar Recoil_mapMap = mapMap;\n\nfunction graph() {\n return {\n nodeDeps: new Map(),\n nodeToNodeSubscriptions: new Map()\n };\n}\n\nfunction cloneGraph(graph) {\n return {\n nodeDeps: Recoil_mapMap(graph.nodeDeps, s => new Set(s)),\n nodeToNodeSubscriptions: Recoil_mapMap(graph.nodeToNodeSubscriptions, s => new Set(s))\n };\n} // Note that this overwrites the deps of existing nodes, rather than unioning\n// the new deps with the old deps.\n\n\nfunction mergeDependencyMapIntoGraph(deps, graph, // If olderGraph is given then we will not overwrite changes made to the given\n// graph compared with olderGraph:\nolderGraph) {\n const {\n nodeDeps,\n nodeToNodeSubscriptions\n } = graph;\n deps.forEach((upstreams, downstream) => {\n const existingUpstreams = nodeDeps.get(downstream);\n\n if (existingUpstreams && olderGraph && existingUpstreams !== olderGraph.nodeDeps.get(downstream)) {\n return;\n } // Update nodeDeps:\n\n\n nodeDeps.set(downstream, new Set(upstreams)); // Add new deps to nodeToNodeSubscriptions:\n\n const addedUpstreams = existingUpstreams == null ? upstreams : Recoil_differenceSets(upstreams, existingUpstreams);\n addedUpstreams.forEach(upstream => {\n if (!nodeToNodeSubscriptions.has(upstream)) {\n nodeToNodeSubscriptions.set(upstream, new Set());\n }\n\n const existing = Recoil_nullthrows(nodeToNodeSubscriptions.get(upstream));\n existing.add(downstream);\n }); // Remove removed deps from nodeToNodeSubscriptions:\n\n if (existingUpstreams) {\n const removedUpstreams = Recoil_differenceSets(existingUpstreams, upstreams);\n removedUpstreams.forEach(upstream => {\n if (!nodeToNodeSubscriptions.has(upstream)) {\n return;\n }\n\n const existing = Recoil_nullthrows(nodeToNodeSubscriptions.get(upstream));\n existing.delete(downstream);\n\n if (existing.size === 0) {\n nodeToNodeSubscriptions.delete(upstream);\n }\n });\n }\n });\n}\n\nfunction saveDependencyMapToStore(dependencyMap, store, version) {\n var _storeState$nextTree, _storeState$previousT, _storeState$previousT2, _storeState$previousT3;\n\n const storeState = store.getState();\n\n if (!(version === storeState.currentTree.version || version === ((_storeState$nextTree = storeState.nextTree) === null || _storeState$nextTree === void 0 ? void 0 : _storeState$nextTree.version) || version === ((_storeState$previousT = storeState.previousTree) === null || _storeState$previousT === void 0 ? void 0 : _storeState$previousT.version))) {\n Recoil_recoverableViolation('Tried to save dependencies to a discarded tree');\n } // Merge the dependencies discovered into the store's dependency map\n // for the version that was read:\n\n\n const graph = store.getGraph(version);\n mergeDependencyMapIntoGraph(dependencyMap, graph); // If this version is not the latest version, also write these dependencies\n // into later versions if they don't already have their own:\n\n if (version === ((_storeState$previousT2 = storeState.previousTree) === null || _storeState$previousT2 === void 0 ? void 0 : _storeState$previousT2.version)) {\n const currentGraph = store.getGraph(storeState.currentTree.version);\n mergeDependencyMapIntoGraph(dependencyMap, currentGraph, graph);\n }\n\n if (version === ((_storeState$previousT3 = storeState.previousTree) === null || _storeState$previousT3 === void 0 ? void 0 : _storeState$previousT3.version) || version === storeState.currentTree.version) {\n var _storeState$nextTree2;\n\n const nextVersion = (_storeState$nextTree2 = storeState.nextTree) === null || _storeState$nextTree2 === void 0 ? void 0 : _storeState$nextTree2.version;\n\n if (nextVersion !== undefined) {\n const nextGraph = store.getGraph(nextVersion);\n mergeDependencyMapIntoGraph(dependencyMap, nextGraph, graph);\n }\n }\n}\n\nfunction mergeDepsIntoDependencyMap(from, into) {\n from.forEach((upstreamDeps, downstreamNode) => {\n if (!into.has(downstreamNode)) {\n into.set(downstreamNode, new Set());\n }\n\n const deps = Recoil_nullthrows(into.get(downstreamNode));\n upstreamDeps.forEach(dep => deps.add(dep));\n });\n}\n\nfunction addToDependencyMap(downstream, upstream, dependencyMap) {\n if (!dependencyMap.has(downstream)) {\n dependencyMap.set(downstream, new Set());\n }\n\n Recoil_nullthrows(dependencyMap.get(downstream)).add(upstream);\n}\n\nvar Recoil_Graph = {\n addToDependencyMap,\n cloneGraph,\n graph,\n mergeDepsIntoDependencyMap,\n saveDependencyMapToStore\n};\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar hamt_1 = createCommonjsModule(function (module) {\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n/**\n @fileOverview Hash Array Mapped Trie.\n\n Code based on: https://github.com/exclipy/pdata\n*/\n\n\nvar hamt = {}; // export\n\n/* Configuration\n ******************************************************************************/\n\nvar SIZE = 5;\nvar BUCKET_SIZE = Math.pow(2, SIZE);\nvar MASK = BUCKET_SIZE - 1;\nvar MAX_INDEX_NODE = BUCKET_SIZE / 2;\nvar MIN_ARRAY_NODE = BUCKET_SIZE / 4;\n/*\n ******************************************************************************/\n\nvar nothing = {};\n\nvar constant = function constant(x) {\n return function () {\n return x;\n };\n};\n/**\n Get 32 bit hash of string.\n\n Based on:\n http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery\n*/\n\n\nvar hash = hamt.hash = function (str) {\n var type = typeof str === 'undefined' ? 'undefined' : _typeof(str);\n if (type === 'number') return str;\n if (type !== 'string') str += '';\n var hash = 0;\n\n for (var i = 0, len = str.length; i < len; ++i) {\n var c = str.charCodeAt(i);\n hash = (hash << 5) - hash + c | 0;\n }\n\n return hash;\n};\n/* Bit Ops\n ******************************************************************************/\n\n/**\n Hamming weight.\n\n Taken from: http://jsperf.com/hamming-weight\n*/\n\n\nvar popcount = function popcount(x) {\n x -= x >> 1 & 0x55555555;\n x = (x & 0x33333333) + (x >> 2 & 0x33333333);\n x = x + (x >> 4) & 0x0f0f0f0f;\n x += x >> 8;\n x += x >> 16;\n return x & 0x7f;\n};\n\nvar hashFragment = function hashFragment(shift, h) {\n return h >>> shift & MASK;\n};\n\nvar toBitmap = function toBitmap(x) {\n return 1 << x;\n};\n\nvar fromBitmap = function fromBitmap(bitmap, bit) {\n return popcount(bitmap & bit - 1);\n};\n/* Array Ops\n ******************************************************************************/\n\n/**\n Set a value in an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to change.\n @param v New value\n @param arr Array.\n*/\n\n\nvar arrayUpdate = function arrayUpdate(mutate, at, v, arr) {\n var out = arr;\n\n if (!mutate) {\n var len = arr.length;\n out = new Array(len);\n\n for (var i = 0; i < len; ++i) {\n out[i] = arr[i];\n }\n }\n\n out[at] = v;\n return out;\n};\n/**\n Remove a value from an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to remove.\n @param arr Array.\n*/\n\n\nvar arraySpliceOut = function arraySpliceOut(mutate, at, arr) {\n var newLen = arr.length - 1;\n var i = 0;\n var g = 0;\n var out = arr;\n\n if (mutate) {\n i = g = at;\n } else {\n out = new Array(newLen);\n\n while (i < at) {\n out[g++] = arr[i++];\n }\n }\n\n ++i;\n\n while (i <= newLen) {\n out[g++] = arr[i++];\n }\n\n if (mutate) {\n out.length = newLen;\n }\n\n return out;\n};\n/**\n Insert a value into an array.\n\n @param mutate Should the input array be mutated?\n @param at Index to insert at.\n @param v Value to insert,\n @param arr Array.\n*/\n\n\nvar arraySpliceIn = function arraySpliceIn(mutate, at, v, arr) {\n var len = arr.length;\n\n if (mutate) {\n var _i = len;\n\n while (_i >= at) {\n arr[_i--] = arr[_i];\n }\n\n arr[at] = v;\n return arr;\n }\n\n var i = 0,\n g = 0;\n var out = new Array(len + 1);\n\n while (i < at) {\n out[g++] = arr[i++];\n }\n\n out[at] = v;\n\n while (i < len) {\n out[++g] = arr[i++];\n }\n\n return out;\n};\n/* Node Structures\n ******************************************************************************/\n\n\nvar LEAF = 1;\nvar COLLISION = 2;\nvar INDEX = 3;\nvar ARRAY = 4;\n/**\n Empty node.\n*/\n\nvar empty = {\n __hamt_isEmpty: true\n};\n\nvar isEmptyNode = function isEmptyNode(x) {\n return x === empty || x && x.__hamt_isEmpty;\n};\n/**\n Leaf holding a value.\n\n @member edit Edit of the node.\n @member hash Hash of key.\n @member key Key.\n @member value Value stored.\n*/\n\n\nvar Leaf = function Leaf(edit, hash, key, value) {\n return {\n type: LEAF,\n edit: edit,\n hash: hash,\n key: key,\n value: value,\n _modify: Leaf__modify\n };\n};\n/**\n Leaf holding multiple values with the same hash but different keys.\n\n @member edit Edit of the node.\n @member hash Hash of key.\n @member children Array of collision children node.\n*/\n\n\nvar Collision = function Collision(edit, hash, children) {\n return {\n type: COLLISION,\n edit: edit,\n hash: hash,\n children: children,\n _modify: Collision__modify\n };\n};\n/**\n Internal node with a sparse set of children.\n\n Uses a bitmap and array to pack children.\n\n @member edit Edit of the node.\n @member mask Bitmap that encode the positions of children in the array.\n @member children Array of child nodes.\n*/\n\n\nvar IndexedNode = function IndexedNode(edit, mask, children) {\n return {\n type: INDEX,\n edit: edit,\n mask: mask,\n children: children,\n _modify: IndexedNode__modify\n };\n};\n/**\n Internal node with many children.\n\n @member edit Edit of the node.\n @member size Number of children.\n @member children Array of child nodes.\n*/\n\n\nvar ArrayNode = function ArrayNode(edit, size, children) {\n return {\n type: ARRAY,\n edit: edit,\n size: size,\n children: children,\n _modify: ArrayNode__modify\n };\n};\n/**\n Is `node` a leaf node?\n*/\n\n\nvar isLeaf = function isLeaf(node) {\n return node === empty || node.type === LEAF || node.type === COLLISION;\n};\n/* Internal node operations.\n ******************************************************************************/\n\n/**\n Expand an indexed node into an array node.\n\n @param edit Current edit.\n @param frag Index of added child.\n @param child Added child.\n @param mask Index node mask before child added.\n @param subNodes Index node children before child added.\n*/\n\n\nvar expand = function expand(edit, frag, child, bitmap, subNodes) {\n var arr = [];\n var bit = bitmap;\n var count = 0;\n\n for (var i = 0; bit; ++i) {\n if (bit & 1) arr[i] = subNodes[count++];\n bit >>>= 1;\n }\n\n arr[frag] = child;\n return ArrayNode(edit, count + 1, arr);\n};\n/**\n Collapse an array node into a indexed node.\n\n @param edit Current edit.\n @param count Number of elements in new array.\n @param removed Index of removed element.\n @param elements Array node children before remove.\n*/\n\n\nvar pack = function pack(edit, count, removed, elements) {\n var children = new Array(count - 1);\n var g = 0;\n var bitmap = 0;\n\n for (var i = 0, len = elements.length; i < len; ++i) {\n if (i !== removed) {\n var elem = elements[i];\n\n if (elem && !isEmptyNode(elem)) {\n children[g++] = elem;\n bitmap |= 1 << i;\n }\n }\n }\n\n return IndexedNode(edit, bitmap, children);\n};\n/**\n Merge two leaf nodes.\n\n @param shift Current shift.\n @param h1 Node 1 hash.\n @param n1 Node 1.\n @param h2 Node 2 hash.\n @param n2 Node 2.\n*/\n\n\nvar mergeLeaves = function mergeLeaves(edit, shift, h1, n1, h2, n2) {\n if (h1 === h2) return Collision(edit, h1, [n2, n1]);\n var subH1 = hashFragment(shift, h1);\n var subH2 = hashFragment(shift, h2);\n return IndexedNode(edit, toBitmap(subH1) | toBitmap(subH2), subH1 === subH2 ? [mergeLeaves(edit, shift + SIZE, h1, n1, h2, n2)] : subH1 < subH2 ? [n1, n2] : [n2, n1]);\n};\n/**\n Update an entry in a collision list.\n\n @param mutate Should mutation be used?\n @param edit Current edit.\n @param keyEq Key compare function.\n @param hash Hash of collision.\n @param list Collision list.\n @param f Update function.\n @param k Key to update.\n @param size Size ref.\n*/\n\n\nvar updateCollisionList = function updateCollisionList(mutate, edit, keyEq, h, list, f, k, size) {\n var len = list.length;\n\n for (var i = 0; i < len; ++i) {\n var child = list[i];\n\n if (keyEq(k, child.key)) {\n var value = child.value;\n\n var _newValue = f(value);\n\n if (_newValue === value) return list;\n\n if (_newValue === nothing) {\n --size.value;\n return arraySpliceOut(mutate, i, list);\n }\n\n return arrayUpdate(mutate, i, Leaf(edit, h, k, _newValue), list);\n }\n }\n\n var newValue = f();\n if (newValue === nothing) return list;\n ++size.value;\n return arrayUpdate(mutate, len, Leaf(edit, h, k, newValue), list);\n};\n\nvar canEditNode = function canEditNode(edit, node) {\n return edit === node.edit;\n};\n/* Editing\n ******************************************************************************/\n\n\nvar Leaf__modify = function Leaf__modify(edit, keyEq, shift, f, h, k, size) {\n if (keyEq(k, this.key)) {\n var _v = f(this.value);\n\n if (_v === this.value) return this;else if (_v === nothing) {\n --size.value;\n return empty;\n }\n\n if (canEditNode(edit, this)) {\n this.value = _v;\n return this;\n }\n\n return Leaf(edit, h, k, _v);\n }\n\n var v = f();\n if (v === nothing) return this;\n ++size.value;\n return mergeLeaves(edit, shift, this.hash, this, h, Leaf(edit, h, k, v));\n};\n\nvar Collision__modify = function Collision__modify(edit, keyEq, shift, f, h, k, size) {\n if (h === this.hash) {\n var canEdit = canEditNode(edit, this);\n var list = updateCollisionList(canEdit, edit, keyEq, this.hash, this.children, f, k, size);\n if (list === this.children) return this;\n return list.length > 1 ? Collision(edit, this.hash, list) : list[0]; // collapse single element collision list\n }\n\n var v = f();\n if (v === nothing) return this;\n ++size.value;\n return mergeLeaves(edit, shift, this.hash, this, h, Leaf(edit, h, k, v));\n};\n\nvar IndexedNode__modify = function IndexedNode__modify(edit, keyEq, shift, f, h, k, size) {\n var mask = this.mask;\n var children = this.children;\n var frag = hashFragment(shift, h);\n var bit = toBitmap(frag);\n var indx = fromBitmap(mask, bit);\n var exists = mask & bit;\n var current = exists ? children[indx] : empty;\n\n var child = current._modify(edit, keyEq, shift + SIZE, f, h, k, size);\n\n if (current === child) return this;\n var canEdit = canEditNode(edit, this);\n var bitmap = mask;\n var newChildren = void 0;\n\n if (exists && isEmptyNode(child)) {\n // remove\n bitmap &= ~bit;\n if (!bitmap) return empty;\n if (children.length <= 2 && isLeaf(children[indx ^ 1])) return children[indx ^ 1]; // collapse\n\n newChildren = arraySpliceOut(canEdit, indx, children);\n } else if (!exists && !isEmptyNode(child)) {\n // add\n if (children.length >= MAX_INDEX_NODE) return expand(edit, frag, child, mask, children);\n bitmap |= bit;\n newChildren = arraySpliceIn(canEdit, indx, child, children);\n } else {\n // modify\n newChildren = arrayUpdate(canEdit, indx, child, children);\n }\n\n if (canEdit) {\n this.mask = bitmap;\n this.children = newChildren;\n return this;\n }\n\n return IndexedNode(edit, bitmap, newChildren);\n};\n\nvar ArrayNode__modify = function ArrayNode__modify(edit, keyEq, shift, f, h, k, size) {\n var count = this.size;\n var children = this.children;\n var frag = hashFragment(shift, h);\n var child = children[frag];\n\n var newChild = (child || empty)._modify(edit, keyEq, shift + SIZE, f, h, k, size);\n\n if (child === newChild) return this;\n var canEdit = canEditNode(edit, this);\n var newChildren = void 0;\n\n if (isEmptyNode(child) && !isEmptyNode(newChild)) {\n // add\n ++count;\n newChildren = arrayUpdate(canEdit, frag, newChild, children);\n } else if (!isEmptyNode(child) && isEmptyNode(newChild)) {\n // remove\n --count;\n if (count <= MIN_ARRAY_NODE) return pack(edit, count, frag, children);\n newChildren = arrayUpdate(canEdit, frag, empty, children);\n } else {\n // modify\n newChildren = arrayUpdate(canEdit, frag, newChild, children);\n }\n\n if (canEdit) {\n this.size = count;\n this.children = newChildren;\n return this;\n }\n\n return ArrayNode(edit, count, newChildren);\n};\n\nempty._modify = function (edit, keyEq, shift, f, h, k, size) {\n var v = f();\n if (v === nothing) return empty;\n ++size.value;\n return Leaf(edit, h, k, v);\n};\n/*\n ******************************************************************************/\n\n\nfunction Map(editable, edit, config, root, size) {\n this._editable = editable;\n this._edit = edit;\n this._config = config;\n this._root = root;\n this._size = size;\n}\n\nMap.prototype.setTree = function (newRoot, newSize) {\n if (this._editable) {\n this._root = newRoot;\n this._size = newSize;\n return this;\n }\n\n return newRoot === this._root ? this : new Map(this._editable, this._edit, this._config, newRoot, newSize);\n};\n/* Queries\n ******************************************************************************/\n\n/**\n Lookup the value for `key` in `map` using a custom `hash`.\n\n Returns the value or `alt` if none.\n*/\n\n\nvar tryGetHash = hamt.tryGetHash = function (alt, hash, key, map) {\n var node = map._root;\n var shift = 0;\n var keyEq = map._config.keyEq;\n\n while (true) {\n switch (node.type) {\n case LEAF:\n {\n return keyEq(key, node.key) ? node.value : alt;\n }\n\n case COLLISION:\n {\n if (hash === node.hash) {\n var children = node.children;\n\n for (var i = 0, len = children.length; i < len; ++i) {\n var child = children[i];\n if (keyEq(key, child.key)) return child.value;\n }\n }\n\n return alt;\n }\n\n case INDEX:\n {\n var frag = hashFragment(shift, hash);\n var bit = toBitmap(frag);\n\n if (node.mask & bit) {\n node = node.children[fromBitmap(node.mask, bit)];\n shift += SIZE;\n break;\n }\n\n return alt;\n }\n\n case ARRAY:\n {\n node = node.children[hashFragment(shift, hash)];\n\n if (node) {\n shift += SIZE;\n break;\n }\n\n return alt;\n }\n\n default:\n return alt;\n }\n }\n};\n\nMap.prototype.tryGetHash = function (alt, hash, key) {\n return tryGetHash(alt, hash, key, this);\n};\n/**\n Lookup the value for `key` in `map` using internal hash function.\n\n @see `tryGetHash`\n*/\n\n\nvar tryGet = hamt.tryGet = function (alt, key, map) {\n return tryGetHash(alt, map._config.hash(key), key, map);\n};\n\nMap.prototype.tryGet = function (alt, key) {\n return tryGet(alt, key, this);\n};\n/**\n Lookup the value for `key` in `map` using a custom `hash`.\n\n Returns the value or `undefined` if none.\n*/\n\n\nvar getHash = hamt.getHash = function (hash, key, map) {\n return tryGetHash(undefined, hash, key, map);\n};\n\nMap.prototype.getHash = function (hash, key) {\n return getHash(hash, key, this);\n};\n/**\n Lookup the value for `key` in `map` using internal hash function.\n\n @see `get`\n*/\n\n\nvar get = hamt.get = function (key, map) {\n return tryGetHash(undefined, map._config.hash(key), key, map);\n};\n\nMap.prototype.get = function (key, alt) {\n return tryGet(alt, key, this);\n};\n/**\n Does an entry exist for `key` in `map`? Uses custom `hash`.\n*/\n\n\nvar hasHash = hamt.has = function (hash, key, map) {\n return tryGetHash(nothing, hash, key, map) !== nothing;\n};\n\nMap.prototype.hasHash = function (hash, key) {\n return hasHash(hash, key, this);\n};\n/**\n Does an entry exist for `key` in `map`? Uses internal hash function.\n*/\n\n\nvar has = hamt.has = function (key, map) {\n return hasHash(map._config.hash(key), key, map);\n};\n\nMap.prototype.has = function (key) {\n return has(key, this);\n};\n\nvar defKeyCompare = function defKeyCompare(x, y) {\n return x === y;\n};\n/**\n Create an empty map.\n\n @param config Configuration.\n*/\n\n\nhamt.make = function (config) {\n return new Map(0, 0, {\n keyEq: config && config.keyEq || defKeyCompare,\n hash: config && config.hash || hash\n }, empty, 0);\n};\n/**\n Empty map.\n*/\n\n\nhamt.empty = hamt.make();\n/**\n Does `map` contain any elements?\n*/\n\nvar isEmpty = hamt.isEmpty = function (map) {\n return map && !!isEmptyNode(map._root);\n};\n\nMap.prototype.isEmpty = function () {\n return isEmpty(this);\n};\n/* Updates\n ******************************************************************************/\n\n/**\n Alter the value stored for `key` in `map` using function `f` using\n custom hash.\n\n `f` is invoked with the current value for `k` if it exists,\n or no arguments if no such value exists. `modify` will always either\n update or insert a value into the map.\n\n Returns a map with the modified value. Does not alter `map`.\n*/\n\n\nvar modifyHash = hamt.modifyHash = function (f, hash, key, map) {\n var size = {\n value: map._size\n };\n\n var newRoot = map._root._modify(map._editable ? map._edit : NaN, map._config.keyEq, 0, f, hash, key, size);\n\n return map.setTree(newRoot, size.value);\n};\n\nMap.prototype.modifyHash = function (hash, key, f) {\n return modifyHash(f, hash, key, this);\n};\n/**\n Alter the value stored for `key` in `map` using function `f` using\n internal hash function.\n\n @see `modifyHash`\n*/\n\n\nvar modify = hamt.modify = function (f, key, map) {\n return modifyHash(f, map._config.hash(key), key, map);\n};\n\nMap.prototype.modify = function (key, f) {\n return modify(f, key, this);\n};\n/**\n Store `value` for `key` in `map` using custom `hash`.\n\n Returns a map with the modified value. Does not alter `map`.\n*/\n\n\nvar setHash = hamt.setHash = function (hash, key, value, map) {\n return modifyHash(constant(value), hash, key, map);\n};\n\nMap.prototype.setHash = function (hash, key, value) {\n return setHash(hash, key, value, this);\n};\n/**\n Store `value` for `key` in `map` using internal hash function.\n\n @see `setHash`\n*/\n\n\nvar set = hamt.set = function (key, value, map) {\n return setHash(map._config.hash(key), key, value, map);\n};\n\nMap.prototype.set = function (key, value) {\n return set(key, value, this);\n};\n/**\n Remove the entry for `key` in `map`.\n\n Returns a map with the value removed. Does not alter `map`.\n*/\n\n\nvar del = constant(nothing);\n\nvar removeHash = hamt.removeHash = function (hash, key, map) {\n return modifyHash(del, hash, key, map);\n};\n\nMap.prototype.removeHash = Map.prototype.deleteHash = function (hash, key) {\n return removeHash(hash, key, this);\n};\n/**\n Remove the entry for `key` in `map` using internal hash function.\n\n @see `removeHash`\n*/\n\n\nvar remove = hamt.remove = function (key, map) {\n return removeHash(map._config.hash(key), key, map);\n};\n\nMap.prototype.remove = Map.prototype.delete = function (key) {\n return remove(key, this);\n};\n/* Mutation\n ******************************************************************************/\n\n/**\n Mark `map` as mutable.\n */\n\n\nvar beginMutation = hamt.beginMutation = function (map) {\n return new Map(map._editable + 1, map._edit + 1, map._config, map._root, map._size);\n};\n\nMap.prototype.beginMutation = function () {\n return beginMutation(this);\n};\n/**\n Mark `map` as immutable.\n */\n\n\nvar endMutation = hamt.endMutation = function (map) {\n map._editable = map._editable && map._editable - 1;\n return map;\n};\n\nMap.prototype.endMutation = function () {\n return endMutation(this);\n};\n/**\n Mutate `map` within the context of `f`.\n @param f\n @param map HAMT\n*/\n\n\nvar mutate = hamt.mutate = function (f, map) {\n var transient = beginMutation(map);\n f(transient);\n return endMutation(transient);\n};\n\nMap.prototype.mutate = function (f) {\n return mutate(f, this);\n};\n/* Traversal\n ******************************************************************************/\n\n/**\n Apply a continuation.\n*/\n\n\nvar appk = function appk(k) {\n return k && lazyVisitChildren(k[0], k[1], k[2], k[3], k[4]);\n};\n/**\n Recursively visit all values stored in an array of nodes lazily.\n*/\n\n\nvar lazyVisitChildren = function lazyVisitChildren(len, children, i, f, k) {\n while (i < len) {\n var child = children[i++];\n if (child && !isEmptyNode(child)) return lazyVisit(child, f, [len, children, i, f, k]);\n }\n\n return appk(k);\n};\n/**\n Recursively visit all values stored in `node` lazily.\n*/\n\n\nvar lazyVisit = function lazyVisit(node, f, k) {\n switch (node.type) {\n case LEAF:\n return {\n value: f(node),\n rest: k\n };\n\n case COLLISION:\n case ARRAY:\n case INDEX:\n var children = node.children;\n return lazyVisitChildren(children.length, children, 0, f, k);\n\n default:\n return appk(k);\n }\n};\n\nvar DONE = {\n done: true\n};\n/**\n Javascript iterator over a map.\n*/\n\nfunction MapIterator(v) {\n this.v = v;\n}\n\nMapIterator.prototype.next = function () {\n if (!this.v) return DONE;\n var v0 = this.v;\n this.v = appk(v0.rest);\n return v0;\n};\n\nMapIterator.prototype[Symbol.iterator] = function () {\n return this;\n};\n/**\n Lazily visit each value in map with function `f`.\n*/\n\n\nvar visit = function visit(map, f) {\n return new MapIterator(lazyVisit(map._root, f));\n};\n/**\n Get a Javascsript iterator of `map`.\n\n Iterates over `[key, value]` arrays.\n*/\n\n\nvar buildPairs = function buildPairs(x) {\n return [x.key, x.value];\n};\n\nvar entries = hamt.entries = function (map) {\n return visit(map, buildPairs);\n};\n\nMap.prototype.entries = Map.prototype[Symbol.iterator] = function () {\n return entries(this);\n};\n/**\n Get array of all keys in `map`.\n\n Order is not guaranteed.\n*/\n\n\nvar buildKeys = function buildKeys(x) {\n return x.key;\n};\n\nvar keys = hamt.keys = function (map) {\n return visit(map, buildKeys);\n};\n\nMap.prototype.keys = function () {\n return keys(this);\n};\n/**\n Get array of all values in `map`.\n\n Order is not guaranteed, duplicates are preserved.\n*/\n\n\nvar buildValues = function buildValues(x) {\n return x.value;\n};\n\nvar values = hamt.values = Map.prototype.values = function (map) {\n return visit(map, buildValues);\n};\n\nMap.prototype.values = function () {\n return values(this);\n};\n/* Fold\n ******************************************************************************/\n\n/**\n Visit every entry in the map, aggregating data.\n\n Order of nodes is not guaranteed.\n\n @param f Function mapping accumulated value, value, and key to new value.\n @param z Starting value.\n @param m HAMT\n*/\n\n\nvar fold = hamt.fold = function (f, z, m) {\n var root = m._root;\n if (root.type === LEAF) return f(z, root.value, root.key);\n var toVisit = [root.children];\n var children = void 0;\n\n while (children = toVisit.pop()) {\n for (var i = 0, len = children.length; i < len;) {\n var child = children[i++];\n\n if (child && child.type) {\n if (child.type === LEAF) z = f(z, child.value, child.key);else toVisit.push(child.children);\n }\n }\n }\n\n return z;\n};\n\nMap.prototype.fold = function (f, z) {\n return fold(f, z, this);\n};\n/**\n Visit every entry in the map, aggregating data.\n\n Order of nodes is not guaranteed.\n\n @param f Function invoked with value and key\n @param map HAMT\n*/\n\n\nvar forEach = hamt.forEach = function (f, map) {\n return fold(function (_, value, key) {\n return f(value, key, map);\n }, null, map);\n};\n\nMap.prototype.forEach = function (f) {\n return forEach(f, this);\n};\n/* Aggregate\n ******************************************************************************/\n\n/**\n Get the number of entries in `map`.\n*/\n\n\nvar count = hamt.count = function (map) {\n return map._size;\n};\n\nMap.prototype.count = function () {\n return count(this);\n};\n\nObject.defineProperty(Map.prototype, 'size', {\n get: Map.prototype.count\n});\n/* Export\n ******************************************************************************/\n\nif ( module.exports) {\n module.exports = hamt;\n} else {\n undefined.hamt = hamt;\n}\n});\n\nclass BuiltInMap {\n constructor(existing) {\n _defineProperty(this, \"_map\", void 0);\n\n this._map = new Map(existing === null || existing === void 0 ? void 0 : existing.entries());\n }\n\n keys() {\n return this._map.keys();\n }\n\n entries() {\n return this._map.entries();\n }\n\n get(k) {\n return this._map.get(k);\n }\n\n has(k) {\n return this._map.has(k);\n }\n\n set(k, v) {\n this._map.set(k, v);\n\n return this;\n }\n\n delete(k) {\n this._map.delete(k);\n\n return this;\n }\n\n clone() {\n return persistentMap(this);\n }\n\n toMap() {\n return new Map(this._map);\n }\n\n}\n\nclass HashArrayMappedTrieMap {\n // Because hamt.empty is not a function there is no way to introduce type\n // parameters on it, so empty is typed as HAMTPlusMap.\n // flowlint-next-line unclear-type:off\n constructor(existing) {\n _defineProperty(this, \"_hamt\", hamt_1.empty.beginMutation());\n\n if (existing instanceof HashArrayMappedTrieMap) {\n const h = existing._hamt.endMutation();\n\n existing._hamt = h.beginMutation();\n this._hamt = h.beginMutation();\n } else if (existing) {\n for (const [k, v] of existing.entries()) {\n this._hamt.set(k, v);\n }\n }\n }\n\n keys() {\n return this._hamt.keys();\n }\n\n entries() {\n return this._hamt.entries();\n }\n\n get(k) {\n return this._hamt.get(k);\n }\n\n has(k) {\n return this._hamt.has(k);\n }\n\n set(k, v) {\n this._hamt.set(k, v);\n\n return this;\n }\n\n delete(k) {\n this._hamt.delete(k);\n\n return this;\n }\n\n clone() {\n return persistentMap(this);\n }\n\n toMap() {\n return new Map(this._hamt);\n }\n\n}\n\nfunction persistentMap(existing) {\n if (Recoil_gkx_1('recoil_hamt_2020')) {\n return new HashArrayMappedTrieMap(existing);\n } else {\n return new BuiltInMap(existing);\n }\n}\n\nvar Recoil_PersistentMap = {\n persistentMap\n};\n\nvar Recoil_PersistentMap_1 = Recoil_PersistentMap.persistentMap;\n\nvar Recoil_PersistentMap$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n persistentMap: Recoil_PersistentMap_1\n});\n\nconst {\n graph: graph$1\n} = Recoil_Graph;\n\nconst {\n persistentMap: persistentMap$1\n} = Recoil_PersistentMap$1; // flowlint-next-line unclear-type:off\n\n\nlet nextTreeStateVersion = 0;\n\nconst getNextTreeStateVersion = () => nextTreeStateVersion++;\n\nfunction makeEmptyTreeState() {\n const version = getNextTreeStateVersion();\n return {\n version,\n stateID: version,\n transactionMetadata: {},\n dirtyAtoms: new Set(),\n atomValues: persistentMap$1(),\n nonvalidatedAtoms: persistentMap$1()\n };\n}\n\nfunction makeEmptyStoreState() {\n const currentTree = makeEmptyTreeState();\n return {\n currentTree,\n nextTree: null,\n previousTree: null,\n knownAtoms: new Set(),\n knownSelectors: new Set(),\n transactionSubscriptions: new Map(),\n nodeTransactionSubscriptions: new Map(),\n nodeToComponentSubscriptions: new Map(),\n queuedComponentCallbacks_DEPRECATED: [],\n suspendedComponentResolvers: new Set(),\n graphsByVersion: new Map().set(currentTree.version, graph$1()),\n versionsUsedByComponent: new Map(),\n retention: {\n referenceCounts: new Map(),\n nodesRetainedByZone: new Map(),\n retainablesToCheckForRelease: new Set()\n },\n nodeCleanupFunctions: new Map()\n };\n}\n\nvar Recoil_State = {\n makeEmptyTreeState,\n makeEmptyStoreState,\n getNextTreeStateVersion\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction unionSets(...sets) {\n const result = new Set();\n\n for (const set of sets) {\n for (const value of set) {\n result.add(value);\n }\n }\n\n return result;\n}\n\nvar Recoil_unionSets = unionSets;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * The someSet() method tests whether some elements in the given Set pass the\n * test implemented by the provided function.\n */\n\nfunction someSet(set, callback, context) {\n const iterator = set.entries();\n let current = iterator.next();\n\n while (!current.done) {\n const entry = current.value;\n\n if (callback.call(context, entry[1], entry[0], set)) {\n return true;\n }\n\n current = iterator.next();\n }\n\n return false;\n}\n\nvar Recoil_someSet = someSet;\n\nconst {\n cleanUpNode: cleanUpNode$1\n} = Recoil_FunctionalCore;\n\nconst {\n deleteNodeConfigIfPossible: deleteNodeConfigIfPossible$1,\n getNode: getNode$2\n} = Recoil_Node;\n\nconst {\n RetentionZone: RetentionZone$2\n} = Recoil_RetentionZone;\n\nconst emptySet$1 = new Set();\n\nfunction releaseRetainablesNowOnCurrentTree(store, retainables) {\n const storeState = store.getState();\n const treeState = storeState.currentTree;\n\n if (storeState.nextTree) {\n Recoil_recoverableViolation('releaseNodesNowOnCurrentTree should only be called at the end of a batch');\n return; // leak memory rather than erase something that's about to be used.\n }\n\n const nodes = new Set();\n\n for (const r of retainables) {\n if (r instanceof RetentionZone$2) {\n for (const n of nodesRetainedByZone(storeState, r)) {\n nodes.add(n);\n }\n } else {\n nodes.add(r);\n }\n }\n\n const releasableNodes = findReleasableNodes(store, nodes);\n\n for (const node of releasableNodes) {\n releaseNode(store, treeState, node);\n }\n}\n\nfunction findReleasableNodes(store, searchFromNodes) {\n const storeState = store.getState();\n const treeState = storeState.currentTree;\n const graph = store.getGraph(treeState.version);\n const releasableNodes = new Set(); // mutated to collect answer\n\n const nonReleasableNodes = new Set();\n findReleasableNodesInner(searchFromNodes);\n return releasableNodes;\n\n function findReleasableNodesInner(searchFromNodes) {\n const releasableNodesFoundThisIteration = new Set();\n const downstreams = getDownstreamNodesInTopologicalOrder(store, treeState, searchFromNodes, releasableNodes, // don't descend into these\n nonReleasableNodes // don't descend into these\n ); // Find which of the downstream nodes are releasable and which are not:\n\n for (const node of downstreams) {\n var _storeState$retention;\n\n // Not releasable if configured to be retained forever:\n if (getNode$2(node).retainedBy === 'recoilRoot') {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if retained directly by a component:\n\n\n if (((_storeState$retention = storeState.retention.referenceCounts.get(node)) !== null && _storeState$retention !== void 0 ? _storeState$retention : 0) > 0) {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if retained by a zone:\n\n\n if (zonesThatCouldRetainNode(node).some(z => storeState.retention.referenceCounts.get(z))) {\n nonReleasableNodes.add(node);\n continue;\n } // Not releasable if it has a non-releasable child (which will already be in\n // nonReleasableNodes because we are going in topological order):\n\n\n const nodeChildren = graph.nodeToNodeSubscriptions.get(node);\n\n if (nodeChildren && Recoil_someSet(nodeChildren, child => nonReleasableNodes.has(child))) {\n nonReleasableNodes.add(node);\n continue;\n }\n\n releasableNodes.add(node);\n releasableNodesFoundThisIteration.add(node);\n } // If we found any releasable nodes, we need to walk UP from those nodes to\n // find whether their parents can now be released as well:\n\n\n const parents = new Set();\n\n for (const node of releasableNodesFoundThisIteration) {\n for (const parent of (_graph$nodeDeps$get = graph.nodeDeps.get(node)) !== null && _graph$nodeDeps$get !== void 0 ? _graph$nodeDeps$get : emptySet$1) {\n var _graph$nodeDeps$get;\n\n if (!releasableNodes.has(parent)) {\n parents.add(parent);\n }\n }\n }\n\n if (parents.size) {\n findReleasableNodesInner(parents);\n }\n }\n} // Children before parents\n\n\nfunction getDownstreamNodesInTopologicalOrder(store, treeState, nodes, // Mutable set is destroyed in place\ndoNotDescendInto1, doNotDescendInto2) {\n const graph = store.getGraph(treeState.version);\n const answer = [];\n const visited = new Set();\n\n while (nodes.size > 0) {\n visit(Recoil_nullthrows(nodes.values().next().value));\n }\n\n return answer;\n\n function visit(node) {\n if (doNotDescendInto1.has(node) || doNotDescendInto2.has(node)) {\n nodes.delete(node);\n return;\n }\n\n if (visited.has(node)) {\n return;\n }\n\n const children = graph.nodeToNodeSubscriptions.get(node);\n\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n\n visited.add(node);\n nodes.delete(node);\n answer.push(node);\n }\n}\n\nfunction releaseNode(store, treeState, node) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n } // Atom effects, in-closure caches, etc.:\n\n\n cleanUpNode$1(store, node); // Delete from store state:\n\n const storeState = store.getState();\n storeState.knownAtoms.delete(node);\n storeState.knownSelectors.delete(node);\n storeState.nodeTransactionSubscriptions.delete(node);\n storeState.retention.referenceCounts.delete(node);\n const zones = zonesThatCouldRetainNode(node);\n\n for (const zone of zones) {\n var _storeState$retention2;\n\n (_storeState$retention2 = storeState.retention.nodesRetainedByZone.get(zone)) === null || _storeState$retention2 === void 0 ? void 0 : _storeState$retention2.delete(node);\n } // Note that we DO NOT delete from nodeToComponentSubscriptions because this\n // already happens when the last component that was retaining the node unmounts,\n // and this could happen either before or after that.\n // Delete from TreeState and dep graph:\n\n\n treeState.atomValues.delete(node);\n treeState.dirtyAtoms.delete(node);\n treeState.nonvalidatedAtoms.delete(node);\n const graph = storeState.graphsByVersion.get(treeState.version);\n\n if (graph) {\n const deps = graph.nodeDeps.get(node);\n\n if (deps !== undefined) {\n graph.nodeDeps.delete(node);\n\n for (const dep of deps) {\n var _graph$nodeToNodeSubs;\n\n (_graph$nodeToNodeSubs = graph.nodeToNodeSubscriptions.get(dep)) === null || _graph$nodeToNodeSubs === void 0 ? void 0 : _graph$nodeToNodeSubs.delete(node);\n }\n } // No need to delete sub's deps as there should be no subs at this point.\n // But an invariant would require deleting nodes in topological order.\n\n\n graph.nodeToNodeSubscriptions.delete(node);\n } // Node config (for family members only as their configs can be recreated, and\n // only if they are not retained within any other Stores):\n\n\n deleteNodeConfigIfPossible$1(node);\n}\n\nfunction nodesRetainedByZone(storeState, zone) {\n var _storeState$retention3;\n\n return (_storeState$retention3 = storeState.retention.nodesRetainedByZone.get(zone)) !== null && _storeState$retention3 !== void 0 ? _storeState$retention3 : emptySet$1;\n}\n\nfunction zonesThatCouldRetainNode(node) {\n const retainedBy = getNode$2(node).retainedBy;\n\n if (retainedBy === undefined || retainedBy === 'components' || retainedBy === 'recoilRoot') {\n return [];\n } else if (retainedBy instanceof RetentionZone$2) {\n return [retainedBy];\n } else {\n return retainedBy; // it's an array of zones\n }\n}\n\nfunction scheduleOrPerformPossibleReleaseOfRetainable(store, retainable) {\n const state = store.getState();\n\n if (state.nextTree) {\n state.retention.retainablesToCheckForRelease.add(retainable);\n } else {\n releaseRetainablesNowOnCurrentTree(store, new Set([retainable]));\n }\n}\n\nfunction updateRetainCount(store, retainable, delta) {\n var _map$get;\n\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const map = store.getState().retention.referenceCounts;\n const newCount = ((_map$get = map.get(retainable)) !== null && _map$get !== void 0 ? _map$get : 0) + delta;\n\n if (newCount === 0) {\n map.delete(retainable);\n scheduleOrPerformPossibleReleaseOfRetainable(store, retainable);\n } else {\n map.set(retainable, newCount);\n }\n}\n\nfunction releaseScheduledRetainablesNow(store) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const state = store.getState();\n releaseRetainablesNowOnCurrentTree(store, state.retention.retainablesToCheckForRelease);\n state.retention.retainablesToCheckForRelease.clear();\n}\n\nfunction retainedByOptionWithDefault(r) {\n // The default will change from 'recoilRoot' to 'components' in the future.\n return r === undefined ? 'recoilRoot' : r;\n}\n\nvar Recoil_Retention = {\n updateRetainCount,\n releaseScheduledRetainablesNow,\n retainedByOptionWithDefault\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Combines multiple Iterables into a single Iterable.\n * Traverses the input Iterables in the order provided and maintains the order\n * of their elements.\n *\n * Example:\n * ```\n * const r = Array.from(concatIterables(['a', 'b'], ['c'], ['d', 'e', 'f']));\n * r == ['a', 'b', 'c', 'd', 'e', 'f'];\n * ```\n */\n\nfunction* concatIterables(iters) {\n for (const iter of iters) {\n for (const val of iter) {\n yield val;\n }\n }\n}\n\nvar Recoil_concatIterables = concatIterables;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst isSSR = typeof window === 'undefined';\nconst isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative'; // eslint-disable-line fb-www/typeof-undefined\n\nvar Recoil_Environment = {\n isSSR,\n isReactNative\n};\n\nconst {\n isSSR: isSSR$1\n} = Recoil_Environment;\n\n\n\n\n\n\n\n\n\nconst {\n batchUpdates: batchUpdates$1\n} = Recoil_Batching;\n\nconst {\n initializeNodeIfNewToStore: initializeNodeIfNewToStore$1,\n peekNodeInfo: peekNodeInfo$1\n} = Recoil_FunctionalCore;\n\nconst {\n graph: graph$2\n} = Recoil_Graph;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$1,\n recoilValues: recoilValues$1,\n recoilValuesForKeys: recoilValuesForKeys$2\n} = Recoil_Node;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$2,\n getRecoilValueAsLoadable: getRecoilValueAsLoadable$1,\n setRecoilValue: setRecoilValue$1,\n setUnvalidatedRecoilValue: setUnvalidatedRecoilValue$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n getNextTreeStateVersion: getNextTreeStateVersion$1,\n makeEmptyStoreState: makeEmptyStoreState$1\n} = Recoil_State; // Opaque at this surface because it's part of the public API from here.\n\n\n// A \"Snapshot\" is \"read-only\" and captures a specific set of values of atoms.\n// However, the data-flow-graph and selector values may evolve as selector\n// evaluation functions are executed and async selectors resolve.\nclass Snapshot {\n constructor(storeState) {\n _defineProperty(this, \"_store\", void 0);\n\n _defineProperty(this, \"_refCount\", 0);\n\n _defineProperty(this, \"getLoadable\", recoilValue => {\n this.checkRefCount_INTERNAL();\n return getRecoilValueAsLoadable$1(this._store, recoilValue);\n });\n\n _defineProperty(this, \"getPromise\", recoilValue => {\n this.checkRefCount_INTERNAL();\n return this.getLoadable(recoilValue).toPromise();\n });\n\n _defineProperty(this, \"getNodes_UNSTABLE\", opt => {\n this.checkRefCount_INTERNAL(); // TODO Deal with modified selectors\n\n if ((opt === null || opt === void 0 ? void 0 : opt.isModified) === true) {\n if ((opt === null || opt === void 0 ? void 0 : opt.isInitialized) === false) {\n return [];\n }\n\n const state = this._store.getState().currentTree;\n\n return recoilValuesForKeys$2(state.dirtyAtoms);\n }\n\n const knownAtoms = this._store.getState().knownAtoms;\n\n const knownSelectors = this._store.getState().knownSelectors;\n\n return (opt === null || opt === void 0 ? void 0 : opt.isInitialized) == null ? recoilValues$1.values() : opt.isInitialized === true ? recoilValuesForKeys$2(Recoil_concatIterables([this._store.getState().knownAtoms, this._store.getState().knownSelectors])) : Recoil_filterIterable(recoilValues$1.values(), ({\n key\n }) => !knownAtoms.has(key) && !knownSelectors.has(key));\n });\n\n _defineProperty(this, \"getInfo_UNSTABLE\", ({\n key\n }) => {\n this.checkRefCount_INTERNAL();\n return peekNodeInfo$1(this._store, this._store.getState().currentTree, key);\n });\n\n _defineProperty(this, \"map\", mapper => {\n this.checkRefCount_INTERNAL();\n const mutableSnapshot = new MutableSnapshot(this);\n mapper(mutableSnapshot); // if removing batchUpdates from `set` add it here\n\n return cloneSnapshot(mutableSnapshot.getStore_INTERNAL());\n });\n\n _defineProperty(this, \"asyncMap\", async mapper => {\n this.checkRefCount_INTERNAL();\n const mutableSnapshot = new MutableSnapshot(this);\n await mapper(mutableSnapshot);\n return cloneSnapshot(mutableSnapshot.getStore_INTERNAL());\n });\n\n this._store = {\n getState: () => storeState,\n replaceState: replacer => {\n storeState.currentTree = replacer(storeState.currentTree); // no batching so nextTree is never active\n },\n getGraph: version => {\n const graphs = storeState.graphsByVersion;\n\n if (graphs.has(version)) {\n return Recoil_nullthrows(graphs.get(version));\n }\n\n const newGraph = graph$2();\n graphs.set(version, newGraph);\n return newGraph;\n },\n subscribeToTransactions: () => ({\n release: () => {}\n }),\n addTransactionMetadata: () => {\n throw new Error('Cannot subscribe to Snapshots');\n }\n }; // Initialize any nodes that are live in the parent store (primarily so that this\n // snapshot gets counted towards the node's live stores count).\n\n for (const nodeKey of this._store.getState().nodeCleanupFunctions.keys()) {\n initializeNodeIfNewToStore$1(this._store, storeState.currentTree, nodeKey, 'get');\n }\n\n this.retain();\n this.autorelease();\n }\n\n retain() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return () => undefined;\n }\n\n this._refCount++;\n let released = false;\n return () => {\n if (!released) {\n released = true;\n this.release();\n }\n };\n }\n\n autorelease() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n if (!isSSR$1) {\n window.setTimeout(() => this.release(), 0);\n }\n }\n\n release() {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n this._refCount--;\n\n if (this._refCount === 0) ;\n }\n\n checkRefCount_INTERNAL() {\n if (Recoil_gkx_1('recoil_memory_managament_2020') && this._refCount <= 0) {\n if (process.env.NODE_ENV !== \"production\") {\n Recoil_recoverableViolation('Recoil Snapshots only last for the duration of the callback they are provided to. To keep a Snapshot longer, call its retain() method (and then call release() when you are done with it). This is currently a DEV-only warning but will become a real error soon. Please reach out to Dave McCabe for help fixing this. To temporarily suppress this warning add gk_disable=recoil_memory_managament_2020 to the URL.');\n } // What we will ship later:\n // throw new Error(\n // 'Recoil Snapshots only last for the duration of the callback they are provided to. To keep a Snapshot longer, call its retain() method (and then call release() when you are done with it).',\n // );\n\n }\n }\n\n getStore_INTERNAL() {\n this.checkRefCount_INTERNAL();\n return this._store;\n }\n\n getID() {\n this.checkRefCount_INTERNAL();\n return this.getID_INTERNAL();\n }\n\n getID_INTERNAL() {\n this.checkRefCount_INTERNAL();\n return this._store.getState().currentTree.stateID;\n } // We want to allow the methods to be destructured and used as accessors\n // eslint-disable-next-line fb-www/extra-arrow-initializer\n\n\n}\n\nfunction cloneStoreState(store, treeState, bumpVersion = false) {\n const storeState = store.getState();\n const version = bumpVersion ? getNextTreeStateVersion$1() : treeState.version;\n return {\n currentTree: bumpVersion ? {\n // TODO snapshots shouldn't really have versions because a new version number\n // is always assigned when the snapshot is gone to.\n version,\n stateID: version,\n transactionMetadata: { ...treeState.transactionMetadata\n },\n dirtyAtoms: new Set(treeState.dirtyAtoms),\n atomValues: treeState.atomValues.clone(),\n nonvalidatedAtoms: treeState.nonvalidatedAtoms.clone()\n } : treeState,\n nextTree: null,\n previousTree: null,\n knownAtoms: new Set(storeState.knownAtoms),\n // FIXME here's a copy\n knownSelectors: new Set(storeState.knownSelectors),\n // FIXME here's a copy\n transactionSubscriptions: new Map(),\n nodeTransactionSubscriptions: new Map(),\n nodeToComponentSubscriptions: new Map(),\n queuedComponentCallbacks_DEPRECATED: [],\n suspendedComponentResolvers: new Set(),\n graphsByVersion: new Map().set(version, store.getGraph(treeState.version)),\n versionsUsedByComponent: new Map(),\n retention: {\n referenceCounts: new Map(),\n nodesRetainedByZone: new Map(),\n retainablesToCheckForRelease: new Set()\n },\n nodeCleanupFunctions: new Map()\n };\n} // Factory to build a fresh snapshot\n\n\nfunction freshSnapshot(initializeState) {\n const snapshot = new Snapshot(makeEmptyStoreState$1());\n return initializeState != null ? snapshot.map(initializeState) : snapshot;\n} // Factory to clone a snapahot state\n\n\nfunction cloneSnapshot(store, version = 'current') {\n const storeState = store.getState();\n const treeState = version === 'current' ? storeState.currentTree : Recoil_nullthrows(storeState.previousTree);\n return new Snapshot(cloneStoreState(store, treeState));\n}\n\nclass MutableSnapshot extends Snapshot {\n constructor(snapshot) {\n super(cloneStoreState(snapshot.getStore_INTERNAL(), snapshot.getStore_INTERNAL().getState().currentTree, true));\n\n _defineProperty(this, \"set\", (recoilState, newValueOrUpdater) => {\n this.checkRefCount_INTERNAL(); // This batchUpdates ensures this `set` is applied immediately and you can\n // read the written value after calling `set`. I would like to remove this\n // behavior and only batch in `Snapshot.map`, but this would be a breaking\n // change potentially.\n\n batchUpdates$1(() => {\n setRecoilValue$1(this.getStore_INTERNAL(), recoilState, newValueOrUpdater);\n });\n });\n\n _defineProperty(this, \"reset\", recoilState => {\n this.checkRefCount_INTERNAL(); // See note at `set` about batched updates.\n\n batchUpdates$1(() => setRecoilValue$1(this.getStore_INTERNAL(), recoilState, DEFAULT_VALUE$1));\n });\n\n _defineProperty(this, \"setUnvalidatedAtomValues_DEPRECATED\", values => {\n this.checkRefCount_INTERNAL();\n const store = this.getStore_INTERNAL();\n batchUpdates$1(() => {\n for (const [k, v] of values.entries()) {\n setUnvalidatedRecoilValue$1(store, new AbstractRecoilValue$2(k), v);\n }\n });\n });\n } // We want to allow the methods to be destructured and used as accessors\n // eslint-disable-next-line fb-www/extra-arrow-initializer\n\n\n}\n\nvar Recoil_Snapshot = {\n Snapshot,\n MutableSnapshot,\n freshSnapshot,\n cloneSnapshot\n};\n\nvar Recoil_Snapshot_1 = Recoil_Snapshot.Snapshot;\nvar Recoil_Snapshot_2 = Recoil_Snapshot.MutableSnapshot;\nvar Recoil_Snapshot_3 = Recoil_Snapshot.freshSnapshot;\nvar Recoil_Snapshot_4 = Recoil_Snapshot.cloneSnapshot;\n\nvar Recoil_Snapshot$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Snapshot: Recoil_Snapshot_1,\n MutableSnapshot: Recoil_Snapshot_2,\n freshSnapshot: Recoil_Snapshot_3,\n cloneSnapshot: Recoil_Snapshot_4\n});\n\n// @fb-only: const RecoilusagelogEvent = require('RecoilusagelogEvent');\n// @fb-only: const RecoilUsageLogFalcoEvent = require('RecoilUsageLogFalcoEvent');\n// @fb-only: const URI = require('URI');\n\n\nconst {\n getNextTreeStateVersion: getNextTreeStateVersion$2,\n makeEmptyStoreState: makeEmptyStoreState$2\n} = Recoil_State;\n\n\n\n\n\n // @fb-only: const recoverableViolation = require('../util/Recoil_recoverableViolation');\n\n\n\n\nconst {\n cleanUpNode: cleanUpNode$2,\n getDownstreamNodes: getDownstreamNodes$2,\n setNodeValue: setNodeValue$2,\n setUnvalidatedAtomValue_DEPRECATED: setUnvalidatedAtomValue_DEPRECATED$1\n} = Recoil_FunctionalCore;\n\nconst {\n graph: graph$3\n} = Recoil_Graph;\n\nconst {\n cloneGraph: cloneGraph$1\n} = Recoil_Graph;\n\nconst {\n applyAtomValueWrites: applyAtomValueWrites$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n releaseScheduledRetainablesNow: releaseScheduledRetainablesNow$1\n} = Recoil_Retention;\n\nconst {\n freshSnapshot: freshSnapshot$1\n} = Recoil_Snapshot$1;\n\n\n\nconst {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState\n} = react;\n\nfunction notInAContext() {\n throw new Error('This component must be used inside a component.');\n}\n\nconst defaultStore = Object.freeze({\n getState: notInAContext,\n replaceState: notInAContext,\n getGraph: notInAContext,\n subscribeToTransactions: notInAContext,\n addTransactionMetadata: notInAContext\n});\nlet stateReplacerIsBeingExecuted = false;\n\nfunction startNextTreeIfNeeded(storeState) {\n if (stateReplacerIsBeingExecuted) {\n throw new Error('An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.');\n }\n\n if (storeState.nextTree === null) {\n const version = storeState.currentTree.version;\n const nextVersion = getNextTreeStateVersion$2();\n storeState.nextTree = { ...storeState.currentTree,\n version: nextVersion,\n stateID: nextVersion,\n dirtyAtoms: new Set(),\n transactionMetadata: {}\n };\n storeState.graphsByVersion.set(nextVersion, cloneGraph$1(Recoil_nullthrows(storeState.graphsByVersion.get(version))));\n }\n}\n\nconst AppContext = react.createContext({\n current: defaultStore\n});\n\nconst useStoreRef = () => useContext(AppContext);\n\nconst MutableSourceContext = react.createContext(null); // TODO T2710559282599660\n\nfunction useRecoilMutableSource() {\n const mutableSource = useContext(MutableSourceContext);\n\n if (mutableSource == null) {\n Recoil_expectationViolation('Attempted to use a Recoil hook outside of a . ' + ' must be an ancestor of any component that uses ' + 'Recoil hooks.');\n }\n\n return mutableSource;\n}\n\nfunction sendEndOfBatchNotifications(store) {\n const storeState = store.getState();\n const treeState = storeState.currentTree; // Inform transaction subscribers of the transaction:\n\n const dirtyAtoms = treeState.dirtyAtoms;\n\n if (dirtyAtoms.size) {\n // Execute Node-specific subscribers before global subscribers\n for (const [key, subscriptions] of storeState.nodeTransactionSubscriptions) {\n if (dirtyAtoms.has(key)) {\n for (const [_, subscription] of subscriptions) {\n subscription(store);\n }\n }\n }\n\n for (const [_, subscription] of storeState.transactionSubscriptions) {\n subscription(store);\n } // Components that are subscribed to the dirty atom:\n\n\n const dependentNodes = getDownstreamNodes$2(store, treeState, dirtyAtoms);\n\n for (const key of dependentNodes) {\n const comps = storeState.nodeToComponentSubscriptions.get(key);\n\n if (comps) {\n for (const [_subID, [_debugName, callback]] of comps) {\n callback(treeState);\n }\n }\n } // Wake all suspended components so the right one(s) can try to re-render.\n // We need to wake up components not just when some asynchronous selector\n // resolved, but also when changing synchronous values because this may cause\n // a selector to change from asynchronous to synchronous, in which case there\n // would be no follow-up asynchronous resolution to wake us up.\n // TODO OPTIMIZATION Only wake up related downstream components\n\n\n storeState.suspendedComponentResolvers.forEach(cb => cb());\n } // Special behavior ONLY invoked by useInterface.\n // FIXME delete queuedComponentCallbacks_DEPRECATED when deleting useInterface.\n\n\n storeState.queuedComponentCallbacks_DEPRECATED.forEach(cb => cb(treeState));\n storeState.queuedComponentCallbacks_DEPRECATED.splice(0, storeState.queuedComponentCallbacks_DEPRECATED.length);\n}\n/*\n * The purpose of the Batcher is to observe when React batches end so that\n * Recoil state changes can be batched. Whenever Recoil state changes, we call\n * setState on the batcher. Then we wait for that change to be committed, which\n * signifies the end of the batch. That's when we respond to the Recoil change.\n */\n\n\nfunction Batcher({\n setNotifyBatcherOfChange\n}) {\n const storeRef = useStoreRef();\n const [_, setState] = useState([]);\n setNotifyBatcherOfChange(() => setState({}));\n useEffect(() => {\n // enqueueExecution runs this function immediately; it is only used to\n // manipulate the order of useEffects during tests, since React seems to\n // call useEffect in an unpredictable order sometimes.\n Recoil_Queue.enqueueExecution('Batcher', () => {\n const storeState = storeRef.current.getState();\n const {\n nextTree\n } = storeState; // Ignore commits that are not because of Recoil transactions -- namely,\n // because something above RecoilRoot re-rendered:\n\n if (nextTree === null) {\n return;\n } // nextTree is now committed -- note that copying and reset occurs when\n // a transaction begins, in startNextTreeIfNeeded:\n\n\n storeState.previousTree = storeState.currentTree;\n storeState.currentTree = nextTree;\n storeState.nextTree = null;\n sendEndOfBatchNotifications(storeRef.current);\n const discardedVersion = Recoil_nullthrows(storeState.previousTree).version;\n storeState.graphsByVersion.delete(discardedVersion);\n storeState.previousTree = null;\n\n if (Recoil_gkx_1('recoil_memory_managament_2020')) {\n releaseScheduledRetainablesNow$1(storeRef.current);\n }\n });\n }); // If an asynchronous selector resolves after the Batcher is unmounted,\n // notifyBatcherOfChange will still be called. An error gets thrown whenever\n // setState is called after a component is already unmounted, so this sets\n // notifyBatcherOfChange to be a no-op.\n\n useEffect(() => {\n return () => {\n setNotifyBatcherOfChange(() => {});\n };\n }, [setNotifyBatcherOfChange]);\n return null;\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined' && !window.$recoilDebugStates) {\n window.$recoilDebugStates = [];\n }\n} // When removing this deprecated function, remove stateBySettingRecoilValue\n// which will no longer be needed.\n\n\nfunction initialStoreState_DEPRECATED(store, initializeState) {\n const initial = makeEmptyStoreState$2();\n initializeState({\n // $FlowFixMe[escaped-generic]\n set: (atom, value) => {\n const state = initial.currentTree;\n const writes = setNodeValue$2(store, state, atom.key, value);\n const writtenNodes = new Set(writes.keys());\n const nonvalidatedAtoms = state.nonvalidatedAtoms.clone();\n\n for (const n of writtenNodes) {\n nonvalidatedAtoms.delete(n);\n }\n\n initial.currentTree = { ...state,\n dirtyAtoms: Recoil_unionSets(state.dirtyAtoms, writtenNodes),\n atomValues: applyAtomValueWrites$1(state.atomValues, writes),\n // NB: PLEASE un-export applyAtomValueWrites when deleting this code\n nonvalidatedAtoms\n };\n },\n setUnvalidatedAtomValues: atomValues => {\n // FIXME replace this with a mutative loop\n atomValues.forEach((v, k) => {\n initial.currentTree = setUnvalidatedAtomValue_DEPRECATED$1(initial.currentTree, k, v);\n });\n }\n });\n return initial;\n}\n\nfunction initialStoreState(initializeState) {\n const snapshot = freshSnapshot$1().map(initializeState);\n return snapshot.getStore_INTERNAL().getState();\n}\n\nlet nextID = 0;\n\nfunction RecoilRoot({\n initializeState_DEPRECATED,\n initializeState,\n store_INTERNAL: storeProp,\n // For use with React \"context bridging\"\n children\n}) {\n var _createMutableSource;\n\n // prettier-ignore\n // @fb-only: useEffect(() => {\n // @fb-only: if (gkx('recoil_usage_logging')) {\n // @fb-only: try {\n // @fb-only: RecoilUsageLogFalcoEvent.log(() => ({\n // @fb-only: type: RecoilusagelogEvent.RECOIL_ROOT_MOUNTED,\n // @fb-only: path: URI.getRequestURI().getPath(),\n // @fb-only: }));\n // @fb-only: } catch {\n // @fb-only: recoverableViolation(\n // @fb-only: 'Error when logging Recoil Usage event',\n // @fb-only: 'recoil',\n // @fb-only: );\n // @fb-only: }\n // @fb-only: }\n // @fb-only: }, []);\n let storeState; // eslint-disable-line prefer-const\n\n const getGraph = version => {\n const graphs = storeState.current.graphsByVersion;\n\n if (graphs.has(version)) {\n return Recoil_nullthrows(graphs.get(version));\n }\n\n const newGraph = graph$3();\n graphs.set(version, newGraph);\n return newGraph;\n };\n\n const subscribeToTransactions = (callback, key) => {\n if (key == null) {\n // Global transaction subscriptions\n const {\n transactionSubscriptions\n } = storeRef.current.getState();\n const id = nextID++;\n transactionSubscriptions.set(id, callback);\n return {\n release: () => {\n transactionSubscriptions.delete(id);\n }\n };\n } else {\n // Node-specific transaction subscriptions:\n const {\n nodeTransactionSubscriptions\n } = storeRef.current.getState();\n\n if (!nodeTransactionSubscriptions.has(key)) {\n nodeTransactionSubscriptions.set(key, new Map());\n }\n\n const id = nextID++;\n Recoil_nullthrows(nodeTransactionSubscriptions.get(key)).set(id, callback);\n return {\n release: () => {\n const subs = nodeTransactionSubscriptions.get(key);\n\n if (subs) {\n subs.delete(id);\n\n if (subs.size === 0) {\n nodeTransactionSubscriptions.delete(key);\n }\n }\n }\n };\n }\n };\n\n const addTransactionMetadata = metadata => {\n startNextTreeIfNeeded(storeRef.current.getState());\n\n for (const k of Object.keys(metadata)) {\n Recoil_nullthrows(storeRef.current.getState().nextTree).transactionMetadata[k] = metadata[k];\n }\n };\n\n const replaceState = replacer => {\n const storeState = storeRef.current.getState();\n startNextTreeIfNeeded(storeState); // Use replacer to get the next state:\n\n const nextTree = Recoil_nullthrows(storeState.nextTree);\n let replaced;\n\n try {\n stateReplacerIsBeingExecuted = true;\n replaced = replacer(nextTree);\n } finally {\n stateReplacerIsBeingExecuted = false;\n }\n\n if (replaced === nextTree) {\n return;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined') {\n window.$recoilDebugStates.push(replaced); // TODO this shouldn't happen here because it's not batched\n }\n } // Save changes to nextTree and schedule a React update:\n\n\n storeState.nextTree = replaced;\n Recoil_nullthrows(notifyBatcherOfChange.current)();\n };\n\n const notifyBatcherOfChange = useRef(null);\n const setNotifyBatcherOfChange = useCallback(x => {\n notifyBatcherOfChange.current = x;\n }, [notifyBatcherOfChange]); // FIXME T2710559282599660\n\n const createMutableSource = (_createMutableSource = react.createMutableSource) !== null && _createMutableSource !== void 0 ? _createMutableSource : // flowlint-line unclear-type:off\n react.unstable_createMutableSource; // flowlint-line unclear-type:off\n\n const store = storeProp !== null && storeProp !== void 0 ? storeProp : {\n getState: () => storeState.current,\n replaceState,\n getGraph,\n subscribeToTransactions,\n addTransactionMetadata\n };\n const storeRef = useRef(store);\n storeState = useRef(initializeState_DEPRECATED != null ? initialStoreState_DEPRECATED(store, initializeState_DEPRECATED) : initializeState != null ? initialStoreState(initializeState) : makeEmptyStoreState$2());\n const mutableSource = useMemo(() => createMutableSource ? createMutableSource(storeState, () => storeState.current.currentTree.version) : null, [createMutableSource, storeState]); // Cleanup when the is unmounted\n\n useEffect(() => () => {\n for (const atomKey of storeRef.current.getState().knownAtoms) {\n cleanUpNode$2(storeRef.current, atomKey);\n }\n }, []);\n return /*#__PURE__*/react.createElement(AppContext.Provider, {\n value: storeRef\n }, /*#__PURE__*/react.createElement(MutableSourceContext.Provider, {\n value: mutableSource\n }, /*#__PURE__*/react.createElement(Batcher, {\n setNotifyBatcherOfChange: setNotifyBatcherOfChange\n }), children));\n}\n\nvar Recoil_RecoilRoot_react = {\n useStoreRef,\n useRecoilMutableSource,\n RecoilRoot,\n sendEndOfBatchNotifications_FOR_TESTING: sendEndOfBatchNotifications\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a map containing all of the keys + values from the original map where\n * the given callback returned true.\n */\n\nfunction filterMap(map, callback) {\n const result = new Map();\n\n for (const [key, value] of map) {\n if (callback(value, key)) {\n result.set(key, value);\n }\n }\n\n return result;\n}\n\nvar Recoil_filterMap = filterMap;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n/**\n * Returns a set containing all of the values from the original set where\n * the given callback returned true.\n */\n\nfunction filterSet(set, callback) {\n const result = new Set();\n\n for (const value of set) {\n if (callback(value)) {\n result.add(value);\n }\n }\n\n return result;\n}\n\nvar Recoil_filterSet = filterSet;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n\nvar invariant_1 = invariant;\n\n// @oss-only\n\n\nvar Recoil_invariant = invariant_1;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction mergeMaps(...maps) {\n const result = new Map();\n\n for (let i = 0; i < maps.length; i++) {\n const iterator = maps[i].keys();\n let nextKey;\n\n while (!(nextKey = iterator.next()).done) {\n // $FlowFixMe[incompatible-call] - map/iterator knows nothing about flow types\n result.set(nextKey.value, maps[i].get(nextKey.value));\n }\n }\n /* $FlowFixMe[incompatible-return] (>=0.66.0 site=www,mobile) This comment\n * suppresses an error found when Flow v0.66 was deployed. To see the error\n * delete this comment and run Flow. */\n\n\n return result;\n}\n\nvar Recoil_mergeMaps = mergeMaps;\n\nvar _useMutableSource;\n\n // FIXME T2710559282599660\n\n\nconst useMutableSource = // flowlint-line unclear-type:off\n(_useMutableSource = react.useMutableSource) !== null && _useMutableSource !== void 0 ? _useMutableSource : react.unstable_useMutableSource; // flowlint-line unclear-type:off\n\nfunction mutableSourceExists() {\n return useMutableSource && !(typeof window !== 'undefined' && window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE);\n}\n\nvar Recoil_mutableSource = {\n mutableSourceExists,\n useMutableSource\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction shallowArrayEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0, l = a.length; i < l; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nvar Recoil_shallowArrayEqual = shallowArrayEqual;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * MIT License\n *\n * Copyright (c) 2014-2019 Georg Tavonius\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nconst UNKNOWN_FUNCTION = '';\n/**\n * This parses the different stack traces and puts them into one format\n * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit)\n */\n\nfunction stackTraceParser(stackString) {\n const lines = stackString.split('\\n');\n return lines.reduce((stack, line) => {\n const parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);\n\n if (parseResult) {\n stack.push(parseResult);\n }\n\n return stack;\n }, []);\n}\n\nconst chromeRe = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRe = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nfunction parseChrome(line) {\n const parts = chromeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n const isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n const submatch = chromeEvalRe.exec(parts[2]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n\n parts[3] = submatch[2]; // line\n\n parts[4] = submatch[3]; // column\n }\n\n return {\n file: !isNative ? parts[2] : null,\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: isNative ? [parts[2]] : [],\n lineNumber: parts[3] ? +parts[3] : null,\n column: parts[4] ? +parts[4] : null\n };\n}\n\nconst winjsRe = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseWinjs(line) {\n const parts = winjsRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nconst geckoRe = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRe = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nfunction parseGecko(line) {\n const parts = geckoRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n const submatch = geckoEvalRe.exec(parts[3]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: parts[2] ? parts[2].split(',') : [],\n lineNumber: parts[4] ? +parts[4] : null,\n column: parts[5] ? +parts[5] : null\n };\n}\n\nconst javaScriptCoreRe = /^\\s*(?:([^@]*)(?:\\((.*?)\\))?@)?(\\S.*?):(\\d+)(?::(\\d+))?\\s*$/i;\n\nfunction parseJSC(line) {\n const parts = javaScriptCoreRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[4],\n column: parts[5] ? +parts[5] : null\n };\n}\n\nconst nodeRe = /^\\s*at (?:((?:\\[object object\\])?[^\\\\/]+(?: \\[as \\S+\\])?) )?\\(?(.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseNode(line) {\n const parts = nodeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nvar Recoil_stackTraceParser = stackTraceParser;\n\nconst {\n useRef: useRef$1\n} = react;\n\nfunction useComponentName() {\n const nameRef = useRef$1();\n\n if (process.env.NODE_ENV !== \"production\") {\n if (Recoil_gkx_1('recoil_infer_component_names')) {\n var _nameRef$current;\n\n if (nameRef.current === undefined) {\n // There is no blessed way to determine the calling React component from\n // within a hook. This hack uses the fact that hooks must start with 'use'\n // and that hooks are either called by React Components or other hooks. It\n // follows therefore, that to find the calling component, you simply need\n // to look down the stack and find the first function which doesn't start\n // with 'use'. We are only enabling this in dev for now, since once the\n // codebase is minified, the naming assumptions no longer hold true.\n const frames = Recoil_stackTraceParser(new Error().stack);\n\n for (const {\n methodName\n } of frames) {\n // I observed cases where the frame was of the form 'Object.useXXX'\n // hence why I'm searching for hooks following a word boundary\n if (!methodName.match(/\\buse[^\\b]+$/)) {\n return nameRef.current = methodName;\n }\n }\n\n nameRef.current = null;\n }\n\n return (_nameRef$current = nameRef.current) !== null && _nameRef$current !== void 0 ? _nameRef$current : '';\n }\n } // @fb-only: return \"\";\n\n\n return ''; // @oss-only\n}\n\nvar Recoil_useComponentName = useComponentName;\n\nconst {\n batchUpdates: batchUpdates$2\n} = Recoil_Batching;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$2,\n getNode: getNode$3,\n nodes: nodes$1\n} = Recoil_Node;\n\nconst {\n useRecoilMutableSource: useRecoilMutableSource$1,\n useStoreRef: useStoreRef$1\n} = Recoil_RecoilRoot_react;\n\nconst {\n isRecoilValue: isRecoilValue$2\n} = Recoil_RecoilValue$1;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$3,\n getRecoilValueAsLoadable: getRecoilValueAsLoadable$2,\n setRecoilValue: setRecoilValue$2,\n setRecoilValueLoadable: setRecoilValueLoadable$1,\n setUnvalidatedRecoilValue: setUnvalidatedRecoilValue$2,\n subscribeToRecoilValue: subscribeToRecoilValue$1\n} = Recoil_RecoilValueInterface;\n\nconst {\n updateRetainCount: updateRetainCount$1\n} = Recoil_Retention;\n\nconst {\n RetentionZone: RetentionZone$3\n} = Recoil_RetentionZone;\n\nconst {\n Snapshot: Snapshot$1,\n cloneSnapshot: cloneSnapshot$1\n} = Recoil_Snapshot$1;\n\nconst {\n setByAddingToSet: setByAddingToSet$2\n} = Recoil_CopyOnWrite;\n\n\n\nconst {\n isSSR: isSSR$2\n} = Recoil_Environment;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n mutableSourceExists: mutableSourceExists$1,\n useMutableSource: useMutableSource$1\n} = Recoil_mutableSource;\n\n\n\n\n\n\n\n\n\nconst {\n useCallback: useCallback$1,\n useEffect: useEffect$1,\n useMemo: useMemo$1,\n useRef: useRef$2,\n useState: useState$1\n} = react; // Components that aren't mounted after suspending for this long will be assumed\n// to be discarded and their resources released.\n\n\nconst SUSPENSE_TIMEOUT_MS = 120000;\n\nfunction handleLoadable(loadable, atom, storeRef) {\n // We can't just throw the promise we are waiting on to Suspense. If the\n // upstream dependencies change it may produce a state in which the component\n // can render, but it would still be suspended on a Promise that may never resolve.\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n const promise = new Promise(resolve => {\n storeRef.current.getState().suspendedComponentResolvers.add(resolve);\n });\n throw promise;\n } else if (loadable.state === 'hasError') {\n throw loadable.contents;\n } else {\n throw new Error(`Invalid value of loadable atom \"${atom.key}\"`);\n }\n}\n\nfunction validateRecoilValue(recoilValue, hookName) {\n if (!isRecoilValue$2(recoilValue)) {\n throw new Error(`Invalid argument to ${hookName}: expected an atom or selector but got ${String(recoilValue)}`);\n }\n}\n\n/**\n * Various things are broken with useRecoilInterface, particularly concurrent mode\n * and memory management. They will not be fixed.\n * */\nfunction useRecoilInterface_DEPRECATED() {\n const storeRef = useStoreRef$1();\n const [_, forceUpdate] = useState$1([]);\n const recoilValuesUsed = useRef$2(new Set());\n recoilValuesUsed.current = new Set(); // Track the RecoilValues used just during this render\n\n const previousSubscriptions = useRef$2(new Set());\n const subscriptions = useRef$2(new Map());\n const unsubscribeFrom = useCallback$1(key => {\n const sub = subscriptions.current.get(key);\n\n if (sub) {\n sub.release();\n subscriptions.current.delete(key);\n }\n }, [subscriptions]);\n const componentName = Recoil_useComponentName();\n useEffect$1(() => {\n const store = storeRef.current;\n\n function updateState(_state, key) {\n if (!subscriptions.current.has(key)) {\n return;\n }\n\n forceUpdate([]);\n }\n\n Recoil_differenceSets(recoilValuesUsed.current, previousSubscriptions.current).forEach(key => {\n if (subscriptions.current.has(key)) {\n Recoil_expectationViolation(`Double subscription to RecoilValue \"${key}\"`);\n return;\n }\n\n const sub = subscribeToRecoilValue$1(store, new AbstractRecoilValue$3(key), state => {\n updateState(state, key);\n }, componentName);\n subscriptions.current.set(key, sub);\n /**\n * Since we're subscribing in an effect we need to update to the latest\n * value of the atom since it may have changed since we rendered. We can\n * go ahead and do that now, unless we're in the middle of a batch --\n * in which case we should do it at the end of the batch, due to the\n * following edge case: Suppose an atom is updated in another useEffect\n * of this same component. Then the following sequence of events occur:\n * 1. Atom is updated and subs fired (but we may not be subscribed\n * yet depending on order of effects, so we miss this) Updated value\n * is now in nextTree, but not currentTree.\n * 2. This effect happens. We subscribe and update.\n * 3. From the update we re-render and read currentTree, with old value.\n * 4. Batcher's effect sets currentTree to nextTree.\n * In this sequence we miss the update. To avoid that, add the update\n * to queuedComponentCallback if a batch is in progress.\n */\n // FIXME delete queuedComponentCallbacks_DEPRECATED when deleting useInterface.\n\n const state = store.getState();\n\n if (state.nextTree) {\n store.getState().queuedComponentCallbacks_DEPRECATED.push(() => {\n updateState(store.getState(), key);\n });\n } else {\n updateState(store.getState(), key);\n }\n });\n Recoil_differenceSets(previousSubscriptions.current, recoilValuesUsed.current).forEach(key => {\n unsubscribeFrom(key);\n });\n previousSubscriptions.current = recoilValuesUsed.current;\n });\n useEffect$1(() => {\n const subs = subscriptions.current;\n return () => subs.forEach((_, key) => unsubscribeFrom(key));\n }, [unsubscribeFrom]);\n return useMemo$1(() => {\n function useSetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useSetRecoilState');\n }\n\n return newValueOrUpdater => {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n };\n }\n\n function useResetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useResetRecoilState');\n }\n\n return () => setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n }\n\n function useRecoilValueLoadable(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n if (!recoilValuesUsed.current.has(recoilValue.key)) {\n recoilValuesUsed.current = setByAddingToSet$2(recoilValuesUsed.current, recoilValue.key);\n } // TODO Restore optimization to memoize lookup\n\n\n return getRecoilValueAsLoadable$2(storeRef.current, recoilValue);\n }\n\n function useRecoilValue(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValue');\n }\n\n const loadable = useRecoilValueLoadable(recoilValue); // $FlowFixMe[escaped-generic]\n\n return handleLoadable(loadable, recoilValue, storeRef);\n }\n\n function useRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilState');\n }\n\n return [useRecoilValue(recoilState), useSetRecoilState(recoilState)];\n }\n\n function useRecoilStateLoadable(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilStateLoadable');\n }\n\n return [useRecoilValueLoadable(recoilState), useSetRecoilState(recoilState)];\n }\n\n return {\n getRecoilValue: useRecoilValue,\n getRecoilValueLoadable: useRecoilValueLoadable,\n getRecoilState: useRecoilState,\n getRecoilStateLoadable: useRecoilStateLoadable,\n getSetRecoilState: useSetRecoilState,\n getResetRecoilState: useResetRecoilState\n };\n }, [recoilValuesUsed, storeRef]);\n}\n\nconst recoilComponentGetRecoilValueCount_FOR_TESTING = {\n current: 0\n};\n\nfunction useRecoilValueLoadable_MUTABLESOURCE(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n const storeRef = useStoreRef$1();\n const getLoadable = useCallback$1(() => {\n const store = storeRef.current;\n const treeState = store.getState().currentTree;\n return getRecoilValueAsLoadable$2(store, recoilValue, treeState);\n }, [storeRef, recoilValue]);\n const getLoadableWithTesting = useCallback$1(() => {\n if (process.env.NODE_ENV !== \"production\") {\n recoilComponentGetRecoilValueCount_FOR_TESTING.current++;\n }\n\n return getLoadable();\n }, [getLoadable]);\n const componentName = Recoil_useComponentName();\n const subscribe = useCallback$1((_storeState, callback) => {\n const store = storeRef.current;\n const subscription = subscribeToRecoilValue$1(store, recoilValue, () => {\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return callback();\n } // Only re-render if the value has changed.\n // This will evaluate the atom/selector now as well as when the\n // component renders, but that may help with prefetching.\n\n\n const newLoadable = getLoadable();\n\n if (!prevLoadableRef.current.is(newLoadable)) {\n callback();\n }\n }, componentName);\n return subscription.release;\n }, [storeRef, recoilValue, componentName, getLoadable]);\n const source = useRecoilMutableSource$1();\n const loadable = useMutableSource$1(source, getLoadableWithTesting, subscribe);\n const prevLoadableRef = useRef$2(loadable);\n useEffect$1(() => {\n prevLoadableRef.current = loadable;\n });\n return loadable;\n}\n\nfunction useRecoilValueLoadable_LEGACY(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n const storeRef = useStoreRef$1();\n const [_, forceUpdate] = useState$1([]);\n const componentName = Recoil_useComponentName();\n useEffect$1(() => {\n const store = storeRef.current;\n const storeState = store.getState();\n const subscription = subscribeToRecoilValue$1(store, recoilValue, _state => {\n var _prevLoadableRef$curr;\n\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return forceUpdate([]);\n }\n\n const newLoadable = getRecoilValueAsLoadable$2(store, recoilValue, store.getState().currentTree);\n\n if (!((_prevLoadableRef$curr = prevLoadableRef.current) === null || _prevLoadableRef$curr === void 0 ? void 0 : _prevLoadableRef$curr.is(newLoadable))) {\n forceUpdate(newLoadable);\n }\n }, componentName);\n /**\n * Since we're subscribing in an effect we need to update to the latest\n * value of the atom since it may have changed since we rendered. We can\n * go ahead and do that now, unless we're in the middle of a batch --\n * in which case we should do it at the end of the batch, due to the\n * following edge case: Suppose an atom is updated in another useEffect\n * of this same component. Then the following sequence of events occur:\n * 1. Atom is updated and subs fired (but we may not be subscribed\n * yet depending on order of effects, so we miss this) Updated value\n * is now in nextTree, but not currentTree.\n * 2. This effect happens. We subscribe and update.\n * 3. From the update we re-render and read currentTree, with old value.\n * 4. Batcher's effect sets currentTree to nextTree.\n * In this sequence we miss the update. To avoid that, add the update\n * to queuedComponentCallback if a batch is in progress.\n */\n\n if (storeState.nextTree) {\n store.getState().queuedComponentCallbacks_DEPRECATED.push(() => {\n prevLoadableRef.current = null;\n forceUpdate([]);\n });\n } else {\n var _prevLoadableRef$curr2;\n\n if (!Recoil_gkx_1('recoil_suppress_rerender_in_callback')) {\n return forceUpdate([]);\n }\n\n const newLoadable = getRecoilValueAsLoadable$2(store, recoilValue, store.getState().currentTree);\n\n if (!((_prevLoadableRef$curr2 = prevLoadableRef.current) === null || _prevLoadableRef$curr2 === void 0 ? void 0 : _prevLoadableRef$curr2.is(newLoadable))) {\n forceUpdate(newLoadable);\n }\n }\n\n return subscription.release;\n }, [componentName, recoilValue, storeRef]);\n const loadable = getRecoilValueAsLoadable$2(storeRef.current, recoilValue);\n const prevLoadableRef = useRef$2(loadable);\n useEffect$1(() => {\n prevLoadableRef.current = loadable;\n });\n return loadable;\n}\n/**\n Like useRecoilValue(), but either returns the value if available or\n just undefined if not available for any reason, such as pending or error.\n*/\n\n\nfunction useRecoilValueLoadable(recoilValue) {\n if (Recoil_gkx_1('recoil_memory_managament_2020')) {\n // eslint-disable-next-line fb-www/react-hooks\n useRetain(recoilValue);\n }\n\n if (mutableSourceExists$1()) {\n // eslint-disable-next-line fb-www/react-hooks\n return useRecoilValueLoadable_MUTABLESOURCE(recoilValue);\n } else {\n // eslint-disable-next-line fb-www/react-hooks\n return useRecoilValueLoadable_LEGACY(recoilValue);\n }\n}\n/**\n Returns the value represented by the RecoilValue.\n If the value is pending, it will throw a Promise to suspend the component,\n if the value is an error it will throw it for the nearest React error boundary.\n This will also subscribe the component for any updates in the value.\n */\n\n\nfunction useRecoilValue(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValue');\n }\n\n const storeRef = useStoreRef$1();\n const loadable = useRecoilValueLoadable(recoilValue); // $FlowFixMe[escaped-generic]\n\n return handleLoadable(loadable, recoilValue, storeRef);\n}\n/**\n Returns a function that allows the value of a RecoilState to be updated, but does\n not subscribe the component to changes to that RecoilState.\n*/\n\n\nfunction useSetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useSetRecoilState');\n }\n\n const storeRef = useStoreRef$1();\n return useCallback$1(newValueOrUpdater => {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n }, [storeRef, recoilState]);\n}\n/**\n Returns a function that will reset the value of a RecoilState to its default\n*/\n\n\nfunction useResetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useResetRecoilState');\n }\n\n const storeRef = useStoreRef$1();\n return useCallback$1(() => {\n setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n }, [storeRef, recoilState]);\n}\n/**\n Equivalent to useState(). Allows the value of the RecoilState to be read and written.\n Subsequent updates to the RecoilState will cause the component to re-render. If the\n RecoilState is pending, this will suspend the component and initiate the\n retrieval of the value. If evaluating the RecoilState resulted in an error, this will\n throw the error so that the nearest React error boundary can catch it.\n*/\n\n\nfunction useRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilState');\n }\n\n return [useRecoilValue(recoilState), useSetRecoilState(recoilState)];\n}\n/**\n Like useRecoilState(), but does not cause Suspense or React error handling. Returns\n an object that indicates whether the RecoilState is available, pending, or\n unavailable due to an error.\n*/\n\n\nfunction useRecoilStateLoadable(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilStateLoadable');\n }\n\n return [useRecoilValueLoadable(recoilState), useSetRecoilState(recoilState)];\n}\n\nfunction useTransactionSubscription(callback) {\n const storeRef = useStoreRef$1();\n useEffect$1(() => {\n const sub = storeRef.current.subscribeToTransactions(callback);\n return sub.release;\n }, [callback, storeRef]);\n}\n\nfunction externallyVisibleAtomValuesInState(state) {\n const atomValues = state.atomValues.toMap();\n const persistedAtomContentsValues = Recoil_mapMap(Recoil_filterMap(atomValues, (v, k) => {\n const node = getNode$3(k);\n const persistence = node.persistence_UNSTABLE;\n return persistence != null && persistence.type !== 'none' && v.state === 'hasValue';\n }), v => v.contents); // Merge in nonvalidated atoms; we may not have defs for them but they will\n // all have persistence on or they wouldn't be there in the first place.\n\n return Recoil_mergeMaps(state.nonvalidatedAtoms.toMap(), persistedAtomContentsValues);\n}\n\n/**\n Calls the given callback after any atoms have been modified and the consequent\n component re-renders have been committed. This is intended for persisting\n the values of the atoms to storage. The stored values can then be restored\n using the useSetUnvalidatedAtomValues hook.\n\n The callback receives the following info:\n\n atomValues: The current value of every atom that is both persistable (persistence\n type not set to 'none') and whose value is available (not in an\n error or loading state).\n\n previousAtomValues: The value of every persistable and available atom before\n the transaction began.\n\n atomInfo: A map containing the persistence settings for each atom. Every key\n that exists in atomValues will also exist in atomInfo.\n\n modifiedAtoms: The set of atoms that were written to during the transaction.\n\n transactionMetadata: Arbitrary information that was added via the\n useSetUnvalidatedAtomValues hook. Useful for ignoring the useSetUnvalidatedAtomValues\n transaction, to avoid loops.\n*/\nfunction useTransactionObservation_DEPRECATED(callback) {\n useTransactionSubscription(useCallback$1(store => {\n let previousTree = store.getState().previousTree;\n const currentTree = store.getState().currentTree;\n\n if (!previousTree) {\n Recoil_recoverableViolation('Transaction subscribers notified without a previous tree being present -- this is a bug in Recoil');\n previousTree = store.getState().currentTree; // attempt to trundle on\n }\n\n const atomValues = externallyVisibleAtomValuesInState(currentTree);\n const previousAtomValues = externallyVisibleAtomValuesInState(previousTree);\n const atomInfo = Recoil_mapMap(nodes$1, node => {\n var _node$persistence_UNS, _node$persistence_UNS2, _node$persistence_UNS3, _node$persistence_UNS4;\n\n return {\n persistence_UNSTABLE: {\n type: (_node$persistence_UNS = (_node$persistence_UNS2 = node.persistence_UNSTABLE) === null || _node$persistence_UNS2 === void 0 ? void 0 : _node$persistence_UNS2.type) !== null && _node$persistence_UNS !== void 0 ? _node$persistence_UNS : 'none',\n backButton: (_node$persistence_UNS3 = (_node$persistence_UNS4 = node.persistence_UNSTABLE) === null || _node$persistence_UNS4 === void 0 ? void 0 : _node$persistence_UNS4.backButton) !== null && _node$persistence_UNS3 !== void 0 ? _node$persistence_UNS3 : false\n }\n };\n }); // Filter on existance in atomValues so that externally-visible rules\n // are also applied to modified atoms (specifically exclude selectors):\n\n const modifiedAtoms = Recoil_filterSet(currentTree.dirtyAtoms, k => atomValues.has(k) || previousAtomValues.has(k));\n callback({\n atomValues,\n previousAtomValues,\n atomInfo,\n modifiedAtoms,\n transactionMetadata: { ...currentTree.transactionMetadata\n }\n });\n }, [callback]));\n}\n\nfunction useRecoilTransactionObserver(callback) {\n useTransactionSubscription(useCallback$1(store => {\n const snapshot = cloneSnapshot$1(store, 'current');\n const previousSnapshot = cloneSnapshot$1(store, 'previous');\n callback({\n snapshot,\n previousSnapshot\n });\n }, [callback]));\n}\n\nfunction usePrevious(value) {\n const ref = useRef$2();\n useEffect$1(() => {\n ref.current = value;\n });\n return ref.current;\n} // Return a snapshot of the current state and subscribe to all state changes\n\n\nfunction useRecoilSnapshot() {\n const storeRef = useStoreRef$1();\n const [snapshot, setSnapshot] = useState$1(() => cloneSnapshot$1(storeRef.current));\n const previousSnapshot = usePrevious(snapshot);\n const timeoutID = useRef$2();\n useEffect$1(() => {\n if (timeoutID.current && !isSSR$2) {\n window.clearTimeout(timeoutID.current);\n }\n\n return snapshot.retain();\n }, [snapshot]);\n useTransactionSubscription(useCallback$1(store => setSnapshot(cloneSnapshot$1(store)), []));\n\n if (previousSnapshot !== snapshot && !isSSR$2) {\n if (timeoutID.current) {\n previousSnapshot === null || previousSnapshot === void 0 ? void 0 : previousSnapshot.release();\n window.clearTimeout(timeoutID.current);\n }\n\n snapshot.retain();\n timeoutID.current = window.setTimeout(() => {\n snapshot.release();\n timeoutID.current = null;\n }, SUSPENSE_TIMEOUT_MS);\n }\n\n return snapshot;\n}\n\nfunction useGotoRecoilSnapshot() {\n const storeRef = useStoreRef$1();\n return useCallback$1(snapshot => {\n var _storeState$nextTree;\n\n const storeState = storeRef.current.getState();\n const prev = (_storeState$nextTree = storeState.nextTree) !== null && _storeState$nextTree !== void 0 ? _storeState$nextTree : storeState.currentTree;\n const next = snapshot.getStore_INTERNAL().getState().currentTree;\n batchUpdates$2(() => {\n const keysToUpdate = new Set();\n\n for (const keys of [prev.atomValues.keys(), next.atomValues.keys()]) {\n for (const key of keys) {\n var _prev$atomValues$get, _next$atomValues$get;\n\n if (((_prev$atomValues$get = prev.atomValues.get(key)) === null || _prev$atomValues$get === void 0 ? void 0 : _prev$atomValues$get.contents) !== ((_next$atomValues$get = next.atomValues.get(key)) === null || _next$atomValues$get === void 0 ? void 0 : _next$atomValues$get.contents) && getNode$3(key).shouldRestoreFromSnapshots) {\n keysToUpdate.add(key);\n }\n }\n }\n\n keysToUpdate.forEach(key => {\n setRecoilValueLoadable$1(storeRef.current, new AbstractRecoilValue$3(key), next.atomValues.has(key) ? Recoil_nullthrows(next.atomValues.get(key)) : DEFAULT_VALUE$2);\n });\n storeRef.current.replaceState(state => {\n return { ...state,\n stateID: snapshot.getID_INTERNAL()\n };\n });\n });\n }, [storeRef]);\n}\n\nfunction useSetUnvalidatedAtomValues() {\n const storeRef = useStoreRef$1();\n return (values, transactionMetadata = {}) => {\n batchUpdates$2(() => {\n storeRef.current.addTransactionMetadata(transactionMetadata);\n values.forEach((value, key) => setUnvalidatedRecoilValue$2(storeRef.current, new AbstractRecoilValue$3(key), value));\n });\n };\n}\n\nclass Sentinel {}\n\nconst SENTINEL = new Sentinel();\n\nfunction useRecoilCallback(fn, deps) {\n const storeRef = useStoreRef$1();\n const gotoSnapshot = useGotoRecoilSnapshot();\n return useCallback$1((...args) => {\n function set(recoilState, newValueOrUpdater) {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n }\n\n function reset(recoilState) {\n setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n } // Use currentTree for the snapshot to show the currently committed state\n\n\n const snapshot = cloneSnapshot$1(storeRef.current);\n let ret = SENTINEL;\n batchUpdates$2(() => {\n const errMsg = 'useRecoilCallback expects a function that returns a function: ' + 'it accepts a function of the type (RecoilInterface) => T = R ' + 'and returns a callback function T => R, where RecoilInterface is an ' + 'object {snapshot, set, ...} and T and R are the argument and return ' + 'types of the callback you want to create. Please see the docs ' + 'at recoiljs.org for details.';\n\n if (typeof fn !== 'function') {\n throw new Error(errMsg);\n } // flowlint-next-line unclear-type:off\n\n\n const cb = fn({\n set,\n reset,\n snapshot,\n gotoSnapshot\n });\n\n if (typeof cb !== 'function') {\n throw new Error(errMsg);\n }\n\n ret = cb(...args);\n });\n !!(ret instanceof Sentinel) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'batchUpdates should return immediately') : Recoil_invariant(false) : void 0;\n return ret;\n }, deps != null ? [...deps, storeRef] : undefined // eslint-disable-line fb-www/react-hooks-deps\n );\n} // I don't see a way to avoid the any type here because we want to accept readable\n// and writable values with any type parameter, but normally with writable ones\n// RecoilState is not a subtype of RecoilState.\n\n\n// flowlint-line unclear-type:off\nfunction useRetain(toRetain) {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n } // eslint-disable-next-line fb-www/react-hooks\n\n\n return useRetain_ACTUAL(toRetain);\n}\n\nfunction useRetain_ACTUAL(toRetain) {\n const array = Array.isArray(toRetain) ? toRetain : [toRetain];\n const retainables = array.map(a => a instanceof RetentionZone$3 ? a : a.key);\n const storeRef = useStoreRef$1();\n useEffect$1(() => {\n if (!Recoil_gkx_1('recoil_memory_managament_2020')) {\n return;\n }\n\n const store = storeRef.current;\n\n if (timeoutID.current && !isSSR$2) {\n // Already performed a temporary retain on render, simply cancel the release\n // of that temporary retain.\n window.clearTimeout(timeoutID.current);\n timeoutID.current = null;\n } else {\n // Log this since it's not clear that there's any scenario where it should happen.\n Recoil_recoverableViolation('Did not retain recoil value on render, or committed after timeout elapsed. This is fine, but odd.');\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, 1);\n }\n }\n\n return () => {\n for (const r of retainables) {\n updateRetainCount$1(store, r, -1);\n }\n }; // eslint-disable-next-line fb-www/react-hooks-deps\n }, [storeRef, ...retainables]); // We want to retain if the component suspends. This is terrible but the Suspense\n // API affords us no better option. If we suspend and never commit after some\n // seconds, then release. The 'actual' retain/release in the effect above\n // cancels this.\n\n const timeoutID = useRef$2();\n const previousRetainables = usePrevious(retainables);\n\n if (!isSSR$2 && (previousRetainables === undefined || !Recoil_shallowArrayEqual(previousRetainables, retainables))) {\n const store = storeRef.current;\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, 1);\n }\n\n if (previousRetainables) {\n for (const r of previousRetainables) {\n updateRetainCount$1(store, r, -1);\n }\n }\n\n if (timeoutID.current) {\n window.clearTimeout(timeoutID.current);\n }\n\n timeoutID.current = window.setTimeout(() => {\n timeoutID.current = null;\n\n for (const r of retainables) {\n updateRetainCount$1(store, r, -1);\n }\n }, SUSPENSE_TIMEOUT_MS);\n }\n}\n\nvar Recoil_Hooks = {\n recoilComponentGetRecoilValueCount_FOR_TESTING,\n useGotoRecoilSnapshot,\n useRecoilCallback,\n useRecoilInterface: useRecoilInterface_DEPRECATED,\n useRecoilSnapshot,\n useRecoilState,\n useRecoilStateLoadable,\n useRecoilTransactionObserver,\n useRecoilValue,\n useRecoilValueLoadable,\n useRetain,\n useResetRecoilState,\n useSetRecoilState,\n useSetUnvalidatedAtomValues,\n useTransactionObservation_DEPRECATED,\n useTransactionSubscription_DEPRECATED: useTransactionSubscription\n};\n\nconst {\n peekNodeInfo: peekNodeInfo$2\n} = Recoil_FunctionalCore;\n\nconst {\n useStoreRef: useStoreRef$2\n} = Recoil_RecoilRoot_react;\n\nfunction useGetRecoilValueInfo() {\n const storeRef = useStoreRef$2();\n return ({\n key\n }) => peekNodeInfo$2(storeRef.current, storeRef.current.getState().currentTree, key);\n}\n\nvar Recoil_useGetRecoilValueInfo = useGetRecoilValueInfo;\n\nconst {\n RecoilRoot: RecoilRoot$1,\n useStoreRef: useStoreRef$3\n} = Recoil_RecoilRoot_react;\n\n\n\nconst {\n useMemo: useMemo$2\n} = react;\n\nfunction useRecoilBridgeAcrossReactRoots() {\n const store = useStoreRef$3().current;\n return useMemo$2(() => {\n function RecoilBridge({\n children\n }) {\n return /*#__PURE__*/react.createElement(RecoilRoot$1, {\n store_INTERNAL: store\n }, children);\n }\n\n return RecoilBridge;\n }, [store]);\n}\n\nvar Recoil_useRecoilBridgeAcrossReactRoots = useRecoilBridgeAcrossReactRoots;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n// Split declaration and implementation to allow this function to pretend to\n// check for actual instance of Promise instead of something with a `then`\n// method.\n// eslint-disable-next-line no-redeclare\nfunction isPromise(p) {\n return !!p && typeof p.then === 'function';\n}\n\nvar Recoil_isPromise = isPromise;\n\n// TODO Convert Loadable to a Class to allow for runtime type detection.\n// Containing static factories of withValue(), withError(), withPromise(), and all()\n\n\nclass Canceled {}\n\nconst CANCELED = new Canceled();\nconst loadableAccessors = {\n /**\n * if loadable has a value (state === 'hasValue'), return that value.\n * Otherwise, throw the (unwrapped) promise or the error.\n */\n getValue() {\n if (this.state === 'loading') {\n throw this.contents.then(({\n __value\n }) => __value);\n }\n\n if (this.state !== 'hasValue') {\n throw this.contents;\n }\n\n return this.contents;\n },\n\n toPromise() {\n return this.state === 'hasValue' ? Promise.resolve(this.contents) : this.state === 'hasError' ? Promise.reject(this.contents) : this.contents.then(({\n __value\n }) => __value);\n },\n\n valueMaybe() {\n return this.state === 'hasValue' ? this.contents : undefined;\n },\n\n valueOrThrow() {\n if (this.state !== 'hasValue') {\n const error = new Error(`Loadable expected value, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents;\n },\n\n errorMaybe() {\n return this.state === 'hasError' ? this.contents : undefined;\n },\n\n errorOrThrow() {\n if (this.state !== 'hasError') {\n const error = new Error(`Loadable expected error, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents;\n },\n\n promiseMaybe() {\n return this.state === 'loading' ? this.contents.then(({\n __value\n }) => __value) : undefined;\n },\n\n promiseOrThrow() {\n if (this.state !== 'loading') {\n const error = new Error(`Loadable expected promise, but in \"${this.state}\" state`); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n return this.contents.then(({\n __value\n }) => __value);\n },\n\n is(other) {\n return other.state === this.state && other.contents === this.contents;\n },\n\n // TODO Unit tests\n // TODO Convert Loadable to a Class to better support chaining\n // by returning a Loadable from a map function\n map(map) {\n if (this.state === 'hasError') {\n return this;\n }\n\n if (this.state === 'hasValue') {\n try {\n const next = map(this.contents); // TODO if next instanceof Loadable, then return next\n\n return Recoil_isPromise(next) ? loadableWithPromise(next) : loadableWithValue(next);\n } catch (e) {\n return Recoil_isPromise(e) ? // If we \"suspended\", then try again.\n // errors and subsequent retries will be handled in 'loading' case\n loadableWithPromise(e.next(() => map(this.contents))) : loadableWithError(e);\n }\n }\n\n if (this.state === 'loading') {\n return loadableWithPromise(this.contents // TODO if map returns a loadable, then return the value or promise or throw the error\n .then(map).catch(e => {\n if (Recoil_isPromise(e)) {\n // we were \"suspended,\" try again\n return e.then(() => map(this.contents));\n }\n\n throw e;\n }));\n }\n\n const error = new Error('Invalid Loadable state'); // V8 keeps closures alive until stack is accessed, this prevents a memory leak\n throw error;\n }\n\n};\n\nfunction loadableWithValue(value) {\n // Build objects this way since Flow doesn't support disjoint unions for class properties\n return Object.freeze({\n state: 'hasValue',\n contents: value,\n ...loadableAccessors\n });\n}\n\nfunction loadableWithError(error) {\n return Object.freeze({\n state: 'hasError',\n contents: error,\n ...loadableAccessors\n });\n}\n\nfunction loadableWithPromise(promise) {\n return Object.freeze({\n state: 'loading',\n contents: promise,\n ...loadableAccessors\n });\n}\n\nfunction loadableLoading() {\n return loadableWithPromise(new Promise(() => {}));\n}\n\nfunction loadableAll(inputs) {\n return inputs.every(i => i.state === 'hasValue') ? loadableWithValue(inputs.map(i => i.contents)) : inputs.some(i => i.state === 'hasError') ? loadableWithError(Recoil_nullthrows(inputs.find(i => i.state === 'hasError'), 'Invalid loadable passed to loadableAll').contents) : loadableWithPromise(Promise.all(inputs.map(i => i.contents)).then(value => ({\n __value: value\n })));\n}\n\nvar Recoil_Loadable = {\n loadableWithValue,\n loadableWithError,\n loadableWithPromise,\n loadableLoading,\n loadableAll,\n Canceled,\n CANCELED\n};\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction isNode(object) {\n var _ownerDocument, _doc$defaultView;\n\n if (typeof window === 'undefined') {\n return false;\n }\n\n const doc = object != null ? (_ownerDocument = object.ownerDocument) !== null && _ownerDocument !== void 0 ? _ownerDocument : object : document;\n const defaultView = (_doc$defaultView = doc.defaultView) !== null && _doc$defaultView !== void 0 ? _doc$defaultView : window;\n return !!(object != null && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));\n}\n\nvar Recoil_isNode = isNode;\n\nconst {\n isReactNative: isReactNative$1,\n isSSR: isSSR$3\n} = Recoil_Environment;\n\n\n\n\n\nfunction shouldNotBeFrozen(value) {\n // Primitives and functions:\n if (value === null || typeof value !== 'object') {\n return true;\n } // React elements:\n\n\n switch (typeof value.$$typeof) {\n case 'symbol':\n return true;\n\n case 'number':\n return true;\n } // Immutable structures:\n\n\n if (value['@@__IMMUTABLE_ITERABLE__@@'] != null || value['@@__IMMUTABLE_KEYED__@@'] != null || value['@@__IMMUTABLE_INDEXED__@@'] != null || value['@@__IMMUTABLE_ORDERED__@@'] != null || value['@@__IMMUTABLE_RECORD__@@'] != null) {\n return true;\n } // DOM nodes:\n\n\n if (Recoil_isNode(value)) {\n return true;\n }\n\n if (Recoil_isPromise(value)) {\n return true;\n }\n\n if (value instanceof Error) {\n return true;\n }\n\n if (ArrayBuffer.isView(value)) {\n return true;\n } // Some environments, just as Jest, don't work with the instanceof check\n\n\n if (!isSSR$3 && !isReactNative$1 && ( // $FlowFixMe(site=recoil) Window does not have a FlowType definition https://github.com/facebook/flow/issues/6709\n value === window || value instanceof Window)) {\n return true;\n }\n\n return false;\n} // Recursively freeze a value to enforce it is read-only.\n// This may also have minimal performance improvements for enumerating\n// objects (based on browser implementations, of course)\n\n\nfunction deepFreezeValue(value) {\n if (typeof value !== 'object' || shouldNotBeFrozen(value)) {\n return;\n }\n\n Object.freeze(value); // Make all properties read-only\n\n for (const key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) {\n const prop = value[key]; // Prevent infinite recurssion for circular references.\n\n if (typeof prop === 'object' && prop != null && !Object.isFrozen(prop)) {\n deepFreezeValue(prop);\n }\n }\n }\n\n Object.seal(value); // This also makes existing properties non-configurable.\n}\n\nvar Recoil_deepFreezeValue = deepFreezeValue;\n\nconst TIME_WARNING_THRESHOLD_MS = 15;\n\nfunction stringify(x, opt, key) {\n // A optimization to avoid the more expensive JSON.stringify() for simple strings\n // This may lose protection for u2028 and u2029, though.\n if (typeof x === 'string' && !x.includes('\"') && !x.includes('\\\\')) {\n return `\"${x}\"`;\n } // Handle primitive types\n\n\n switch (typeof x) {\n case 'undefined':\n return '';\n // JSON.stringify(undefined) returns undefined, but we always want to return a string\n\n case 'boolean':\n return x ? 'true' : 'false';\n\n case 'number':\n case 'symbol':\n // case 'bigint': // BigInt is not supported in www\n return String(x);\n\n case 'string':\n // Add surrounding quotes and escape internal quotes\n return JSON.stringify(x);\n\n case 'function':\n if ((opt === null || opt === void 0 ? void 0 : opt.allowFunctions) !== true) {\n throw new Error('Attempt to serialize function in a Recoil cache key');\n }\n\n return `__FUNCTION(${x.name})__`;\n }\n\n if (x === null) {\n return 'null';\n } // Fallback case for unknown types\n\n\n if (typeof x !== 'object') {\n var _JSON$stringify;\n\n return (_JSON$stringify = JSON.stringify(x)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : '';\n } // Deal with all promises as equivalent for now.\n\n\n if (Recoil_isPromise(x)) {\n return '__PROMISE__';\n } // Arrays handle recursive stringification\n\n\n if (Array.isArray(x)) {\n return `[${x.map((v, i) => stringify(v, opt, i.toString()))}]`;\n } // If an object defines a toJSON() method, then use that to override the\n // serialization. This matches the behavior of JSON.stringify().\n // Pass the key for compatibility.\n // Immutable.js collections define this method to allow us to serialize them.\n\n\n if (typeof x.toJSON === 'function') {\n // flowlint-next-line unclear-type: off\n return stringify(x.toJSON(key), opt, key);\n } // For built-in Maps, sort the keys in a stable order instead of the\n // default insertion order. Support non-string keys.\n\n\n if (x instanceof Map) {\n const obj = {};\n\n for (const [k, v] of x) {\n // Stringify will escape any nested quotes\n obj[typeof k === 'string' ? k : stringify(k, opt)] = v;\n }\n\n return stringify(obj, opt, key);\n } // For built-in Sets, sort the keys in a stable order instead of the\n // default insertion order.\n\n\n if (x instanceof Set) {\n return stringify(Array.from(x).sort((a, b) => stringify(a, opt).localeCompare(stringify(b, opt))), opt, key);\n } // Anything else that is iterable serialize as an Array.\n\n\n if (Symbol !== undefined && x[Symbol.iterator] != null && typeof x[Symbol.iterator] === 'function') {\n // flowlint-next-line unclear-type: off\n return stringify(Array.from(x), opt, key);\n } // For all other Objects, sort the keys in a stable order.\n\n\n return `{${Object.keys(x).filter(key => x[key] !== undefined).sort() // stringify the key to add quotes and escape any nested slashes or quotes.\n .map(key => `${stringify(key, opt)}:${stringify(x[key], opt, key)}`).join(',')}}`;\n} // Utility similar to JSON.stringify() except:\n// * Serialize built-in Sets as an Array\n// * Serialize built-in Maps as an Object. Supports non-string keys.\n// * Serialize other iterables as arrays\n// * Sort the keys of Objects and Maps to have a stable order based on string conversion.\n// This overrides their default insertion order.\n// * Still uses toJSON() of any object to override serialization\n// * Support Symbols (though don't guarantee uniqueness)\n// * We could support BigInt, but Flow doesn't seem to like it.\n// See Recoil_stableStringify-test.js for examples\n\n\nfunction stableStringify(x, opt = {\n allowFunctions: false\n}) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined') {\n const startTime = window.performance ? window.performance.now() : 0;\n const str = stringify(x, opt);\n const endTime = window.performance ? window.performance.now() : 0;\n\n if (endTime - startTime > TIME_WARNING_THRESHOLD_MS) {\n /* eslint-disable fb-www/no-console */\n console.groupCollapsed(`Recoil: Spent ${endTime - startTime}ms computing a cache key`);\n console.warn(x, str);\n console.groupEnd();\n /* eslint-enable fb-www/no-console */\n }\n\n return str;\n }\n }\n\n return stringify(x, opt);\n}\n\nvar Recoil_stableStringify = stableStringify;\n\nclass TreeCache {\n constructor(options) {\n var _options$onHit, _options$onSet, _options$mapNodeValue;\n\n _defineProperty(this, \"_numLeafs\", void 0);\n\n _defineProperty(this, \"_root\", void 0);\n\n _defineProperty(this, \"_onHit\", void 0);\n\n _defineProperty(this, \"_onSet\", void 0);\n\n _defineProperty(this, \"_mapNodeValue\", void 0);\n\n this._numLeafs = 0;\n this._root = null;\n this._onHit = (_options$onHit = options === null || options === void 0 ? void 0 : options.onHit) !== null && _options$onHit !== void 0 ? _options$onHit : () => {};\n this._onSet = (_options$onSet = options === null || options === void 0 ? void 0 : options.onSet) !== null && _options$onSet !== void 0 ? _options$onSet : () => {};\n this._mapNodeValue = (_options$mapNodeValue = options === null || options === void 0 ? void 0 : options.mapNodeValue) !== null && _options$mapNodeValue !== void 0 ? _options$mapNodeValue : val => val;\n }\n\n size() {\n return this._numLeafs;\n } // TODO: nodeCount(): number\n\n\n root() {\n return this._root;\n }\n\n get(getNodeValue, handlers) {\n var _this$getLeafNode;\n\n return (_this$getLeafNode = this.getLeafNode(getNodeValue, handlers)) === null || _this$getLeafNode === void 0 ? void 0 : _this$getLeafNode.value;\n }\n\n getLeafNode(getNodeValue, handlers) {\n return findLeaf(this.root(), nodeKey => this._mapNodeValue(getNodeValue(nodeKey)), {\n onNodeVisit: node => {\n handlers === null || handlers === void 0 ? void 0 : handlers.onNodeVisit(node);\n\n if (node.type === 'leaf') {\n this._onHit(node);\n }\n }\n });\n }\n\n set(route, value, handlers) {\n let leafNode;\n const newRoot = addLeaf(this.root(), route.map(([nodeKey, nodeValue]) => [nodeKey, this._mapNodeValue(nodeValue)]), null, value, null, {\n onNodeVisit: node => {\n handlers === null || handlers === void 0 ? void 0 : handlers.onNodeVisit(node);\n\n if (node.type === 'leaf') {\n leafNode = node;\n }\n }\n });\n\n if (!this.root()) {\n this._root = newRoot;\n }\n\n this._numLeafs++;\n\n this._onSet(Recoil_nullthrows(leafNode));\n }\n\n delete(node) {\n if (!this.root()) {\n return false;\n }\n\n const root = Recoil_nullthrows(this.root());\n const existsInTree = pruneNodeFromTree(root, node, node.parent);\n\n if (!existsInTree) {\n return false;\n }\n\n if (node === root || root.type === 'branch' && !root.branches.size) {\n this._root = null;\n this._numLeafs = 0;\n return true;\n }\n\n this._numLeafs -= countDownstreamLeaves(node);\n return true;\n }\n\n clear() {\n this._numLeafs = 0;\n this._root = null;\n }\n\n}\n\nconst findLeaf = (root, getNodeValue, handlers) => {\n var _handlers$onNodeVisit;\n\n if (root == null) {\n return undefined;\n }\n\n handlers === null || handlers === void 0 ? void 0 : (_handlers$onNodeVisit = handlers.onNodeVisit) === null || _handlers$onNodeVisit === void 0 ? void 0 : _handlers$onNodeVisit.call(handlers, root);\n\n if (root.type === 'leaf') {\n return root;\n }\n\n const nodeValue = getNodeValue(root.nodeKey);\n return findLeaf(root.branches.get(nodeValue), getNodeValue, handlers);\n};\n\nconst addLeaf = (root, route, parent, value, branchKey, handlers) => {\n var _handlers$onNodeVisit2;\n\n let node;\n\n if (root == null) {\n if (route.length === 0) {\n node = {\n type: 'leaf',\n value,\n parent,\n branchKey\n };\n } else {\n const [path, ...rest] = route;\n const [nodeKey, nodeValue] = path;\n node = {\n type: 'branch',\n nodeKey,\n parent,\n branches: new Map(),\n branchKey\n };\n node.branches.set(nodeValue, addLeaf(null, rest, node, value, nodeValue, handlers));\n }\n } else {\n node = root;\n\n if (route.length) {\n const [path, ...rest] = route;\n const [nodeKey, nodeValue] = path;\n !(root.type === 'branch' && root.nodeKey === nodeKey) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Existing cache must have a branch midway through the route with matching node key') : Recoil_invariant(false) : void 0;\n root.branches.set(nodeValue, addLeaf(root.branches.get(nodeValue), rest, root, value, nodeValue, handlers));\n }\n }\n\n handlers === null || handlers === void 0 ? void 0 : (_handlers$onNodeVisit2 = handlers.onNodeVisit) === null || _handlers$onNodeVisit2 === void 0 ? void 0 : _handlers$onNodeVisit2.call(handlers, node);\n return node;\n};\n\nconst pruneNodeFromTree = (root, node, parent) => {\n if (!parent) {\n return root === node;\n }\n\n parent.branches.delete(node.branchKey);\n return pruneUpstreamBranches(root, parent, parent.parent);\n};\n\nconst pruneUpstreamBranches = (root, branchNode, parent) => {\n if (!parent) {\n return root === branchNode;\n }\n\n if (branchNode.branches.size === 0) {\n parent.branches.delete(branchNode.branchKey);\n }\n\n return pruneUpstreamBranches(root, parent, parent.parent);\n};\n\nconst countDownstreamLeaves = node => node.type === 'leaf' ? 1 : Array.from(node.branches.values()).reduce((sum, currNode) => sum + countDownstreamLeaves(currNode), 0);\n\nvar Recoil_TreeCache = {\n TreeCache\n};\n\nvar Recoil_TreeCache_1 = Recoil_TreeCache.TreeCache;\n\nvar Recoil_TreeCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n TreeCache: Recoil_TreeCache_1\n});\n\nclass LRUCache {\n constructor(options) {\n var _options$mapKey;\n\n _defineProperty(this, \"_maxSize\", void 0);\n\n _defineProperty(this, \"_size\", void 0);\n\n _defineProperty(this, \"_head\", void 0);\n\n _defineProperty(this, \"_tail\", void 0);\n\n _defineProperty(this, \"_map\", void 0);\n\n _defineProperty(this, \"_keyMapper\", void 0);\n\n this._maxSize = options.maxSize;\n this._size = 0;\n this._head = null;\n this._tail = null;\n this._map = new Map();\n this._keyMapper = (_options$mapKey = options.mapKey) !== null && _options$mapKey !== void 0 ? _options$mapKey : v => v;\n }\n\n head() {\n return this._head;\n }\n\n tail() {\n return this._tail;\n }\n\n size() {\n return this._size;\n }\n\n maxSize() {\n return this._maxSize;\n }\n\n has(key) {\n return this._map.has(this._keyMapper(key));\n }\n\n get(key) {\n const mappedKey = this._keyMapper(key);\n\n const node = this._map.get(mappedKey);\n\n if (!node) {\n return undefined;\n }\n\n this.set(key, node.value);\n return node.value;\n }\n\n set(key, val) {\n const mappedKey = this._keyMapper(key);\n\n const existingNode = this._map.get(mappedKey);\n\n if (existingNode) {\n this.delete(key);\n }\n\n const head = this.head();\n const node = {\n key,\n right: head,\n left: null,\n value: val\n };\n\n if (head) {\n head.left = node;\n } else {\n this._tail = node;\n }\n\n this._map.set(mappedKey, node);\n\n this._head = node;\n this._size++;\n\n this._maybeDeleteLRU();\n }\n\n _maybeDeleteLRU() {\n if (this.size() > this.maxSize()) {\n this.deleteLru();\n }\n }\n\n deleteLru() {\n const tail = this.tail();\n\n if (tail) {\n this.delete(tail.key);\n }\n }\n\n delete(key) {\n const mappedKey = this._keyMapper(key);\n\n if (!this._size || !this._map.has(mappedKey)) {\n return;\n }\n\n const node = Recoil_nullthrows(this._map.get(mappedKey));\n const right = node.right;\n const left = node.left;\n\n if (right) {\n right.left = node.left;\n }\n\n if (left) {\n left.right = node.right;\n }\n\n if (node === this.head()) {\n this._head = right;\n }\n\n if (node === this.tail()) {\n this._tail = left;\n }\n\n this._map.delete(mappedKey);\n\n this._size--;\n }\n\n clear() {\n this._size = 0;\n this._head = null;\n this._tail = null;\n this._map = new Map();\n }\n\n}\n\nvar Recoil_LRUCache = {\n LRUCache\n};\n\nvar Recoil_LRUCache_1 = Recoil_LRUCache.LRUCache;\n\nvar Recoil_LRUCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n LRUCache: Recoil_LRUCache_1\n});\n\nconst {\n LRUCache: LRUCache$1\n} = Recoil_LRUCache$1;\n\nconst {\n TreeCache: TreeCache$1\n} = Recoil_TreeCache$1;\n\nfunction treeCacheLRU(maxSize, mapNodeValue = v => v) {\n const lruCache = new LRUCache$1({\n maxSize\n });\n const cache = new TreeCache$1({\n mapNodeValue,\n onHit: node => {\n lruCache.set(node, true);\n },\n onSet: node => {\n const lruNode = lruCache.tail();\n lruCache.set(node, true);\n\n if (lruNode && cache.size() > maxSize) {\n cache.delete(lruNode.key);\n }\n }\n });\n return cache;\n}\n\nvar Recoil_treeCacheLRU = treeCacheLRU;\n\nconst {\n TreeCache: TreeCache$2\n} = Recoil_TreeCache$1;\n\n\n\nconst defaultPolicy = {\n equality: 'reference',\n eviction: 'none',\n maxSize: Infinity\n};\n\nfunction treeCacheFromPolicy({\n equality = defaultPolicy.equality,\n eviction = defaultPolicy.eviction,\n maxSize = defaultPolicy.maxSize\n} = defaultPolicy) {\n const valueMapper = getValueMapper(equality);\n const treeCache = getTreeCache(eviction, maxSize, valueMapper);\n return treeCache;\n}\n\nfunction getValueMapper(equality) {\n switch (equality) {\n case 'reference':\n return val => val;\n\n case 'value':\n return val => Recoil_stableStringify(val);\n }\n\n throw new Error(`Unrecognized equality policy ${equality}`);\n}\n\nfunction getTreeCache(eviction, maxSize, mapNodeValue) {\n switch (eviction) {\n case 'none':\n return new TreeCache$2({\n mapNodeValue\n });\n\n case 'lru':\n return Recoil_treeCacheLRU(Recoil_nullthrows(maxSize), mapNodeValue);\n }\n\n throw new Error(`Unrecognized eviction policy ${eviction}`);\n}\n\nvar Recoil_treeCacheFromPolicy = treeCacheFromPolicy;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is a stub for some integration into FB internal stuff\n */\nfunction startPerfBlock(_id) {\n return () => null;\n}\n\nvar Recoil_PerformanceTimings = {\n startPerfBlock\n};\n\nconst {\n CANCELED: CANCELED$1,\n Canceled: Canceled$1,\n loadableWithError: loadableWithError$1,\n loadableWithPromise: loadableWithPromise$1,\n loadableWithValue: loadableWithValue$1\n} = Recoil_Loadable;\n\n\n\nconst {\n getNodeLoadable: getNodeLoadable$2,\n peekNodeLoadable: peekNodeLoadable$1,\n setNodeValue: setNodeValue$3\n} = Recoil_FunctionalCore;\n\nconst {\n saveDependencyMapToStore: saveDependencyMapToStore$1\n} = Recoil_Graph;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$3,\n RecoilValueNotReady: RecoilValueNotReady$2,\n getConfigDeletionHandler: getConfigDeletionHandler$1,\n registerNode: registerNode$1\n} = Recoil_Node;\n\nconst {\n isRecoilValue: isRecoilValue$3\n} = Recoil_RecoilValue$1;\n\nconst {\n AbstractRecoilValue: AbstractRecoilValue$4\n} = Recoil_RecoilValue$1;\n\nconst {\n setRecoilValueLoadable: setRecoilValueLoadable$2\n} = Recoil_RecoilValueInterface;\n\nconst {\n retainedByOptionWithDefault: retainedByOptionWithDefault$1\n} = Recoil_Retention;\n\n\n\n\n\n\n\n\n\n\n\nconst {\n startPerfBlock: startPerfBlock$1\n} = Recoil_PerformanceTimings;\n\n\n\nconst dependencyStack = []; // for detecting circular dependencies.\n\nconst waitingStores = new Map();\n/* eslint-disable no-redeclare */\n\nconst getNewExecutionId = (() => {\n let executionId = 0;\n return () => executionId++;\n})();\n\nfunction getInitialExecutionInfo() {\n return {\n depValuesDiscoveredSoFarDuringAsyncWork: null,\n latestLoadable: null,\n latestExecutionId: null,\n stateVersion: null\n };\n}\n\nfunction selector(options) {\n const {\n key,\n get,\n cachePolicy_UNSTABLE: cachePolicy\n } = options;\n const set = options.set != null ? options.set : undefined; // flow\n\n const cache = Recoil_treeCacheFromPolicy(cachePolicy !== null && cachePolicy !== void 0 ? cachePolicy : {\n equality: 'reference',\n eviction: 'none'\n });\n const retainedBy = retainedByOptionWithDefault$1(options.retainedBy_UNSTABLE);\n const executionInfoMap = new Map();\n let liveStoresCount = 0;\n\n function selectorIsLive() {\n return !Recoil_gkx_1('recoil_memory_managament_2020') || liveStoresCount > 0;\n }\n\n function getExecutionInfo(store) {\n if (!executionInfoMap.has(store)) {\n executionInfoMap.set(store, getInitialExecutionInfo());\n }\n\n return Recoil_nullthrows(executionInfoMap.get(store));\n }\n\n function selectorInit(store) {\n liveStoresCount++;\n store.getState().knownSelectors.add(key); // FIXME remove knownSelectors?\n\n return () => {\n liveStoresCount--;\n store.getState().knownSelectors.delete(key);\n executionInfoMap.delete(store);\n };\n }\n\n function selectorShouldDeleteConfigOnRelease() {\n return getConfigDeletionHandler$1(key) !== undefined && !selectorIsLive();\n }\n\n function notifyStoreWhenAsyncSettles(store, loadable, executionId) {\n if (loadable.state === 'loading') {\n let stores = waitingStores.get(executionId);\n\n if (stores == null) {\n waitingStores.set(executionId, stores = new Set());\n }\n\n stores.add(store);\n }\n }\n\n function notifyStoresOfSettledAsync(newLoadable, executionId) {\n const stores = waitingStores.get(executionId);\n\n if (stores !== undefined) {\n for (const store of stores) {\n setRecoilValueLoadable$2(store, new AbstractRecoilValue$4(key), newLoadable);\n }\n\n waitingStores.delete(executionId);\n }\n }\n\n function getCachedNodeLoadable(store, state, key) {\n if (state.atomValues.has(key)) {\n return Recoil_nullthrows(state.atomValues.get(key));\n }\n\n const loadable = getNodeLoadable$2(store, state, key);\n const isKeyPointingToSelector = store.getState().knownSelectors.has(key);\n\n if (loadable.state !== 'loading' && isKeyPointingToSelector) {\n state.atomValues.set(key, loadable);\n }\n\n return loadable;\n }\n /**\n * This function attaches a then() and a catch() to a promise that was\n * returned from a selector's get() (either explicitly or implicitly by\n * running a function that uses the \"async\" keyword). If a selector's get()\n * returns a promise, we have two possibilities:\n *\n * 1. The promise will resolve, in which case it will have completely finished\n * executing without any remaining pending dependencies. No more retries\n * are needed and we can proceed with updating the cache and notifying\n * subscribers (if it is the latest execution, otherwise only the cache\n * will be updated and subscriptions will not be fired). This is the case\n * handled by the attached then() handler.\n *\n * 2. The promise will throw because it either has an error or it came across\n * an async dependency that has not yet resolved, in which case we will\n * call wrapDepdencyPromise(), whose responsibility is to handle dependency\n * promises. This case is handled by the attached catch() handler.\n *\n * Both branches will eventually resolve to the final result of the selector\n * (or an error if a real error occurred).\n *\n * The execution will run to completion even if it is stale, and its value\n * will be cached. But stale executions will not update global state or update\n * executionInfo as that is the responsibility of the 'latest' execution.\n *\n * Note this function should not be passed a promise that was thrown--AKA a\n * dependency promise. Dependency promises should be passed to\n * wrapPendingDependencyPromise()).\n */\n\n\n function wrapPendingPromise(store, promise, state, depValues, executionId) {\n return promise.then(value => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n const loadable = loadableWithValue$1(value);\n maybeFreezeValue(value);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n return {\n __value: value,\n __key: key\n };\n }).catch(errorOrPromise => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n if (isLatestExecution(store, executionId)) {\n updateExecutionInfoDepValues(depValues, store, executionId);\n }\n\n if (Recoil_isPromise(errorOrPromise)) {\n return wrapPendingDependencyPromise(store, errorOrPromise, state, depValues, executionId);\n }\n\n const loadable = loadableWithError$1(errorOrPromise);\n maybeFreezeValue(errorOrPromise);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n throw errorOrPromise;\n });\n }\n /**\n * This function attaches a then() and a catch() to a promise that was\n * thrown from a selector's get(). If a selector's get() throws a promise,\n * we have two possibilities:\n *\n * 1. The promise will resolve, meaning one of our selector's dependencies is\n * now available and we should \"retry\" our get() by running it again. This\n * is the case handled by the attached then() handler.\n *\n * 2. The promise will throw because something went wrong with the dependency\n * promise (in other words a real error occurred). This case is handled by\n * the attached catch() handler. If the dependency promise throws, it is\n * _always_ a real error and not another dependency promise (any dependency\n * promises would have been handled upstream).\n *\n * The then() branch will eventually resolve to the final result of the\n * selector (or an error if a real error occurs), and the catch() will always\n * resolve to an error because the dependency promise is a promise that was\n * wrapped upstream, meaning it will only resolve to its real value or to a\n * real error.\n *\n * The execution will run to completion even if it is stale, and its value\n * will be cached. But stale executions will not update global state or update\n * executionInfo as that is the responsibility of the 'latest' execution.\n *\n * Note this function should not be passed a promise that was returned from\n * get(). The intention is that this function is only passed promises that\n * were thrown due to a pending dependency. Promises returned by get() should\n * be passed to wrapPendingPromise() instead.\n */\n\n\n function wrapPendingDependencyPromise(store, promise, state, existingDeps, executionId) {\n return promise.then(resolvedDep => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n if (resolvedDep instanceof Canceled$1) {\n Recoil_recoverableViolation('Selector was released while it had dependencies');\n return CANCELED$1;\n }\n\n const {\n __key: resolvedDepKey,\n __value: depValue\n } = resolvedDep !== null && resolvedDep !== void 0 ? resolvedDep : {};\n /**\n * We need to bypass the selector dep cache if the resolved dep was a\n * user-thrown promise because the selector dep cache will contain the\n * stale values of dependencies, causing an infinite evaluation loop.\n */\n\n let bypassSelectorDepCacheOnReevaluation = true;\n\n if (resolvedDepKey != null) {\n /**\n * Note for async atoms, this means we are changing the atom's value\n * in the store for the given version. This should be alright because\n * the version of state is now stale and a new version will have\n * already been triggered by the atom being resolved (see this logic\n * in Recoil_atom.js)\n */\n state.atomValues.set(resolvedDepKey, loadableWithValue$1(depValue));\n /**\n * We've added the resolved dependency to the selector dep cache, so\n * there's no need to bypass the cache\n */\n\n bypassSelectorDepCacheOnReevaluation = false;\n }\n\n const [loadable, depValues] = evaluateSelectorGetter(store, state, executionId, bypassSelectorDepCacheOnReevaluation);\n\n if (isLatestExecution(store, executionId)) {\n updateExecutionInfoDepValues(depValues, store, executionId);\n }\n\n maybeFreezeLoadableContents(loadable);\n\n if (loadable.state !== 'loading') {\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n }\n\n if (loadable.state === 'hasError') {\n throw loadable.contents;\n }\n\n if (loadable.state === 'hasValue') {\n return {\n __value: loadable.contents,\n __key: key\n };\n }\n /**\n * Returning promise here without wrapping as the wrapepr logic was\n * already done when we called evaluateSelectorGetter() to get this\n * loadable\n */\n\n\n return loadable.contents;\n }).catch(error => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$1;\n }\n\n const loadable = loadableWithError$1(error);\n maybeFreezeValue(error);\n setCache(state, depValuesToDepRoute(existingDeps), loadableWithError$1(error));\n setDepsInStore(store, state, new Set(existingDeps.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n throw error;\n });\n }\n\n function setLoadableInStoreToNotifyDeps(store, loadable, executionId) {\n if (isLatestExecution(store, executionId)) {\n setExecutionInfo(loadable, store);\n notifyStoresOfSettledAsync(loadable, executionId);\n }\n }\n\n function setDepsInStore(store, state, deps, executionId) {\n var _store$getState, _store$getState$curre, _store$getState2, _store$getState2$next;\n\n if (isLatestExecution(store, executionId) || state.version === ((_store$getState = store.getState()) === null || _store$getState === void 0 ? void 0 : (_store$getState$curre = _store$getState.currentTree) === null || _store$getState$curre === void 0 ? void 0 : _store$getState$curre.version) || state.version === ((_store$getState2 = store.getState()) === null || _store$getState2 === void 0 ? void 0 : (_store$getState2$next = _store$getState2.nextTree) === null || _store$getState2$next === void 0 ? void 0 : _store$getState2$next.version)) {\n var _store$getState$nextT, _store$getState3, _store$getState3$next;\n\n saveDependencyMapToStore$1(new Map([[key, deps]]), store, (_store$getState$nextT = (_store$getState3 = store.getState()) === null || _store$getState3 === void 0 ? void 0 : (_store$getState3$next = _store$getState3.nextTree) === null || _store$getState3$next === void 0 ? void 0 : _store$getState3$next.version) !== null && _store$getState$nextT !== void 0 ? _store$getState$nextT : store.getState().currentTree.version);\n }\n }\n\n function setNewDepInStore(store, state, deps, newDepKey, executionId) {\n deps.add(newDepKey);\n setDepsInStore(store, state, deps, executionId);\n }\n\n function evaluateSelectorGetter(store, state, executionId, bypassSelectorDepCache = false) {\n const endPerfBlock = startPerfBlock$1(key); // TODO T63965866: use execution ID here\n\n let result;\n let resultIsError = false;\n let loadable;\n const depValues = new Map();\n /**\n * Starting a fresh set of deps that we'll be using to update state. We're\n * starting a new set versus adding it in existing state deps because\n * the version of state that we update deps for may be a more recent version\n * than the version the selector was called with. This is because the latest\n * execution will update the deps of the current/latest version of state (\n * this is safe to do because the fact that the selector is the latest\n * execution means the deps we discover below are our best guess at the\n * deps for the current/latest state in the store)\n */\n\n const deps = new Set();\n setDepsInStore(store, state, deps, executionId);\n\n function getRecoilValue(recoilValue) {\n const {\n key: depKey\n } = recoilValue;\n setNewDepInStore(store, state, deps, depKey, executionId);\n const depLoadable = bypassSelectorDepCache ? getNodeLoadable$2(store, state, depKey) : getCachedNodeLoadable(store, state, depKey);\n depValues.set(depKey, depLoadable);\n\n if (depLoadable.state === 'hasValue') {\n return depLoadable.contents;\n }\n\n throw depLoadable.contents;\n }\n\n try {\n result = get({\n get: getRecoilValue\n });\n result = isRecoilValue$3(result) ? getRecoilValue(result) : result;\n\n if (Recoil_isPromise(result)) {\n result = wrapPendingPromise(store, // $FlowFixMe[incompatible-call]\n result, state, depValues, executionId).finally(endPerfBlock);\n } else {\n endPerfBlock();\n }\n } catch (errorOrDepPromise) {\n result = errorOrDepPromise;\n\n if (Recoil_isPromise(result)) {\n result = wrapPendingDependencyPromise(store, // $FlowFixMe[incompatible-call]\n result, state, depValues, executionId).finally(endPerfBlock);\n } else {\n resultIsError = true;\n endPerfBlock();\n }\n }\n\n if (resultIsError) {\n loadable = loadableWithError$1(result);\n } else if (Recoil_isPromise(result)) {\n // $FlowFixMe[incompatible-call]\n loadable = loadableWithPromise$1(result);\n } else {\n // $FlowFixMe[incompatible-call]\n loadable = loadableWithValue$1(result);\n }\n\n maybeFreezeLoadableContents(loadable);\n return [loadable, depValues];\n }\n\n function getValFromCacheAndUpdatedDownstreamDeps(store, state) {\n const depsAfterCacheDone = new Set();\n const executionInfo = getExecutionInfo(store);\n const cachedVal = cache.get(nodeKey => {\n !(typeof nodeKey === 'string') ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Cache nodeKey is type string') : Recoil_invariant(false) : void 0;\n const loadable = getCachedNodeLoadable(store, state, nodeKey);\n return loadable.contents;\n }, {\n onNodeVisit: node => {\n if (node.type === 'branch' && node.nodeKey !== key && typeof node.nodeKey === 'string') {\n depsAfterCacheDone.add(node.nodeKey);\n }\n }\n });\n /**\n * Ensure store contains correct dependencies if we hit the cache so that\n * the store deps and cache are in sync for a given state. This is important\n * because store deps are normally updated when new executions are created,\n * but cache hits don't trigger new executions but they still _may_ signifiy\n * a change in deps in the store if the store deps for this state are empty\n * or stale.\n */\n\n if (cachedVal) {\n setDepsInStore(store, state, depsAfterCacheDone, executionInfo.latestExecutionId);\n }\n\n return cachedVal;\n }\n /**\n * FIXME: dep keys should take into account the state of the loadable to\n * prevent the edge case where a loadable with an error and a loadable with\n * an error as a value are treated as the same thing incorrectly. For example\n * these two should be treated differently:\n *\n * selector({key: '', get: () => new Error('hi')});\n * selector({key: '', get () => {throw new Error('hi')}});\n *\n * With current implementation they are treated the same\n */\n\n\n function depValuesToDepRoute(depValues) {\n return Array.from(depValues.entries()).map(([key, valLoadable]) => [key, valLoadable.contents]);\n }\n\n function getValFromRunningNewExecutionAndUpdatedDeps(store, state) {\n const newExecutionId = getNewExecutionId();\n const [loadable, newDepValues] = evaluateSelectorGetter(store, state, newExecutionId);\n setExecutionInfo(loadable, store, newDepValues, newExecutionId, state);\n maybeSetCacheWithLoadable(state, depValuesToDepRoute(newDepValues), loadable);\n notifyStoreWhenAsyncSettles(store, loadable, newExecutionId);\n return loadable;\n }\n /**\n * Given a tree state, this function returns the \"selector result\", which is\n * defined as a size-2 tuple of [DependencyMap, Loadable].\n *\n * The selector's get() function will only be re-evaluated if _both_ of the\n * following statements are true:\n *\n * 1. The current dep values from the given state produced a cache key that\n * was not found in the cache.\n * 2. There is no currently running async execution OR there is an\n * async execution that is running, but after comparing the dep values in\n * the given state with the dep values that the execution has discovered so\n * far we find that at least one dep value has changed, in which case we\n * start a new execution (the previously running execution will continue to\n * run to completion, but only the new execution will be deemed the\n * 'latest' execution, meaning it will be the only execution that will\n * update global state when it is finished. Any non-latest executions will\n * run to completion and update the selector cache but not global state).\n */\n\n\n function getSelectorValAndUpdatedDeps(store, state) {\n const cachedVal = getValFromCacheAndUpdatedDownstreamDeps(store, state);\n\n if (cachedVal != null) {\n setExecutionInfo(cachedVal, store);\n return cachedVal;\n }\n\n const inProgressExecutionInfo = getExecutionInfoOfInProgressExecution(store, state); // FIXME: this won't work with custom caching b/c it uses separate cache\n\n if (inProgressExecutionInfo) {\n const executionInfo = inProgressExecutionInfo;\n notifyStoreWhenAsyncSettles(store, Recoil_nullthrows(executionInfo.latestLoadable), Recoil_nullthrows(executionInfo.latestExecutionId)); // FIXME: check after the fact to see if we made the right choice by waiting\n\n return Recoil_nullthrows(executionInfo.latestLoadable);\n }\n\n return getValFromRunningNewExecutionAndUpdatedDeps(store, state);\n }\n /**\n * Searches execution info across all stores to see if there is an in-progress\n * execution whose dependency values match the values of the requesting store.\n */\n\n\n function getExecutionInfoOfInProgressExecution(store, state) {\n var _Array$from$find;\n\n const [, executionInfo] = (_Array$from$find = Array.from(executionInfoMap.entries()).find(([, executionInfo]) => {\n return executionInfo.latestLoadable != null && executionInfo.latestExecutionId != null && !haveAsyncDepsChanged(store, state);\n })) !== null && _Array$from$find !== void 0 ? _Array$from$find : [];\n return executionInfo;\n }\n\n const mapOfCheckedVersions = new Map();\n\n function haveAsyncDepsChanged(store, state) {\n var _executionInfo$depVal, _mapOfCheckedVersions;\n\n const executionInfo = getExecutionInfo(store);\n const oldDepValues = (_executionInfo$depVal = executionInfo.depValuesDiscoveredSoFarDuringAsyncWork) !== null && _executionInfo$depVal !== void 0 ? _executionInfo$depVal : new Map();\n const cachedDepValuesCheckedForThisVersion = Array(((_mapOfCheckedVersions = mapOfCheckedVersions.get(state.version)) !== null && _mapOfCheckedVersions !== void 0 ? _mapOfCheckedVersions : new Map()).entries());\n const isCachedVersionSame = mapOfCheckedVersions.has(state.version) && cachedDepValuesCheckedForThisVersion.length === oldDepValues.size && cachedDepValuesCheckedForThisVersion.every(([nodeKey, nodeVal]) => {\n return oldDepValues.get(nodeKey) === nodeVal;\n });\n\n if (oldDepValues == null || state.version === executionInfo.stateVersion || isCachedVersionSame) {\n return false;\n }\n\n mapOfCheckedVersions.set(state.version, new Map(oldDepValues));\n return Array.from(oldDepValues).some(([nodeKey, oldVal]) => {\n const loadable = getCachedNodeLoadable(store, state, nodeKey);\n return loadable.contents !== oldVal.contents &&\n /**\n * FIXME: in the condition below we're making the assumption that a\n * dependency that goes from loading to having a value is always because\n * the dependency resolved to that value, so we don't count it as a dep\n * change as the normal retry loop will handle retrying in response to a\n * resolved async dep. This is an incorrect assumption for the edge case\n * where there is an async selector that is loading, and while it is\n * loading one of its dependencies changes, triggering a new execution,\n * and that new execution produces a value synchronously (we don't make\n * that assumption for asynchronous work b/c it's guaranteed that a\n * loadable that goes from 'loading' to 'loading' in a new loadable is\n * a dep change).\n */\n !(oldVal.state === 'loading' && loadable.state !== 'loading');\n });\n }\n /**\n * This function will update the selector's execution info when the selector\n * has either finished running an execution or has started a new execution. If\n * the given loadable is in a 'loading' state, the intention is that a new\n * execution has started. Otherwise, the intention is that an execution has\n * just finished.\n */\n\n\n function setExecutionInfo(loadable, store, depValues, newExecutionId, state) {\n const executionInfo = getExecutionInfo(store);\n\n if (loadable.state === 'loading') {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = depValues;\n executionInfo.latestExecutionId = newExecutionId;\n executionInfo.latestLoadable = loadable;\n executionInfo.stateVersion = state === null || state === void 0 ? void 0 : state.version;\n } else {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = null;\n executionInfo.latestExecutionId = null;\n executionInfo.latestLoadable = null;\n executionInfo.stateVersion = null;\n }\n }\n /**\n * Conditionally updates the cache with a given loadable.\n *\n * We only cache loadables that are not loading because our cache keys are\n * based on dep values, which are in an unfinished state for loadables that\n * have a 'loading' state (new deps may be discovered while the selector\n * runs its async code). We never want to cache partial dependencies b/c it\n * could lead to errors, such as prematurely returning the result based on a\n * partial list of deps-- we need the full list of deps to ensure that we\n * are returning the correct result from cache.\n */\n\n\n function maybeSetCacheWithLoadable(state, depRoute, loadable) {\n if (loadable.state !== 'loading') {\n setCache(state, depRoute, loadable);\n }\n }\n\n function updateExecutionInfoDepValues(depValues, store, executionId) {\n const executionInfo = getExecutionInfo(store);\n\n if (isLatestExecution(store, executionId)) {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = depValues;\n }\n }\n\n function clearExecutionInfo(store, executionId) {\n if (isLatestExecution(store, executionId)) {\n executionInfoMap.delete(store);\n }\n }\n\n function isLatestExecution(store, executionId) {\n const executionInfo = getExecutionInfo(store);\n return executionId === executionInfo.latestExecutionId;\n }\n\n function maybeFreezeLoadableContents(loadable) {\n if (loadable.state !== 'loading') {\n maybeFreezeValue(loadable.contents);\n }\n }\n\n function maybeFreezeValue(val) {\n if (process.env.NODE_ENV !== \"production\") {\n if (Boolean(options.dangerouslyAllowMutability) === false) {\n Recoil_deepFreezeValue(val);\n }\n }\n }\n\n function setCache(state, cacheRoute, loadable) {\n state.atomValues.set(key, loadable);\n cache.set(cacheRoute, loadable);\n }\n\n function detectCircularDependencies(fn) {\n if (dependencyStack.includes(key)) {\n const message = `Recoil selector has circular dependencies: ${dependencyStack.slice(dependencyStack.indexOf(key)).join(' \\u2192 ')}`;\n return loadableWithError$1(new Error(message));\n }\n\n dependencyStack.push(key);\n\n try {\n return fn();\n } finally {\n dependencyStack.pop();\n }\n }\n\n function selectorPeek(store, state) {\n const cacheVal = cache.get(nodeKey => {\n !(typeof nodeKey === 'string') ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Cache nodeKey is type string') : Recoil_invariant(false) : void 0;\n const peek = peekNodeLoadable$1(store, state, nodeKey);\n return peek === null || peek === void 0 ? void 0 : peek.contents;\n });\n return cacheVal;\n }\n\n function selectorGet(store, state) {\n return detectCircularDependencies(() => getSelectorValAndUpdatedDeps(store, state));\n }\n\n function invalidateSelector(state) {\n state.atomValues.delete(key);\n }\n\n if (set != null) {\n function selectorSet(store, state, newValue) {\n let syncSelectorSetFinished = false;\n const writes = new Map();\n\n function getRecoilValue({\n key\n }) {\n if (syncSelectorSetFinished) {\n throw new Error('Recoil: Async selector sets are not currently supported.');\n }\n\n const loadable = getCachedNodeLoadable(store, state, key);\n\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n throw new RecoilValueNotReady$2(key);\n } else {\n throw loadable.contents;\n }\n }\n\n function setRecoilState(recoilState, valueOrUpdater) {\n if (syncSelectorSetFinished) {\n throw new Error('Recoil: Async selector sets are not currently supported.');\n }\n\n const newValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict type S from being a function itself without losing support for opaque types\n // flowlint-next-line unclear-type:off\n valueOrUpdater(getRecoilValue(recoilState)) : valueOrUpdater;\n const upstreamWrites = setNodeValue$3(store, state, recoilState.key, newValue);\n upstreamWrites.forEach((v, k) => writes.set(k, v));\n }\n\n function resetRecoilState(recoilState) {\n setRecoilState(recoilState, DEFAULT_VALUE$3);\n }\n\n const ret = set({\n set: setRecoilState,\n get: getRecoilValue,\n reset: resetRecoilState\n }, newValue); // set should be a void method, but if the user makes it `async`, then it\n // will return a Promise, which we don't currently support.\n\n if (ret !== undefined) {\n throw Recoil_isPromise(ret) ? new Error('Recoil: Async selector sets are not currently supported.') : new Error('Recoil: selector set should be a void function.');\n }\n\n syncSelectorSetFinished = true;\n return writes;\n }\n\n return registerNode$1({\n key,\n peek: selectorPeek,\n get: selectorGet,\n set: selectorSet,\n init: selectorInit,\n invalidate: invalidateSelector,\n shouldDeleteConfigOnRelease: selectorShouldDeleteConfigOnRelease,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false,\n retainedBy\n });\n } else {\n return registerNode$1({\n key,\n peek: selectorPeek,\n get: selectorGet,\n init: selectorInit,\n invalidate: invalidateSelector,\n shouldDeleteConfigOnRelease: selectorShouldDeleteConfigOnRelease,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false,\n retainedBy\n });\n }\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selector = selector;\n\n// @fb-only: const {scopedAtom} = require('Recoil_ScopedAtom');\nconst {\n loadableWithError: loadableWithError$2,\n loadableWithPromise: loadableWithPromise$2,\n loadableWithValue: loadableWithValue$2\n} = Recoil_Loadable;\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$4,\n DefaultValue: DefaultValue$2,\n getConfigDeletionHandler: getConfigDeletionHandler$2,\n registerNode: registerNode$2,\n setConfigDeletionHandler: setConfigDeletionHandler$1\n} = Recoil_Node;\n\nconst {\n isRecoilValue: isRecoilValue$4\n} = Recoil_RecoilValue$1;\n\nconst {\n markRecoilValueModified: markRecoilValueModified$1,\n setRecoilValue: setRecoilValue$3,\n setRecoilValueLoadable: setRecoilValueLoadable$3\n} = Recoil_RecoilValueInterface;\n\nconst {\n retainedByOptionWithDefault: retainedByOptionWithDefault$2\n} = Recoil_Retention;\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction baseAtom(options) {\n const {\n key,\n persistence_UNSTABLE: persistence\n } = options;\n const retainedBy = retainedByOptionWithDefault$2(options.retainedBy_UNSTABLE);\n let liveStoresCount = 0;\n let defaultLoadable = Recoil_isPromise(options.default) ? loadableWithPromise$2(options.default.then(value => {\n defaultLoadable = loadableWithValue$2(value); // TODO Temporary disable Flow due to pending selector_NEW refactor\n\n const promiseInfo = {\n __key: key,\n __value: value\n };\n return promiseInfo;\n }).catch(error => {\n defaultLoadable = loadableWithError$2(error);\n throw error;\n })) : loadableWithValue$2(options.default);\n let cachedAnswerForUnvalidatedValue = undefined; // Cleanup handlers for this atom\n // Rely on stable reference equality of the store to use it as a key per \n\n const cleanupEffectsByStore = new Map();\n\n function wrapPendingPromise(store, promise) {\n const wrappedPromise = promise.then(value => {\n var _store$getState$nextT, _state$atomValues$get;\n\n const state = (_store$getState$nextT = store.getState().nextTree) !== null && _store$getState$nextT !== void 0 ? _store$getState$nextT : store.getState().currentTree;\n\n if (((_state$atomValues$get = state.atomValues.get(key)) === null || _state$atomValues$get === void 0 ? void 0 : _state$atomValues$get.contents) === wrappedPromise) {\n setRecoilValue$3(store, node, value);\n }\n\n return {\n __key: key,\n __value: value\n };\n }).catch(error => {\n var _store$getState$nextT2, _state$atomValues$get2;\n\n const state = (_store$getState$nextT2 = store.getState().nextTree) !== null && _store$getState$nextT2 !== void 0 ? _store$getState$nextT2 : store.getState().currentTree;\n\n if (((_state$atomValues$get2 = state.atomValues.get(key)) === null || _state$atomValues$get2 === void 0 ? void 0 : _state$atomValues$get2.contents) === wrappedPromise) {\n setRecoilValueLoadable$3(store, node, loadableWithError$2(error));\n }\n\n throw error;\n });\n return wrappedPromise;\n }\n\n function initAtom(store, initState, trigger) {\n liveStoresCount++;\n const alreadyKnown = store.getState().knownAtoms.has(key);\n store.getState().knownAtoms.add(key); // Setup async defaults to notify subscribers when they resolve\n\n if (defaultLoadable.state === 'loading') {\n const notifyDefaultSubscribers = () => {\n var _store$getState$nextT3;\n\n const state = (_store$getState$nextT3 = store.getState().nextTree) !== null && _store$getState$nextT3 !== void 0 ? _store$getState$nextT3 : store.getState().currentTree;\n\n if (!state.atomValues.has(key)) {\n markRecoilValueModified$1(store, node);\n }\n };\n\n defaultLoadable.contents.then(notifyDefaultSubscribers).catch(notifyDefaultSubscribers);\n } // Run Atom Effects\n // This state is scoped by Store, since this is in the initAtom() closure\n\n\n let initValue = DEFAULT_VALUE$4;\n let pendingSetSelf = null;\n\n if (options.effects_UNSTABLE != null && !alreadyKnown) {\n let duringInit = true;\n\n const setSelf = effect => valueOrUpdater => {\n if (duringInit) {\n const currentValue = initValue instanceof DefaultValue$2 || Recoil_isPromise(initValue) ? defaultLoadable.state === 'hasValue' ? defaultLoadable.contents : DEFAULT_VALUE$4 : initValue;\n initValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict T from being a function without losing support for opaque types\n valueOrUpdater(currentValue) // flowlint-line unclear-type:off\n : valueOrUpdater;\n } else {\n if (Recoil_isPromise(valueOrUpdater)) {\n throw new Error('Setting atoms to async values is not implemented.');\n }\n\n if (typeof valueOrUpdater !== 'function') {\n pendingSetSelf = {\n effect,\n value: valueOrUpdater\n };\n }\n\n setRecoilValue$3(store, node, typeof valueOrUpdater === 'function' ? currentValue => {\n const newValue = // cast to any because we can't restrict T from being a function without losing support for opaque types\n valueOrUpdater(currentValue); // flowlint-line unclear-type:off\n\n pendingSetSelf = {\n effect,\n value: newValue\n };\n return newValue;\n } : valueOrUpdater);\n }\n };\n\n const resetSelf = effect => () => setSelf(effect)(DEFAULT_VALUE$4);\n\n const onSet = effect => handler => {\n store.subscribeToTransactions(currentStore => {\n var _pendingSetSelf3;\n\n // eslint-disable-next-line prefer-const\n let {\n currentTree,\n previousTree\n } = currentStore.getState();\n\n if (!previousTree) {\n Recoil_recoverableViolation('Transaction subscribers notified without a next tree being present -- this is a bug in Recoil');\n previousTree = currentTree; // attempt to trundle on\n }\n\n const newLoadable = currentTree.atomValues.get(key);\n\n if (newLoadable == null || newLoadable.state === 'hasValue') {\n var _previousTree$atomVal, _pendingSetSelf, _pendingSetSelf2;\n\n const newValue = newLoadable != null ? newLoadable.contents : DEFAULT_VALUE$4;\n const oldLoadable = (_previousTree$atomVal = previousTree.atomValues.get(key)) !== null && _previousTree$atomVal !== void 0 ? _previousTree$atomVal : defaultLoadable;\n const oldValue = oldLoadable.state === 'hasValue' ? oldLoadable.contents : DEFAULT_VALUE$4; // TODO This isn't actually valid, use as a placeholder for now.\n // Ignore atom value changes that were set via setSelf() in the same effect.\n // We will still properly call the handler if there was a subsequent\n // set from something other than an atom effect which was batched\n // with the `setSelf()` call. However, we may incorrectly ignore\n // the handler if the subsequent batched call happens to set the\n // atom to the exact same value as the `setSelf()`. But, in that\n // case, it was kind of a noop, so the semantics are debatable..\n\n if (((_pendingSetSelf = pendingSetSelf) === null || _pendingSetSelf === void 0 ? void 0 : _pendingSetSelf.effect) !== effect || ((_pendingSetSelf2 = pendingSetSelf) === null || _pendingSetSelf2 === void 0 ? void 0 : _pendingSetSelf2.value) !== newValue) {\n handler(newValue, oldValue);\n }\n }\n\n if (((_pendingSetSelf3 = pendingSetSelf) === null || _pendingSetSelf3 === void 0 ? void 0 : _pendingSetSelf3.effect) === effect) {\n pendingSetSelf = null;\n }\n }, key);\n };\n\n for (const effect of (_options$effects_UNST = options.effects_UNSTABLE) !== null && _options$effects_UNST !== void 0 ? _options$effects_UNST : []) {\n var _options$effects_UNST;\n\n const cleanup = effect({\n node,\n trigger,\n setSelf: setSelf(effect),\n resetSelf: resetSelf(effect),\n onSet: onSet(effect)\n });\n\n if (cleanup != null) {\n cleanupEffectsByStore.set(store, cleanup);\n }\n }\n\n duringInit = false;\n } // Mutate initial state in place since we know there are no other subscribers\n // since we are the ones initializing on first use.\n\n\n if (!(initValue instanceof DefaultValue$2)) {\n var _store$getState$nextT4;\n\n const initLoadable = Recoil_isPromise(initValue) ? loadableWithPromise$2(wrapPendingPromise(store, initValue)) : loadableWithValue$2(initValue);\n initState.atomValues.set(key, initLoadable); // If there is a pending transaction, then also mutate the next state tree.\n // This could happen if the atom was first initialized in an action that\n // also updated some other atom's state.\n\n (_store$getState$nextT4 = store.getState().nextTree) === null || _store$getState$nextT4 === void 0 ? void 0 : _store$getState$nextT4.atomValues.set(key, initLoadable);\n }\n\n return () => {\n var _cleanupEffectsByStor;\n\n liveStoresCount--;\n (_cleanupEffectsByStor = cleanupEffectsByStore.get(store)) === null || _cleanupEffectsByStor === void 0 ? void 0 : _cleanupEffectsByStor();\n cleanupEffectsByStore.delete(store);\n store.getState().knownAtoms.delete(key); // FIXME remove knownAtoms?\n };\n }\n\n function peekAtom(_store, state) {\n var _ref, _state$atomValues$get3, _cachedAnswerForUnval;\n\n return (_ref = (_state$atomValues$get3 = state.atomValues.get(key)) !== null && _state$atomValues$get3 !== void 0 ? _state$atomValues$get3 : (_cachedAnswerForUnval = cachedAnswerForUnvalidatedValue) === null || _cachedAnswerForUnval === void 0 ? void 0 : _cachedAnswerForUnval[1]) !== null && _ref !== void 0 ? _ref : defaultLoadable;\n }\n\n function getAtom(_store, state) {\n if (state.atomValues.has(key)) {\n // Atom value is stored in state:\n return Recoil_nullthrows(state.atomValues.get(key));\n } else if (state.nonvalidatedAtoms.has(key)) {\n // Atom value is stored but needs validation before use.\n // We might have already validated it and have a cached validated value:\n if (cachedAnswerForUnvalidatedValue != null) {\n return cachedAnswerForUnvalidatedValue;\n }\n\n if (persistence == null) {\n Recoil_expectationViolation(`Tried to restore a persisted value for atom ${key} but it has no persistence settings.`);\n return defaultLoadable;\n }\n\n const nonvalidatedValue = state.nonvalidatedAtoms.get(key);\n const validatorResult = persistence.validator(nonvalidatedValue, DEFAULT_VALUE$4);\n const validatedValueLoadable = validatorResult instanceof DefaultValue$2 ? defaultLoadable : loadableWithValue$2(validatorResult);\n cachedAnswerForUnvalidatedValue = validatedValueLoadable;\n return cachedAnswerForUnvalidatedValue;\n } else {\n return defaultLoadable;\n }\n }\n\n function invalidateAtom() {\n cachedAnswerForUnvalidatedValue = undefined;\n }\n\n function setAtom(_store, state, newValue) {\n // Bail out if we're being set to the existing value, or if we're being\n // reset but have no stored value (validated or unvalidated) to reset from:\n if (state.atomValues.has(key)) {\n const existing = Recoil_nullthrows(state.atomValues.get(key));\n\n if (existing.state === 'hasValue' && newValue === existing.contents) {\n return new Map();\n }\n } else if (!state.nonvalidatedAtoms.has(key) && newValue instanceof DefaultValue$2) {\n return new Map();\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (options.dangerouslyAllowMutability !== true) {\n Recoil_deepFreezeValue(newValue);\n }\n }\n\n cachedAnswerForUnvalidatedValue = undefined; // can be released now if it was previously in use\n\n return new Map().set(key, loadableWithValue$2(newValue));\n }\n\n function shouldDeleteConfigOnReleaseAtom() {\n return getConfigDeletionHandler$2(key) !== undefined && liveStoresCount <= 0;\n }\n\n const node = registerNode$2({\n key,\n peek: peekAtom,\n get: getAtom,\n set: setAtom,\n init: initAtom,\n invalidate: invalidateAtom,\n shouldDeleteConfigOnRelease: shouldDeleteConfigOnReleaseAtom,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n persistence_UNSTABLE: options.persistence_UNSTABLE ? {\n type: options.persistence_UNSTABLE.type,\n backButton: options.persistence_UNSTABLE.backButton\n } : undefined,\n shouldRestoreFromSnapshots: true,\n retainedBy\n });\n return node;\n} // prettier-ignore\n\n\nfunction atom(options) {\n const {\n default: optionsDefault,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n ...restOptions\n } = options;\n\n if (isRecoilValue$4(optionsDefault) // Continue to use atomWithFallback for promise defaults for scoped atoms\n // for now, since scoped atoms don't support async defaults\n // @fb-only: || (isPromise(optionsDefault) && scopeRules_APPEND_ONLY_READ_THE_DOCS)\n ) {\n return atomWithFallback({ ...restOptions,\n default: optionsDefault // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n\n }); // @fb-only: } else if (scopeRules_APPEND_ONLY_READ_THE_DOCS && !isPromise(optionsDefault)) {\n // @fb-only: return scopedAtom({\n // @fb-only: ...restOptions,\n // @fb-only: default: optionsDefault,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: });\n } else {\n return baseAtom({ ...restOptions,\n default: optionsDefault\n });\n }\n}\n\nfunction atomWithFallback(options) {\n const base = atom({ ...options,\n default: DEFAULT_VALUE$4,\n persistence_UNSTABLE: options.persistence_UNSTABLE === undefined ? undefined : { ...options.persistence_UNSTABLE,\n validator: storedValue => storedValue instanceof DefaultValue$2 ? storedValue : Recoil_nullthrows(options.persistence_UNSTABLE).validator(storedValue, DEFAULT_VALUE$4)\n },\n // TODO Hack for now.\n // flowlint-next-line unclear-type: off\n effects_UNSTABLE: options.effects_UNSTABLE\n });\n const sel = Recoil_selector({\n key: `${options.key}__withFallback`,\n get: ({\n get\n }) => {\n const baseValue = get(base);\n return baseValue instanceof DefaultValue$2 ? options.default : baseValue;\n },\n set: ({\n set\n }, newValue) => set(base, newValue),\n dangerouslyAllowMutability: options.dangerouslyAllowMutability\n });\n setConfigDeletionHandler$1(sel.key, getConfigDeletionHandler$2(options.key));\n return sel;\n}\n\nvar Recoil_atom = atom;\n\n/**\n * (c) Facebook, Inc. and its affiliates. Confidential and proprietary.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nclass MapCache {\n constructor(options) {\n var _options$mapKey;\n\n _defineProperty(this, \"_map\", void 0);\n\n _defineProperty(this, \"_keyMapper\", void 0);\n\n this._map = new Map();\n this._keyMapper = (_options$mapKey = options === null || options === void 0 ? void 0 : options.mapKey) !== null && _options$mapKey !== void 0 ? _options$mapKey : v => v;\n }\n\n size() {\n return this._map.size;\n }\n\n has(key) {\n return this._map.has(this._keyMapper(key));\n }\n\n get(key) {\n return this._map.get(this._keyMapper(key));\n }\n\n set(key, val) {\n this._map.set(this._keyMapper(key), val);\n }\n\n delete(key) {\n this._map.delete(this._keyMapper(key));\n }\n\n clear() {\n this._map.clear();\n }\n\n}\n\nvar Recoil_MapCache = {\n MapCache\n};\n\nvar Recoil_MapCache_1 = Recoil_MapCache.MapCache;\n\nvar Recoil_MapCache$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MapCache: Recoil_MapCache_1\n});\n\nconst {\n LRUCache: LRUCache$2\n} = Recoil_LRUCache$1;\n\nconst {\n MapCache: MapCache$1\n} = Recoil_MapCache$1;\n\nconst defaultPolicy$1 = {\n equality: 'reference',\n eviction: 'none',\n maxSize: Infinity\n};\n\nfunction cacheFromPolicy({\n equality = defaultPolicy$1.equality,\n eviction = defaultPolicy$1.eviction,\n maxSize = defaultPolicy$1.maxSize\n} = defaultPolicy$1) {\n const valueMapper = getValueMapper$1(equality);\n const cache = getCache(eviction, maxSize, valueMapper);\n return cache;\n}\n\nfunction getValueMapper$1(equality) {\n switch (equality) {\n case 'reference':\n return val => val;\n\n case 'value':\n return val => Recoil_stableStringify(val);\n }\n\n throw new Error(`Unrecognized equality policy ${equality}`);\n}\n\nfunction getCache(eviction, maxSize, mapKey) {\n switch (eviction) {\n case 'none':\n return new MapCache$1({\n mapKey\n });\n\n case 'lru':\n return new LRUCache$2({\n mapKey,\n maxSize: Recoil_nullthrows(maxSize)\n });\n }\n\n throw new Error(`Unrecognized eviction policy ${eviction}`);\n}\n\nvar Recoil_cacheFromPolicy = cacheFromPolicy;\n\nconst {\n setConfigDeletionHandler: setConfigDeletionHandler$2\n} = Recoil_Node;\n\n\n\n // Keep in mind the parameter needs to be serializable as a cahche key\n// using Recoil_stableStringify\n\n\n// Add a unique index to each selector in case the cache implementation allows\n// duplicate keys based on equivalent stringified parameters\nlet nextIndex = 0;\n/* eslint-disable no-redeclare */\n\n// Return a function that returns members of a family of selectors of the same type\n// E.g.,\n//\n// const s = selectorFamily(...);\n// s({a: 1}) => a selector\n// s({a: 2}) => a different selector\n//\n// By default, the selectors are distinguished by distinct values of the\n// parameter based on value equality, not reference equality. This allows using\n// object literals or other equivalent objects at callsites to not create\n// duplicate cache entries. This behavior may be overridden with the\n// cacheImplementationForParams option.\nfunction selectorFamily(options) {\n var _options$cachePolicyF;\n\n const selectorCache = Recoil_cacheFromPolicy((_options$cachePolicyF = options.cachePolicyForParams_UNSTABLE) !== null && _options$cachePolicyF !== void 0 ? _options$cachePolicyF : {\n equality: 'value',\n eviction: 'none'\n });\n return params => {\n var _stableStringify;\n\n const cachedSelector = selectorCache.get(params);\n\n if (cachedSelector != null) {\n return cachedSelector;\n }\n\n const myKey = `${options.key}__selectorFamily/${(_stableStringify = Recoil_stableStringify(params, {\n // It is possible to use functions in parameters if the user uses\n // a cache with reference equality thanks to the incrementing index.\n allowFunctions: true\n })) !== null && _stableStringify !== void 0 ? _stableStringify : 'void'}/${nextIndex++}`; // Append index in case values serialize to the same key string\n\n const myGet = callbacks => options.get(params)(callbacks);\n\n const myCachePolicy = options.cachePolicy_UNSTABLE;\n const retainedBy = typeof options.retainedBy_UNSTABLE === 'function' ? options.retainedBy_UNSTABLE(params) : options.retainedBy_UNSTABLE;\n let newSelector;\n\n if (options.set != null) {\n const set = options.set;\n\n const mySet = (callbacks, newValue) => set(params)(callbacks, newValue);\n\n newSelector = Recoil_selector({\n key: myKey,\n get: myGet,\n set: mySet,\n cachePolicy_UNSTABLE: myCachePolicy,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: retainedBy\n });\n } else {\n newSelector = Recoil_selector({\n key: myKey,\n get: myGet,\n cachePolicy_UNSTABLE: myCachePolicy,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: retainedBy\n });\n }\n\n selectorCache.set(params, newSelector);\n setConfigDeletionHandler$2(newSelector.key, () => {\n selectorCache.delete(params);\n });\n return newSelector;\n };\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selectorFamily = selectorFamily;\n\n// @fb-only: const {parameterizedScopedAtomLegacy} = require('Recoil_ScopedAtom');\n\n\nconst {\n DEFAULT_VALUE: DEFAULT_VALUE$5,\n DefaultValue: DefaultValue$3,\n setConfigDeletionHandler: setConfigDeletionHandler$3\n} = Recoil_Node;\n/*\nA function which returns an atom based on the input parameter.\n\nEach unique parameter returns a unique atom. E.g.,\n\n const f = atomFamily(...);\n f({a: 1}) => an atom\n f({a: 2}) => a different atom\n\nThis allows components to persist local, private state using atoms. Each\ninstance of the component may have a different key, which it uses as the\nparameter for a family of atoms; in this way, each component will have\nits own atom not shared by other instances. These state keys may be composed\ninto children's state keys as well.\n*/\n\n\nfunction atomFamily(options) {\n var _options$cachePolicyF;\n\n const atomCache = Recoil_cacheFromPolicy((_options$cachePolicyF = options.cachePolicyForParams_UNSTABLE) !== null && _options$cachePolicyF !== void 0 ? _options$cachePolicyF : {\n equality: 'value',\n eviction: 'none'\n }); // An atom to represent any legacy atoms that we can upgrade to an atomFamily\n\n const legacyAtomOptions = {\n key: options.key,\n // Legacy atoms just used the plain key directly\n default: DEFAULT_VALUE$5,\n persistence_UNSTABLE: options.persistence_UNSTABLE\n };\n let legacyAtom; // prettier-ignore\n // @fb-only: if (\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS\n // @fb-only: ) {\n // @fb-only: legacyAtom = parameterizedScopedAtomLegacy({\n // @fb-only: ...legacyAtomOptions,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS:\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: });\n // @fb-only: } else {\n\n legacyAtom = Recoil_atom(legacyAtomOptions); // @fb-only: }\n // Selector to calculate the default value based on any persisted legacy atoms\n // that were upgraded to a atomFamily\n\n const atomFamilyDefault = Recoil_selectorFamily({\n key: `${options.key}__atomFamily/Default`,\n get: param => ({\n get\n }) => {\n const legacyValue = get(typeof legacyAtom === 'function' ? legacyAtom(param) : legacyAtom); // Atom was upgraded from a non-parameterized atom\n\n if (!(legacyValue instanceof DefaultValue$3)) {\n return legacyValue;\n } // There's no legacy atom value, so use the user-specified default\n\n\n return typeof options.default === 'function' ? // The default was parameterized\n // Flow doesn't know that T isn't a function, so we need to case to any\n options.default(param) // flowlint-line unclear-type:off\n : // Default may be a static value, promise, or RecoilValue\n options.default;\n },\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n retainedBy_UNSTABLE: options.retainedBy_UNSTABLE\n }); // Simple atomFamily implementation to cache individual atoms based\n // on the parameter value equality.\n\n return params => {\n var _stableStringify;\n\n const cachedAtom = atomCache.get(params);\n\n if (cachedAtom != null) {\n return cachedAtom;\n }\n\n const {\n cachePolicyForParams_UNSTABLE,\n ...atomOptions\n } = options;\n const newAtom = Recoil_atom({ ...atomOptions,\n key: `${options.key}__${(_stableStringify = Recoil_stableStringify(params)) !== null && _stableStringify !== void 0 ? _stableStringify : 'void'}`,\n default: atomFamilyDefault(params),\n retainedBy_UNSTABLE: typeof options.retainedBy_UNSTABLE === 'function' ? options.retainedBy_UNSTABLE(params) : options.retainedBy_UNSTABLE,\n effects_UNSTABLE: typeof options.effects_UNSTABLE === 'function' ? options.effects_UNSTABLE(params) : options.effects_UNSTABLE // prettier-ignore\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS: mapScopeRules(\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: params,\n // @fb-only: ),\n\n });\n atomCache.set(params, newAtom);\n setConfigDeletionHandler$3(newAtom.key, () => {\n atomCache.delete(params);\n });\n return newAtom;\n };\n}\n\nvar Recoil_atomFamily = atomFamily;\n\n// flowlint-next-line unclear-type:off\n\n\nconst constantSelector = Recoil_selectorFamily({\n key: '__constant',\n get: constant => () => constant,\n cachePolicyForParams_UNSTABLE: {\n equality: 'reference'\n }\n}); // Function that returns a selector which always produces the\n// same constant value. It may be called multiple times with the\n// same value, based on reference equality, and will provide the\n// same selector.\n\nfunction constSelector(constant) {\n return constantSelector(constant);\n}\n\nvar Recoil_constSelector = constSelector;\n\n// flowlint-next-line unclear-type:off\n\n\nconst throwingSelector = Recoil_selectorFamily({\n key: '__error',\n get: message => () => {\n throw new Error(message);\n },\n cachePolicyForParams_UNSTABLE: {\n equality: 'reference'\n }\n}); // Function that returns a selector which always throws an error\n// with the provided message.\n\nfunction errorSelector(message) {\n return throwingSelector(message);\n}\n\nvar Recoil_errorSelector = errorSelector;\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Wraps another recoil value and prevents writing to it.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction readOnlySelector(atom) {\n // flowlint-next-line unclear-type: off\n return atom;\n}\n\nvar Recoil_readOnlySelector = readOnlySelector;\n\nconst {\n loadableWithError: loadableWithError$3,\n loadableWithPromise: loadableWithPromise$3,\n loadableWithValue: loadableWithValue$3\n} = Recoil_Loadable;\n\n\n\n /////////////////\n// TRUTH TABLE\n/////////////////\n// Dependencies waitForNone waitForAny waitForAll waitForAllSettled\n// [loading, loading] [Promise, Promise] Promise Promise Promise\n// [value, loading] [value, Promise] [value, Promise] Promise Promise\n// [value, value] [value, value] [value, value] [value, value] [value, value]\n//\n// [error, loading] [Error, Promise] [Error, Promise] Error Promise\n// [error, error] [Error, Error] [Error, Error] Error [error, error]\n// [value, error] [value, Error] [value, Error] Error [value, error]\n// Issue parallel requests for all dependencies and return the current\n// status if they have results, have some error, or are still pending.\n\n\nfunction concurrentRequests(getRecoilValue, deps) {\n const results = Array(deps.length).fill(undefined);\n const exceptions = Array(deps.length).fill(undefined);\n\n for (const [i, dep] of deps.entries()) {\n try {\n results[i] = getRecoilValue(dep);\n } catch (e) {\n // exceptions can either be Promises of pending results or real errors\n exceptions[i] = e;\n }\n }\n\n return [results, exceptions];\n}\n\nfunction isError(exp) {\n return exp != null && !Recoil_isPromise(exp);\n}\n\nfunction unwrapDependencies(dependencies) {\n return Array.isArray(dependencies) ? dependencies : Object.getOwnPropertyNames(dependencies).map(key => dependencies[key]);\n}\n\nfunction getValueFromLoadablePromiseResult(result) {\n if (result != null && typeof result === 'object' && result.hasOwnProperty('__value')) {\n return result.__value;\n }\n\n return result;\n}\n\nfunction wrapResults(dependencies, results) {\n return Array.isArray(dependencies) ? results : // Object.getOwnPropertyNames() has consistent key ordering with ES6\n Object.getOwnPropertyNames(dependencies).reduce((out, key, idx) => ({ ...out,\n [key]: results[idx]\n }), {});\n}\n\nfunction wrapLoadables(dependencies, results, exceptions) {\n const output = exceptions.map((exception, idx) => exception == null ? loadableWithValue$3(results[idx]) : Recoil_isPromise(exception) ? loadableWithPromise$3(exception) : loadableWithError$3(exception));\n return wrapResults(dependencies, output);\n}\n\nfunction combineAsyncResultsWithSyncResults(syncResults, asyncResults) {\n return asyncResults.map((result, idx) =>\n /**\n * it's important we use === undefined as opposed to == null, because the\n * resolved value of the async promise could be `null`, in which case we\n * don't want to use syncResults[idx], which would be undefined. If async\n * promise resolves to `undefined`, that's ok because `syncResults[idx]`\n * will also be `undefined`. That's a little hacky, but it works.\n */\n result === undefined ? syncResults[idx] : result);\n} // Selector that requests all dependencies in parallel and immediately returns\n// current results without waiting.\n\n\nconst waitForNone = Recoil_selectorFamily({\n key: '__waitForNone',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // Always return the current status of the results; never block.\n\n return wrapLoadables(dependencies, results, exceptions);\n }\n}); // Selector that requests all dependencies in parallel and waits for at least\n// one to be available before returning results. It will only error if all\n// dependencies have errors.\n\nconst waitForAny = Recoil_selectorFamily({\n key: '__waitForAny',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If any results are available, value or error, return the current status\n\n if (exceptions.some(exp => !Recoil_isPromise(exp))) {\n return wrapLoadables(dependencies, results, exceptions);\n } // Otherwise, return a promise that will resolve when the next result is\n // available, whichever one happens to be next. But, if all pending\n // dependencies end up with errors, then reject the promise.\n\n\n return new Promise(resolve => {\n for (const [i, exp] of exceptions.entries()) {\n if (Recoil_isPromise(exp)) {\n exp.then(result => {\n results[i] = getValueFromLoadablePromiseResult(result);\n exceptions[i] = undefined;\n resolve(wrapLoadables(dependencies, results, exceptions));\n }).catch(error => {\n exceptions[i] = error;\n resolve(wrapLoadables(dependencies, results, exceptions));\n });\n }\n }\n });\n }\n}); // Selector that requests all dependencies in parallel and waits for all to be\n// available before returning a value. It will error if any dependencies error.\n\nconst waitForAll = Recoil_selectorFamily({\n key: '__waitForAll',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If all results are available, return the results\n\n if (exceptions.every(exp => exp == null)) {\n return wrapResults(dependencies, results);\n } // If we have any errors, throw the first error\n\n\n const error = exceptions.find(isError);\n\n if (error != null) {\n throw error;\n } // Otherwise, return a promise that will resolve when all results are available\n\n\n return Promise.all(exceptions).then(exceptionResults => wrapResults(dependencies, combineAsyncResultsWithSyncResults(results, exceptionResults).map(getValueFromLoadablePromiseResult)));\n }\n});\nconst waitForAllSettled = Recoil_selectorFamily({\n key: '__waitForAllSettled',\n get: dependencies => ({\n get\n }) => {\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n const deps = unwrapDependencies(dependencies);\n const [results, exceptions] = concurrentRequests(get, deps); // If all results are available, return the results\n\n if (exceptions.every(exp => !Recoil_isPromise(exp))) {\n return wrapLoadables(dependencies, results, exceptions);\n } // Wait for all results to settle\n\n\n return Promise.all(exceptions.map((exp, i) => Recoil_isPromise(exp) ? exp.then(result => {\n results[i] = getValueFromLoadablePromiseResult(result);\n exceptions[i] = undefined;\n }).catch(error => {\n results[i] = undefined;\n exceptions[i] = error;\n }) : null)) // Then wrap them as loadables\n .then(() => wrapLoadables(dependencies, results, exceptions));\n }\n});\nconst noWait = Recoil_selectorFamily({\n key: '__noWait',\n get: dependency => ({\n get\n }) => {\n try {\n return loadableWithValue$3(get(dependency));\n } catch (exception) {\n return Recoil_isPromise(exception) ? loadableWithPromise$3(exception) : loadableWithError$3(exception);\n }\n }\n});\nvar Recoil_WaitFor = {\n waitForNone,\n waitForAny,\n waitForAll,\n waitForAllSettled,\n noWait\n};\n\nconst {\n batchUpdates: batchUpdates$3,\n setBatcher: setBatcher$1\n} = Recoil_Batching;\n\nconst {\n DefaultValue: DefaultValue$4\n} = Recoil_Node;\n\nconst {\n RecoilRoot: RecoilRoot$2\n} = Recoil_RecoilRoot_react;\n\nconst {\n isRecoilValue: isRecoilValue$5\n} = Recoil_RecoilValue$1;\n\nconst {\n retentionZone: retentionZone$1\n} = Recoil_RetentionZone;\n\nconst {\n freshSnapshot: freshSnapshot$2\n} = Recoil_Snapshot$1;\n\nconst {\n useGotoRecoilSnapshot: useGotoRecoilSnapshot$1,\n useRecoilCallback: useRecoilCallback$1,\n useRecoilSnapshot: useRecoilSnapshot$1,\n useRecoilState: useRecoilState$1,\n useRecoilStateLoadable: useRecoilStateLoadable$1,\n useRecoilTransactionObserver: useRecoilTransactionObserver$1,\n useRecoilValue: useRecoilValue$1,\n useRecoilValueLoadable: useRecoilValueLoadable$1,\n useResetRecoilState: useResetRecoilState$1,\n useRetain: useRetain$1,\n useSetRecoilState: useSetRecoilState$1,\n useSetUnvalidatedAtomValues: useSetUnvalidatedAtomValues$1,\n useTransactionObservation_DEPRECATED: useTransactionObservation_DEPRECATED$1\n} = Recoil_Hooks;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n noWait: noWait$1,\n waitForAll: waitForAll$1,\n waitForAllSettled: waitForAllSettled$1,\n waitForAny: waitForAny$1,\n waitForNone: waitForNone$1\n} = Recoil_WaitFor;\n\nvar Recoil_index = {\n // Types\n DefaultValue: DefaultValue$4,\n // Components\n RecoilRoot: RecoilRoot$2,\n useRecoilBridgeAcrossReactRoots_UNSTABLE: Recoil_useRecoilBridgeAcrossReactRoots,\n // RecoilValues\n atom: Recoil_atom,\n selector: Recoil_selector,\n // Other factories\n retentionZone: retentionZone$1,\n // Convenience RecoilValues\n atomFamily: Recoil_atomFamily,\n selectorFamily: Recoil_selectorFamily,\n constSelector: Recoil_constSelector,\n errorSelector: Recoil_errorSelector,\n readOnlySelector: Recoil_readOnlySelector,\n // Hooks that accept RecoilValues\n useRecoilValue: useRecoilValue$1,\n useRecoilValueLoadable: useRecoilValueLoadable$1,\n useRecoilState: useRecoilState$1,\n useRecoilStateLoadable: useRecoilStateLoadable$1,\n useSetRecoilState: useSetRecoilState$1,\n useResetRecoilState: useResetRecoilState$1,\n useGetRecoilValueInfo_UNSTABLE: Recoil_useGetRecoilValueInfo,\n useRetain: useRetain$1,\n // Hooks for asynchronous Recoil\n useRecoilCallback: useRecoilCallback$1,\n // Hooks for Snapshots\n useGotoRecoilSnapshot: useGotoRecoilSnapshot$1,\n useRecoilSnapshot: useRecoilSnapshot$1,\n useRecoilTransactionObserver_UNSTABLE: useRecoilTransactionObserver$1,\n useTransactionObservation_UNSTABLE: useTransactionObservation_DEPRECATED$1,\n useSetUnvalidatedAtomValues_UNSTABLE: useSetUnvalidatedAtomValues$1,\n // Concurrency Helpers\n noWait: noWait$1,\n waitForNone: waitForNone$1,\n waitForAny: waitForAny$1,\n waitForAll: waitForAll$1,\n waitForAllSettled: waitForAllSettled$1,\n // Other functions\n isRecoilValue: isRecoilValue$5,\n // Batching\n batchUpdates: batchUpdates$3,\n setBatcher: setBatcher$1,\n // Snapshot Utils\n snapshot_UNSTABLE: freshSnapshot$2\n};\nvar Recoil_index_1 = Recoil_index.DefaultValue;\nvar Recoil_index_2 = Recoil_index.RecoilRoot;\nvar Recoil_index_3 = Recoil_index.useRecoilBridgeAcrossReactRoots_UNSTABLE;\nvar Recoil_index_4 = Recoil_index.atom;\nvar Recoil_index_5 = Recoil_index.selector;\nvar Recoil_index_6 = Recoil_index.retentionZone;\nvar Recoil_index_7 = Recoil_index.atomFamily;\nvar Recoil_index_8 = Recoil_index.selectorFamily;\nvar Recoil_index_9 = Recoil_index.constSelector;\nvar Recoil_index_10 = Recoil_index.errorSelector;\nvar Recoil_index_11 = Recoil_index.readOnlySelector;\nvar Recoil_index_12 = Recoil_index.useRecoilValue;\nvar Recoil_index_13 = Recoil_index.useRecoilValueLoadable;\nvar Recoil_index_14 = Recoil_index.useRecoilState;\nvar Recoil_index_15 = Recoil_index.useRecoilStateLoadable;\nvar Recoil_index_16 = Recoil_index.useSetRecoilState;\nvar Recoil_index_17 = Recoil_index.useResetRecoilState;\nvar Recoil_index_18 = Recoil_index.useGetRecoilValueInfo_UNSTABLE;\nvar Recoil_index_19 = Recoil_index.useRetain;\nvar Recoil_index_20 = Recoil_index.useRecoilCallback;\nvar Recoil_index_21 = Recoil_index.useGotoRecoilSnapshot;\nvar Recoil_index_22 = Recoil_index.useRecoilSnapshot;\nvar Recoil_index_23 = Recoil_index.useRecoilTransactionObserver_UNSTABLE;\nvar Recoil_index_24 = Recoil_index.useTransactionObservation_UNSTABLE;\nvar Recoil_index_25 = Recoil_index.useSetUnvalidatedAtomValues_UNSTABLE;\nvar Recoil_index_26 = Recoil_index.noWait;\nvar Recoil_index_27 = Recoil_index.waitForNone;\nvar Recoil_index_28 = Recoil_index.waitForAny;\nvar Recoil_index_29 = Recoil_index.waitForAll;\nvar Recoil_index_30 = Recoil_index.waitForAllSettled;\nvar Recoil_index_31 = Recoil_index.isRecoilValue;\nvar Recoil_index_32 = Recoil_index.batchUpdates;\nvar Recoil_index_33 = Recoil_index.setBatcher;\nvar Recoil_index_34 = Recoil_index.snapshot_UNSTABLE;\n\nexport default Recoil_index;\nexport { Recoil_index_1 as DefaultValue, Recoil_index_2 as RecoilRoot, Recoil_index_4 as atom, Recoil_index_7 as atomFamily, Recoil_index_32 as batchUpdates, Recoil_index_9 as constSelector, Recoil_index_10 as errorSelector, Recoil_index_31 as isRecoilValue, Recoil_index_26 as noWait, Recoil_index_11 as readOnlySelector, Recoil_index_6 as retentionZone, Recoil_index_5 as selector, Recoil_index_8 as selectorFamily, Recoil_index_33 as setBatcher, Recoil_index_34 as snapshot_UNSTABLE, Recoil_index_18 as useGetRecoilValueInfo_UNSTABLE, Recoil_index_21 as useGotoRecoilSnapshot, Recoil_index_3 as useRecoilBridgeAcrossReactRoots_UNSTABLE, Recoil_index_20 as useRecoilCallback, Recoil_index_22 as useRecoilSnapshot, Recoil_index_14 as useRecoilState, Recoil_index_15 as useRecoilStateLoadable, Recoil_index_23 as useRecoilTransactionObserver_UNSTABLE, Recoil_index_12 as useRecoilValue, Recoil_index_13 as useRecoilValueLoadable, Recoil_index_17 as useResetRecoilState, Recoil_index_19 as useRetain, Recoil_index_16 as useSetRecoilState, Recoil_index_25 as useSetUnvalidatedAtomValues_UNSTABLE, Recoil_index_24 as useTransactionObservation_UNSTABLE, Recoil_index_29 as waitForAll, Recoil_index_30 as waitForAllSettled, Recoil_index_28 as waitForAny, Recoil_index_27 as waitForNone };\n","export var HandlerRole;\n\n(function (HandlerRole) {\n HandlerRole[\"SOURCE\"] = \"SOURCE\";\n HandlerRole[\"TARGET\"] = \"TARGET\";\n})(HandlerRole || (HandlerRole = {}));","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n // Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\n function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }\n\n function ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n }\n\n function isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n }\n\n function isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n }\n\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };\n","/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nexport function invariant(condition: any, format: string, ...args: any[]) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n let error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n let argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() {\n return args[argIndex++];\n })\n );\n error.name = 'Invariant Violation';\n }\n\n (error as any).framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n","export var INIT_COORDS = 'dnd-core/INIT_COORDS';\nexport var BEGIN_DRAG = 'dnd-core/BEGIN_DRAG';\nexport var PUBLISH_DRAG_SOURCE = 'dnd-core/PUBLISH_DRAG_SOURCE';\nexport var HOVER = 'dnd-core/HOVER';\nexport var DROP = 'dnd-core/DROP';\nexport var END_DRAG = 'dnd-core/END_DRAG';","import { INIT_COORDS } from '../types';\nexport function setClientOffset(clientOffset, sourceClientOffset) {\n return {\n type: INIT_COORDS,\n payload: {\n sourceClientOffset: sourceClientOffset || null,\n clientOffset: clientOffset || null\n }\n };\n}","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n// cheap lodash replacements\n\n/**\n * drop-in replacement for _.get\n * @param obj\n * @param path\n * @param defaultValue\n */\nexport function get(obj, path, defaultValue) {\n return path.split('.').reduce(function (a, c) {\n return a && a[c] ? a[c] : defaultValue || null;\n }, obj);\n}\n/**\n * drop-in replacement for _.without\n */\n\nexport function without(items, item) {\n return items.filter(function (i) {\n return i !== item;\n });\n}\n/**\n * drop-in replacement for _.isString\n * @param input\n */\n\nexport function isString(input) {\n return typeof input === 'string';\n}\n/**\n * drop-in replacement for _.isString\n * @param input\n */\n\nexport function isObject(input) {\n return _typeof(input) === 'object';\n}\n/**\n * repalcement for _.xor\n * @param itemsA\n * @param itemsB\n */\n\nexport function xor(itemsA, itemsB) {\n var map = new Map();\n\n var insertItem = function insertItem(item) {\n return map.set(item, map.has(item) ? map.get(item) + 1 : 1);\n };\n\n itemsA.forEach(insertItem);\n itemsB.forEach(insertItem);\n var result = [];\n map.forEach(function (count, key) {\n if (count === 1) {\n result.push(key);\n }\n });\n return result;\n}\n/**\n * replacement for _.intersection\n * @param itemsA\n * @param itemsB\n */\n\nexport function intersection(itemsA, itemsB) {\n return itemsA.filter(function (t) {\n return itemsB.indexOf(t) > -1;\n });\n}","import { invariant } from '@react-dnd/invariant';\nimport { setClientOffset } from './local/setClientOffset';\nimport { isObject } from '../../utils/js_utils';\nimport { BEGIN_DRAG, INIT_COORDS } from './types';\nvar ResetCoordinatesAction = {\n type: INIT_COORDS,\n payload: {\n clientOffset: null,\n sourceClientOffset: null\n }\n};\nexport default function createBeginDrag(manager) {\n return function beginDrag() {\n var sourceIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n publishSource: true\n };\n var _options$publishSourc = options.publishSource,\n publishSource = _options$publishSourc === void 0 ? true : _options$publishSourc,\n clientOffset = options.clientOffset,\n getSourceClientOffset = options.getSourceClientOffset;\n var monitor = manager.getMonitor();\n var registry = manager.getRegistry(); // Initialize the coordinates using the client offset\n\n manager.dispatch(setClientOffset(clientOffset));\n verifyInvariants(sourceIds, monitor, registry); // Get the draggable source\n\n var sourceId = getDraggableSource(sourceIds, monitor);\n\n if (sourceId === null) {\n manager.dispatch(ResetCoordinatesAction);\n return;\n } // Get the source client offset\n\n\n var sourceClientOffset = null;\n\n if (clientOffset) {\n verifyGetSourceClientOffsetIsFunction(getSourceClientOffset);\n sourceClientOffset = getSourceClientOffset(sourceId);\n } // Initialize the full coordinates\n\n\n manager.dispatch(setClientOffset(clientOffset, sourceClientOffset));\n var source = registry.getSource(sourceId);\n var item = source.beginDrag(monitor, sourceId);\n verifyItemIsObject(item);\n registry.pinSource(sourceId);\n var itemType = registry.getSourceType(sourceId);\n return {\n type: BEGIN_DRAG,\n payload: {\n itemType: itemType,\n item: item,\n sourceId: sourceId,\n clientOffset: clientOffset || null,\n sourceClientOffset: sourceClientOffset || null,\n isSourcePublic: !!publishSource\n }\n };\n };\n}\n\nfunction verifyInvariants(sourceIds, monitor, registry) {\n invariant(!monitor.isDragging(), 'Cannot call beginDrag while dragging.');\n sourceIds.forEach(function (sourceId) {\n invariant(registry.getSource(sourceId), 'Expected sourceIds to be registered.');\n });\n}\n\nfunction verifyGetSourceClientOffsetIsFunction(getSourceClientOffset) {\n invariant(typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.');\n}\n\nfunction verifyItemIsObject(item) {\n invariant(isObject(item), 'Item must be an object.');\n}\n\nfunction getDraggableSource(sourceIds, monitor) {\n var sourceId = null;\n\n for (var i = sourceIds.length - 1; i >= 0; i--) {\n if (monitor.canDragSource(sourceIds[i])) {\n sourceId = sourceIds[i];\n break;\n }\n }\n\n return sourceId;\n}","import { PUBLISH_DRAG_SOURCE } from './types';\nexport default function createPublishDragSource(manager) {\n return function publishDragSource() {\n var monitor = manager.getMonitor();\n\n if (monitor.isDragging()) {\n return {\n type: PUBLISH_DRAG_SOURCE\n };\n }\n };\n}","export default function matchesType(targetType, draggedItemType) {\n if (draggedItemType === null) {\n return targetType === null;\n }\n\n return Array.isArray(targetType) ? targetType.some(function (t) {\n return t === draggedItemType;\n }) : targetType === draggedItemType;\n}","import { invariant } from '@react-dnd/invariant';\nimport matchesType from '../../utils/matchesType';\nimport { HOVER } from './types';\nexport default function createHover(manager) {\n return function hover(targetIdsArg) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n clientOffset = _ref.clientOffset;\n\n verifyTargetIdsIsArray(targetIdsArg);\n var targetIds = targetIdsArg.slice(0);\n var monitor = manager.getMonitor();\n var registry = manager.getRegistry();\n checkInvariants(targetIds, monitor, registry);\n var draggedItemType = monitor.getItemType();\n removeNonMatchingTargetIds(targetIds, registry, draggedItemType);\n hoverAllTargets(targetIds, monitor, registry);\n return {\n type: HOVER,\n payload: {\n targetIds: targetIds,\n clientOffset: clientOffset || null\n }\n };\n };\n}\n\nfunction verifyTargetIdsIsArray(targetIdsArg) {\n invariant(Array.isArray(targetIdsArg), 'Expected targetIds to be an array.');\n}\n\nfunction checkInvariants(targetIds, monitor, registry) {\n invariant(monitor.isDragging(), 'Cannot call hover while not dragging.');\n invariant(!monitor.didDrop(), 'Cannot call hover after drop.');\n\n for (var i = 0; i < targetIds.length; i++) {\n var targetId = targetIds[i];\n invariant(targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.');\n var target = registry.getTarget(targetId);\n invariant(target, 'Expected targetIds to be registered.');\n }\n}\n\nfunction removeNonMatchingTargetIds(targetIds, registry, draggedItemType) {\n // Remove those targetIds that don't match the targetType. This\n // fixes shallow isOver which would only be non-shallow because of\n // non-matching targets.\n for (var i = targetIds.length - 1; i >= 0; i--) {\n var targetId = targetIds[i];\n var targetType = registry.getTargetType(targetId);\n\n if (!matchesType(targetType, draggedItemType)) {\n targetIds.splice(i, 1);\n }\n }\n}\n\nfunction hoverAllTargets(targetIds, monitor, registry) {\n // Finally call hover on all matching targets.\n targetIds.forEach(function (targetId) {\n var target = registry.getTarget(targetId);\n target.hover(monitor, targetId);\n });\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { invariant } from '@react-dnd/invariant';\nimport { DROP } from './types';\nimport { isObject } from '../../utils/js_utils';\nexport default function createDrop(manager) {\n return function drop() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var monitor = manager.getMonitor();\n var registry = manager.getRegistry();\n verifyInvariants(monitor);\n var targetIds = getDroppableTargets(monitor); // Multiple actions are dispatched here, which is why this doesn't return an action\n\n targetIds.forEach(function (targetId, index) {\n var dropResult = determineDropResult(targetId, index, registry, monitor);\n var action = {\n type: DROP,\n payload: {\n dropResult: _objectSpread({}, options, {}, dropResult)\n }\n };\n manager.dispatch(action);\n });\n };\n}\n\nfunction verifyInvariants(monitor) {\n invariant(monitor.isDragging(), 'Cannot call drop while not dragging.');\n invariant(!monitor.didDrop(), 'Cannot call drop twice during one drag operation.');\n}\n\nfunction determineDropResult(targetId, index, registry, monitor) {\n var target = registry.getTarget(targetId);\n var dropResult = target ? target.drop(monitor, targetId) : undefined;\n verifyDropResultType(dropResult);\n\n if (typeof dropResult === 'undefined') {\n dropResult = index === 0 ? {} : monitor.getDropResult();\n }\n\n return dropResult;\n}\n\nfunction verifyDropResultType(dropResult) {\n invariant(typeof dropResult === 'undefined' || isObject(dropResult), 'Drop result must either be an object or undefined.');\n}\n\nfunction getDroppableTargets(monitor) {\n var targetIds = monitor.getTargetIds().filter(monitor.canDropOnTarget, monitor);\n targetIds.reverse();\n return targetIds;\n}","import { invariant } from '@react-dnd/invariant';\nimport { END_DRAG } from './types';\nexport default function createEndDrag(manager) {\n return function endDrag() {\n var monitor = manager.getMonitor();\n var registry = manager.getRegistry();\n verifyIsDragging(monitor);\n var sourceId = monitor.getSourceId();\n var source = registry.getSource(sourceId, true);\n source.endDrag(monitor, sourceId);\n registry.unpinSource();\n return {\n type: END_DRAG\n };\n };\n}\n\nfunction verifyIsDragging(monitor) {\n invariant(monitor.isDragging(), 'Cannot call endDrag while not dragging.');\n}","import createBeginDrag from './beginDrag';\nimport createPublishDragSource from './publishDragSource';\nimport createHover from './hover';\nimport createDrop from './drop';\nimport createEndDrag from './endDrag';\nexport * from './types';\nexport default function createDragDropActions(manager) {\n return {\n beginDrag: createBeginDrag(manager),\n publishDragSource: createPublishDragSource(manager),\n hover: createHover(manager),\n drop: createDrop(manager),\n endDrag: createEndDrag(manager)\n };\n}","export var strictEquality = function strictEquality(a, b) {\n return a === b;\n};\n/**\n * Determine if two cartesian coordinate offsets are equal\n * @param offsetA\n * @param offsetB\n */\n\nexport function areCoordsEqual(offsetA, offsetB) {\n if (!offsetA && !offsetB) {\n return true;\n } else if (!offsetA || !offsetB) {\n return false;\n } else {\n return offsetA.x === offsetB.x && offsetA.y === offsetB.y;\n }\n}\n/**\n * Determines if two arrays of items are equal\n * @param a The first array of items\n * @param b The second array of items\n */\n\nexport function areArraysEqual(a, b) {\n var isEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : strictEquality;\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { INIT_COORDS, BEGIN_DRAG, HOVER, END_DRAG, DROP } from '../actions/dragDrop';\nimport { areCoordsEqual } from '../utils/equality';\nvar initialState = {\n initialSourceClientOffset: null,\n initialClientOffset: null,\n clientOffset: null\n};\nexport default function dragOffset() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments.length > 1 ? arguments[1] : undefined;\n var payload = action.payload;\n\n switch (action.type) {\n case INIT_COORDS:\n case BEGIN_DRAG:\n return {\n initialSourceClientOffset: payload.sourceClientOffset,\n initialClientOffset: payload.clientOffset,\n clientOffset: payload.clientOffset\n };\n\n case HOVER:\n if (areCoordsEqual(state.clientOffset, payload.clientOffset)) {\n return state;\n }\n\n return _objectSpread({}, state, {\n clientOffset: payload.clientOffset\n });\n\n case END_DRAG:\n case DROP:\n return initialState;\n\n default:\n return state;\n }\n}","export var ADD_SOURCE = 'dnd-core/ADD_SOURCE';\nexport var ADD_TARGET = 'dnd-core/ADD_TARGET';\nexport var REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE';\nexport var REMOVE_TARGET = 'dnd-core/REMOVE_TARGET';\nexport function addSource(sourceId) {\n return {\n type: ADD_SOURCE,\n payload: {\n sourceId: sourceId\n }\n };\n}\nexport function addTarget(targetId) {\n return {\n type: ADD_TARGET,\n payload: {\n targetId: targetId\n }\n };\n}\nexport function removeSource(sourceId) {\n return {\n type: REMOVE_SOURCE,\n payload: {\n sourceId: sourceId\n }\n };\n}\nexport function removeTarget(targetId) {\n return {\n type: REMOVE_TARGET,\n payload: {\n targetId: targetId\n }\n };\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { BEGIN_DRAG, PUBLISH_DRAG_SOURCE, HOVER, END_DRAG, DROP } from '../actions/dragDrop';\nimport { REMOVE_TARGET } from '../actions/registry';\nimport { without } from '../utils/js_utils';\nvar initialState = {\n itemType: null,\n item: null,\n sourceId: null,\n targetIds: [],\n dropResult: null,\n didDrop: false,\n isSourcePublic: null\n};\nexport default function dragOperation() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments.length > 1 ? arguments[1] : undefined;\n var payload = action.payload;\n\n switch (action.type) {\n case BEGIN_DRAG:\n return _objectSpread({}, state, {\n itemType: payload.itemType,\n item: payload.item,\n sourceId: payload.sourceId,\n isSourcePublic: payload.isSourcePublic,\n dropResult: null,\n didDrop: false\n });\n\n case PUBLISH_DRAG_SOURCE:\n return _objectSpread({}, state, {\n isSourcePublic: true\n });\n\n case HOVER:\n return _objectSpread({}, state, {\n targetIds: payload.targetIds\n });\n\n case REMOVE_TARGET:\n if (state.targetIds.indexOf(payload.targetId) === -1) {\n return state;\n }\n\n return _objectSpread({}, state, {\n targetIds: without(state.targetIds, payload.targetId)\n });\n\n case DROP:\n return _objectSpread({}, state, {\n dropResult: payload.dropResult,\n didDrop: true,\n targetIds: []\n });\n\n case END_DRAG:\n return _objectSpread({}, state, {\n itemType: null,\n item: null,\n sourceId: null,\n dropResult: null,\n didDrop: false,\n isSourcePublic: null,\n targetIds: []\n });\n\n default:\n return state;\n }\n}","import { ADD_SOURCE, ADD_TARGET, REMOVE_SOURCE, REMOVE_TARGET } from '../actions/registry';\nexport default function refCount() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var action = arguments.length > 1 ? arguments[1] : undefined;\n\n switch (action.type) {\n case ADD_SOURCE:\n case ADD_TARGET:\n return state + 1;\n\n case REMOVE_SOURCE:\n case REMOVE_TARGET:\n return state - 1;\n\n default:\n return state;\n }\n}","import { intersection } from './js_utils';\nexport var NONE = [];\nexport var ALL = [];\nNONE.__IS_NONE__ = true;\nALL.__IS_ALL__ = true;\n/**\n * Determines if the given handler IDs are dirty or not.\n *\n * @param dirtyIds The set of dirty handler ids\n * @param handlerIds The set of handler ids to check\n */\n\nexport function areDirty(dirtyIds, handlerIds) {\n if (dirtyIds === NONE) {\n return false;\n }\n\n if (dirtyIds === ALL || typeof handlerIds === 'undefined') {\n return true;\n }\n\n var commonIds = intersection(handlerIds, dirtyIds);\n return commonIds.length > 0;\n}","import { BEGIN_DRAG, PUBLISH_DRAG_SOURCE, HOVER, END_DRAG, DROP } from '../actions/dragDrop';\nimport { ADD_SOURCE, ADD_TARGET, REMOVE_SOURCE, REMOVE_TARGET } from '../actions/registry';\nimport { areArraysEqual } from '../utils/equality';\nimport { NONE, ALL } from '../utils/dirtiness';\nimport { xor } from '../utils/js_utils';\nexport default function dirtyHandlerIds() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : NONE;\n var action = arguments.length > 1 ? arguments[1] : undefined;\n\n switch (action.type) {\n case HOVER:\n break;\n\n case ADD_SOURCE:\n case ADD_TARGET:\n case REMOVE_TARGET:\n case REMOVE_SOURCE:\n return NONE;\n\n case BEGIN_DRAG:\n case PUBLISH_DRAG_SOURCE:\n case END_DRAG:\n case DROP:\n default:\n return ALL;\n }\n\n var _action$payload = action.payload,\n _action$payload$targe = _action$payload.targetIds,\n targetIds = _action$payload$targe === void 0 ? [] : _action$payload$targe,\n _action$payload$prevT = _action$payload.prevTargetIds,\n prevTargetIds = _action$payload$prevT === void 0 ? [] : _action$payload$prevT;\n var result = xor(targetIds, prevTargetIds);\n var didChange = result.length > 0 || !areArraysEqual(targetIds, prevTargetIds);\n\n if (!didChange) {\n return NONE;\n } // Check the target ids at the innermost position. If they are valid, add them\n // to the result\n\n\n var prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1];\n var innermostTargetId = targetIds[targetIds.length - 1];\n\n if (prevInnermostTargetId !== innermostTargetId) {\n if (prevInnermostTargetId) {\n result.push(prevInnermostTargetId);\n }\n\n if (innermostTargetId) {\n result.push(innermostTargetId);\n }\n }\n\n return result;\n}","export default function stateId() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return state + 1;\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport dragOffset from './dragOffset';\nimport dragOperation from './dragOperation';\nimport refCount from './refCount';\nimport dirtyHandlerIds from './dirtyHandlerIds';\nimport stateId from './stateId';\nimport { get } from '../utils/js_utils';\nexport default function reduce() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments.length > 1 ? arguments[1] : undefined;\n return {\n dirtyHandlerIds: dirtyHandlerIds(state.dirtyHandlerIds, {\n type: action.type,\n payload: _objectSpread({}, action.payload, {\n prevTargetIds: get(state, 'dragOperation.targetIds', [])\n })\n }),\n dragOffset: dragOffset(state.dragOffset, action),\n refCount: refCount(state.refCount, action),\n dragOperation: dragOperation(state.dragOperation, action),\n stateId: stateId(state.stateId)\n };\n}","/**\n * Coordinate addition\n * @param a The first coordinate\n * @param b The second coordinate\n */\nexport function add(a, b) {\n return {\n x: a.x + b.x,\n y: a.y + b.y\n };\n}\n/**\n * Coordinate subtraction\n * @param a The first coordinate\n * @param b The second coordinate\n */\n\nexport function subtract(a, b) {\n return {\n x: a.x - b.x,\n y: a.y - b.y\n };\n}\n/**\n * Returns the cartesian distance of the drag source component's position, based on its position\n * at the time when the current drag operation has started, and the movement difference.\n *\n * Returns null if no item is being dragged.\n *\n * @param state The offset state to compute from\n */\n\nexport function getSourceClientOffset(state) {\n var clientOffset = state.clientOffset,\n initialClientOffset = state.initialClientOffset,\n initialSourceClientOffset = state.initialSourceClientOffset;\n\n if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) {\n return null;\n }\n\n return subtract(add(clientOffset, initialSourceClientOffset), initialClientOffset);\n}\n/**\n * Determines the x,y offset between the client offset and the initial client offset\n *\n * @param state The offset state to compute from\n */\n\nexport function getDifferenceFromInitialOffset(state) {\n var clientOffset = state.clientOffset,\n initialClientOffset = state.initialClientOffset;\n\n if (!clientOffset || !initialClientOffset) {\n return null;\n }\n\n return subtract(clientOffset, initialClientOffset);\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { invariant } from '@react-dnd/invariant';\nimport matchesType from './utils/matchesType';\nimport { getSourceClientOffset as _getSourceClientOffset, getDifferenceFromInitialOffset as _getDifferenceFromInitialOffset } from './utils/coords';\nimport { areDirty } from './utils/dirtiness';\n\nvar DragDropMonitorImpl =\n/*#__PURE__*/\nfunction () {\n function DragDropMonitorImpl(store, registry) {\n _classCallCheck(this, DragDropMonitorImpl);\n\n this.store = store;\n this.registry = registry;\n }\n\n _createClass(DragDropMonitorImpl, [{\n key: \"subscribeToStateChange\",\n value: function subscribeToStateChange(listener) {\n var _this = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n handlerIds: undefined\n };\n var handlerIds = options.handlerIds;\n invariant(typeof listener === 'function', 'listener must be a function.');\n invariant(typeof handlerIds === 'undefined' || Array.isArray(handlerIds), 'handlerIds, when specified, must be an array of strings.');\n var prevStateId = this.store.getState().stateId;\n\n var handleChange = function handleChange() {\n var state = _this.store.getState();\n\n var currentStateId = state.stateId;\n\n try {\n var canSkipListener = currentStateId === prevStateId || currentStateId === prevStateId + 1 && !areDirty(state.dirtyHandlerIds, handlerIds);\n\n if (!canSkipListener) {\n listener();\n }\n } finally {\n prevStateId = currentStateId;\n }\n };\n\n return this.store.subscribe(handleChange);\n }\n }, {\n key: \"subscribeToOffsetChange\",\n value: function subscribeToOffsetChange(listener) {\n var _this2 = this;\n\n invariant(typeof listener === 'function', 'listener must be a function.');\n var previousState = this.store.getState().dragOffset;\n\n var handleChange = function handleChange() {\n var nextState = _this2.store.getState().dragOffset;\n\n if (nextState === previousState) {\n return;\n }\n\n previousState = nextState;\n listener();\n };\n\n return this.store.subscribe(handleChange);\n }\n }, {\n key: \"canDragSource\",\n value: function canDragSource(sourceId) {\n if (!sourceId) {\n return false;\n }\n\n var source = this.registry.getSource(sourceId);\n invariant(source, 'Expected to find a valid source.');\n\n if (this.isDragging()) {\n return false;\n }\n\n return source.canDrag(this, sourceId);\n }\n }, {\n key: \"canDropOnTarget\",\n value: function canDropOnTarget(targetId) {\n // undefined on initial render\n if (!targetId) {\n return false;\n }\n\n var target = this.registry.getTarget(targetId);\n invariant(target, 'Expected to find a valid target.');\n\n if (!this.isDragging() || this.didDrop()) {\n return false;\n }\n\n var targetType = this.registry.getTargetType(targetId);\n var draggedItemType = this.getItemType();\n return matchesType(targetType, draggedItemType) && target.canDrop(this, targetId);\n }\n }, {\n key: \"isDragging\",\n value: function isDragging() {\n return Boolean(this.getItemType());\n }\n }, {\n key: \"isDraggingSource\",\n value: function isDraggingSource(sourceId) {\n // undefined on initial render\n if (!sourceId) {\n return false;\n }\n\n var source = this.registry.getSource(sourceId, true);\n invariant(source, 'Expected to find a valid source.');\n\n if (!this.isDragging() || !this.isSourcePublic()) {\n return false;\n }\n\n var sourceType = this.registry.getSourceType(sourceId);\n var draggedItemType = this.getItemType();\n\n if (sourceType !== draggedItemType) {\n return false;\n }\n\n return source.isDragging(this, sourceId);\n }\n }, {\n key: \"isOverTarget\",\n value: function isOverTarget(targetId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n shallow: false\n };\n\n // undefined on initial render\n if (!targetId) {\n return false;\n }\n\n var shallow = options.shallow;\n\n if (!this.isDragging()) {\n return false;\n }\n\n var targetType = this.registry.getTargetType(targetId);\n var draggedItemType = this.getItemType();\n\n if (draggedItemType && !matchesType(targetType, draggedItemType)) {\n return false;\n }\n\n var targetIds = this.getTargetIds();\n\n if (!targetIds.length) {\n return false;\n }\n\n var index = targetIds.indexOf(targetId);\n\n if (shallow) {\n return index === targetIds.length - 1;\n } else {\n return index > -1;\n }\n }\n }, {\n key: \"getItemType\",\n value: function getItemType() {\n return this.store.getState().dragOperation.itemType;\n }\n }, {\n key: \"getItem\",\n value: function getItem() {\n return this.store.getState().dragOperation.item;\n }\n }, {\n key: \"getSourceId\",\n value: function getSourceId() {\n return this.store.getState().dragOperation.sourceId;\n }\n }, {\n key: \"getTargetIds\",\n value: function getTargetIds() {\n return this.store.getState().dragOperation.targetIds;\n }\n }, {\n key: \"getDropResult\",\n value: function getDropResult() {\n return this.store.getState().dragOperation.dropResult;\n }\n }, {\n key: \"didDrop\",\n value: function didDrop() {\n return this.store.getState().dragOperation.didDrop;\n }\n }, {\n key: \"isSourcePublic\",\n value: function isSourcePublic() {\n return this.store.getState().dragOperation.isSourcePublic;\n }\n }, {\n key: \"getInitialClientOffset\",\n value: function getInitialClientOffset() {\n return this.store.getState().dragOffset.initialClientOffset;\n }\n }, {\n key: \"getInitialSourceClientOffset\",\n value: function getInitialSourceClientOffset() {\n return this.store.getState().dragOffset.initialSourceClientOffset;\n }\n }, {\n key: \"getClientOffset\",\n value: function getClientOffset() {\n return this.store.getState().dragOffset.clientOffset;\n }\n }, {\n key: \"getSourceClientOffset\",\n value: function getSourceClientOffset() {\n return _getSourceClientOffset(this.store.getState().dragOffset);\n }\n }, {\n key: \"getDifferenceFromInitialOffset\",\n value: function getDifferenceFromInitialOffset() {\n return _getDifferenceFromInitialOffset(this.store.getState().dragOffset);\n }\n }]);\n\n return DragDropMonitorImpl;\n}();\n\nexport { DragDropMonitorImpl as default };","var nextUniqueId = 0;\nexport default function getNextUniqueId() {\n return nextUniqueId++;\n}","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { invariant } from '@react-dnd/invariant';\nexport function validateSourceContract(source) {\n invariant(typeof source.canDrag === 'function', 'Expected canDrag to be a function.');\n invariant(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.');\n invariant(typeof source.endDrag === 'function', 'Expected endDrag to be a function.');\n}\nexport function validateTargetContract(target) {\n invariant(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');\n invariant(typeof target.hover === 'function', 'Expected hover to be a function.');\n invariant(typeof target.drop === 'function', 'Expected beginDrag to be a function.');\n}\nexport function validateType(type, allowArray) {\n if (allowArray && Array.isArray(type)) {\n type.forEach(function (t) {\n return validateType(t, false);\n });\n return;\n }\n\n invariant(typeof type === 'string' || _typeof(type) === 'symbol', allowArray ? 'Type can only be a string, a symbol, or an array of either.' : 'Type can only be a string or a symbol.');\n}","// Use the fastest means possible to execute a task in its own turn, with\n// priority over other events including IO, animation, reflow, and redraw\n// events in browsers.\n//\n// An exception thrown by a task will permanently interrupt the processing of\n// subsequent tasks. The higher level `asap` function ensures that if an\n// exception is thrown by a task, that the task queue will continue flushing as\n// soon as possible, but if you use `rawAsap` directly, you are responsible to\n// either ensure that no exceptions are thrown from your task, or to manually\n// call `rawAsap.requestFlush` if an exception is thrown.\nexport function rawAsap(task) {\n if (!queue.length) {\n requestFlush();\n flushing = true;\n } // Equivalent to push, but avoids a function call.\n\n\n queue[queue.length] = task;\n}\nvar queue = []; // Once a flush has been requested, no further calls to `requestFlush` are\n// necessary until the next `flush` completes.\n// @ts-ignore\n\nvar flushing = false; // `requestFlush` is an implementation-specific method that attempts to kick\n// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n// the event queue before yielding to the browser's own event loop.\n\nvar requestFlush; // The position of the next task to execute in the task queue. This is\n// preserved between calls to `flush` so that it can be resumed if\n// a task throws an exception.\n\nvar index = 0; // If a task schedules additional tasks recursively, the task queue can grow\n// unbounded. To prevent memory exhaustion, the task queue will periodically\n// truncate already-completed tasks.\n\nvar capacity = 1024; // The flush function processes all tasks that have been scheduled with\n// `rawAsap` unless and until one of those tasks throws an exception.\n// If a task throws an exception, `flush` ensures that its state will remain\n// consistent and will resume where it left off when called again.\n// However, `flush` does not make any arrangements to be called again if an\n// exception is thrown.\n\nfunction flush() {\n while (index < queue.length) {\n var currentIndex = index; // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n\n index = index + 1;\n queue[currentIndex].call(); // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n\n queue.length -= index;\n index = 0;\n }\n }\n\n queue.length = 0;\n index = 0;\n flushing = false;\n} // `requestFlush` is implemented using a strategy based on data collected from\n// every available SauceLabs Selenium web driver worker at time of writing.\n// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` or `self` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\n\n/* globals self */\n\n\nvar scope = typeof global !== 'undefined' ? global : self;\nvar BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver; // MutationObservers are desirable because they have high priority and work\n// reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\n\nif (typeof BrowserMutationObserver === 'function') {\n requestFlush = makeRequestCallFromMutationObserver(flush); // MessageChannels are desirable because they give direct access to the HTML\n // task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n // 11-12, and in web workers in many engines.\n // Although message channels yield to any queued rendering and IO tasks, they\n // would be better than imposing the 4ms delay of timers.\n // However, they do not work reliably in Internet Explorer or Safari.\n // Internet Explorer 10 is the only browser that has setImmediate but does\n // not have MutationObservers.\n // Although setImmediate yields to the browser's renderer, it would be\n // preferrable to falling back to setTimeout since it does not have\n // the minimum 4ms penalty.\n // Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n // Desktop to a lesser extent) that renders both setImmediate and\n // MessageChannel useless for the purposes of ASAP.\n // https://github.com/kriskowal/q/issues/396\n // Timers are implemented universally.\n // We fall back to timers in workers in most engines, and in foreground\n // contexts in the following browsers.\n // However, note that even this simple case requires nuances to operate in a\n // broad spectrum of browsers.\n //\n // - Firefox 3-13\n // - Internet Explorer 6-9\n // - iPad Safari 4.3\n // - Lynx 2.8.7\n} else {\n requestFlush = makeRequestCallFromTimer(flush);\n} // `requestFlush` requests that the high priority event queue be flushed as\n// soon as possible.\n// This is useful to prevent an error thrown in a task from stalling the event\n// queue if the exception handled by Node.js’s\n// `process.on(\"uncaughtException\")` or by a domain.\n\n\nrawAsap.requestFlush = requestFlush; // To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between \"1\" and \"-1\".\n\nfunction makeRequestCallFromMutationObserver(callback) {\n var toggle = 1;\n var observer = new BrowserMutationObserver(callback);\n var node = document.createTextNode('');\n observer.observe(node, {\n characterData: true\n });\n return function requestCall() {\n toggle = -toggle;\n node.data = toggle;\n };\n} // The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page's first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don't need to fall back in that case.\n// function makeRequestCallFromMessageChannel(callback) {\n// var channel = new MessageChannel();\n// channel.port1.onmessage = callback;\n// return function requestCall() {\n// channel.port2.postMessage(0);\n// };\n// }\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n// function makeRequestCallFromSetImmediate(callback) {\n// return function requestCall() {\n// setImmediate(callback);\n// };\n// }\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\n\nfunction makeRequestCallFromTimer(callback) {\n return function requestCall() {\n // We dispatch a timeout with a specified delay of 0 for engines that\n // can reliably accommodate that request. This will usually be snapped\n // to a 4 milisecond delay, but once we're flushing, there's no delay\n // between events.\n var timeoutHandle = setTimeout(handleTimer, 0); // However, since this timer gets frequently dropped in Firefox\n // workers, we enlist an interval handle that will try to fire\n // an event 20 times per second until it succeeds.\n\n var intervalHandle = setInterval(handleTimer, 50);\n\n function handleTimer() {\n // Whichever timer succeeds will cancel both timers and\n // execute the callback.\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n callback();\n }\n };\n} // This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// its existence.\n\n\nrawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; // ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js","import { rawAsap } from './raw'; // rawAsap provides everything we need except exception management.\n// RawTasks are recycled to reduce GC churn.\n\nvar freeTasks = []; // We queue errors to ensure they are thrown in right order (FIFO).\n// Array-as-queue is good enough here, since we are just dealing with exceptions.\n\nvar pendingErrors = [];\nvar requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);\n\nfunction throwFirstError() {\n if (pendingErrors.length) {\n throw pendingErrors.shift();\n }\n}\n/**\n * Calls a task as soon as possible after returning, in its own event, with priority\n * over other events like animation, reflow, and repaint. An error thrown from an\n * event will not interrupt, nor even substantially slow down the processing of\n * other events, but will be rather postponed to a lower priority event.\n * @param {{call}} task A callable object, typically a function that takes no\n * arguments.\n */\n\n\nexport function asap(task) {\n var rawTask;\n\n if (freeTasks.length) {\n rawTask = freeTasks.pop();\n } else {\n rawTask = new RawTask();\n }\n\n rawTask.task = task;\n rawAsap(rawTask);\n} // We wrap tasks with recyclable task objects. A task object implements\n// `call`, just like a function.\n\nvar RawTask =\n/** @class */\nfunction () {\n function RawTask() {}\n\n RawTask.prototype.call = function () {\n try {\n this.task.call();\n } catch (error) {\n if (asap.onerror) {\n // This hook exists purely for testing purposes.\n // Its name will be periodically randomized to break any code that\n // depends on its existence.\n asap.onerror(error);\n } else {\n // In a web browser, exceptions are not fatal. However, to avoid\n // slowing down the queue of pending tasks, we rethrow the error in a\n // lower priority turn.\n pendingErrors.push(error);\n requestErrorThrow();\n }\n } finally {\n this.task = null;\n freeTasks[freeTasks.length] = this;\n }\n };\n\n return RawTask;\n}();","export * from './asap';","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { invariant } from '@react-dnd/invariant';\nimport { addSource as _addSource, addTarget as _addTarget, removeSource as _removeSource, removeTarget as _removeTarget } from './actions/registry';\nimport getNextUniqueId from './utils/getNextUniqueId';\nimport { HandlerRole } from './interfaces';\nimport { validateSourceContract, validateTargetContract, validateType } from './contracts';\nimport { asap } from '@react-dnd/asap';\n\nfunction getNextHandlerId(role) {\n var id = getNextUniqueId().toString();\n\n switch (role) {\n case HandlerRole.SOURCE:\n return \"S\".concat(id);\n\n case HandlerRole.TARGET:\n return \"T\".concat(id);\n\n default:\n throw new Error(\"Unknown Handler Role: \".concat(role));\n }\n}\n\nfunction parseRoleFromHandlerId(handlerId) {\n switch (handlerId[0]) {\n case 'S':\n return HandlerRole.SOURCE;\n\n case 'T':\n return HandlerRole.TARGET;\n\n default:\n invariant(false, \"Cannot parse handler ID: \".concat(handlerId));\n }\n}\n\nfunction mapContainsValue(map, searchValue) {\n var entries = map.entries();\n var isDone = false;\n\n do {\n var _entries$next = entries.next(),\n done = _entries$next.done,\n _entries$next$value = _slicedToArray(_entries$next.value, 2),\n value = _entries$next$value[1];\n\n if (value === searchValue) {\n return true;\n }\n\n isDone = !!done;\n } while (!isDone);\n\n return false;\n}\n\nvar HandlerRegistryImpl =\n/*#__PURE__*/\nfunction () {\n function HandlerRegistryImpl(store) {\n _classCallCheck(this, HandlerRegistryImpl);\n\n this.types = new Map();\n this.dragSources = new Map();\n this.dropTargets = new Map();\n this.pinnedSourceId = null;\n this.pinnedSource = null;\n this.store = store;\n }\n\n _createClass(HandlerRegistryImpl, [{\n key: \"addSource\",\n value: function addSource(type, source) {\n validateType(type);\n validateSourceContract(source);\n var sourceId = this.addHandler(HandlerRole.SOURCE, type, source);\n this.store.dispatch(_addSource(sourceId));\n return sourceId;\n }\n }, {\n key: \"addTarget\",\n value: function addTarget(type, target) {\n validateType(type, true);\n validateTargetContract(target);\n var targetId = this.addHandler(HandlerRole.TARGET, type, target);\n this.store.dispatch(_addTarget(targetId));\n return targetId;\n }\n }, {\n key: \"containsHandler\",\n value: function containsHandler(handler) {\n return mapContainsValue(this.dragSources, handler) || mapContainsValue(this.dropTargets, handler);\n }\n }, {\n key: \"getSource\",\n value: function getSource(sourceId) {\n var includePinned = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n invariant(this.isSourceId(sourceId), 'Expected a valid source ID.');\n var isPinned = includePinned && sourceId === this.pinnedSourceId;\n var source = isPinned ? this.pinnedSource : this.dragSources.get(sourceId);\n return source;\n }\n }, {\n key: \"getTarget\",\n value: function getTarget(targetId) {\n invariant(this.isTargetId(targetId), 'Expected a valid target ID.');\n return this.dropTargets.get(targetId);\n }\n }, {\n key: \"getSourceType\",\n value: function getSourceType(sourceId) {\n invariant(this.isSourceId(sourceId), 'Expected a valid source ID.');\n return this.types.get(sourceId);\n }\n }, {\n key: \"getTargetType\",\n value: function getTargetType(targetId) {\n invariant(this.isTargetId(targetId), 'Expected a valid target ID.');\n return this.types.get(targetId);\n }\n }, {\n key: \"isSourceId\",\n value: function isSourceId(handlerId) {\n var role = parseRoleFromHandlerId(handlerId);\n return role === HandlerRole.SOURCE;\n }\n }, {\n key: \"isTargetId\",\n value: function isTargetId(handlerId) {\n var role = parseRoleFromHandlerId(handlerId);\n return role === HandlerRole.TARGET;\n }\n }, {\n key: \"removeSource\",\n value: function removeSource(sourceId) {\n var _this = this;\n\n invariant(this.getSource(sourceId), 'Expected an existing source.');\n this.store.dispatch(_removeSource(sourceId));\n asap(function () {\n _this.dragSources.delete(sourceId);\n\n _this.types.delete(sourceId);\n });\n }\n }, {\n key: \"removeTarget\",\n value: function removeTarget(targetId) {\n invariant(this.getTarget(targetId), 'Expected an existing target.');\n this.store.dispatch(_removeTarget(targetId));\n this.dropTargets.delete(targetId);\n this.types.delete(targetId);\n }\n }, {\n key: \"pinSource\",\n value: function pinSource(sourceId) {\n var source = this.getSource(sourceId);\n invariant(source, 'Expected an existing source.');\n this.pinnedSourceId = sourceId;\n this.pinnedSource = source;\n }\n }, {\n key: \"unpinSource\",\n value: function unpinSource() {\n invariant(this.pinnedSource, 'No source is pinned at the time.');\n this.pinnedSourceId = null;\n this.pinnedSource = null;\n }\n }, {\n key: \"addHandler\",\n value: function addHandler(role, type, handler) {\n var id = getNextHandlerId(role);\n this.types.set(id, type);\n\n if (role === HandlerRole.SOURCE) {\n this.dragSources.set(id, handler);\n } else if (role === HandlerRole.TARGET) {\n this.dropTargets.set(id, handler);\n }\n\n return id;\n }\n }]);\n\n return HandlerRegistryImpl;\n}();\n\nexport { HandlerRegistryImpl as default };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { createStore } from 'redux';\nimport reducer from './reducers';\nimport dragDropActions from './actions/dragDrop';\nimport DragDropMonitorImpl from './DragDropMonitorImpl';\nimport HandlerRegistryImpl from './HandlerRegistryImpl';\n\nfunction makeStoreInstance(debugMode) {\n // TODO: if we ever make a react-native version of this,\n // we'll need to consider how to pull off dev-tooling\n var reduxDevTools = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__;\n return createStore(reducer, debugMode && reduxDevTools && reduxDevTools({\n name: 'dnd-core',\n instanceId: 'dnd-core'\n }));\n}\n\nvar DragDropManagerImpl =\n/*#__PURE__*/\nfunction () {\n function DragDropManagerImpl() {\n var _this = this;\n\n var debugMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n _classCallCheck(this, DragDropManagerImpl);\n\n this.isSetUp = false;\n\n this.handleRefCountChange = function () {\n var shouldSetUp = _this.store.getState().refCount > 0;\n\n if (_this.backend) {\n if (shouldSetUp && !_this.isSetUp) {\n _this.backend.setup();\n\n _this.isSetUp = true;\n } else if (!shouldSetUp && _this.isSetUp) {\n _this.backend.teardown();\n\n _this.isSetUp = false;\n }\n }\n };\n\n var store = makeStoreInstance(debugMode);\n this.store = store;\n this.monitor = new DragDropMonitorImpl(store, new HandlerRegistryImpl(store));\n store.subscribe(this.handleRefCountChange);\n }\n\n _createClass(DragDropManagerImpl, [{\n key: \"receiveBackend\",\n value: function receiveBackend(backend) {\n this.backend = backend;\n }\n }, {\n key: \"getMonitor\",\n value: function getMonitor() {\n return this.monitor;\n }\n }, {\n key: \"getBackend\",\n value: function getBackend() {\n return this.backend;\n }\n }, {\n key: \"getRegistry\",\n value: function getRegistry() {\n return this.monitor.registry;\n }\n }, {\n key: \"getActions\",\n value: function getActions() {\n /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n var manager = this;\n var dispatch = this.store.dispatch;\n\n function bindActionCreator(actionCreator) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var action = actionCreator.apply(manager, args);\n\n if (typeof action !== 'undefined') {\n dispatch(action);\n }\n };\n }\n\n var actions = dragDropActions(this);\n return Object.keys(actions).reduce(function (boundActions, key) {\n var action = actions[key];\n boundActions[key] = bindActionCreator(action);\n return boundActions;\n }, {});\n }\n }, {\n key: \"dispatch\",\n value: function dispatch(action) {\n this.store.dispatch(action);\n }\n }]);\n\n return DragDropManagerImpl;\n}();\n\nexport { DragDropManagerImpl as default };","import DragDropManagerImpl from './DragDropManagerImpl';\nexport function createDragDropManager(backendFactory, globalContext, backendOptions, debugMode) {\n var manager = new DragDropManagerImpl(debugMode);\n var backend = backendFactory(manager, globalContext, backendOptions);\n manager.receiveBackend(backend);\n return manager;\n}","export * from './interfaces';\nexport * from './factories';","import * as React from 'react';\nimport { createDragDropManager } from 'dnd-core';\n/**\n * Create the React Context\n */\n\nexport var DndContext = React.createContext({\n dragDropManager: undefined\n});\n/**\n * Creates the context object we're providing\n * @param backend\n * @param context\n */\n\nexport function createDndContext(backend, context, options, debugMode) {\n return {\n dragDropManager: createDragDropManager(backend, context, options, debugMode)\n };\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from 'react';\nimport { memo } from 'react';\nimport { DndContext, createDndContext } from './DndContext';\nvar refCount = 0;\n/**\n * A React component that provides the React-DnD context\n */\n\nexport var DndProvider = memo(function (_ref) {\n var children = _ref.children,\n props = _objectWithoutProperties(_ref, [\"children\"]);\n\n var _getDndContextValue = getDndContextValue(props),\n _getDndContextValue2 = _slicedToArray(_getDndContextValue, 2),\n manager = _getDndContextValue2[0],\n isGlobalInstance = _getDndContextValue2[1]; // memoized from props\n\n /**\n * If the global context was used to store the DND context\n * then where theres no more references to it we should\n * clean it up to avoid memory leaks\n */\n\n\n React.useEffect(function () {\n if (isGlobalInstance) {\n refCount++;\n }\n\n return function () {\n if (isGlobalInstance) {\n refCount--;\n\n if (refCount === 0) {\n var context = getGlobalContext();\n context[instanceSymbol] = null;\n }\n }\n };\n }, []);\n return React.createElement(DndContext.Provider, {\n value: manager\n }, children);\n});\nDndProvider.displayName = 'DndProvider';\n\nfunction getDndContextValue(props) {\n if ('manager' in props) {\n var _manager = {\n dragDropManager: props.manager\n };\n return [_manager, false];\n }\n\n var manager = createSingletonDndContext(props.backend, props.context, props.options, props.debugMode);\n var isGlobalInstance = !props.context;\n return [manager, isGlobalInstance];\n}\n\nvar instanceSymbol = Symbol.for('__REACT_DND_CONTEXT_INSTANCE__');\n\nfunction createSingletonDndContext(backend) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getGlobalContext();\n var options = arguments.length > 2 ? arguments[2] : undefined;\n var debugMode = arguments.length > 3 ? arguments[3] : undefined;\n var ctx = context;\n\n if (!ctx[instanceSymbol]) {\n ctx[instanceSymbol] = createDndContext(backend, context, options, debugMode);\n }\n\n return ctx[instanceSymbol];\n}\n\nfunction getGlobalContext() {\n return typeof global !== 'undefined' ? global : window;\n}","import * as React from 'react';\n/*\n * A utility for rendering a drag preview image\n */\n\nexport var DragPreviewImage = React.memo(function (_ref) {\n var connect = _ref.connect,\n src = _ref.src;\n\n if (typeof Image !== 'undefined') {\n var img = new Image();\n img.src = src;\n\n img.onload = function () {\n return connect(img);\n };\n }\n\n return null;\n});\nDragPreviewImage.displayName = 'DragPreviewImage';","export * from './DndContext';\nexport * from './DndProvider';\nexport * from './DragPreviewImage';","import { useLayoutEffect, useEffect } from 'react'; // suppress the useLayoutEffect warning on server side.\n\nexport var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { shallowEqual } from '@react-dnd/shallowequal';\nimport { useState, useCallback } from 'react';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n/**\n *\n * @param monitor The monitor to collect state from\n * @param collect The collecting function\n * @param onUpdate A method to invoke when updates occur\n */\n\nexport function useCollector(monitor, collect, onUpdate) {\n var _useState = useState(function () {\n return collect(monitor);\n }),\n _useState2 = _slicedToArray(_useState, 2),\n collected = _useState2[0],\n setCollected = _useState2[1];\n\n var updateCollected = useCallback(function () {\n var nextValue = collect(monitor);\n\n if (!shallowEqual(collected, nextValue)) {\n setCollected(nextValue);\n\n if (onUpdate) {\n onUpdate();\n }\n }\n }, [collected, monitor, onUpdate]); // update the collected properties after the first render\n // and the components are attached to dnd-core\n\n useIsomorphicLayoutEffect(updateCollected, []);\n return [collected, updateCollected];\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\nimport { useCollector } from './useCollector';\nexport function useMonitorOutput(monitor, collect, onCollect) {\n var _useCollector = useCollector(monitor, collect, onCollect),\n _useCollector2 = _slicedToArray(_useCollector, 2),\n collected = _useCollector2[0],\n updateCollected = _useCollector2[1];\n\n useIsomorphicLayoutEffect(function subscribeToMonitorStateChange() {\n var handlerId = monitor.getHandlerId();\n\n if (handlerId == null) {\n return undefined;\n }\n\n return monitor.subscribeToStateChange(updateCollected, {\n handlerIds: [handlerId]\n });\n }, [monitor, updateCollected]);\n return collected;\n}","export function registerTarget(type, target, manager) {\n var registry = manager.getRegistry();\n var targetId = registry.addTarget(type, target);\n return [targetId, function () {\n return registry.removeTarget(targetId);\n }];\n}\nexport function registerSource(type, source, manager) {\n var registry = manager.getRegistry();\n var sourceId = registry.addSource(type, source);\n return [sourceId, function () {\n return registry.removeSource(sourceId);\n }];\n}","import { useContext } from 'react';\nimport { invariant } from '@react-dnd/invariant';\nimport { DndContext } from '../../common/DndContext';\n/**\n * A hook to retrieve the DragDropManager from Context\n */\n\nexport function useDragDropManager() {\n var _useContext = useContext(DndContext),\n dragDropManager = _useContext.dragDropManager;\n\n invariant(dragDropManager != null, 'Expected drag drop context');\n return dragDropManager;\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { invariant } from '@react-dnd/invariant';\nvar isCallingCanDrag = false;\nvar isCallingIsDragging = false;\nexport var DragSourceMonitorImpl =\n/*#__PURE__*/\nfunction () {\n function DragSourceMonitorImpl(manager) {\n _classCallCheck(this, DragSourceMonitorImpl);\n\n this.sourceId = null;\n this.internalMonitor = manager.getMonitor();\n }\n\n _createClass(DragSourceMonitorImpl, [{\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(sourceId) {\n this.sourceId = sourceId;\n }\n }, {\n key: \"getHandlerId\",\n value: function getHandlerId() {\n return this.sourceId;\n }\n }, {\n key: \"canDrag\",\n value: function canDrag() {\n invariant(!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor');\n\n try {\n isCallingCanDrag = true;\n return this.internalMonitor.canDragSource(this.sourceId);\n } finally {\n isCallingCanDrag = false;\n }\n }\n }, {\n key: \"isDragging\",\n value: function isDragging() {\n if (!this.sourceId) {\n return false;\n }\n\n invariant(!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor');\n\n try {\n isCallingIsDragging = true;\n return this.internalMonitor.isDraggingSource(this.sourceId);\n } finally {\n isCallingIsDragging = false;\n }\n }\n }, {\n key: \"subscribeToStateChange\",\n value: function subscribeToStateChange(listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n }\n }, {\n key: \"isDraggingSource\",\n value: function isDraggingSource(sourceId) {\n return this.internalMonitor.isDraggingSource(sourceId);\n }\n }, {\n key: \"isOverTarget\",\n value: function isOverTarget(targetId, options) {\n return this.internalMonitor.isOverTarget(targetId, options);\n }\n }, {\n key: \"getTargetIds\",\n value: function getTargetIds() {\n return this.internalMonitor.getTargetIds();\n }\n }, {\n key: \"isSourcePublic\",\n value: function isSourcePublic() {\n return this.internalMonitor.isSourcePublic();\n }\n }, {\n key: \"getSourceId\",\n value: function getSourceId() {\n return this.internalMonitor.getSourceId();\n }\n }, {\n key: \"subscribeToOffsetChange\",\n value: function subscribeToOffsetChange(listener) {\n return this.internalMonitor.subscribeToOffsetChange(listener);\n }\n }, {\n key: \"canDragSource\",\n value: function canDragSource(sourceId) {\n return this.internalMonitor.canDragSource(sourceId);\n }\n }, {\n key: \"canDropOnTarget\",\n value: function canDropOnTarget(targetId) {\n return this.internalMonitor.canDropOnTarget(targetId);\n }\n }, {\n key: \"getItemType\",\n value: function getItemType() {\n return this.internalMonitor.getItemType();\n }\n }, {\n key: \"getItem\",\n value: function getItem() {\n return this.internalMonitor.getItem();\n }\n }, {\n key: \"getDropResult\",\n value: function getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n }, {\n key: \"didDrop\",\n value: function didDrop() {\n return this.internalMonitor.didDrop();\n }\n }, {\n key: \"getInitialClientOffset\",\n value: function getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n }, {\n key: \"getInitialSourceClientOffset\",\n value: function getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n }, {\n key: \"getSourceClientOffset\",\n value: function getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n }, {\n key: \"getClientOffset\",\n value: function getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n }, {\n key: \"getDifferenceFromInitialOffset\",\n value: function getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n }]);\n\n return DragSourceMonitorImpl;\n}();","import { cloneElement } from 'react';\nimport { invariant } from '@react-dnd/invariant';\n\nfunction setRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n}\n\nexport function cloneWithRef(element, newRef) {\n var previousRef = element.ref;\n invariant(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a or
. ' + 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');\n\n if (!previousRef) {\n // When there is no ref on the element, use the new ref directly\n return cloneElement(element, {\n ref: newRef\n });\n } else {\n return cloneElement(element, {\n ref: function ref(node) {\n setRef(previousRef, node);\n setRef(newRef, node);\n }\n });\n }\n}","import { isValidElement } from 'react';\nimport { cloneWithRef } from '../utils/cloneWithRef';\n\nfunction throwIfCompositeComponentElement(element) {\n // Custom components can no longer be wrapped directly in React DnD 2.0\n // so that we don't need to depend on findDOMNode() from react-dom.\n if (typeof element.type === 'string') {\n return;\n }\n\n var displayName = element.type.displayName || element.type.name || 'the component';\n throw new Error('Only native element nodes can now be passed to React DnD connectors.' + \"You can either wrap \".concat(displayName, \" into a
, or turn it into a \") + 'drag source or a drop target itself.');\n}\n\nfunction wrapHookToRecognizeElement(hook) {\n return function () {\n var elementOrNode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n // When passed a node, call the hook straight away.\n if (!isValidElement(elementOrNode)) {\n var node = elementOrNode;\n hook(node, options); // return the node so it can be chained (e.g. when within callback refs\n //
connectDragSource(connectDropTarget(node))}/>\n\n return node;\n } // If passed a ReactElement, clone it and attach this function as a ref.\n // This helps us achieve a neat API where user doesn't even know that refs\n // are being used under the hood.\n\n\n var element = elementOrNode;\n throwIfCompositeComponentElement(element); // When no options are passed, use the hook directly\n\n var ref = options ? function (node) {\n return hook(node, options);\n } : hook;\n return cloneWithRef(element, ref);\n };\n}\n\nexport default function wrapConnectorHooks(hooks) {\n var wrappedHooks = {};\n Object.keys(hooks).forEach(function (key) {\n var hook = hooks[key]; // ref objects should be passed straight through without wrapping\n\n if (key.endsWith('Ref')) {\n wrappedHooks[key] = hooks[key];\n } else {\n var wrappedHook = wrapHookToRecognizeElement(hook);\n\n wrappedHooks[key] = function () {\n return wrappedHook;\n };\n }\n });\n return wrappedHooks;\n}","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nexport function isRef(obj) {\n return (// eslint-disable-next-line no-prototype-builtins\n obj !== null && _typeof(obj) === 'object' && obj.hasOwnProperty('current')\n );\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport wrapConnectorHooks from './wrapConnectorHooks';\nimport { isRef } from '../utils/isRef';\nimport { shallowEqual } from '@react-dnd/shallowequal';\nexport var SourceConnector =\n/*#__PURE__*/\nfunction () {\n function SourceConnector(backend) {\n var _this = this;\n\n _classCallCheck(this, SourceConnector);\n\n this.hooks = wrapConnectorHooks({\n dragSource: function dragSource(node, options) {\n _this.clearDragSource();\n\n _this.dragSourceOptions = options || null;\n\n if (isRef(node)) {\n _this.dragSourceRef = node;\n } else {\n _this.dragSourceNode = node;\n }\n\n _this.reconnectDragSource();\n },\n dragPreview: function dragPreview(node, options) {\n _this.clearDragPreview();\n\n _this.dragPreviewOptions = options || null;\n\n if (isRef(node)) {\n _this.dragPreviewRef = node;\n } else {\n _this.dragPreviewNode = node;\n }\n\n _this.reconnectDragPreview();\n }\n });\n this.handlerId = null; // The drop target may either be attached via ref or connect function\n\n this.dragSourceRef = null;\n this.dragSourceOptionsInternal = null; // The drag preview may either be attached via ref or connect function\n\n this.dragPreviewRef = null;\n this.dragPreviewOptionsInternal = null;\n this.lastConnectedHandlerId = null;\n this.lastConnectedDragSource = null;\n this.lastConnectedDragSourceOptions = null;\n this.lastConnectedDragPreview = null;\n this.lastConnectedDragPreviewOptions = null;\n this.backend = backend;\n }\n\n _createClass(SourceConnector, [{\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(newHandlerId) {\n if (this.handlerId === newHandlerId) {\n return;\n }\n\n this.handlerId = newHandlerId;\n this.reconnect();\n }\n }, {\n key: \"reconnect\",\n value: function reconnect() {\n this.reconnectDragSource();\n this.reconnectDragPreview();\n }\n }, {\n key: \"reconnectDragSource\",\n value: function reconnectDragSource() {\n var dragSource = this.dragSource; // if nothing has changed then don't resubscribe\n\n var didChange = this.didHandlerIdChange() || this.didConnectedDragSourceChange() || this.didDragSourceOptionsChange();\n\n if (didChange) {\n this.disconnectDragSource();\n }\n\n if (!this.handlerId) {\n return;\n }\n\n if (!dragSource) {\n this.lastConnectedDragSource = dragSource;\n return;\n }\n\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDragSource = dragSource;\n this.lastConnectedDragSourceOptions = this.dragSourceOptions;\n this.dragSourceUnsubscribe = this.backend.connectDragSource(this.handlerId, dragSource, this.dragSourceOptions);\n }\n }\n }, {\n key: \"reconnectDragPreview\",\n value: function reconnectDragPreview() {\n var dragPreview = this.dragPreview; // if nothing has changed then don't resubscribe\n\n var didChange = this.didHandlerIdChange() || this.didConnectedDragPreviewChange() || this.didDragPreviewOptionsChange();\n\n if (!this.handlerId) {\n this.disconnectDragPreview();\n } else if (this.dragPreview && didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDragPreview = dragPreview;\n this.lastConnectedDragPreviewOptions = this.dragPreviewOptions;\n this.disconnectDragPreview();\n this.dragPreviewUnsubscribe = this.backend.connectDragPreview(this.handlerId, dragPreview, this.dragPreviewOptions);\n }\n }\n }, {\n key: \"didHandlerIdChange\",\n value: function didHandlerIdChange() {\n return this.lastConnectedHandlerId !== this.handlerId;\n }\n }, {\n key: \"didConnectedDragSourceChange\",\n value: function didConnectedDragSourceChange() {\n return this.lastConnectedDragSource !== this.dragSource;\n }\n }, {\n key: \"didConnectedDragPreviewChange\",\n value: function didConnectedDragPreviewChange() {\n return this.lastConnectedDragPreview !== this.dragPreview;\n }\n }, {\n key: \"didDragSourceOptionsChange\",\n value: function didDragSourceOptionsChange() {\n return !shallowEqual(this.lastConnectedDragSourceOptions, this.dragSourceOptions);\n }\n }, {\n key: \"didDragPreviewOptionsChange\",\n value: function didDragPreviewOptionsChange() {\n return !shallowEqual(this.lastConnectedDragPreviewOptions, this.dragPreviewOptions);\n }\n }, {\n key: \"disconnectDragSource\",\n value: function disconnectDragSource() {\n if (this.dragSourceUnsubscribe) {\n this.dragSourceUnsubscribe();\n this.dragSourceUnsubscribe = undefined;\n }\n }\n }, {\n key: \"disconnectDragPreview\",\n value: function disconnectDragPreview() {\n if (this.dragPreviewUnsubscribe) {\n this.dragPreviewUnsubscribe();\n this.dragPreviewUnsubscribe = undefined;\n this.dragPreviewNode = null;\n this.dragPreviewRef = null;\n }\n }\n }, {\n key: \"clearDragSource\",\n value: function clearDragSource() {\n this.dragSourceNode = null;\n this.dragSourceRef = null;\n }\n }, {\n key: \"clearDragPreview\",\n value: function clearDragPreview() {\n this.dragPreviewNode = null;\n this.dragPreviewRef = null;\n }\n }, {\n key: \"connectTarget\",\n get: function get() {\n return this.dragSource;\n }\n }, {\n key: \"dragSourceOptions\",\n get: function get() {\n return this.dragSourceOptionsInternal;\n },\n set: function set(options) {\n this.dragSourceOptionsInternal = options;\n }\n }, {\n key: \"dragPreviewOptions\",\n get: function get() {\n return this.dragPreviewOptionsInternal;\n },\n set: function set(options) {\n this.dragPreviewOptionsInternal = options;\n }\n }, {\n key: \"dragSource\",\n get: function get() {\n return this.dragSourceNode || this.dragSourceRef && this.dragSourceRef.current;\n }\n }, {\n key: \"dragPreview\",\n get: function get() {\n return this.dragPreviewNode || this.dragPreviewRef && this.dragPreviewRef.current;\n }\n }]);\n\n return SourceConnector;\n}();","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { useMemo } from 'react';\nimport { invariant } from '@react-dnd/invariant';\nimport { registerSource } from '../../common/registration';\nimport { useDragDropManager } from './useDragDropManager';\nimport { DragSourceMonitorImpl } from '../../common/DragSourceMonitorImpl';\nimport { SourceConnector } from '../../common/SourceConnector';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\nexport function useDragSourceMonitor() {\n var manager = useDragDropManager();\n var monitor = useMemo(function () {\n return new DragSourceMonitorImpl(manager);\n }, [manager]);\n var connector = useMemo(function () {\n return new SourceConnector(manager.getBackend());\n }, [manager]);\n return [monitor, connector];\n}\nexport function useDragHandler(spec, monitor, connector) {\n var manager = useDragDropManager();\n var handler = useMemo(function () {\n return {\n beginDrag: function beginDrag() {\n var _spec$current = spec.current,\n begin = _spec$current.begin,\n item = _spec$current.item;\n\n if (begin) {\n var beginResult = begin(monitor);\n invariant(beginResult == null || _typeof(beginResult) === 'object', 'dragSpec.begin() must either return an object, undefined, or null');\n return beginResult || item || {};\n }\n\n return item || {};\n },\n canDrag: function canDrag() {\n if (typeof spec.current.canDrag === 'boolean') {\n return spec.current.canDrag;\n } else if (typeof spec.current.canDrag === 'function') {\n return spec.current.canDrag(monitor);\n } else {\n return true;\n }\n },\n isDragging: function isDragging(globalMonitor, target) {\n var isDragging = spec.current.isDragging;\n return isDragging ? isDragging(monitor) : target === globalMonitor.getSourceId();\n },\n endDrag: function endDrag() {\n var end = spec.current.end;\n\n if (end) {\n end(monitor.getItem(), monitor);\n }\n\n connector.reconnect();\n }\n };\n }, []);\n useIsomorphicLayoutEffect(function registerHandler() {\n var _registerSource = registerSource(spec.current.item.type, handler, manager),\n _registerSource2 = _slicedToArray(_registerSource, 2),\n handlerId = _registerSource2[0],\n unregister = _registerSource2[1];\n\n monitor.receiveHandlerId(handlerId);\n connector.receiveHandlerId(handlerId);\n return unregister;\n }, []);\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { useRef, useMemo } from 'react';\nimport { invariant } from '@react-dnd/invariant';\nimport { useMonitorOutput } from './internal/useMonitorOutput';\nimport { useIsomorphicLayoutEffect } from './internal/useIsomorphicLayoutEffect';\nimport { useDragSourceMonitor, useDragHandler } from './internal/drag';\n/**\n * useDragSource hook\n * @param sourceSpec The drag source specification *\n */\n\nexport function useDrag(spec) {\n var specRef = useRef(spec);\n specRef.current = spec; // TODO: wire options into createSourceConnector\n\n invariant(spec.item != null, 'item must be defined');\n invariant(spec.item.type != null, 'item type must be defined');\n\n var _useDragSourceMonitor = useDragSourceMonitor(),\n _useDragSourceMonitor2 = _slicedToArray(_useDragSourceMonitor, 2),\n monitor = _useDragSourceMonitor2[0],\n connector = _useDragSourceMonitor2[1];\n\n useDragHandler(specRef, monitor, connector);\n var result = useMonitorOutput(monitor, specRef.current.collect || function () {\n return {};\n }, function () {\n return connector.reconnect();\n });\n var connectDragSource = useMemo(function () {\n return connector.hooks.dragSource();\n }, [connector]);\n var connectDragPreview = useMemo(function () {\n return connector.hooks.dragPreview();\n }, [connector]);\n useIsomorphicLayoutEffect(function () {\n connector.dragSourceOptions = specRef.current.options || null;\n connector.reconnect();\n }, [connector]);\n useIsomorphicLayoutEffect(function () {\n connector.dragPreviewOptions = specRef.current.previewOptions || null;\n connector.reconnect();\n }, [connector]);\n return [result, connectDragSource, connectDragPreview];\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { shallowEqual } from '@react-dnd/shallowequal';\nimport wrapConnectorHooks from './wrapConnectorHooks';\nimport { isRef } from '../utils/isRef';\nexport var TargetConnector =\n/*#__PURE__*/\nfunction () {\n function TargetConnector(backend) {\n var _this = this;\n\n _classCallCheck(this, TargetConnector);\n\n this.hooks = wrapConnectorHooks({\n dropTarget: function dropTarget(node, options) {\n _this.clearDropTarget();\n\n _this.dropTargetOptions = options;\n\n if (isRef(node)) {\n _this.dropTargetRef = node;\n } else {\n _this.dropTargetNode = node;\n }\n\n _this.reconnect();\n }\n });\n this.handlerId = null; // The drop target may either be attached via ref or connect function\n\n this.dropTargetRef = null;\n this.dropTargetOptionsInternal = null;\n this.lastConnectedHandlerId = null;\n this.lastConnectedDropTarget = null;\n this.lastConnectedDropTargetOptions = null;\n this.backend = backend;\n }\n\n _createClass(TargetConnector, [{\n key: \"reconnect\",\n value: function reconnect() {\n // if nothing has changed then don't resubscribe\n var didChange = this.didHandlerIdChange() || this.didDropTargetChange() || this.didOptionsChange();\n\n if (didChange) {\n this.disconnectDropTarget();\n }\n\n var dropTarget = this.dropTarget;\n\n if (!this.handlerId) {\n return;\n }\n\n if (!dropTarget) {\n this.lastConnectedDropTarget = dropTarget;\n return;\n }\n\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDropTarget = dropTarget;\n this.lastConnectedDropTargetOptions = this.dropTargetOptions;\n this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, dropTarget, this.dropTargetOptions);\n }\n }\n }, {\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(newHandlerId) {\n if (newHandlerId === this.handlerId) {\n return;\n }\n\n this.handlerId = newHandlerId;\n this.reconnect();\n }\n }, {\n key: \"didHandlerIdChange\",\n value: function didHandlerIdChange() {\n return this.lastConnectedHandlerId !== this.handlerId;\n }\n }, {\n key: \"didDropTargetChange\",\n value: function didDropTargetChange() {\n return this.lastConnectedDropTarget !== this.dropTarget;\n }\n }, {\n key: \"didOptionsChange\",\n value: function didOptionsChange() {\n return !shallowEqual(this.lastConnectedDropTargetOptions, this.dropTargetOptions);\n }\n }, {\n key: \"disconnectDropTarget\",\n value: function disconnectDropTarget() {\n if (this.unsubscribeDropTarget) {\n this.unsubscribeDropTarget();\n this.unsubscribeDropTarget = undefined;\n }\n }\n }, {\n key: \"clearDropTarget\",\n value: function clearDropTarget() {\n this.dropTargetRef = null;\n this.dropTargetNode = null;\n }\n }, {\n key: \"connectTarget\",\n get: function get() {\n return this.dropTarget;\n }\n }, {\n key: \"dropTargetOptions\",\n get: function get() {\n return this.dropTargetOptionsInternal;\n },\n set: function set(options) {\n this.dropTargetOptionsInternal = options;\n }\n }, {\n key: \"dropTarget\",\n get: function get() {\n return this.dropTargetNode || this.dropTargetRef && this.dropTargetRef.current;\n }\n }]);\n\n return TargetConnector;\n}();","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { invariant } from '@react-dnd/invariant';\nvar isCallingCanDrop = false;\nexport var DropTargetMonitorImpl =\n/*#__PURE__*/\nfunction () {\n function DropTargetMonitorImpl(manager) {\n _classCallCheck(this, DropTargetMonitorImpl);\n\n this.targetId = null;\n this.internalMonitor = manager.getMonitor();\n }\n\n _createClass(DropTargetMonitorImpl, [{\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(targetId) {\n this.targetId = targetId;\n }\n }, {\n key: \"getHandlerId\",\n value: function getHandlerId() {\n return this.targetId;\n }\n }, {\n key: \"subscribeToStateChange\",\n value: function subscribeToStateChange(listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n }\n }, {\n key: \"canDrop\",\n value: function canDrop() {\n // Cut out early if the target id has not been set. This should prevent errors\n // where the user has an older version of dnd-core like in\n // https://github.com/react-dnd/react-dnd/issues/1310\n if (!this.targetId) {\n return false;\n }\n\n invariant(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor');\n\n try {\n isCallingCanDrop = true;\n return this.internalMonitor.canDropOnTarget(this.targetId);\n } finally {\n isCallingCanDrop = false;\n }\n }\n }, {\n key: \"isOver\",\n value: function isOver(options) {\n if (!this.targetId) {\n return false;\n }\n\n return this.internalMonitor.isOverTarget(this.targetId, options);\n }\n }, {\n key: \"getItemType\",\n value: function getItemType() {\n return this.internalMonitor.getItemType();\n }\n }, {\n key: \"getItem\",\n value: function getItem() {\n return this.internalMonitor.getItem();\n }\n }, {\n key: \"getDropResult\",\n value: function getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n }, {\n key: \"didDrop\",\n value: function didDrop() {\n return this.internalMonitor.didDrop();\n }\n }, {\n key: \"getInitialClientOffset\",\n value: function getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n }, {\n key: \"getInitialSourceClientOffset\",\n value: function getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n }, {\n key: \"getSourceClientOffset\",\n value: function getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n }, {\n key: \"getClientOffset\",\n value: function getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n }, {\n key: \"getDifferenceFromInitialOffset\",\n value: function getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n }]);\n\n return DropTargetMonitorImpl;\n}();","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { useMemo } from 'react';\nimport { registerTarget } from '../../common/registration';\nimport { useDragDropManager } from './useDragDropManager';\nimport { TargetConnector } from '../../common/TargetConnector';\nimport { DropTargetMonitorImpl } from '../../common/DropTargetMonitorImpl';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\nexport function useDropTargetMonitor() {\n var manager = useDragDropManager();\n var monitor = useMemo(function () {\n return new DropTargetMonitorImpl(manager);\n }, [manager]);\n var connector = useMemo(function () {\n return new TargetConnector(manager.getBackend());\n }, [manager]);\n return [monitor, connector];\n}\nexport function useDropHandler(spec, monitor, connector) {\n var manager = useDragDropManager();\n var handler = useMemo(function () {\n return {\n canDrop: function canDrop() {\n var canDrop = spec.current.canDrop;\n return canDrop ? canDrop(monitor.getItem(), monitor) : true;\n },\n hover: function hover() {\n var hover = spec.current.hover;\n\n if (hover) {\n hover(monitor.getItem(), monitor);\n }\n },\n drop: function drop() {\n var drop = spec.current.drop;\n\n if (drop) {\n return drop(monitor.getItem(), monitor);\n }\n }\n };\n }, [monitor]);\n useIsomorphicLayoutEffect(function registerHandler() {\n var _registerTarget = registerTarget(spec.current.accept, handler, manager),\n _registerTarget2 = _slicedToArray(_registerTarget, 2),\n handlerId = _registerTarget2[0],\n unregister = _registerTarget2[1];\n\n monitor.receiveHandlerId(handlerId);\n connector.receiveHandlerId(handlerId);\n return unregister;\n }, [monitor, connector]);\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { useRef, useMemo } from 'react';\nimport { invariant } from '@react-dnd/invariant';\nimport { useMonitorOutput } from './internal/useMonitorOutput';\nimport { useIsomorphicLayoutEffect } from './internal/useIsomorphicLayoutEffect';\nimport { useDropHandler, useDropTargetMonitor } from './internal/drop';\n/**\n * useDropTarget Hook\n * @param spec The drop target specification\n */\n\nexport function useDrop(spec) {\n var specRef = useRef(spec);\n specRef.current = spec;\n invariant(spec.accept != null, 'accept must be defined');\n\n var _useDropTargetMonitor = useDropTargetMonitor(),\n _useDropTargetMonitor2 = _slicedToArray(_useDropTargetMonitor, 2),\n monitor = _useDropTargetMonitor2[0],\n connector = _useDropTargetMonitor2[1];\n\n useDropHandler(specRef, monitor, connector);\n var result = useMonitorOutput(monitor, specRef.current.collect || function () {\n return {};\n }, function () {\n return connector.reconnect();\n });\n var connectDropTarget = useMemo(function () {\n return connector.hooks.dropTarget();\n }, [connector]);\n useIsomorphicLayoutEffect(function () {\n connector.dropTargetOptions = spec.options || null;\n connector.reconnect();\n }, [spec.options]);\n return [result, connectDropTarget];\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { useEffect } from 'react';\nimport { useDragDropManager } from './internal/useDragDropManager';\nimport { useCollector } from './internal/useCollector';\n/**\n * useDragLayer Hook\n * @param collector The property collector\n */\n\nexport function useDragLayer(collect) {\n var dragDropManager = useDragDropManager();\n var monitor = dragDropManager.getMonitor();\n\n var _useCollector = useCollector(monitor, collect),\n _useCollector2 = _slicedToArray(_useCollector, 2),\n collected = _useCollector2[0],\n updateCollected = _useCollector2[1];\n\n useEffect(function () {\n return monitor.subscribeToOffsetChange(updateCollected);\n });\n useEffect(function () {\n return monitor.subscribeToStateChange(updateCollected);\n });\n return collected;\n}","export * from './useDrag';\nexport * from './useDrop';\nexport * from './useDragLayer';","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n// cheap lodash replacements\nexport function isFunction(input) {\n return typeof input === 'function';\n}\nexport function noop() {// noop\n}\n\nfunction isObjectLike(input) {\n return _typeof(input) === 'object' && input !== null;\n}\n\nexport function isPlainObject(input) {\n if (!isObjectLike(input)) {\n return false;\n }\n\n if (Object.getPrototypeOf(input) === null) {\n return true;\n }\n\n var proto = input;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(input) === proto;\n}","export function getDecoratedComponent(instanceRef) {\n var currentRef = instanceRef.current;\n\n if (currentRef == null) {\n return null;\n } else if (currentRef.decoratedRef) {\n // go through the private field in decorateHandler to avoid the invariant hit\n return currentRef.decoratedRef.current;\n } else {\n return currentRef;\n }\n}\nexport function isClassComponent(Component) {\n return Component && Component.prototype && typeof Component.prototype.render === 'function';\n}\nexport function isRefForwardingComponent(C) {\n return C && C.$$typeof && C.$$typeof.toString() === 'Symbol(react.forward_ref)';\n}\nexport function isRefable(C) {\n return isClassComponent(C) || isRefForwardingComponent(C);\n}\nexport function checkDecoratorArguments(functionName, signature) {\n if (process.env.NODE_ENV !== 'production') {\n for (var i = 0; i < (arguments.length <= 2 ? 0 : arguments.length - 2); i++) {\n var arg = i + 2 < 2 || arguments.length <= i + 2 ? undefined : arguments[i + 2];\n\n if (arg && arg.prototype && arg.prototype.render) {\n // eslint-disable-next-line no-console\n console.error('You seem to be applying the arguments in the wrong order. ' + \"It should be \".concat(functionName, \"(\").concat(signature, \")(Component), not the other way around. \") + 'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#you-seem-to-be-applying-the-arguments-in-the-wrong-order');\n return;\n }\n }\n }\n}","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { isFunction, noop } from '../utils/js_utils';\n/**\n * Provides a set of static methods for creating Disposables.\n * @param {Function} action Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n */\n\nexport var Disposable =\n/*#__PURE__*/\nfunction () {\n function Disposable(action) {\n _classCallCheck(this, Disposable);\n\n this.isDisposed = false;\n this.action = isFunction(action) ? action : noop;\n }\n /**\n * Validates whether the given object is a disposable\n * @param {Object} Object to test whether it has a dispose method\n * @returns {Boolean} true if a disposable object, else false.\n */\n\n\n _createClass(Disposable, [{\n key: \"dispose\",\n\n /** Performs the task of cleaning up resources. */\n value: function dispose() {\n if (!this.isDisposed) {\n this.action();\n this.isDisposed = true;\n }\n }\n }], [{\n key: \"isDisposable\",\n value: function isDisposable(d) {\n return d && isFunction(d.dispose);\n }\n }, {\n key: \"_fixup\",\n value: function _fixup(result) {\n return Disposable.isDisposable(result) ? result : Disposable.empty;\n }\n /**\n * Creates a disposable object that invokes the specified action when disposed.\n * @param {Function} dispose Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n * @return {Disposable} The disposable object that runs the given action upon disposal.\n */\n\n }, {\n key: \"create\",\n value: function create(action) {\n return new Disposable(action);\n }\n }]);\n\n return Disposable;\n}();\n/**\n * Gets the disposable that does nothing when disposed.\n */\n\nDisposable.empty = {\n dispose: noop\n};\n/**\n * Represents a group of disposable resources that are disposed together.\n * @constructor\n */\n\nexport var CompositeDisposable =\n/*#__PURE__*/\nfunction () {\n function CompositeDisposable() {\n _classCallCheck(this, CompositeDisposable);\n\n this.isDisposed = false;\n\n for (var _len = arguments.length, disposables = new Array(_len), _key = 0; _key < _len; _key++) {\n disposables[_key] = arguments[_key];\n }\n\n this.disposables = disposables;\n }\n /**\n * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.\n * @param {Any} item Disposable to add.\n */\n\n\n _createClass(CompositeDisposable, [{\n key: \"add\",\n value: function add(item) {\n if (this.isDisposed) {\n item.dispose();\n } else {\n this.disposables.push(item);\n }\n }\n /**\n * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.\n * @param {Any} item Disposable to remove.\n * @returns {Boolean} true if found; false otherwise.\n */\n\n }, {\n key: \"remove\",\n value: function remove(item) {\n var shouldDispose = false;\n\n if (!this.isDisposed) {\n var idx = this.disposables.indexOf(item);\n\n if (idx !== -1) {\n shouldDispose = true;\n this.disposables.splice(idx, 1);\n item.dispose();\n }\n }\n\n return shouldDispose;\n }\n /**\n * Disposes all disposables in the group and removes them from the group but\n * does not dispose the CompositeDisposable.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n if (!this.isDisposed) {\n var len = this.disposables.length;\n var currentDisposables = new Array(len);\n\n for (var i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n\n this.disposables = [];\n\n for (var _i = 0; _i < len; _i++) {\n currentDisposables[_i].dispose();\n }\n }\n }\n /**\n * Disposes all disposables in the group and removes them from the group.\n */\n\n }, {\n key: \"dispose\",\n value: function dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true;\n var len = this.disposables.length;\n var currentDisposables = new Array(len);\n\n for (var i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n\n this.disposables = [];\n\n for (var _i2 = 0; _i2 < len; _i2++) {\n currentDisposables[_i2].dispose();\n }\n }\n }\n }]);\n\n return CompositeDisposable;\n}();\n/**\n * Represents a disposable resource whose underlying disposable resource can\n * be replaced by another disposable resource, causing automatic disposal of\n * the previous underlying disposable resource.\n */\n\nexport var SerialDisposable =\n/*#__PURE__*/\nfunction () {\n function SerialDisposable() {\n _classCallCheck(this, SerialDisposable);\n\n this.isDisposed = false;\n }\n /**\n * Gets the underlying disposable.\n * @returns {Any} the underlying disposable.\n */\n\n\n _createClass(SerialDisposable, [{\n key: \"getDisposable\",\n value: function getDisposable() {\n return this.current;\n }\n }, {\n key: \"setDisposable\",\n value: function setDisposable(value) {\n var shouldDispose = this.isDisposed;\n\n if (!shouldDispose) {\n var old = this.current;\n this.current = value;\n\n if (old) {\n old.dispose();\n }\n }\n\n if (shouldDispose && value) {\n value.dispose();\n }\n }\n /** Performs the task of cleaning up resources. */\n\n }, {\n key: \"dispose\",\n value: function dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true;\n var old = this.current;\n this.current = undefined;\n\n if (old) {\n old.dispose();\n }\n }\n }\n }]);\n\n return SerialDisposable;\n}();","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport * as React from 'react';\nimport { shallowEqual } from '@react-dnd/shallowequal';\nimport { invariant } from '@react-dnd/invariant';\nimport hoistStatics from 'hoist-non-react-statics';\nimport { DndContext } from '../index';\nimport { isPlainObject } from '../utils/js_utils';\nimport { Disposable, CompositeDisposable, SerialDisposable } from './disposables';\nimport { isRefable } from './utils';\nexport default function decorateHandler(_ref) {\n var DecoratedComponent = _ref.DecoratedComponent,\n createHandler = _ref.createHandler,\n createMonitor = _ref.createMonitor,\n createConnector = _ref.createConnector,\n registerHandler = _ref.registerHandler,\n containerDisplayName = _ref.containerDisplayName,\n getType = _ref.getType,\n collect = _ref.collect,\n options = _ref.options;\n var _options$arePropsEqua = options.arePropsEqual,\n arePropsEqual = _options$arePropsEqua === void 0 ? shallowEqual : _options$arePropsEqua;\n var Decorated = DecoratedComponent;\n var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';\n\n var DragDropContainer =\n /*#__PURE__*/\n function (_React$Component) {\n _inherits(DragDropContainer, _React$Component);\n\n function DragDropContainer(props) {\n var _this;\n\n _classCallCheck(this, DragDropContainer);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(DragDropContainer).call(this, props));\n _this.decoratedRef = React.createRef();\n\n _this.handleChange = function () {\n var nextState = _this.getCurrentState();\n\n if (!shallowEqual(nextState, _this.state)) {\n _this.setState(nextState);\n }\n };\n\n _this.disposable = new SerialDisposable();\n\n _this.receiveProps(props);\n\n _this.dispose();\n\n return _this;\n }\n\n _createClass(DragDropContainer, [{\n key: \"getHandlerId\",\n value: function getHandlerId() {\n return this.handlerId;\n }\n }, {\n key: \"getDecoratedComponentInstance\",\n value: function getDecoratedComponentInstance() {\n invariant(this.decoratedRef.current, 'In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()');\n return this.decoratedRef.current;\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n return !arePropsEqual(nextProps, this.props) || !shallowEqual(nextState, this.state);\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.disposable = new SerialDisposable();\n this.currentType = undefined;\n this.receiveProps(this.props);\n this.handleChange();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!arePropsEqual(this.props, prevProps)) {\n this.receiveProps(this.props);\n this.handleChange();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.dispose();\n }\n }, {\n key: \"receiveProps\",\n value: function receiveProps(props) {\n if (!this.handler) {\n return;\n }\n\n this.handler.receiveProps(props);\n this.receiveType(getType(props));\n }\n }, {\n key: \"receiveType\",\n value: function receiveType(type) {\n if (!this.handlerMonitor || !this.manager || !this.handlerConnector) {\n return;\n }\n\n if (type === this.currentType) {\n return;\n }\n\n this.currentType = type;\n\n var _registerHandler = registerHandler(type, this.handler, this.manager),\n _registerHandler2 = _slicedToArray(_registerHandler, 2),\n handlerId = _registerHandler2[0],\n unregister = _registerHandler2[1];\n\n this.handlerId = handlerId;\n this.handlerMonitor.receiveHandlerId(handlerId);\n this.handlerConnector.receiveHandlerId(handlerId);\n var globalMonitor = this.manager.getMonitor();\n var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, {\n handlerIds: [handlerId]\n });\n this.disposable.setDisposable(new CompositeDisposable(new Disposable(unsubscribe), new Disposable(unregister)));\n }\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.disposable.dispose();\n\n if (this.handlerConnector) {\n this.handlerConnector.receiveHandlerId(null);\n }\n }\n }, {\n key: \"getCurrentState\",\n value: function getCurrentState() {\n if (!this.handlerConnector) {\n return {};\n }\n\n var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor, this.props);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(isPlainObject(nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState);\n }\n\n return nextState;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return React.createElement(DndContext.Consumer, null, function (_ref2) {\n var dragDropManager = _ref2.dragDropManager;\n\n _this2.receiveDragDropManager(dragDropManager);\n\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(function () {\n return _this2.handlerConnector.reconnect();\n });\n }\n\n return React.createElement(Decorated, Object.assign({}, _this2.props, _this2.getCurrentState(), {\n // NOTE: if Decorated is a Function Component, decoratedRef will not be populated unless it's a refforwarding component.\n ref: isRefable(Decorated) ? _this2.decoratedRef : null\n }));\n });\n }\n }, {\n key: \"receiveDragDropManager\",\n value: function receiveDragDropManager(dragDropManager) {\n if (this.manager !== undefined) {\n return;\n }\n\n invariant(dragDropManager !== undefined, 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to render a DndProvider component in your top-level component. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);\n\n if (dragDropManager === undefined) {\n return;\n }\n\n this.manager = dragDropManager;\n this.handlerMonitor = createMonitor(dragDropManager);\n this.handlerConnector = createConnector(dragDropManager.getBackend());\n this.handler = createHandler(this.handlerMonitor, this.decoratedRef);\n }\n }]);\n\n return DragDropContainer;\n }(React.Component);\n\n DragDropContainer.DecoratedComponent = DecoratedComponent;\n DragDropContainer.displayName = \"\".concat(containerDisplayName, \"(\").concat(displayName, \")\");\n return hoistStatics(DragDropContainer, DecoratedComponent);\n}","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nexport function isValidType(type, allowArray) {\n return typeof type === 'string' || _typeof(type) === 'symbol' || !!allowArray && Array.isArray(type) && type.every(function (t) {\n return isValidType(t, false);\n });\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { invariant } from '@react-dnd/invariant';\nimport { isPlainObject } from '../utils/js_utils';\nimport { getDecoratedComponent } from './utils';\nvar ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];\nvar REQUIRED_SPEC_METHODS = ['beginDrag'];\n\nvar SourceImpl =\n/*#__PURE__*/\nfunction () {\n function SourceImpl(spec, monitor, ref) {\n var _this = this;\n\n _classCallCheck(this, SourceImpl);\n\n this.props = null;\n\n this.beginDrag = function () {\n if (!_this.props) {\n return;\n }\n\n var item = _this.spec.beginDrag(_this.props, _this.monitor, _this.ref.current);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(isPlainObject(item), 'beginDrag() must return a plain object that represents the dragged item. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', item);\n }\n\n return item;\n };\n\n this.spec = spec;\n this.monitor = monitor;\n this.ref = ref;\n }\n\n _createClass(SourceImpl, [{\n key: \"receiveProps\",\n value: function receiveProps(props) {\n this.props = props;\n }\n }, {\n key: \"canDrag\",\n value: function canDrag() {\n if (!this.props) {\n return false;\n }\n\n if (!this.spec.canDrag) {\n return true;\n }\n\n return this.spec.canDrag(this.props, this.monitor);\n }\n }, {\n key: \"isDragging\",\n value: function isDragging(globalMonitor, sourceId) {\n if (!this.props) {\n return false;\n }\n\n if (!this.spec.isDragging) {\n return sourceId === globalMonitor.getSourceId();\n }\n\n return this.spec.isDragging(this.props, this.monitor);\n }\n }, {\n key: \"endDrag\",\n value: function endDrag() {\n if (!this.props) {\n return;\n }\n\n if (!this.spec.endDrag) {\n return;\n }\n\n this.spec.endDrag(this.props, this.monitor, getDecoratedComponent(this.ref));\n }\n }]);\n\n return SourceImpl;\n}();\n\nexport default function createSourceFactory(spec) {\n Object.keys(spec).forEach(function (key) {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected \"%s\" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', key, key, spec[key]);\n });\n REQUIRED_SPEC_METHODS.forEach(function (key) {\n invariant(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', key, key, spec[key]);\n });\n return function createSource(monitor, ref) {\n return new SourceImpl(spec, monitor, ref);\n };\n}","import { invariant } from '@react-dnd/invariant';\nimport { isPlainObject } from '../utils/js_utils';\nimport { checkDecoratorArguments } from './utils';\nimport decorateHandler from './decorateHandler';\nimport { registerSource } from '../common/registration';\nimport { DragSourceMonitorImpl } from '../common/DragSourceMonitorImpl';\nimport { SourceConnector } from '../common/SourceConnector';\nimport { isValidType } from '../utils/isValidType';\nimport createSourceFactory from './createSourceFactory';\n/**\n * Decorates a component as a dragsource\n * @param type The dragsource type\n * @param spec The drag source specification\n * @param collect The props collector function\n * @param options DnD options\n */\n\nexport function DragSource(type, spec, collect) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n checkDecoratorArguments('DragSource', 'type, spec, collect[, options]', type, spec, collect, options);\n var getType = type;\n\n if (typeof type !== 'function') {\n invariant(isValidType(type), 'Expected \"type\" provided as the first argument to DragSource to be ' + 'a string, or a function that returns a string given the current props. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', type);\n\n getType = function getType() {\n return type;\n };\n }\n\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DragSource to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', spec);\n var createSource = createSourceFactory(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DragSource to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DragSource to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', collect);\n return function decorateSource(DecoratedComponent) {\n return decorateHandler({\n containerDisplayName: 'DragSource',\n createHandler: createSource,\n registerHandler: registerSource,\n createConnector: function createConnector(backend) {\n return new SourceConnector(backend);\n },\n createMonitor: function createMonitor(manager) {\n return new DragSourceMonitorImpl(manager);\n },\n DecoratedComponent: DecoratedComponent,\n getType: getType,\n collect: collect,\n options: options\n });\n };\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { invariant } from '@react-dnd/invariant';\nimport { isPlainObject } from '../utils/js_utils';\nimport { getDecoratedComponent } from './utils';\nvar ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];\n\nvar TargetImpl =\n/*#__PURE__*/\nfunction () {\n function TargetImpl(spec, monitor, ref) {\n _classCallCheck(this, TargetImpl);\n\n this.props = null;\n this.spec = spec;\n this.monitor = monitor;\n this.ref = ref;\n }\n\n _createClass(TargetImpl, [{\n key: \"receiveProps\",\n value: function receiveProps(props) {\n this.props = props;\n }\n }, {\n key: \"receiveMonitor\",\n value: function receiveMonitor(monitor) {\n this.monitor = monitor;\n }\n }, {\n key: \"canDrop\",\n value: function canDrop() {\n if (!this.spec.canDrop) {\n return true;\n }\n\n return this.spec.canDrop(this.props, this.monitor);\n }\n }, {\n key: \"hover\",\n value: function hover() {\n if (!this.spec.hover) {\n return;\n }\n\n this.spec.hover(this.props, this.monitor, getDecoratedComponent(this.ref));\n }\n }, {\n key: \"drop\",\n value: function drop() {\n if (!this.spec.drop) {\n return undefined;\n }\n\n var dropResult = this.spec.drop(this.props, this.monitor, this.ref.current);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(typeof dropResult === 'undefined' || isPlainObject(dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', dropResult);\n }\n\n return dropResult;\n }\n }]);\n\n return TargetImpl;\n}();\n\nexport default function createTargetFactory(spec) {\n Object.keys(spec).forEach(function (key) {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected \"%s\" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', key, key, spec[key]);\n });\n return function createTarget(monitor, ref) {\n return new TargetImpl(spec, monitor, ref);\n };\n}","import { invariant } from '@react-dnd/invariant';\nimport { isPlainObject } from '../utils/js_utils';\nimport { registerTarget } from '../common/registration';\nimport { isValidType } from '../utils/isValidType';\nimport { TargetConnector } from '../common/TargetConnector';\nimport { DropTargetMonitorImpl } from '../common/DropTargetMonitorImpl';\nimport { checkDecoratorArguments } from './utils';\nimport decorateHandler from './decorateHandler';\nimport createTargetFactory from './createTargetFactory';\nexport function DropTarget(type, spec, collect) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n checkDecoratorArguments('DropTarget', 'type, spec, collect[, options]', type, spec, collect, options);\n var getType = type;\n\n if (typeof type !== 'function') {\n invariant(isValidType(type, true), 'Expected \"type\" provided as the first argument to DropTarget to be ' + 'a string, an array of strings, or a function that returns either given ' + 'the current props. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', type);\n\n getType = function getType() {\n return type;\n };\n }\n\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', spec);\n var createTarget = createTargetFactory(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', collect);\n return function decorateTarget(DecoratedComponent) {\n return decorateHandler({\n containerDisplayName: 'DropTarget',\n createHandler: createTarget,\n registerHandler: registerTarget,\n createMonitor: function createMonitor(manager) {\n return new DropTargetMonitorImpl(manager);\n },\n createConnector: function createConnector(backend) {\n return new TargetConnector(backend);\n },\n DecoratedComponent: DecoratedComponent,\n getType: getType,\n collect: collect,\n options: options\n });\n };\n}","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport * as React from 'react';\nimport { shallowEqual } from '@react-dnd/shallowequal';\nimport hoistStatics from 'hoist-non-react-statics';\nimport { invariant } from '@react-dnd/invariant';\nimport { DndContext } from '../index';\nimport { isPlainObject } from '../utils/js_utils';\nimport { isRefable, checkDecoratorArguments } from './utils';\nexport function DragLayer(collect) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n checkDecoratorArguments('DragLayer', 'collect[, options]', collect, options);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ', 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the second argument to DragLayer to be a plain object when specified. ' + 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer', options);\n return function decorateLayer(DecoratedComponent) {\n var Decorated = DecoratedComponent;\n var _options$arePropsEqua = options.arePropsEqual,\n arePropsEqual = _options$arePropsEqua === void 0 ? shallowEqual : _options$arePropsEqua;\n var displayName = Decorated.displayName || Decorated.name || 'Component';\n\n var DragLayerContainer =\n /*#__PURE__*/\n function (_React$Component) {\n _inherits(DragLayerContainer, _React$Component);\n\n function DragLayerContainer() {\n var _this;\n\n _classCallCheck(this, DragLayerContainer);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(DragLayerContainer).apply(this, arguments));\n _this.isCurrentlyMounted = false;\n _this.ref = React.createRef();\n\n _this.handleChange = function () {\n if (!_this.isCurrentlyMounted) {\n return;\n }\n\n var nextState = _this.getCurrentState();\n\n if (!shallowEqual(nextState, _this.state)) {\n _this.setState(nextState);\n }\n };\n\n return _this;\n }\n\n _createClass(DragLayerContainer, [{\n key: \"getDecoratedComponentInstance\",\n value: function getDecoratedComponentInstance() {\n invariant(this.ref.current, 'In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()');\n return this.ref.current;\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n return !arePropsEqual(nextProps, this.props) || !shallowEqual(nextState, this.state);\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.isCurrentlyMounted = true;\n this.handleChange();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.isCurrentlyMounted = false;\n\n if (this.unsubscribeFromOffsetChange) {\n this.unsubscribeFromOffsetChange();\n this.unsubscribeFromOffsetChange = undefined;\n }\n\n if (this.unsubscribeFromStateChange) {\n this.unsubscribeFromStateChange();\n this.unsubscribeFromStateChange = undefined;\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return React.createElement(DndContext.Consumer, null, function (_ref) {\n var dragDropManager = _ref.dragDropManager;\n\n if (dragDropManager === undefined) {\n return null;\n }\n\n _this2.receiveDragDropManager(dragDropManager); // Let componentDidMount fire to initialize the collected state\n\n\n if (!_this2.isCurrentlyMounted) {\n return null;\n }\n\n return React.createElement(Decorated, Object.assign({}, _this2.props, _this2.state, {\n ref: isRefable(Decorated) ? _this2.ref : null\n }));\n });\n }\n }, {\n key: \"receiveDragDropManager\",\n value: function receiveDragDropManager(dragDropManager) {\n if (this.manager !== undefined) {\n return;\n }\n\n this.manager = dragDropManager;\n invariant(_typeof(dragDropManager) === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to render a DndProvider component in your top-level component. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);\n var monitor = this.manager.getMonitor();\n this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange);\n this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange);\n }\n }, {\n key: \"getCurrentState\",\n value: function getCurrentState() {\n if (!this.manager) {\n return {};\n }\n\n var monitor = this.manager.getMonitor();\n return collect(monitor, this.props);\n }\n }]);\n\n return DragLayerContainer;\n }(React.Component);\n\n DragLayerContainer.displayName = \"DragLayer(\".concat(displayName, \")\");\n DragLayerContainer.DecoratedComponent = DecoratedComponent;\n return hoistStatics(DragLayerContainer, DecoratedComponent);\n };\n}","export * from './DragSource';\nexport * from './DropTarget';\nexport * from './DragLayer';","export * from './common';\nexport * from './hooks';\nexport * from './decorators';","// cheap lodash replacements\nexport function memoize(fn) {\n var result = null;\n\n var memoized = function memoized() {\n if (result == null) {\n result = fn();\n }\n\n return result;\n };\n\n return memoized;\n}\n/**\n * drop-in replacement for _.without\n */\n\nexport function without(items, item) {\n return items.filter(function (i) {\n return i !== item;\n });\n}\nexport function union(itemsA, itemsB) {\n var set = new Set();\n\n var insertItem = function insertItem(item) {\n return set.add(item);\n };\n\n itemsA.forEach(insertItem);\n itemsB.forEach(insertItem);\n var result = [];\n set.forEach(function (key) {\n return result.push(key);\n });\n return result;\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { union, without } from './utils/js_utils';\n\nvar EnterLeaveCounter =\n/*#__PURE__*/\nfunction () {\n function EnterLeaveCounter(isNodeInDocument) {\n _classCallCheck(this, EnterLeaveCounter);\n\n this.entered = [];\n this.isNodeInDocument = isNodeInDocument;\n }\n\n _createClass(EnterLeaveCounter, [{\n key: \"enter\",\n value: function enter(enteringNode) {\n var _this = this;\n\n var previousLength = this.entered.length;\n\n var isNodeEntered = function isNodeEntered(node) {\n return _this.isNodeInDocument(node) && (!node.contains || node.contains(enteringNode));\n };\n\n this.entered = union(this.entered.filter(isNodeEntered), [enteringNode]);\n return previousLength === 0 && this.entered.length > 0;\n }\n }, {\n key: \"leave\",\n value: function leave(leavingNode) {\n var previousLength = this.entered.length;\n this.entered = without(this.entered.filter(this.isNodeInDocument), leavingNode);\n return previousLength > 0 && this.entered.length === 0;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.entered = [];\n }\n }]);\n\n return EnterLeaveCounter;\n}();\n\nexport { EnterLeaveCounter as default };","import { memoize } from './utils/js_utils';\nexport var isFirefox = memoize(function () {\n return /firefox/i.test(navigator.userAgent);\n});\nexport var isSafari = memoize(function () {\n return Boolean(window.safari);\n});","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar MonotonicInterpolant =\n/*#__PURE__*/\nfunction () {\n function MonotonicInterpolant(xs, ys) {\n _classCallCheck(this, MonotonicInterpolant);\n\n var length = xs.length; // Rearrange xs and ys so that xs is sorted\n\n var indexes = [];\n\n for (var i = 0; i < length; i++) {\n indexes.push(i);\n }\n\n indexes.sort(function (a, b) {\n return xs[a] < xs[b] ? -1 : 1;\n }); // Get consecutive differences and slopes\n\n var dys = [];\n var dxs = [];\n var ms = [];\n var dx;\n var dy;\n\n for (var _i = 0; _i < length - 1; _i++) {\n dx = xs[_i + 1] - xs[_i];\n dy = ys[_i + 1] - ys[_i];\n dxs.push(dx);\n dys.push(dy);\n ms.push(dy / dx);\n } // Get degree-1 coefficients\n\n\n var c1s = [ms[0]];\n\n for (var _i2 = 0; _i2 < dxs.length - 1; _i2++) {\n var m2 = ms[_i2];\n var mNext = ms[_i2 + 1];\n\n if (m2 * mNext <= 0) {\n c1s.push(0);\n } else {\n dx = dxs[_i2];\n var dxNext = dxs[_i2 + 1];\n var common = dx + dxNext;\n c1s.push(3 * common / ((common + dxNext) / m2 + (common + dx) / mNext));\n }\n }\n\n c1s.push(ms[ms.length - 1]); // Get degree-2 and degree-3 coefficients\n\n var c2s = [];\n var c3s = [];\n var m;\n\n for (var _i3 = 0; _i3 < c1s.length - 1; _i3++) {\n m = ms[_i3];\n var c1 = c1s[_i3];\n var invDx = 1 / dxs[_i3];\n\n var _common = c1 + c1s[_i3 + 1] - m - m;\n\n c2s.push((m - c1 - _common) * invDx);\n c3s.push(_common * invDx * invDx);\n }\n\n this.xs = xs;\n this.ys = ys;\n this.c1s = c1s;\n this.c2s = c2s;\n this.c3s = c3s;\n }\n\n _createClass(MonotonicInterpolant, [{\n key: \"interpolate\",\n value: function interpolate(x) {\n var xs = this.xs,\n ys = this.ys,\n c1s = this.c1s,\n c2s = this.c2s,\n c3s = this.c3s; // The rightmost point in the dataset should give an exact result\n\n var i = xs.length - 1;\n\n if (x === xs[i]) {\n return ys[i];\n } // Search for the interval x is in, returning the corresponding y if x is one of the original xs\n\n\n var low = 0;\n var high = c3s.length - 1;\n var mid;\n\n while (low <= high) {\n mid = Math.floor(0.5 * (low + high));\n var xHere = xs[mid];\n\n if (xHere < x) {\n low = mid + 1;\n } else if (xHere > x) {\n high = mid - 1;\n } else {\n return ys[mid];\n }\n }\n\n i = Math.max(0, high); // Interpolate\n\n var diff = x - xs[i];\n var diffSq = diff * diff;\n return ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq;\n }\n }]);\n\n return MonotonicInterpolant;\n}();\n\nexport { MonotonicInterpolant as default };","import { isSafari, isFirefox } from './BrowserDetector';\nimport MonotonicInterpolant from './MonotonicInterpolant';\nvar ELEMENT_NODE = 1;\nexport function getNodeClientOffset(node) {\n var el = node.nodeType === ELEMENT_NODE ? node : node.parentElement;\n\n if (!el) {\n return null;\n }\n\n var _el$getBoundingClient = el.getBoundingClientRect(),\n top = _el$getBoundingClient.top,\n left = _el$getBoundingClient.left;\n\n return {\n x: left,\n y: top\n };\n}\nexport function getEventClientOffset(e) {\n return {\n x: e.clientX,\n y: e.clientY\n };\n}\n\nfunction isImageNode(node) {\n return node.nodeName === 'IMG' && (isFirefox() || !document.documentElement.contains(node));\n}\n\nfunction getDragPreviewSize(isImage, dragPreview, sourceWidth, sourceHeight) {\n var dragPreviewWidth = isImage ? dragPreview.width : sourceWidth;\n var dragPreviewHeight = isImage ? dragPreview.height : sourceHeight; // Work around @2x coordinate discrepancies in browsers\n\n if (isSafari() && isImage) {\n dragPreviewHeight /= window.devicePixelRatio;\n dragPreviewWidth /= window.devicePixelRatio;\n }\n\n return {\n dragPreviewWidth: dragPreviewWidth,\n dragPreviewHeight: dragPreviewHeight\n };\n}\n\nexport function getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint, offsetPoint) {\n // The browsers will use the image intrinsic size under different conditions.\n // Firefox only cares if it's an image, but WebKit also wants it to be detached.\n var isImage = isImageNode(dragPreview);\n var dragPreviewNode = isImage ? sourceNode : dragPreview;\n var dragPreviewNodeOffsetFromClient = getNodeClientOffset(dragPreviewNode);\n var offsetFromDragPreview = {\n x: clientOffset.x - dragPreviewNodeOffsetFromClient.x,\n y: clientOffset.y - dragPreviewNodeOffsetFromClient.y\n };\n var sourceWidth = sourceNode.offsetWidth,\n sourceHeight = sourceNode.offsetHeight;\n var anchorX = anchorPoint.anchorX,\n anchorY = anchorPoint.anchorY;\n\n var _getDragPreviewSize = getDragPreviewSize(isImage, dragPreview, sourceWidth, sourceHeight),\n dragPreviewWidth = _getDragPreviewSize.dragPreviewWidth,\n dragPreviewHeight = _getDragPreviewSize.dragPreviewHeight;\n\n var calculateYOffset = function calculateYOffset() {\n var interpolantY = new MonotonicInterpolant([0, 0.5, 1], [// Dock to the top\n offsetFromDragPreview.y, // Align at the center\n offsetFromDragPreview.y / sourceHeight * dragPreviewHeight, // Dock to the bottom\n offsetFromDragPreview.y + dragPreviewHeight - sourceHeight]);\n var y = interpolantY.interpolate(anchorY); // Work around Safari 8 positioning bug\n\n if (isSafari() && isImage) {\n // We'll have to wait for @3x to see if this is entirely correct\n y += (window.devicePixelRatio - 1) * dragPreviewHeight;\n }\n\n return y;\n };\n\n var calculateXOffset = function calculateXOffset() {\n // Interpolate coordinates depending on anchor point\n // If you know a simpler way to do this, let me know\n var interpolantX = new MonotonicInterpolant([0, 0.5, 1], [// Dock to the left\n offsetFromDragPreview.x, // Align at the center\n offsetFromDragPreview.x / sourceWidth * dragPreviewWidth, // Dock to the right\n offsetFromDragPreview.x + dragPreviewWidth - sourceWidth]);\n return interpolantX.interpolate(anchorX);\n }; // Force offsets if specified in the options.\n\n\n var offsetX = offsetPoint.offsetX,\n offsetY = offsetPoint.offsetY;\n var isManualOffsetX = offsetX === 0 || offsetX;\n var isManualOffsetY = offsetY === 0 || offsetY;\n return {\n x: isManualOffsetX ? offsetX : calculateXOffset(),\n y: isManualOffsetY ? offsetY : calculateYOffset()\n };\n}","export var FILE = '__NATIVE_FILE__';\nexport var URL = '__NATIVE_URL__';\nexport var TEXT = '__NATIVE_TEXT__';","export function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) {\n var result = typesToTry.reduce(function (resultSoFar, typeToTry) {\n return resultSoFar || dataTransfer.getData(typeToTry);\n }, '');\n return result != null ? result : defaultValue;\n}","var _nativeTypesConfig;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport * as NativeTypes from '../NativeTypes';\nimport { getDataFromDataTransfer } from './getDataFromDataTransfer';\nexport var nativeTypesConfig = (_nativeTypesConfig = {}, _defineProperty(_nativeTypesConfig, NativeTypes.FILE, {\n exposeProperties: {\n files: function files(dataTransfer) {\n return Array.prototype.slice.call(dataTransfer.files);\n },\n items: function items(dataTransfer) {\n return dataTransfer.items;\n }\n },\n matchesTypes: ['Files']\n}), _defineProperty(_nativeTypesConfig, NativeTypes.URL, {\n exposeProperties: {\n urls: function urls(dataTransfer, matchesTypes) {\n return getDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\\n');\n }\n },\n matchesTypes: ['Url', 'text/uri-list']\n}), _defineProperty(_nativeTypesConfig, NativeTypes.TEXT, {\n exposeProperties: {\n text: function text(dataTransfer, matchesTypes) {\n return getDataFromDataTransfer(dataTransfer, matchesTypes, '');\n }\n },\n matchesTypes: ['Text', 'text/plain']\n}), _nativeTypesConfig);","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nexport var NativeDragSource =\n/*#__PURE__*/\nfunction () {\n function NativeDragSource(config) {\n _classCallCheck(this, NativeDragSource);\n\n this.config = config;\n this.item = {};\n this.initializeExposedProperties();\n }\n\n _createClass(NativeDragSource, [{\n key: \"initializeExposedProperties\",\n value: function initializeExposedProperties() {\n var _this = this;\n\n Object.keys(this.config.exposeProperties).forEach(function (property) {\n Object.defineProperty(_this.item, property, {\n configurable: true,\n enumerable: true,\n get: function get() {\n // eslint-disable-next-line no-console\n console.warn(\"Browser doesn't allow reading \\\"\".concat(property, \"\\\" until the drop event.\"));\n return null;\n }\n });\n });\n }\n }, {\n key: \"loadDataTransfer\",\n value: function loadDataTransfer(dataTransfer) {\n var _this2 = this;\n\n if (dataTransfer) {\n var newProperties = {};\n Object.keys(this.config.exposeProperties).forEach(function (property) {\n newProperties[property] = {\n value: _this2.config.exposeProperties[property](dataTransfer, _this2.config.matchesTypes),\n configurable: true,\n enumerable: true\n };\n });\n Object.defineProperties(this.item, newProperties);\n }\n }\n }, {\n key: \"canDrag\",\n value: function canDrag() {\n return true;\n }\n }, {\n key: \"beginDrag\",\n value: function beginDrag() {\n return this.item;\n }\n }, {\n key: \"isDragging\",\n value: function isDragging(monitor, handle) {\n return handle === monitor.getSourceId();\n }\n }, {\n key: \"endDrag\",\n value: function endDrag() {// empty\n }\n }]);\n\n return NativeDragSource;\n}();","import { nativeTypesConfig } from './nativeTypesConfig';\nimport { NativeDragSource } from './NativeDragSource';\nexport function createNativeDragSource(type, dataTransfer) {\n var result = new NativeDragSource(nativeTypesConfig[type]);\n result.loadDataTransfer(dataTransfer);\n return result;\n}\nexport function matchNativeItemType(dataTransfer) {\n if (!dataTransfer) {\n return null;\n }\n\n var dataTransferTypes = Array.prototype.slice.call(dataTransfer.types || []);\n return Object.keys(nativeTypesConfig).filter(function (nativeItemType) {\n var matchesTypes = nativeTypesConfig[nativeItemType].matchesTypes;\n return matchesTypes.some(function (t) {\n return dataTransferTypes.indexOf(t) > -1;\n });\n })[0] || null;\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nexport var OptionsReader =\n/*#__PURE__*/\nfunction () {\n function OptionsReader(globalContext) {\n _classCallCheck(this, OptionsReader);\n\n this.globalContext = globalContext;\n }\n\n _createClass(OptionsReader, [{\n key: \"window\",\n get: function get() {\n if (this.globalContext) {\n return this.globalContext;\n } else if (typeof window !== 'undefined') {\n return window;\n }\n\n return undefined;\n }\n }, {\n key: \"document\",\n get: function get() {\n if (this.window) {\n return this.window.document;\n }\n\n return undefined;\n }\n }]);\n\n return OptionsReader;\n}();","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport EnterLeaveCounter from './EnterLeaveCounter';\nimport { isFirefox } from './BrowserDetector';\nimport { getNodeClientOffset, getEventClientOffset, getDragPreviewOffset } from './OffsetUtils';\nimport { createNativeDragSource, matchNativeItemType } from './NativeDragSources';\nimport * as NativeTypes from './NativeTypes';\nimport { OptionsReader } from './OptionsReader';\n\nvar HTML5Backend =\n/*#__PURE__*/\nfunction () {\n function HTML5Backend(manager, globalContext) {\n var _this = this;\n\n _classCallCheck(this, HTML5Backend);\n\n this.sourcePreviewNodes = new Map();\n this.sourcePreviewNodeOptions = new Map();\n this.sourceNodes = new Map();\n this.sourceNodeOptions = new Map();\n this.dragStartSourceIds = null;\n this.dropTargetIds = [];\n this.dragEnterTargetIds = [];\n this.currentNativeSource = null;\n this.currentNativeHandle = null;\n this.currentDragSourceNode = null;\n this.altKeyPressed = false;\n this.mouseMoveTimeoutTimer = null;\n this.asyncEndDragFrameId = null;\n this.dragOverTargetIds = null;\n\n this.getSourceClientOffset = function (sourceId) {\n return getNodeClientOffset(_this.sourceNodes.get(sourceId));\n };\n\n this.endDragNativeItem = function () {\n if (!_this.isDraggingNativeItem()) {\n return;\n }\n\n _this.actions.endDrag();\n\n _this.registry.removeSource(_this.currentNativeHandle);\n\n _this.currentNativeHandle = null;\n _this.currentNativeSource = null;\n };\n\n this.isNodeInDocument = function (node) {\n // Check the node either in the main document or in the current context\n return _this.document && _this.document.body && document.body.contains(node);\n };\n\n this.endDragIfSourceWasRemovedFromDOM = function () {\n var node = _this.currentDragSourceNode;\n\n if (_this.isNodeInDocument(node)) {\n return;\n }\n\n if (_this.clearCurrentDragSourceNode()) {\n _this.actions.endDrag();\n }\n };\n\n this.handleTopDragStartCapture = function () {\n _this.clearCurrentDragSourceNode();\n\n _this.dragStartSourceIds = [];\n };\n\n this.handleTopDragStart = function (e) {\n if (e.defaultPrevented) {\n return;\n }\n\n var dragStartSourceIds = _this.dragStartSourceIds;\n _this.dragStartSourceIds = null;\n var clientOffset = getEventClientOffset(e); // Avoid crashing if we missed a drop event or our previous drag died\n\n if (_this.monitor.isDragging()) {\n _this.actions.endDrag();\n } // Don't publish the source just yet (see why below)\n\n\n _this.actions.beginDrag(dragStartSourceIds || [], {\n publishSource: false,\n getSourceClientOffset: _this.getSourceClientOffset,\n clientOffset: clientOffset\n });\n\n var dataTransfer = e.dataTransfer;\n var nativeType = matchNativeItemType(dataTransfer);\n\n if (_this.monitor.isDragging()) {\n if (dataTransfer && typeof dataTransfer.setDragImage === 'function') {\n // Use custom drag image if user specifies it.\n // If child drag source refuses drag but parent agrees,\n // use parent's node as drag image. Neither works in IE though.\n var sourceId = _this.monitor.getSourceId();\n\n var sourceNode = _this.sourceNodes.get(sourceId);\n\n var dragPreview = _this.sourcePreviewNodes.get(sourceId) || sourceNode;\n\n if (dragPreview) {\n var _this$getCurrentSourc = _this.getCurrentSourcePreviewNodeOptions(),\n anchorX = _this$getCurrentSourc.anchorX,\n anchorY = _this$getCurrentSourc.anchorY,\n offsetX = _this$getCurrentSourc.offsetX,\n offsetY = _this$getCurrentSourc.offsetY;\n\n var anchorPoint = {\n anchorX: anchorX,\n anchorY: anchorY\n };\n var offsetPoint = {\n offsetX: offsetX,\n offsetY: offsetY\n };\n var dragPreviewOffset = getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint, offsetPoint);\n dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y);\n }\n }\n\n try {\n // Firefox won't drag without setting data\n dataTransfer.setData('application/json', {});\n } catch (err) {} // IE doesn't support MIME types in setData\n // Store drag source node so we can check whether\n // it is removed from DOM and trigger endDrag manually.\n\n\n _this.setCurrentDragSourceNode(e.target); // Now we are ready to publish the drag source.. or are we not?\n\n\n var _this$getCurrentSourc2 = _this.getCurrentSourcePreviewNodeOptions(),\n captureDraggingState = _this$getCurrentSourc2.captureDraggingState;\n\n if (!captureDraggingState) {\n // Usually we want to publish it in the next tick so that browser\n // is able to screenshot the current (not yet dragging) state.\n //\n // It also neatly avoids a situation where render() returns null\n // in the same tick for the source element, and browser freaks out.\n setTimeout(function () {\n return _this.actions.publishDragSource();\n }, 0);\n } else {\n // In some cases the user may want to override this behavior, e.g.\n // to work around IE not supporting custom drag previews.\n //\n // When using a custom drag layer, the only way to prevent\n // the default drag preview from drawing in IE is to screenshot\n // the dragging state in which the node itself has zero opacity\n // and height. In this case, though, returning null from render()\n // will abruptly end the dragging, which is not obvious.\n //\n // This is the reason such behavior is strictly opt-in.\n _this.actions.publishDragSource();\n }\n } else if (nativeType) {\n // A native item (such as URL) dragged from inside the document\n _this.beginDragNativeItem(nativeType);\n } else if (dataTransfer && !dataTransfer.types && (e.target && !e.target.hasAttribute || !e.target.hasAttribute('draggable'))) {\n // Looks like a Safari bug: dataTransfer.types is null, but there was no draggable.\n // Just let it drag. It's a native type (URL or text) and will be picked up in\n // dragenter handler.\n return;\n } else {\n // If by this time no drag source reacted, tell browser not to drag.\n e.preventDefault();\n }\n };\n\n this.handleTopDragEndCapture = function () {\n if (_this.clearCurrentDragSourceNode()) {\n // Firefox can dispatch this event in an infinite loop\n // if dragend handler does something like showing an alert.\n // Only proceed if we have not handled it already.\n _this.actions.endDrag();\n }\n };\n\n this.handleTopDragEnterCapture = function (e) {\n _this.dragEnterTargetIds = [];\n\n var isFirstEnter = _this.enterLeaveCounter.enter(e.target);\n\n if (!isFirstEnter || _this.monitor.isDragging()) {\n return;\n }\n\n var dataTransfer = e.dataTransfer;\n var nativeType = matchNativeItemType(dataTransfer);\n\n if (nativeType) {\n // A native item (such as file or URL) dragged from outside the document\n _this.beginDragNativeItem(nativeType, dataTransfer);\n }\n };\n\n this.handleTopDragEnter = function (e) {\n var dragEnterTargetIds = _this.dragEnterTargetIds;\n _this.dragEnterTargetIds = [];\n\n if (!_this.monitor.isDragging()) {\n // This is probably a native item type we don't understand.\n return;\n }\n\n _this.altKeyPressed = e.altKey;\n\n if (!isFirefox()) {\n // Don't emit hover in `dragenter` on Firefox due to an edge case.\n // If the target changes position as the result of `dragenter`, Firefox\n // will still happily dispatch `dragover` despite target being no longer\n // there. The easy solution is to only fire `hover` in `dragover` on FF.\n _this.actions.hover(dragEnterTargetIds, {\n clientOffset: getEventClientOffset(e)\n });\n }\n\n var canDrop = dragEnterTargetIds.some(function (targetId) {\n return _this.monitor.canDropOnTarget(targetId);\n });\n\n if (canDrop) {\n // IE requires this to fire dragover events\n e.preventDefault();\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = _this.getCurrentDropEffect();\n }\n }\n };\n\n this.handleTopDragOverCapture = function () {\n _this.dragOverTargetIds = [];\n };\n\n this.handleTopDragOver = function (e) {\n var dragOverTargetIds = _this.dragOverTargetIds;\n _this.dragOverTargetIds = [];\n\n if (!_this.monitor.isDragging()) {\n // This is probably a native item type we don't understand.\n // Prevent default \"drop and blow away the whole document\" action.\n e.preventDefault();\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = 'none';\n }\n\n return;\n }\n\n _this.altKeyPressed = e.altKey;\n\n _this.actions.hover(dragOverTargetIds || [], {\n clientOffset: getEventClientOffset(e)\n });\n\n var canDrop = (dragOverTargetIds || []).some(function (targetId) {\n return _this.monitor.canDropOnTarget(targetId);\n });\n\n if (canDrop) {\n // Show user-specified drop effect.\n e.preventDefault();\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = _this.getCurrentDropEffect();\n }\n } else if (_this.isDraggingNativeItem()) {\n // Don't show a nice cursor but still prevent default\n // \"drop and blow away the whole document\" action.\n e.preventDefault();\n } else {\n e.preventDefault();\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = 'none';\n }\n }\n };\n\n this.handleTopDragLeaveCapture = function (e) {\n if (_this.isDraggingNativeItem()) {\n e.preventDefault();\n }\n\n var isLastLeave = _this.enterLeaveCounter.leave(e.target);\n\n if (!isLastLeave) {\n return;\n }\n\n if (_this.isDraggingNativeItem()) {\n _this.endDragNativeItem();\n }\n };\n\n this.handleTopDropCapture = function (e) {\n _this.dropTargetIds = [];\n e.preventDefault();\n\n if (_this.isDraggingNativeItem()) {\n _this.currentNativeSource.loadDataTransfer(e.dataTransfer);\n }\n\n _this.enterLeaveCounter.reset();\n };\n\n this.handleTopDrop = function (e) {\n var dropTargetIds = _this.dropTargetIds;\n _this.dropTargetIds = [];\n\n _this.actions.hover(dropTargetIds, {\n clientOffset: getEventClientOffset(e)\n });\n\n _this.actions.drop({\n dropEffect: _this.getCurrentDropEffect()\n });\n\n if (_this.isDraggingNativeItem()) {\n _this.endDragNativeItem();\n } else {\n _this.endDragIfSourceWasRemovedFromDOM();\n }\n };\n\n this.handleSelectStart = function (e) {\n var target = e.target; // Only IE requires us to explicitly say\n // we want drag drop operation to start\n\n if (typeof target.dragDrop !== 'function') {\n return;\n } // Inputs and textareas should be selectable\n\n\n if (target.tagName === 'INPUT' || target.tagName === 'SELECT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return;\n } // For other targets, ask IE\n // to enable drag and drop\n\n\n e.preventDefault();\n target.dragDrop();\n };\n\n this.options = new OptionsReader(globalContext);\n this.actions = manager.getActions();\n this.monitor = manager.getMonitor();\n this.registry = manager.getRegistry();\n this.enterLeaveCounter = new EnterLeaveCounter(this.isNodeInDocument);\n } // public for test\n\n\n _createClass(HTML5Backend, [{\n key: \"setup\",\n value: function setup() {\n if (this.window === undefined) {\n return;\n }\n\n if (this.window.__isReactDndBackendSetUp) {\n throw new Error('Cannot have two HTML5 backends at the same time.');\n }\n\n this.window.__isReactDndBackendSetUp = true;\n this.addEventListeners(this.window);\n }\n }, {\n key: \"teardown\",\n value: function teardown() {\n if (this.window === undefined) {\n return;\n }\n\n this.window.__isReactDndBackendSetUp = false;\n this.removeEventListeners(this.window);\n this.clearCurrentDragSourceNode();\n\n if (this.asyncEndDragFrameId) {\n this.window.cancelAnimationFrame(this.asyncEndDragFrameId);\n }\n }\n }, {\n key: \"connectDragPreview\",\n value: function connectDragPreview(sourceId, node, options) {\n var _this2 = this;\n\n this.sourcePreviewNodeOptions.set(sourceId, options);\n this.sourcePreviewNodes.set(sourceId, node);\n return function () {\n _this2.sourcePreviewNodes.delete(sourceId);\n\n _this2.sourcePreviewNodeOptions.delete(sourceId);\n };\n }\n }, {\n key: \"connectDragSource\",\n value: function connectDragSource(sourceId, node, options) {\n var _this3 = this;\n\n this.sourceNodes.set(sourceId, node);\n this.sourceNodeOptions.set(sourceId, options);\n\n var handleDragStart = function handleDragStart(e) {\n return _this3.handleDragStart(e, sourceId);\n };\n\n var handleSelectStart = function handleSelectStart(e) {\n return _this3.handleSelectStart(e);\n };\n\n node.setAttribute('draggable', 'true');\n node.addEventListener('dragstart', handleDragStart);\n node.addEventListener('selectstart', handleSelectStart);\n return function () {\n _this3.sourceNodes.delete(sourceId);\n\n _this3.sourceNodeOptions.delete(sourceId);\n\n node.removeEventListener('dragstart', handleDragStart);\n node.removeEventListener('selectstart', handleSelectStart);\n node.setAttribute('draggable', 'false');\n };\n }\n }, {\n key: \"connectDropTarget\",\n value: function connectDropTarget(targetId, node) {\n var _this4 = this;\n\n var handleDragEnter = function handleDragEnter(e) {\n return _this4.handleDragEnter(e, targetId);\n };\n\n var handleDragOver = function handleDragOver(e) {\n return _this4.handleDragOver(e, targetId);\n };\n\n var handleDrop = function handleDrop(e) {\n return _this4.handleDrop(e, targetId);\n };\n\n node.addEventListener('dragenter', handleDragEnter);\n node.addEventListener('dragover', handleDragOver);\n node.addEventListener('drop', handleDrop);\n return function () {\n node.removeEventListener('dragenter', handleDragEnter);\n node.removeEventListener('dragover', handleDragOver);\n node.removeEventListener('drop', handleDrop);\n };\n }\n }, {\n key: \"addEventListeners\",\n value: function addEventListeners(target) {\n // SSR Fix (https://github.com/react-dnd/react-dnd/pull/813\n if (!target.addEventListener) {\n return;\n }\n\n target.addEventListener('dragstart', this.handleTopDragStart);\n target.addEventListener('dragstart', this.handleTopDragStartCapture, true);\n target.addEventListener('dragend', this.handleTopDragEndCapture, true);\n target.addEventListener('dragenter', this.handleTopDragEnter);\n target.addEventListener('dragenter', this.handleTopDragEnterCapture, true);\n target.addEventListener('dragleave', this.handleTopDragLeaveCapture, true);\n target.addEventListener('dragover', this.handleTopDragOver);\n target.addEventListener('dragover', this.handleTopDragOverCapture, true);\n target.addEventListener('drop', this.handleTopDrop);\n target.addEventListener('drop', this.handleTopDropCapture, true);\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners(target) {\n // SSR Fix (https://github.com/react-dnd/react-dnd/pull/813\n if (!target.removeEventListener) {\n return;\n }\n\n target.removeEventListener('dragstart', this.handleTopDragStart);\n target.removeEventListener('dragstart', this.handleTopDragStartCapture, true);\n target.removeEventListener('dragend', this.handleTopDragEndCapture, true);\n target.removeEventListener('dragenter', this.handleTopDragEnter);\n target.removeEventListener('dragenter', this.handleTopDragEnterCapture, true);\n target.removeEventListener('dragleave', this.handleTopDragLeaveCapture, true);\n target.removeEventListener('dragover', this.handleTopDragOver);\n target.removeEventListener('dragover', this.handleTopDragOverCapture, true);\n target.removeEventListener('drop', this.handleTopDrop);\n target.removeEventListener('drop', this.handleTopDropCapture, true);\n }\n }, {\n key: \"getCurrentSourceNodeOptions\",\n value: function getCurrentSourceNodeOptions() {\n var sourceId = this.monitor.getSourceId();\n var sourceNodeOptions = this.sourceNodeOptions.get(sourceId);\n return _objectSpread({\n dropEffect: this.altKeyPressed ? 'copy' : 'move'\n }, sourceNodeOptions || {});\n }\n }, {\n key: \"getCurrentDropEffect\",\n value: function getCurrentDropEffect() {\n if (this.isDraggingNativeItem()) {\n // It makes more sense to default to 'copy' for native resources\n return 'copy';\n }\n\n return this.getCurrentSourceNodeOptions().dropEffect;\n }\n }, {\n key: \"getCurrentSourcePreviewNodeOptions\",\n value: function getCurrentSourcePreviewNodeOptions() {\n var sourceId = this.monitor.getSourceId();\n var sourcePreviewNodeOptions = this.sourcePreviewNodeOptions.get(sourceId);\n return _objectSpread({\n anchorX: 0.5,\n anchorY: 0.5,\n captureDraggingState: false\n }, sourcePreviewNodeOptions || {});\n }\n }, {\n key: \"isDraggingNativeItem\",\n value: function isDraggingNativeItem() {\n var itemType = this.monitor.getItemType();\n return Object.keys(NativeTypes).some(function (key) {\n return NativeTypes[key] === itemType;\n });\n }\n }, {\n key: \"beginDragNativeItem\",\n value: function beginDragNativeItem(type, dataTransfer) {\n this.clearCurrentDragSourceNode();\n this.currentNativeSource = createNativeDragSource(type, dataTransfer);\n this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource);\n this.actions.beginDrag([this.currentNativeHandle]);\n }\n }, {\n key: \"setCurrentDragSourceNode\",\n value: function setCurrentDragSourceNode(node) {\n var _this5 = this;\n\n this.clearCurrentDragSourceNode();\n this.currentDragSourceNode = node; // A timeout of > 0 is necessary to resolve Firefox issue referenced\n // See:\n // * https://github.com/react-dnd/react-dnd/pull/928\n // * https://github.com/react-dnd/react-dnd/issues/869\n\n var MOUSE_MOVE_TIMEOUT = 1000; // Receiving a mouse event in the middle of a dragging operation\n // means it has ended and the drag source node disappeared from DOM,\n // so the browser didn't dispatch the dragend event.\n //\n // We need to wait before we start listening for mousemove events.\n // This is needed because the drag preview needs to be drawn or else it fires an 'mousemove' event\n // immediately in some browsers.\n //\n // See:\n // * https://github.com/react-dnd/react-dnd/pull/928\n // * https://github.com/react-dnd/react-dnd/issues/869\n //\n\n this.mouseMoveTimeoutTimer = setTimeout(function () {\n return _this5.window && _this5.window.addEventListener('mousemove', _this5.endDragIfSourceWasRemovedFromDOM, true);\n }, MOUSE_MOVE_TIMEOUT);\n }\n }, {\n key: \"clearCurrentDragSourceNode\",\n value: function clearCurrentDragSourceNode() {\n if (this.currentDragSourceNode) {\n this.currentDragSourceNode = null;\n\n if (this.window) {\n this.window.clearTimeout(this.mouseMoveTimeoutTimer || undefined);\n this.window.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);\n }\n\n this.mouseMoveTimeoutTimer = null;\n return true;\n }\n\n return false;\n }\n }, {\n key: \"handleDragStart\",\n value: function handleDragStart(e, sourceId) {\n if (e.defaultPrevented) {\n return;\n }\n\n if (!this.dragStartSourceIds) {\n this.dragStartSourceIds = [];\n }\n\n this.dragStartSourceIds.unshift(sourceId);\n }\n }, {\n key: \"handleDragEnter\",\n value: function handleDragEnter(e, targetId) {\n this.dragEnterTargetIds.unshift(targetId);\n }\n }, {\n key: \"handleDragOver\",\n value: function handleDragOver(e, targetId) {\n if (this.dragOverTargetIds === null) {\n this.dragOverTargetIds = [];\n }\n\n this.dragOverTargetIds.unshift(targetId);\n }\n }, {\n key: \"handleDrop\",\n value: function handleDrop(e, targetId) {\n this.dropTargetIds.unshift(targetId);\n }\n }, {\n key: \"window\",\n get: function get() {\n return this.options.window;\n }\n }, {\n key: \"document\",\n get: function get() {\n return this.options.document;\n }\n }]);\n\n return HTML5Backend;\n}();\n\nexport { HTML5Backend as default };","var emptyImage;\nexport function getEmptyImage() {\n if (!emptyImage) {\n emptyImage = new Image();\n emptyImage.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n }\n\n return emptyImage;\n}","import HTML5Backend from './HTML5Backend';\nimport * as NativeTypes from './NativeTypes';\nexport { getEmptyImage } from './getEmptyImage';\nexport { NativeTypes };\n\nvar createBackend = function createBackend(manager, context) {\n return new HTML5Backend(manager, context);\n};\n\nexport default createBackend;","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","const genericMessage = \"Invariant Violation\";\nconst {\n setPrototypeOf = function (obj: any, proto: any) {\n obj.__proto__ = proto;\n return obj;\n },\n} = Object as any;\n\nexport class InvariantError extends Error {\n framesToPop = 1;\n name = genericMessage;\n constructor(message: string | number = genericMessage) {\n super(\n typeof message === \"number\"\n ? `${genericMessage}: ${message} (see https://github.com/apollographql/invariant-packages)`\n : message\n );\n setPrototypeOf(this, InvariantError.prototype);\n }\n}\n\nexport function invariant(\n condition: any,\n message?: string | number,\n): asserts condition {\n if (!condition) {\n throw new InvariantError(message);\n }\n}\n\nconst verbosityLevels = [\"log\", \"warn\", \"error\", \"silent\"] as const;\ntype VerbosityLevel = (typeof verbosityLevels)[number];\ntype ConsoleMethodName = Exclude;\nlet verbosityLevel = verbosityLevels.indexOf(\"log\");\n\nfunction wrapConsoleMethod(method: M) {\n return function () {\n if (verbosityLevels.indexOf(method) >= verbosityLevel) {\n return console[method].apply(console, arguments as any);\n }\n } as (typeof console)[M];\n}\n\nexport namespace invariant {\n export const log = wrapConsoleMethod(\"log\");\n export const warn = wrapConsoleMethod(\"warn\");\n export const error = wrapConsoleMethod(\"error\");\n}\n\nexport function setVerbosity(level: VerbosityLevel): VerbosityLevel {\n const old = verbosityLevels[verbosityLevel];\n verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));\n return old;\n}\n\n// Code that uses ts-invariant with rollup-plugin-invariant may want to\n// import this process stub to avoid errors evaluating process.env.NODE_ENV.\n// However, because most ESM-to-CJS compilers will rewrite the process import\n// as tsInvariant.process, which prevents proper replacement by minifiers, we\n// also export processStub, so you can import { invariant, processStub } from\n// \"ts-invariant\" and assign processStub to a local variable named process.\nexport const processStub: {\n env: Record;\n [key: string]: any;\n} = (\n typeof process === \"object\" &&\n typeof process.env === \"object\"\n) ? process : { env: {} };\n\nexport { processStub as process };\n\nexport default invariant;\n","/**\n * Note: This file is autogenerated using \"resources/gen-version.js\" script and\n * automatically updated by \"npm version\" command.\n */\n\n/**\n * A string containing the version of the GraphQL.js library\n */\nexport var version = '15.5.0';\n/**\n * An object containing the components of the GraphQL.js version string\n */\n\nexport var versionInfo = Object.freeze({\n major: 15,\n minor: 5,\n patch: 0,\n preReleaseTag: null\n});\n","/**\n * Returns true if the value acts like a Promise, i.e. has a \"then\" function,\n * otherwise returns false.\n */\n// eslint-disable-next-line no-redeclare\nexport default function isPromise(value) {\n return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function';\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport default function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}\n","// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nexport var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';\n","/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}\n","import { getLocation } from \"./location.mjs\";\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printLocation(location) {\n return printSourceLocation(location.source, getLocation(location.source, location.start));\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {\n var prefix = _ref2[0];\n return prefix.length;\n }));\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction leftPad(len, str) {\n return whitespace(len - str.length) + str;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// FIXME:\n// flowlint uninitialized-instance-property:off\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport { getLocation } from \"../language/location.mjs\";\nimport { printLocation, printSourceLocation } from \"../language/printLocation.mjs\";\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport var GraphQLError = /*#__PURE__*/function (_Error) {\n _inherits(GraphQLError, _Error);\n\n var _super = _createSuper(GraphQLError);\n\n /**\n * A message describing the Error for debugging purposes.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n *\n * Note: should be treated as readonly, despite invariant usage.\n */\n\n /**\n * An array of { line, column } locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {\n var _locations2, _source2, _positions2, _extensions2;\n\n var _this;\n\n _classCallCheck(this, GraphQLError);\n\n _this = _super.call(this, message); // Compute list of blame nodes.\n\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var _nodes$0$loc;\n\n _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return getLocation(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(getLocation(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions;\n\n if (_extensions == null && originalError != null) {\n var originalExtensions = originalError.extensions;\n\n if (isObjectLike(originalExtensions)) {\n _extensions = originalExtensions;\n }\n }\n\n Object.defineProperties(_assertThisInitialized(_this), {\n name: {\n value: 'GraphQLError'\n },\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: _locations != null\n },\n path: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path !== null && path !== void 0 ? path : undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: path != null\n },\n nodes: {\n value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined\n },\n source: {\n value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined\n },\n positions: {\n value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: _extensions != null\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError !== null && originalError !== void 0 && originalError.stack) {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n return _possibleConstructorReturn(_this);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);\n } else {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n\n return _this;\n }\n\n _createClass(GraphQLError, [{\n key: \"toString\",\n value: function toString() {\n return printError(this);\n } // FIXME: workaround to not break chai comparisons, should be remove in v16\n // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n }, {\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Object';\n }\n }]);\n\n return GraphQLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\n\nexport function printError(error) {\n var output = error.message;\n\n if (error.nodes) {\n for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) {\n var node = _error$nodes2[_i2];\n\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (error.source && error.locations) {\n for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) {\n var location = _error$locations2[_i4];\n output += '\\n\\n' + printSourceLocation(error.source, location);\n }\n }\n\n return output;\n}\n","import { GraphQLError } from \"./GraphQLError.mjs\";\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(\"Syntax Error: \".concat(description), undefined, source, [position]);\n}\n","/**\n * The set of allowed kind values for AST nodes.\n */\nexport var Kind = Object.freeze({\n // Name\n NAME: 'Name',\n // Document\n DOCUMENT: 'Document',\n OPERATION_DEFINITION: 'OperationDefinition',\n VARIABLE_DEFINITION: 'VariableDefinition',\n SELECTION_SET: 'SelectionSet',\n FIELD: 'Field',\n ARGUMENT: 'Argument',\n // Fragments\n FRAGMENT_SPREAD: 'FragmentSpread',\n INLINE_FRAGMENT: 'InlineFragment',\n FRAGMENT_DEFINITION: 'FragmentDefinition',\n // Values\n VARIABLE: 'Variable',\n INT: 'IntValue',\n FLOAT: 'FloatValue',\n STRING: 'StringValue',\n BOOLEAN: 'BooleanValue',\n NULL: 'NullValue',\n ENUM: 'EnumValue',\n LIST: 'ListValue',\n OBJECT: 'ObjectValue',\n OBJECT_FIELD: 'ObjectField',\n // Directives\n DIRECTIVE: 'Directive',\n // Types\n NAMED_TYPE: 'NamedType',\n LIST_TYPE: 'ListType',\n NON_NULL_TYPE: 'NonNullType',\n // Type System Definitions\n SCHEMA_DEFINITION: 'SchemaDefinition',\n OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',\n // Type Definitions\n SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',\n OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',\n FIELD_DEFINITION: 'FieldDefinition',\n INPUT_VALUE_DEFINITION: 'InputValueDefinition',\n INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',\n UNION_TYPE_DEFINITION: 'UnionTypeDefinition',\n ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',\n ENUM_VALUE_DEFINITION: 'EnumValueDefinition',\n INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',\n // Directive Definitions\n DIRECTIVE_DEFINITION: 'DirectiveDefinition',\n // Type System Extensions\n SCHEMA_EXTENSION: 'SchemaExtension',\n // Type Extensions\n SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',\n OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',\n INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',\n UNION_TYPE_EXTENSION: 'UnionTypeExtension',\n ENUM_TYPE_EXTENSION: 'EnumTypeExtension',\n INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'\n});\n/**\n * The enum type representing the possible kind values of AST nodes.\n */\n","export default function invariant(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message != null ? message : 'Unexpected invariant triggered.');\n }\n}\n","// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nvar nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;\nexport default nodejsCustomInspectSymbol;\n","import invariant from \"./invariant.mjs\";\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\n/**\n * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`\n */\n\nexport default function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n}\n","import defineInspect from \"../jsutils/defineInspect.mjs\";\n\n/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport var Location = /*#__PURE__*/function () {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n function Location(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n var _proto = Location.prototype;\n\n _proto.toJSON = function toJSON() {\n return {\n start: this.start,\n end: this.end\n };\n };\n\n return Location;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Location);\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport var Token = /*#__PURE__*/function () {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }\n\n var _proto2 = Token.prototype;\n\n _proto2.toJSON = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n };\n\n return Token;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Token);\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n return maybeNode != null && typeof maybeNode.kind === 'string';\n}\n/**\n * The list of all possible AST node types.\n */\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport var TokenKind = Object.freeze({\n SOF: '',\n EOF: '',\n BANG: '!',\n DOLLAR: '$',\n AMP: '&',\n PAREN_L: '(',\n PAREN_R: ')',\n SPREAD: '...',\n COLON: ':',\n EQUALS: '=',\n AT: '@',\n BRACKET_L: '[',\n BRACKET_R: ']',\n BRACE_L: '{',\n PIPE: '|',\n BRACE_R: '}',\n NAME: 'Name',\n INT: 'Int',\n FLOAT: 'Float',\n STRING: 'String',\n BLOCK_STRING: 'BlockString',\n COMMENT: 'Comment'\n});\n/**\n * The enum type representing the token kinds values.\n */\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable flowtype/no-weak-types */\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\nvar MAX_ARRAY_LENGTH = 10;\nvar MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport default function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (_typeof(value)) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? \"[function \".concat(value.name, \"]\") : '[function]';\n\n case 'object':\n if (value === null) {\n return 'null';\n }\n\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (previouslySeenValues.indexOf(value) !== -1) {\n return '[Circular]';\n }\n\n var seenValues = [].concat(previouslySeenValues, [value]);\n var customInspectFn = getCustomFn(value);\n\n if (customInspectFn !== undefined) {\n var customValue = customInspectFn.call(value); // check for infinite recursion\n\n if (customValue !== value) {\n return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction formatObject(object, seenValues) {\n var keys = Object.keys(object);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n var properties = keys.map(function (key) {\n var value = formatValue(object[key], seenValues);\n return key + ': ' + value;\n });\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n var len = Math.min(MAX_ARRAY_LENGTH, array.length);\n var remaining = array.length - len;\n var items = [];\n\n for (var i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(\"... \".concat(remaining, \" more items\"));\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getCustomFn(object) {\n var customInspectFn = object[String(nodejsCustomInspectSymbol)];\n\n if (typeof customInspectFn === 'function') {\n return customInspectFn;\n }\n\n if (typeof object.inspect === 'function') {\n return object.inspect;\n }\n}\n\nfunction getObjectTag(object) {\n var tag = Object.prototype.toString.call(object).replace(/^\\[object /, '').replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n var name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","export default function devAssert(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */\n// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n// See: https://webpack.js.org/guides/production/\nexport default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n// eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n} : // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (value) {\n var valueClass = value.constructor;\n var className = constructor.name;\n\n if (className && valueClass && valueClass.name === className) {\n throw new Error(\"Cannot use \".concat(className, \" \\\"\").concat(value, \"\\\" from another module or realm.\\n\\nEnsure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory. If different versions of \\\"graphql\\\" are the dependencies of other\\nrelied on modules, use \\\"resolutions\\\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \\\"graphql\\\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.\"));\n }\n }\n\n return false;\n};\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport var Source = /*#__PURE__*/function () {\n function Source(body) {\n var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';\n var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n line: 1,\n column: 1\n };\n typeof body === 'string' || devAssert(0, \"Body must be a string. Received: \".concat(inspect(body), \".\"));\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');\n this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n\n _createClass(Source, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Source';\n }\n }]);\n\n return Source;\n}();\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","/**\n * The set of allowed directive location values.\n */\nexport var DirectiveLocation = Object.freeze({\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n});\n/**\n * The enum type representing the directive location values.\n */\n","/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = getBlockStringIndentation(rawString);\n\n if (commonIndent !== 0) {\n for (var i = 1; i < lines.length; i++) {\n lines[i] = lines[i].slice(commonIndent);\n }\n } // Remove leading and trailing blank lines.\n\n\n var startLine = 0;\n\n while (startLine < lines.length && isBlank(lines[startLine])) {\n ++startLine;\n }\n\n var endLine = lines.length;\n\n while (endLine > startLine && isBlank(lines[endLine - 1])) {\n --endLine;\n } // Return a string of the lines joined with U+000A.\n\n\n return lines.slice(startLine, endLine).join('\\n');\n}\n\nfunction isBlank(str) {\n for (var i = 0; i < str.length; ++i) {\n if (str[i] !== ' ' && str[i] !== '\\t') {\n return false;\n }\n }\n\n return true;\n}\n/**\n * @internal\n */\n\n\nexport function getBlockStringIndentation(value) {\n var _commonIndent;\n\n var isFirstLine = true;\n var isEmptyLine = true;\n var indent = 0;\n var commonIndent = null;\n\n for (var i = 0; i < value.length; ++i) {\n switch (value.charCodeAt(i)) {\n case 13:\n // \\r\n if (value.charCodeAt(i + 1) === 10) {\n ++i; // skip \\r\\n as one symbol\n }\n\n // falls through\n\n case 10:\n // \\n\n isFirstLine = false;\n isEmptyLine = true;\n indent = 0;\n break;\n\n case 9: // \\t\n\n case 32:\n // \n ++indent;\n break;\n\n default:\n if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n }\n\n isEmptyLine = false;\n }\n }\n\n return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value) {\n var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isSingleLine = value.indexOf('\\n') === -1;\n var hasLeadingSpace = value[0] === ' ' || value[0] === '\\t';\n var hasTrailingQuote = value[value.length - 1] === '\"';\n var hasTrailingSlash = value[value.length - 1] === '\\\\';\n var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;\n var result = ''; // Format a multi-line block quote to account for leading space.\n\n if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {\n result += '\\n' + indentation;\n }\n\n result += indentation ? value.replace(/\\n/g, '\\n' + indentation) : value;\n\n if (printAsMultipleLines) {\n result += '\\n';\n }\n\n return '\"\"\"' + result.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"';\n}\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Token } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"./blockString.mjs\";\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport var Lexer = /*#__PURE__*/function () {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n\n var _proto = Lexer.prototype;\n\n _proto.advance = function advance() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n ;\n\n _proto.lookahead = function lookahead() {\n var token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n var _token$next;\n\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n };\n\n return Lexer;\n}();\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;\n}\n\nfunction printCharCode(code) {\n return (// NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n \"\\\"\\\\u\".concat(('00' + code.toString(16).toUpperCase()).slice(-4), \"\\\"\")\n );\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\n\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // \n\n case 9: // \\t\n\n case 32: // \n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}\n/**\n * Report a message that an unexpected character was encountered.\n */\n\n\nfunction unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?';\n }\n\n return \"Cannot parse the unexpected character \".concat(printCharCode(code), \".\");\n}\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\n\n\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\n\n\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++position);\n\n if (code >= 48 && code <= 57) {\n throw syntaxError(source, position, \"Invalid number, unexpected digit after 0: \".concat(printCharCode(code), \".\"));\n }\n } else {\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n code = body.charCodeAt(++position);\n\n if (code === 43 || code === 45) {\n // + -\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n\n if (code === 46 || isNameStart(code)) {\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n }\n\n return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));\n}\n/**\n * Returns the new position in the source after reading digits.\n */\n\n\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\n return position;\n }\n\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n}\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\n\n\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += body.slice(chunkStart, position);\n return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n ++position;\n\n if (code === 92) {\n // \\\n value += body.slice(chunkStart, position - 1);\n code = body.charCodeAt(position);\n\n switch (code) {\n case 34:\n value += '\"';\n break;\n\n case 47:\n value += '/';\n break;\n\n case 92:\n value += '\\\\';\n break;\n\n case 98:\n value += '\\b';\n break;\n\n case 102:\n value += '\\f';\n break;\n\n case 110:\n value += '\\n';\n break;\n\n case 114:\n value += '\\r';\n break;\n\n case 116:\n value += '\\t';\n break;\n\n case 117:\n {\n // uXXXX\n var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));\n\n if (charCode < 0) {\n var invalidSequence = body.slice(position + 1, position + 5);\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\u\".concat(invalidSequence, \".\"));\n }\n\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n }\n\n default:\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\\".concat(String.fromCharCode(code), \".\"));\n }\n\n ++position;\n chunkStart = position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\n\n\nfunction readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Converts four hexadecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\n\n\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\n\n\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\n\n\nfunction readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z\n\n\nfunction isNameStart(code) {\n return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;\n}\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Kind } from \"./kinds.mjs\";\nimport { Location } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { Source, isSource } from \"./source.mjs\";\nimport { DirectiveLocation } from \"./directiveLocation.mjs\";\nimport { Lexer, isPunctuatorTokenKind } from \"./lexer.mjs\";\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n var parser = new Parser(source, options);\n return parser.parseDocument();\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport var Parser = /*#__PURE__*/function () {\n function Parser(source, options) {\n var sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n\n var _proto = Parser.prototype;\n\n _proto.parseName = function parseName() {\n var token = this.expectToken(TokenKind.NAME);\n return {\n kind: Kind.NAME,\n value: token.value,\n loc: this.loc(token)\n };\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n ;\n\n _proto.parseDocument = function parseDocument() {\n var start = this._lexer.token;\n return {\n kind: Kind.DOCUMENT,\n definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),\n loc: this.loc(start)\n };\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\n ;\n\n _proto.parseDefinition = function parseDefinition() {\n if (this.peek(TokenKind.NAME)) {\n switch (this._lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return this.parseTypeSystemDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n } else if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } else if (this.peekDescription()) {\n return this.parseTypeSystemDefinition();\n }\n\n throw this.unexpected();\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n ;\n\n _proto.parseOperationDefinition = function parseOperationDefinition() {\n var start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n var operation = this.parseOperationType();\n var name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * OperationType : one of query mutation subscription\n */\n ;\n\n _proto.parseOperationType = function parseOperationType() {\n var operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return 'query';\n\n case 'mutation':\n return 'mutation';\n\n case 'subscription':\n return 'subscription';\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n ;\n\n _proto.parseVariableDefinitions = function parseVariableDefinitions() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseVariableDefinition = function parseVariableDefinition() {\n var start = this._lexer.token;\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,\n directives: this.parseDirectives(true),\n loc: this.loc(start)\n };\n }\n /**\n * Variable : $ Name\n */\n ;\n\n _proto.parseVariable = function parseVariable() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n }\n /**\n * SelectionSet : { Selection+ }\n */\n ;\n\n _proto.parseSelectionSet = function parseSelectionSet() {\n var start = this._lexer.token;\n return {\n kind: Kind.SELECTION_SET,\n selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n ;\n\n _proto.parseSelection = function parseSelection() {\n return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n ;\n\n _proto.parseField = function parseField() {\n var start = this._lexer.token;\n var nameOrAlias = this.parseName();\n var alias;\n var name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: Kind.FIELD,\n alias: alias,\n name: name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,\n loc: this.loc(start)\n };\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n ;\n\n _proto.parseArguments = function parseArguments(isConst) {\n var item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseArgument = function parseArgument() {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.ARGUMENT,\n name: name,\n value: this.parseValueLiteral(false),\n loc: this.loc(start)\n };\n };\n\n _proto.parseConstArgument = function parseConstArgument() {\n var start = this._lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: this.parseName(),\n value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n ;\n\n _proto.parseFragment = function parseFragment() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n var hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n ;\n\n _proto.parseFragmentDefinition = function parseFragmentDefinition() {\n var _this$_options;\n\n var start = this._lexer.token;\n this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentName : Name but not `on`\n */\n ;\n\n _proto.parseFragmentName = function parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n ;\n\n _proto.parseValueLiteral = function parseValueLiteral(isConst) {\n var token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this._lexer.advance();\n\n return {\n kind: Kind.INT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.FLOAT:\n this._lexer.advance();\n\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this._lexer.advance();\n\n switch (token.value) {\n case 'true':\n return {\n kind: Kind.BOOLEAN,\n value: true,\n loc: this.loc(token)\n };\n\n case 'false':\n return {\n kind: Kind.BOOLEAN,\n value: false,\n loc: this.loc(token)\n };\n\n case 'null':\n return {\n kind: Kind.NULL,\n loc: this.loc(token)\n };\n\n default:\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: this.loc(token)\n };\n }\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return this.parseVariable();\n }\n\n break;\n }\n\n throw this.unexpected();\n };\n\n _proto.parseStringLiteral = function parseStringLiteral() {\n var token = this._lexer.token;\n\n this._lexer.advance();\n\n return {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n loc: this.loc(token)\n };\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n ;\n\n _proto.parseList = function parseList(isConst) {\n var _this = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this.parseValueLiteral(isConst);\n };\n\n return {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\n ;\n\n _proto.parseObject = function parseObject(isConst) {\n var _this2 = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this2.parseObjectField(isConst);\n };\n\n return {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseObjectField = function parseObjectField(isConst) {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.OBJECT_FIELD,\n name: name,\n value: this.parseValueLiteral(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n ;\n\n _proto.parseDirectives = function parseDirectives(isConst) {\n var directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n /**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\n ;\n\n _proto.parseDirective = function parseDirective(isConst) {\n var start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n ;\n\n _proto.parseTypeReference = function parseTypeReference() {\n var start = this._lexer.token;\n var type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n type = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = {\n kind: Kind.LIST_TYPE,\n type: type,\n loc: this.loc(start)\n };\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return {\n kind: Kind.NON_NULL_TYPE,\n type: type,\n loc: this.loc(start)\n };\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n ;\n\n _proto.parseNamedType = function parseNamedType() {\n var start = this._lexer.token;\n return {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Type Definition section.\n\n /**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n }\n\n throw this.unexpected(keywordToken);\n };\n\n _proto.peekDescription = function peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n ;\n\n _proto.parseDescription = function parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n */\n ;\n\n _proto.parseSchemaDefinition = function parseSchemaDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n return {\n kind: Kind.SCHEMA_DEFINITION,\n description: description,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n ;\n\n _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {\n var start = this._lexer.token;\n var operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n var type = this.parseNamedType();\n return {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n ;\n\n _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n ;\n\n _proto.parseImplementsInterfaces = function parseImplementsInterfaces() {\n var _this$_options2;\n\n if (!this.expectOptionalKeyword('implements')) {\n return [];\n }\n\n if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {\n var types = []; // Optional leading ampersand\n\n this.expectOptionalToken(TokenKind.AMP);\n\n do {\n types.push(this.parseNamedType());\n } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));\n\n return types;\n }\n\n return this.delimitedMany(TokenKind.AMP, this.parseNamedType);\n }\n /**\n * FieldsDefinition : { FieldDefinition+ }\n */\n ;\n\n _proto.parseFieldsDefinition = function parseFieldsDefinition() {\n var _this$_options3;\n\n // Legacy support for the SDL?\n if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {\n this._lexer.advance();\n\n this._lexer.advance();\n\n return [];\n }\n\n return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n ;\n\n _proto.parseFieldDefinition = function parseFieldDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n ;\n\n _proto.parseArgumentDefs = function parseArgumentDefs() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseInputValueDef = function parseInputValueDef() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseValueLiteral(true);\n }\n\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n ;\n\n _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n return {\n kind: Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n ;\n\n _proto.parseUnionMemberTypes = function parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n ;\n\n _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n return {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\n ;\n\n _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\n ;\n\n _proto.parseEnumValueDefinition = function parseEnumValueDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n ;\n\n _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n return {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\n ;\n\n _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemExtension = function parseTypeSystemExtension() {\n var keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n */\n ;\n\n _proto.parseSchemaExtension = function parseSchemaExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCHEMA_EXTENSION,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n ;\n\n _proto.parseScalarTypeExtension = function parseScalarTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n ;\n\n _proto.parseObjectTypeExtension = function parseObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n ;\n\n _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n ;\n\n _proto.parseUnionTypeExtension = function parseUnionTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n ;\n\n _proto.parseEnumTypeExtension = function parseEnumTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n ;\n\n _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n */\n ;\n\n _proto.parseDirectiveDefinition = function parseDirectiveDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n var repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n var locations = this.parseDirectiveLocations();\n return {\n kind: Kind.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n repeatable: repeatable,\n locations: locations,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n ;\n\n _proto.parseDirectiveLocations = function parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n ;\n\n _proto.parseDirectiveLocation = function parseDirectiveLocation() {\n var start = this._lexer.token;\n var name = this.parseName();\n\n if (DirectiveLocation[name.value] !== undefined) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a location object, used to identify the place in the source that created a given parsed object.\n */\n ;\n\n _proto.loc = function loc(startToken) {\n var _this$_options4;\n\n if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {\n return new Location(startToken, this._lexer.lastToken, this._lexer.source);\n }\n }\n /**\n * Determines if the next token is of a given kind\n */\n ;\n\n _proto.peek = function peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectToken = function expectToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n throw syntaxError(this._lexer.source, token.start, \"Expected \".concat(getTokenKindDesc(kind), \", found \").concat(getTokenDesc(token), \".\"));\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and return undefined.\n */\n ;\n\n _proto.expectOptionalToken = function expectOptionalToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n return undefined;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectKeyword = function expectKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n } else {\n throw syntaxError(this._lexer.source, token.start, \"Expected \\\"\".concat(value, \"\\\", found \").concat(getTokenDesc(token), \".\"));\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n ;\n\n _proto.expectOptionalKeyword = function expectOptionalKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n ;\n\n _proto.unexpected = function unexpected(atToken) {\n var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(this._lexer.source, token.start, \"Unexpected \".concat(getTokenDesc(token), \".\"));\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.any = function any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.many = function many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n ;\n\n _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n };\n\n return Parser;\n}();\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n var value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? \" \\\"\".concat(value, \"\\\"\") : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? \"\\\"\".concat(kind, \"\\\"\") : kind;\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport { isNode } from \"./ast.mjs\";\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport var QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields']\n};\nexport var BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\n\nexport function visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n\n for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) {\n var k = _Object$keys2[_i2];\n clone[k] = node[k];\n }\n\n node = clone;\n }\n\n var editOffset = 0;\n\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n\n if (inArray) {\n editKey -= editOffset;\n }\n\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n\n if (node === null || node === undefined) {\n continue;\n }\n\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error(\"Invalid AST Node: \".concat(inspect(node), \".\"));\n }\n\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _visitorKeys$node$kin;\n\n stack = {\n inArray: inArray,\n index: index,\n keys: keys,\n edits: edits,\n prev: stack\n };\n inArray = Array.isArray(node);\n keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n\n var specificKindVisitor = specificVisitor[kind];\n\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound]\nvar find = Array.prototype.find ? function (list, predicate) {\n return Array.prototype.find.call(list, predicate);\n} : function (list, predicate) {\n for (var _i2 = 0; _i2 < list.length; _i2++) {\n var value = list[_i2];\n\n if (predicate(value)) {\n return value;\n }\n }\n};\nexport default find;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar objectValues = Object.values || function (obj) {\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n};\n\nexport default objectValues;\n","import inspect from \"../jsutils/inspect.mjs\";\nimport { GraphQLError } from \"./GraphQLError.mjs\";\n/**\n * Given an arbitrary value, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n */\n\nexport function locatedError(rawOriginalError, nodes, path) {\n var _nodes;\n\n // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface.\n var originalError = rawOriginalError instanceof Error ? rawOriginalError : new Error('Unexpected error value: ' + inspect(rawOriginalError)); // Note: this uses a brand-check to support GraphQL errors originating from other contexts.\n\n if (Array.isArray(originalError.path)) {\n return originalError;\n }\n\n return new GraphQLError(originalError.message, (_nodes = originalError.nodes) !== null && _nodes !== void 0 ? _nodes : nodes, originalError.source, originalError.positions, path, originalError);\n}\n","import devAssert from \"../jsutils/devAssert.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nvar NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\n/**\n * Upholds the spec rules about naming.\n */\n\nexport function assertValidName(name) {\n var error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}\n/**\n * Returns an Error if a name is invalid.\n */\n\nexport function isValidNameError(name) {\n typeof name === 'string' || devAssert(0, 'Expected name to be a string.');\n\n if (name.length > 1 && name[0] === '_' && name[1] === '_') {\n return new GraphQLError(\"Name \\\"\".concat(name, \"\\\" must not begin with \\\"__\\\", which is reserved by GraphQL introspection.\"));\n }\n\n if (!NAME_RX.test(name)) {\n return new GraphQLError(\"Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \\\"\".concat(name, \"\\\" does not.\"));\n }\n}\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar objectEntries = Object.entries || function (obj) {\n return Object.keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n};\n\nexport default objectEntries;\n","/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: { name: 'Jon', num: '555-1234' },\n * // Jenny: { name: 'Jenny', num: '867-5309' } }\n * const entriesByName = keyMap(\n * phoneBook,\n * entry => entry.name\n * )\n *\n * // { name: 'Jenny', num: '857-6309' }\n * const jennyEntry = entriesByName['Jenny']\n *\n */\nexport default function keyMap(list, keyFn) {\n return list.reduce(function (map, item) {\n map[keyFn(item)] = item;\n return map;\n }, Object.create(null));\n}\n","import objectEntries from \"../polyfills/objectEntries.mjs\";\n\n/**\n * Creates an object map with the same keys as `map` and values generated by\n * running each value of `map` thru `fn`.\n */\nexport default function mapValue(map, fn) {\n var result = Object.create(null);\n\n for (var _i2 = 0, _objectEntries2 = objectEntries(map); _i2 < _objectEntries2.length; _i2++) {\n var _ref2 = _objectEntries2[_i2];\n var _key = _ref2[0];\n var _value = _ref2[1];\n result[_key] = fn(_value, _key);\n }\n\n return result;\n}\n","import objectEntries from \"../polyfills/objectEntries.mjs\";\nexport default function toObjMap(obj) {\n /* eslint-enable no-redeclare */\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n var map = Object.create(null);\n\n for (var _i2 = 0, _objectEntries2 = objectEntries(obj); _i2 < _objectEntries2.length; _i2++) {\n var _ref2 = _objectEntries2[_i2];\n var key = _ref2[0];\n var value = _ref2[1];\n map[key] = value;\n }\n\n return map;\n}\n","/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * and a function to produce the values from each item in the array.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: '555-1234', Jenny: '867-5309' }\n * const phonesByName = keyValMap(\n * phoneBook,\n * entry => entry.name,\n * entry => entry.num\n * )\n *\n */\nexport default function keyValMap(list, keyFn, valFn) {\n return list.reduce(function (map, item) {\n map[keyFn(item)] = valFn(item);\n return map;\n }, Object.create(null));\n}\n","var MAX_SUGGESTIONS = 5;\n/**\n * Given [ A, B, C ] return ' Did you mean A, B, or C?'.\n */\n\n// eslint-disable-next-line no-redeclare\nexport default function didYouMean(firstArg, secondArg) {\n var _ref = typeof firstArg === 'string' ? [firstArg, secondArg] : [undefined, firstArg],\n subMessage = _ref[0],\n suggestionsArg = _ref[1];\n\n var message = ' Did you mean ';\n\n if (subMessage) {\n message += subMessage + ' ';\n }\n\n var suggestions = suggestionsArg.map(function (x) {\n return \"\\\"\".concat(x, \"\\\"\");\n });\n\n switch (suggestions.length) {\n case 0:\n return '';\n\n case 1:\n return message + suggestions[0] + '?';\n\n case 2:\n return message + suggestions[0] + ' or ' + suggestions[1] + '?';\n }\n\n var selected = suggestions.slice(0, MAX_SUGGESTIONS);\n var lastItem = selected.pop();\n return message + selected.join(', ') + ', or ' + lastItem + '?';\n}\n","/**\n * Returns the first argument it receives.\n */\nexport default function identityFunc(x) {\n return x;\n}\n","/**\n * Returns a number indicating whether a reference string comes before, or after,\n * or is the same as the given string in natural sort order.\n *\n * See: https://en.wikipedia.org/wiki/Natural_sort_order\n *\n */\nexport default function naturalCompare(aStr, bStr) {\n var aIdx = 0;\n var bIdx = 0;\n\n while (aIdx < aStr.length && bIdx < bStr.length) {\n var aChar = aStr.charCodeAt(aIdx);\n var bChar = bStr.charCodeAt(bIdx);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n var aNum = 0;\n\n do {\n ++aIdx;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIdx);\n } while (isDigit(aChar) && aNum > 0);\n\n var bNum = 0;\n\n do {\n ++bIdx;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIdx);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n\n if (aChar > bChar) {\n return 1;\n }\n\n ++aIdx;\n ++bIdx;\n }\n }\n\n return aStr.length - bStr.length;\n}\nvar DIGIT_0 = 48;\nvar DIGIT_9 = 57;\n\nfunction isDigit(code) {\n return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;\n}\n","import naturalCompare from \"./naturalCompare.mjs\";\n/**\n * Given an invalid input string and a list of valid options, returns a filtered\n * list of valid options sorted based on their similarity with the input.\n */\n\nexport default function suggestionList(input, options) {\n var optionsByDistance = Object.create(null);\n var lexicalDistance = new LexicalDistance(input);\n var threshold = Math.floor(input.length * 0.4) + 1;\n\n for (var _i2 = 0; _i2 < options.length; _i2++) {\n var option = options[_i2];\n var distance = lexicalDistance.measure(option, threshold);\n\n if (distance !== undefined) {\n optionsByDistance[option] = distance;\n }\n }\n\n return Object.keys(optionsByDistance).sort(function (a, b) {\n var distanceDiff = optionsByDistance[a] - optionsByDistance[b];\n return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);\n });\n}\n/**\n * Computes the lexical distance between strings A and B.\n *\n * The \"distance\" between two strings is given by counting the minimum number\n * of edits needed to transform string A into string B. An edit can be an\n * insertion, deletion, or substitution of a single character, or a swap of two\n * adjacent characters.\n *\n * Includes a custom alteration from Damerau-Levenshtein to treat case changes\n * as a single edit which helps identify mis-cased values with an edit distance\n * of 1.\n *\n * This distance can be useful for detecting typos in input or sorting\n */\n\nvar LexicalDistance = /*#__PURE__*/function () {\n function LexicalDistance(input) {\n this._input = input;\n this._inputLowerCase = input.toLowerCase();\n this._inputArray = stringToArray(this._inputLowerCase);\n this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)];\n }\n\n var _proto = LexicalDistance.prototype;\n\n _proto.measure = function measure(option, threshold) {\n if (this._input === option) {\n return 0;\n }\n\n var optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit\n\n if (this._inputLowerCase === optionLowerCase) {\n return 1;\n }\n\n var a = stringToArray(optionLowerCase);\n var b = this._inputArray;\n\n if (a.length < b.length) {\n var tmp = a;\n a = b;\n b = tmp;\n }\n\n var aLength = a.length;\n var bLength = b.length;\n\n if (aLength - bLength > threshold) {\n return undefined;\n }\n\n var rows = this._rows;\n\n for (var j = 0; j <= bLength; j++) {\n rows[0][j] = j;\n }\n\n for (var i = 1; i <= aLength; i++) {\n var upRow = rows[(i - 1) % 3];\n var currentRow = rows[i % 3];\n var smallestCell = currentRow[0] = i;\n\n for (var _j = 1; _j <= bLength; _j++) {\n var cost = a[i - 1] === b[_j - 1] ? 0 : 1;\n var currentCell = Math.min(upRow[_j] + 1, // delete\n currentRow[_j - 1] + 1, // insert\n upRow[_j - 1] + cost // substitute\n );\n\n if (i > 1 && _j > 1 && a[i - 1] === b[_j - 2] && a[i - 2] === b[_j - 1]) {\n // transposition\n var doubleDiagonalCell = rows[(i - 2) % 3][_j - 2];\n currentCell = Math.min(currentCell, doubleDiagonalCell + 1);\n }\n\n if (currentCell < smallestCell) {\n smallestCell = currentCell;\n }\n\n currentRow[_j] = currentCell;\n } // Early exit, since distance can't go smaller than smallest element of the previous row.\n\n\n if (smallestCell > threshold) {\n return undefined;\n }\n }\n\n var distance = rows[aLength % 3][bLength];\n return distance <= threshold ? distance : undefined;\n };\n\n return LexicalDistance;\n}();\n\nfunction stringToArray(str) {\n var strLength = str.length;\n var array = new Array(strLength);\n\n for (var i = 0; i < strLength; ++i) {\n array[i] = str.charCodeAt(i);\n }\n\n return array;\n}\n","import { visit } from \"./visitor.mjs\";\nimport { printBlockString } from \"./blockString.mjs\";\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n}\nvar MAX_LINE_LENGTH = 80; // TODO: provide better type coverage in future\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n // Document\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue,\n directives = _ref.directives;\n return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));\n },\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n var prefix = wrap('', alias, ': ') + name;\n var argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n // Fragments\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (// Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n \"fragment \".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), \" \") + \"on \".concat(typeCondition, \" \").concat(wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n // Value\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description' ? '' : ' ') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return value ? 'true' : 'false';\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n // Directive\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n // Type\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n // Type System Definitions\n SchemaDefinition: addDescription(function (_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n }),\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n ScalarTypeDefinition: addDescription(function (_ref22) {\n var name = _ref22.name,\n directives = _ref22.directives;\n return join(['scalar', name, join(directives, ' ')], ' ');\n }),\n ObjectTypeDefinition: addDescription(function (_ref23) {\n var name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n FieldDefinition: addDescription(function (_ref24) {\n var name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' '));\n }),\n InputValueDefinition: addDescription(function (_ref25) {\n var name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');\n }),\n InterfaceTypeDefinition: addDescription(function (_ref26) {\n var name = _ref26.name,\n interfaces = _ref26.interfaces,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n UnionTypeDefinition: addDescription(function (_ref27) {\n var name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n }),\n EnumTypeDefinition: addDescription(function (_ref28) {\n var name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join(['enum', name, join(directives, ' '), block(values)], ' ');\n }),\n EnumValueDefinition: addDescription(function (_ref29) {\n var name = _ref29.name,\n directives = _ref29.directives;\n return join([name, join(directives, ' ')], ' ');\n }),\n InputObjectTypeDefinition: addDescription(function (_ref30) {\n var name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join(['input', name, join(directives, ' '), block(fields)], ' ');\n }),\n DirectiveDefinition: addDescription(function (_ref31) {\n var name = _ref31.name,\n args = _ref31.arguments,\n repeatable = _ref31.repeatable,\n locations = _ref31.locations;\n return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ');\n }),\n SchemaExtension: function SchemaExtension(_ref32) {\n var directives = _ref32.directives,\n operationTypes = _ref32.operationTypes;\n return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n ScalarTypeExtension: function ScalarTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n ObjectTypeExtension: function ObjectTypeExtension(_ref34) {\n var name = _ref34.name,\n interfaces = _ref34.interfaces,\n directives = _ref34.directives,\n fields = _ref34.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {\n var name = _ref35.name,\n interfaces = _ref35.interfaces,\n directives = _ref35.directives,\n fields = _ref35.fields;\n return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n UnionTypeExtension: function UnionTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n types = _ref36.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n EnumTypeExtension: function EnumTypeExtension(_ref37) {\n var name = _ref37.name,\n directives = _ref37.directives,\n values = _ref37.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {\n var name = _ref38.name,\n directives = _ref38.directives,\n fields = _ref38.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n }\n};\n\nfunction addDescription(cb) {\n return function (node) {\n return join([node.description, cb(node)], '\\n');\n };\n}\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\n\nfunction join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\n\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\n\nfunction wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction isMultiline(str) {\n return str.indexOf('\\n') !== -1;\n}\n\nfunction hasMultilineItems(maybeArray) {\n return maybeArray != null && maybeArray.some(isMultiline);\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport keyValMap from \"../jsutils/keyValMap.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value\n * will reflect the provided GraphQL value AST.\n *\n * | GraphQL Value | JavaScript Value |\n * | -------------------- | ---------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String / Enum | String |\n * | Int / Float | Number |\n * | Null | null |\n *\n */\nexport function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case Kind.NULL:\n return null;\n\n case Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case Kind.STRING:\n case Kind.ENUM:\n case Kind.BOOLEAN:\n return valueNode.value;\n\n case Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case Kind.OBJECT:\n return keyValMap(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || invariant(0, 'Unexpected value node: ' + inspect(valueNode));\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport objectEntries from \"../polyfills/objectEntries.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport mapValue from \"../jsutils/mapValue.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport keyValMap from \"../jsutils/keyValMap.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport didYouMean from \"../jsutils/didYouMean.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport identityFunc from \"../jsutils/identityFunc.mjs\";\nimport defineInspect from \"../jsutils/defineInspect.mjs\";\nimport suggestionList from \"../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { valueFromASTUntyped } from \"../utilities/valueFromASTUntyped.mjs\";\nexport function isType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type);\n}\nexport function assertType(type) {\n if (!isType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL type.\"));\n }\n\n return type;\n}\n/**\n * There are predicates for each kind of GraphQL type.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isScalarType(type) {\n return instanceOf(type, GraphQLScalarType);\n}\nexport function assertScalarType(type) {\n if (!isScalarType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Scalar type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isObjectType(type) {\n return instanceOf(type, GraphQLObjectType);\n}\nexport function assertObjectType(type) {\n if (!isObjectType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Object type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isInterfaceType(type) {\n return instanceOf(type, GraphQLInterfaceType);\n}\nexport function assertInterfaceType(type) {\n if (!isInterfaceType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Interface type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isUnionType(type) {\n return instanceOf(type, GraphQLUnionType);\n}\nexport function assertUnionType(type) {\n if (!isUnionType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Union type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isEnumType(type) {\n return instanceOf(type, GraphQLEnumType);\n}\nexport function assertEnumType(type) {\n if (!isEnumType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Enum type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isInputObjectType(type) {\n return instanceOf(type, GraphQLInputObjectType);\n}\nexport function assertInputObjectType(type) {\n if (!isInputObjectType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Input Object type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isListType(type) {\n return instanceOf(type, GraphQLList);\n}\nexport function assertListType(type) {\n if (!isListType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL List type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isNonNullType(type) {\n return instanceOf(type, GraphQLNonNull);\n}\nexport function assertNonNullType(type) {\n if (!isNonNullType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Non-Null type.\"));\n }\n\n return type;\n}\n/**\n * These types may be used as input types for arguments and directives.\n */\n\nexport function isInputType(type) {\n return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType);\n}\nexport function assertInputType(type) {\n if (!isInputType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL input type.\"));\n }\n\n return type;\n}\n/**\n * These types may be used as output types as the result of fields.\n */\n\nexport function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}\nexport function assertOutputType(type) {\n if (!isOutputType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL output type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe types which may be leaf values.\n */\n\nexport function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}\nexport function assertLeafType(type) {\n if (!isLeafType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL leaf type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isCompositeType(type) {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}\nexport function assertCompositeType(type) {\n if (!isCompositeType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL composite type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isAbstractType(type) {\n return isInterfaceType(type) || isUnionType(type);\n}\nexport function assertAbstractType(type) {\n if (!isAbstractType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL abstract type.\"));\n }\n\n return type;\n}\n/**\n * List Type Wrapper\n *\n * A list is a wrapping type which points to another type.\n * Lists are often created within the context of defining the fields of\n * an object type.\n *\n * Example:\n *\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * parents: { type: new GraphQLList(PersonType) },\n * children: { type: new GraphQLList(PersonType) },\n * })\n * })\n *\n */\n// FIXME: workaround to fix issue with Babel parser\n\n/* ::\ndeclare class GraphQLList<+T: GraphQLType> {\n +ofType: T;\n static (ofType: T): GraphQLList;\n // Note: constructors cannot be used for covariant types. Drop the \"new\".\n constructor(ofType: GraphQLType): void;\n}\n*/\n\nexport function GraphQLList(ofType) {\n // istanbul ignore else (to be removed in v16.0.0)\n if (this instanceof GraphQLList) {\n this.ofType = assertType(ofType);\n } else {\n return new GraphQLList(ofType);\n }\n} // Need to cast through any to alter the prototype.\n\nGraphQLList.prototype.toString = function toString() {\n return '[' + String(this.ofType) + ']';\n};\n\nGraphQLList.prototype.toJSON = function toJSON() {\n return this.toString();\n};\n\nObject.defineProperty(GraphQLList.prototype, SYMBOL_TO_STRING_TAG, {\n get: function get() {\n return 'GraphQLList';\n }\n}); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLList);\n/**\n * Non-Null Type Wrapper\n *\n * A non-null is a wrapping type which points to another type.\n * Non-null types enforce that their values are never null and can ensure\n * an error is raised if this ever occurs during a request. It is useful for\n * fields which you can make a strong guarantee on non-nullability, for example\n * usually the id field of a database row will never be null.\n *\n * Example:\n *\n * const RowType = new GraphQLObjectType({\n * name: 'Row',\n * fields: () => ({\n * id: { type: new GraphQLNonNull(GraphQLString) },\n * })\n * })\n *\n * Note: the enforcement of non-nullability occurs within the executor.\n */\n// FIXME: workaround to fix issue with Babel parser\n\n/* ::\ndeclare class GraphQLNonNull<+T: GraphQLNullableType> {\n +ofType: T;\n static (ofType: T): GraphQLNonNull;\n // Note: constructors cannot be used for covariant types. Drop the \"new\".\n constructor(ofType: GraphQLType): void;\n}\n*/\n\nexport function GraphQLNonNull(ofType) {\n // istanbul ignore else (to be removed in v16.0.0)\n if (this instanceof GraphQLNonNull) {\n this.ofType = assertNullableType(ofType);\n } else {\n return new GraphQLNonNull(ofType);\n }\n} // Need to cast through any to alter the prototype.\n\nGraphQLNonNull.prototype.toString = function toString() {\n return String(this.ofType) + '!';\n};\n\nGraphQLNonNull.prototype.toJSON = function toJSON() {\n return this.toString();\n};\n\nObject.defineProperty(GraphQLNonNull.prototype, SYMBOL_TO_STRING_TAG, {\n get: function get() {\n return 'GraphQLNonNull';\n }\n}); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLNonNull);\n/**\n * These types wrap and modify other types\n */\n\nexport function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}\nexport function assertWrappingType(type) {\n if (!isWrappingType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL wrapping type.\"));\n }\n\n return type;\n}\n/**\n * These types can all accept null as a value.\n */\n\nexport function isNullableType(type) {\n return isType(type) && !isNonNullType(type);\n}\nexport function assertNullableType(type) {\n if (!isNullableType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL nullable type.\"));\n }\n\n return type;\n}\n/* eslint-disable no-redeclare */\n\nexport function getNullableType(type) {\n /* eslint-enable no-redeclare */\n if (type) {\n return isNonNullType(type) ? type.ofType : type;\n }\n}\n/**\n * These named types do not include modifiers like List or NonNull.\n */\n\nexport function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}\nexport function assertNamedType(type) {\n if (!isNamedType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL named type.\"));\n }\n\n return type;\n}\n/* eslint-disable no-redeclare */\n\nexport function getNamedType(type) {\n /* eslint-enable no-redeclare */\n if (type) {\n var unwrappedType = type;\n\n while (isWrappingType(unwrappedType)) {\n unwrappedType = unwrappedType.ofType;\n }\n\n return unwrappedType;\n }\n}\n/**\n * Used while defining GraphQL types to allow for circular references in\n * otherwise immutable type definitions.\n */\n\nfunction resolveThunk(thunk) {\n // $FlowFixMe[incompatible-use]\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n\nfunction undefineIfEmpty(arr) {\n return arr && arr.length > 0 ? arr : undefined;\n}\n/**\n * Scalar Type Definition\n *\n * The leaf values of any request and input values to arguments are\n * Scalars (or Enums) and are defined with a name and a series of functions\n * used to parse input from ast or variables and to ensure validity.\n *\n * If a type's serialize function does not return a value (i.e. it returns\n * `undefined`) then an error will be raised and a `null` value will be returned\n * in the response. If the serialize function returns `null`, then no error will\n * be included in the response.\n *\n * Example:\n *\n * const OddType = new GraphQLScalarType({\n * name: 'Odd',\n * serialize(value) {\n * if (value % 2 === 1) {\n * return value;\n * }\n * }\n * });\n *\n */\n\n\nexport var GraphQLScalarType = /*#__PURE__*/function () {\n function GraphQLScalarType(config) {\n var _config$parseValue, _config$serialize, _config$parseLiteral;\n\n var parseValue = (_config$parseValue = config.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : identityFunc;\n this.name = config.name;\n this.description = config.description;\n this.specifiedByUrl = config.specifiedByUrl;\n this.serialize = (_config$serialize = config.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : identityFunc;\n this.parseValue = parseValue;\n this.parseLiteral = (_config$parseLiteral = config.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function (node, variables) {\n return parseValue(valueFromASTUntyped(node, variables));\n };\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.specifiedByUrl == null || typeof config.specifiedByUrl === 'string' || devAssert(0, \"\".concat(this.name, \" must provide \\\"specifiedByUrl\\\" as a string, \") + \"but got: \".concat(inspect(config.specifiedByUrl), \".\"));\n config.serialize == null || typeof config.serialize === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"serialize\\\" function. If this custom Scalar is also used as an input type, ensure \\\"parseValue\\\" and \\\"parseLiteral\\\" functions are also provided.\"));\n\n if (config.parseLiteral) {\n typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function' || devAssert(0, \"\".concat(this.name, \" must provide both \\\"parseValue\\\" and \\\"parseLiteral\\\" functions.\"));\n }\n }\n\n var _proto = GraphQLScalarType.prototype;\n\n _proto.toConfig = function toConfig() {\n var _this$extensionASTNod;\n\n return {\n name: this.name,\n description: this.description,\n specifiedByUrl: this.specifiedByUrl,\n serialize: this.serialize,\n parseValue: this.parseValue,\n parseLiteral: this.parseLiteral,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : []\n };\n };\n\n _proto.toString = function toString() {\n return this.name;\n };\n\n _proto.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLScalarType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLScalarType';\n }\n }]);\n\n return GraphQLScalarType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLScalarType);\n\n/**\n * Object Type Definition\n *\n * Almost all of the GraphQL types you define will be object types. Object types\n * have a name, but most importantly describe their fields.\n *\n * Example:\n *\n * const AddressType = new GraphQLObjectType({\n * name: 'Address',\n * fields: {\n * street: { type: GraphQLString },\n * number: { type: GraphQLInt },\n * formatted: {\n * type: GraphQLString,\n * resolve(obj) {\n * return obj.number + ' ' + obj.street\n * }\n * }\n * }\n * });\n *\n * When two types need to refer to each other, or a type needs to refer to\n * itself in a field, you can use a function expression (aka a closure or a\n * thunk) to supply the fields lazily.\n *\n * Example:\n *\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * name: { type: GraphQLString },\n * bestFriend: { type: PersonType },\n * })\n * });\n *\n */\nexport var GraphQLObjectType = /*#__PURE__*/function () {\n function GraphQLObjectType(config) {\n this.name = config.name;\n this.description = config.description;\n this.isTypeOf = config.isTypeOf;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.isTypeOf == null || typeof config.isTypeOf === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"isTypeOf\\\" as a function, \") + \"but got: \".concat(inspect(config.isTypeOf), \".\"));\n }\n\n var _proto2 = GraphQLObjectType.prototype;\n\n _proto2.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto2.getInterfaces = function getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n };\n\n _proto2.toConfig = function toConfig() {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n isTypeOf: this.isTypeOf,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes || []\n };\n };\n\n _proto2.toString = function toString() {\n return this.name;\n };\n\n _proto2.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLObjectType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLObjectType';\n }\n }]);\n\n return GraphQLObjectType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLObjectType);\n\nfunction defineInterfaces(config) {\n var _resolveThunk;\n\n var interfaces = (_resolveThunk = resolveThunk(config.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];\n Array.isArray(interfaces) || devAssert(0, \"\".concat(config.name, \" interfaces must be an Array or a function which returns an Array.\"));\n return interfaces;\n}\n\nfunction defineFieldMap(config) {\n var fieldMap = resolveThunk(config.fields);\n isPlainObj(fieldMap) || devAssert(0, \"\".concat(config.name, \" fields must be an object with field names as keys or a function which returns such an object.\"));\n return mapValue(fieldMap, function (fieldConfig, fieldName) {\n var _fieldConfig$args;\n\n isPlainObj(fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field config must be an object.\"));\n !('isDeprecated' in fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" should provide \\\"deprecationReason\\\" instead of \\\"isDeprecated\\\".\"));\n fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function' || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field resolver must be a function if \") + \"provided, but got: \".concat(inspect(fieldConfig.resolve), \".\"));\n var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};\n isPlainObj(argsConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" args must be an object with argument names as keys.\"));\n var args = objectEntries(argsConfig).map(function (_ref) {\n var argName = _ref[0],\n argConfig = _ref[1];\n return {\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions && toObjMap(argConfig.extensions),\n astNode: argConfig.astNode\n };\n });\n return {\n name: fieldName,\n description: fieldConfig.description,\n type: fieldConfig.type,\n args: args,\n resolve: fieldConfig.resolve,\n subscribe: fieldConfig.subscribe,\n isDeprecated: fieldConfig.deprecationReason != null,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode\n };\n });\n}\n\nfunction isPlainObj(obj) {\n return isObjectLike(obj) && !Array.isArray(obj);\n}\n\nfunction fieldsToFieldsConfig(fields) {\n return mapValue(fields, function (field) {\n return {\n description: field.description,\n type: field.type,\n args: argsToArgsConfig(field.args),\n resolve: field.resolve,\n subscribe: field.subscribe,\n deprecationReason: field.deprecationReason,\n extensions: field.extensions,\n astNode: field.astNode\n };\n });\n}\n/**\n * @internal\n */\n\n\nexport function argsToArgsConfig(args) {\n return keyValMap(args, function (arg) {\n return arg.name;\n }, function (arg) {\n return {\n description: arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n deprecationReason: arg.deprecationReason,\n extensions: arg.extensions,\n astNode: arg.astNode\n };\n });\n}\nexport function isRequiredArgument(arg) {\n return isNonNullType(arg.type) && arg.defaultValue === undefined;\n}\n\n/**\n * Interface Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Interface type\n * is used to describe what types are possible, what fields are in common across\n * all types, as well as a function to determine which type is actually used\n * when the field is resolved.\n *\n * Example:\n *\n * const EntityType = new GraphQLInterfaceType({\n * name: 'Entity',\n * fields: {\n * name: { type: GraphQLString }\n * }\n * });\n *\n */\nexport var GraphQLInterfaceType = /*#__PURE__*/function () {\n function GraphQLInterfaceType(config) {\n this.name = config.name;\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.resolveType == null || typeof config.resolveType === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"resolveType\\\" as a function, \") + \"but got: \".concat(inspect(config.resolveType), \".\"));\n }\n\n var _proto3 = GraphQLInterfaceType.prototype;\n\n _proto3.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto3.getInterfaces = function getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n };\n\n _proto3.toConfig = function toConfig() {\n var _this$extensionASTNod2;\n\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod2 = this.extensionASTNodes) !== null && _this$extensionASTNod2 !== void 0 ? _this$extensionASTNod2 : []\n };\n };\n\n _proto3.toString = function toString() {\n return this.name;\n };\n\n _proto3.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLInterfaceType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLInterfaceType';\n }\n }]);\n\n return GraphQLInterfaceType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLInterfaceType);\n\n/**\n * Union Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Union type\n * is used to describe what types are possible as well as providing a function\n * to determine which type is actually used when the field is resolved.\n *\n * Example:\n *\n * const PetType = new GraphQLUnionType({\n * name: 'Pet',\n * types: [ DogType, CatType ],\n * resolveType(value) {\n * if (value instanceof Dog) {\n * return DogType;\n * }\n * if (value instanceof Cat) {\n * return CatType;\n * }\n * }\n * });\n *\n */\nexport var GraphQLUnionType = /*#__PURE__*/function () {\n function GraphQLUnionType(config) {\n this.name = config.name;\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._types = defineTypes.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.resolveType == null || typeof config.resolveType === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"resolveType\\\" as a function, \") + \"but got: \".concat(inspect(config.resolveType), \".\"));\n }\n\n var _proto4 = GraphQLUnionType.prototype;\n\n _proto4.getTypes = function getTypes() {\n if (typeof this._types === 'function') {\n this._types = this._types();\n }\n\n return this._types;\n };\n\n _proto4.toConfig = function toConfig() {\n var _this$extensionASTNod3;\n\n return {\n name: this.name,\n description: this.description,\n types: this.getTypes(),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod3 = this.extensionASTNodes) !== null && _this$extensionASTNod3 !== void 0 ? _this$extensionASTNod3 : []\n };\n };\n\n _proto4.toString = function toString() {\n return this.name;\n };\n\n _proto4.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLUnionType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLUnionType';\n }\n }]);\n\n return GraphQLUnionType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLUnionType);\n\nfunction defineTypes(config) {\n var types = resolveThunk(config.types);\n Array.isArray(types) || devAssert(0, \"Must provide Array of types or a function which returns such an array for Union \".concat(config.name, \".\"));\n return types;\n}\n\n/**\n * Enum Type Definition\n *\n * Some leaf values of requests and input values are Enums. GraphQL serializes\n * Enum values as strings, however internally Enums can be represented by any\n * kind of type, often integers.\n *\n * Example:\n *\n * const RGBType = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 }\n * }\n * });\n *\n * Note: If a value is not provided in a definition, the name of the enum value\n * will be used as its internal value.\n */\nexport var GraphQLEnumType\n/* */\n= /*#__PURE__*/function () {\n function GraphQLEnumType(config) {\n this.name = config.name;\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._values = defineEnumValues(this.name, config.values);\n this._valueLookup = new Map(this._values.map(function (enumValue) {\n return [enumValue.value, enumValue];\n }));\n this._nameLookup = keyMap(this._values, function (value) {\n return value.name;\n });\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n }\n\n var _proto5 = GraphQLEnumType.prototype;\n\n _proto5.getValues = function getValues() {\n return this._values;\n };\n\n _proto5.getValue = function getValue(name) {\n return this._nameLookup[name];\n };\n\n _proto5.serialize = function serialize(outputValue) {\n var enumValue = this._valueLookup.get(outputValue);\n\n if (enumValue === undefined) {\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent value: \").concat(inspect(outputValue)));\n }\n\n return enumValue.name;\n };\n\n _proto5.parseValue = function parseValue(inputValue)\n /* T */\n {\n if (typeof inputValue !== 'string') {\n var valueStr = inspect(inputValue);\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent non-string value: \").concat(valueStr, \".\") + didYouMeanEnumValue(this, valueStr));\n }\n\n var enumValue = this.getValue(inputValue);\n\n if (enumValue == null) {\n throw new GraphQLError(\"Value \\\"\".concat(inputValue, \"\\\" does not exist in \\\"\").concat(this.name, \"\\\" enum.\") + didYouMeanEnumValue(this, inputValue));\n }\n\n return enumValue.value;\n };\n\n _proto5.parseLiteral = function parseLiteral(valueNode, _variables)\n /* T */\n {\n // Note: variables will be resolved to a value before calling this function.\n if (valueNode.kind !== Kind.ENUM) {\n var valueStr = print(valueNode);\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent non-enum value: \").concat(valueStr, \".\") + didYouMeanEnumValue(this, valueStr), valueNode);\n }\n\n var enumValue = this.getValue(valueNode.value);\n\n if (enumValue == null) {\n var _valueStr = print(valueNode);\n\n throw new GraphQLError(\"Value \\\"\".concat(_valueStr, \"\\\" does not exist in \\\"\").concat(this.name, \"\\\" enum.\") + didYouMeanEnumValue(this, _valueStr), valueNode);\n }\n\n return enumValue.value;\n };\n\n _proto5.toConfig = function toConfig() {\n var _this$extensionASTNod4;\n\n var values = keyValMap(this.getValues(), function (value) {\n return value.name;\n }, function (value) {\n return {\n description: value.description,\n value: value.value,\n deprecationReason: value.deprecationReason,\n extensions: value.extensions,\n astNode: value.astNode\n };\n });\n return {\n name: this.name,\n description: this.description,\n values: values,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod4 = this.extensionASTNodes) !== null && _this$extensionASTNod4 !== void 0 ? _this$extensionASTNod4 : []\n };\n };\n\n _proto5.toString = function toString() {\n return this.name;\n };\n\n _proto5.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLEnumType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLEnumType';\n }\n }]);\n\n return GraphQLEnumType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLEnumType);\n\nfunction didYouMeanEnumValue(enumType, unknownValueStr) {\n var allNames = enumType.getValues().map(function (value) {\n return value.name;\n });\n var suggestedValues = suggestionList(unknownValueStr, allNames);\n return didYouMean('the enum value', suggestedValues);\n}\n\nfunction defineEnumValues(typeName, valueMap) {\n isPlainObj(valueMap) || devAssert(0, \"\".concat(typeName, \" values must be an object with value names as keys.\"));\n return objectEntries(valueMap).map(function (_ref2) {\n var valueName = _ref2[0],\n valueConfig = _ref2[1];\n isPlainObj(valueConfig) || devAssert(0, \"\".concat(typeName, \".\").concat(valueName, \" must refer to an object with a \\\"value\\\" key \") + \"representing an internal value but got: \".concat(inspect(valueConfig), \".\"));\n !('isDeprecated' in valueConfig) || devAssert(0, \"\".concat(typeName, \".\").concat(valueName, \" should provide \\\"deprecationReason\\\" instead of \\\"isDeprecated\\\".\"));\n return {\n name: valueName,\n description: valueConfig.description,\n value: valueConfig.value !== undefined ? valueConfig.value : valueName,\n isDeprecated: valueConfig.deprecationReason != null,\n deprecationReason: valueConfig.deprecationReason,\n extensions: valueConfig.extensions && toObjMap(valueConfig.extensions),\n astNode: valueConfig.astNode\n };\n });\n}\n\n/**\n * Input Object Type Definition\n *\n * An input object defines a structured collection of fields which may be\n * supplied to a field argument.\n *\n * Using `NonNull` will ensure that a value must be provided by the query\n *\n * Example:\n *\n * const GeoPoint = new GraphQLInputObjectType({\n * name: 'GeoPoint',\n * fields: {\n * lat: { type: new GraphQLNonNull(GraphQLFloat) },\n * lon: { type: new GraphQLNonNull(GraphQLFloat) },\n * alt: { type: GraphQLFloat, defaultValue: 0 },\n * }\n * });\n *\n */\nexport var GraphQLInputObjectType = /*#__PURE__*/function () {\n function GraphQLInputObjectType(config) {\n this.name = config.name;\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineInputFieldMap.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n }\n\n var _proto6 = GraphQLInputObjectType.prototype;\n\n _proto6.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto6.toConfig = function toConfig() {\n var _this$extensionASTNod5;\n\n var fields = mapValue(this.getFields(), function (field) {\n return {\n description: field.description,\n type: field.type,\n defaultValue: field.defaultValue,\n extensions: field.extensions,\n astNode: field.astNode\n };\n });\n return {\n name: this.name,\n description: this.description,\n fields: fields,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod5 = this.extensionASTNodes) !== null && _this$extensionASTNod5 !== void 0 ? _this$extensionASTNod5 : []\n };\n };\n\n _proto6.toString = function toString() {\n return this.name;\n };\n\n _proto6.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLInputObjectType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLInputObjectType';\n }\n }]);\n\n return GraphQLInputObjectType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLInputObjectType);\n\nfunction defineInputFieldMap(config) {\n var fieldMap = resolveThunk(config.fields);\n isPlainObj(fieldMap) || devAssert(0, \"\".concat(config.name, \" fields must be an object with field names as keys or a function which returns such an object.\"));\n return mapValue(fieldMap, function (fieldConfig, fieldName) {\n !('resolve' in fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field has a resolve property, but Input Types cannot define resolvers.\"));\n return {\n name: fieldName,\n description: fieldConfig.description,\n type: fieldConfig.type,\n defaultValue: fieldConfig.defaultValue,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode\n };\n });\n}\n\nexport function isRequiredInputField(field) {\n return isNonNullType(field.type) && field.defaultValue === undefined;\n}\n","import { isInterfaceType, isObjectType, isListType, isNonNullType, isAbstractType } from \"../type/definition.mjs\";\n/**\n * Provided two types, return true if the types are equal (invariant).\n */\n\nexport function isEqualType(typeA, typeB) {\n // Equivalent types are equal.\n if (typeA === typeB) {\n return true;\n } // If either type is non-null, the other must also be non-null.\n\n\n if (isNonNullType(typeA) && isNonNullType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // If either type is a list, the other must also be a list.\n\n\n if (isListType(typeA) && isListType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // Otherwise the types are not equal.\n\n\n return false;\n}\n/**\n * Provided a type and a super type, return true if the first type is either\n * equal or a subset of the second super type (covariant).\n */\n\nexport function isTypeSubTypeOf(schema, maybeSubType, superType) {\n // Equivalent type is a valid subtype\n if (maybeSubType === superType) {\n return true;\n } // If superType is non-null, maybeSubType must also be non-null.\n\n\n if (isNonNullType(superType)) {\n if (isNonNullType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isNonNullType(maybeSubType)) {\n // If superType is nullable, maybeSubType may be non-null or nullable.\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType);\n } // If superType type is a list, maybeSubType type must also be a list.\n\n\n if (isListType(superType)) {\n if (isListType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isListType(maybeSubType)) {\n // If superType is not a list, maybeSubType must also be not a list.\n return false;\n } // If superType type is an abstract type, check if it is super type of maybeSubType.\n // Otherwise, the child type is not a valid subtype of the parent type.\n\n\n return isAbstractType(superType) && (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) && schema.isSubType(superType, maybeSubType);\n}\n/**\n * Provided two composite types, determine if they \"overlap\". Two composite\n * types overlap when the Sets of possible concrete types for each intersect.\n *\n * This is often used to determine if a fragment of a given type could possibly\n * be visited in a context of another type.\n *\n * This function is commutative.\n */\n\nexport function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (isAbstractType(typeA)) {\n if (isAbstractType(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (isAbstractType(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}\n","import { SYMBOL_ITERATOR } from \"./symbols.mjs\";\n\n/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound]\nvar arrayFrom = Array.from || function (obj, mapFn, thisArg) {\n if (obj == null) {\n throw new TypeError('Array.from requires an array-like object - not null or undefined');\n } // Is Iterable?\n\n\n var iteratorMethod = obj[SYMBOL_ITERATOR];\n\n if (typeof iteratorMethod === 'function') {\n var iterator = iteratorMethod.call(obj);\n var result = [];\n var step;\n\n for (var i = 0; !(step = iterator.next()).done; ++i) {\n result.push(mapFn.call(thisArg, step.value, i)); // Infinite Iterators could cause forEach to run forever.\n // After a very large number of iterations, produce an error.\n // istanbul ignore if (Too big to actually test)\n\n if (i > 9999999) {\n throw new TypeError('Near-infinite iteration.');\n }\n }\n\n return result;\n } // Is Array like?\n\n\n var length = obj.length;\n\n if (typeof length === 'number' && length >= 0 && length % 1 === 0) {\n var _result = [];\n\n for (var _i = 0; _i < length; ++_i) {\n if (Object.prototype.hasOwnProperty.call(obj, _i)) {\n _result.push(mapFn.call(thisArg, obj[_i], _i));\n }\n }\n\n return _result;\n }\n\n return [];\n};\n\nexport default arrayFrom;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar isFinitePolyfill = Number.isFinite || function (value) {\n return typeof value === 'number' && isFinite(value);\n};\n\nexport default isFinitePolyfill;\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { SYMBOL_ITERATOR } from \"../polyfills/symbols.mjs\";\n/**\n * Safer version of `Array.from` that return `null` if value isn't convertible to array.\n * Also protects against Array-like objects without items.\n *\n * @example\n *\n * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3]\n * safeArrayFrom('ABC') // null\n * safeArrayFrom({ length: 1 }) // null\n * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha']\n * safeArrayFrom({ key: 'value' }) // null\n * safeArrayFrom(new Map()) // []\n *\n */\n\nexport default function safeArrayFrom(collection) {\n var mapFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) {\n return item;\n };\n\n if (collection == null || _typeof(collection) !== 'object') {\n return null;\n }\n\n if (Array.isArray(collection)) {\n return collection.map(mapFn);\n } // Is Iterable?\n\n\n var iteratorMethod = collection[SYMBOL_ITERATOR];\n\n if (typeof iteratorMethod === 'function') {\n // $FlowFixMe[incompatible-use]\n var iterator = iteratorMethod.call(collection);\n var result = [];\n var step;\n\n for (var i = 0; !(step = iterator.next()).done; ++i) {\n result.push(mapFn(step.value, i));\n }\n\n return result;\n } // Is Array like?\n\n\n var length = collection.length;\n\n if (typeof length === 'number' && length >= 0 && length % 1 === 0) {\n var _result = [];\n\n for (var _i = 0; _i < length; ++_i) {\n if (!Object.prototype.hasOwnProperty.call(collection, _i)) {\n return null;\n }\n\n _result.push(mapFn(collection[String(_i)], _i));\n }\n\n return _result;\n }\n\n return null;\n}\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar isInteger = Number.isInteger || function (value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n};\n\nexport default isInteger;\n","import isFinite from \"../polyfills/isFinite.mjs\";\nimport isInteger from \"../polyfills/isInteger.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { GraphQLScalarType } from \"./definition.mjs\"; // As per the GraphQL Spec, Integers are only treated as valid when a valid\n// 32-bit signed integer, providing the broadest support across platforms.\n//\n// n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because\n// they are internally represented as IEEE 754 doubles.\n\nvar MAX_INT = 2147483647;\nvar MIN_INT = -2147483648;\n\nfunction serializeInt(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n var num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (!isInteger(num)) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(inspect(coercedValue)));\n }\n\n if (num > MAX_INT || num < MIN_INT) {\n throw new GraphQLError('Int cannot represent non 32-bit signed integer value: ' + inspect(coercedValue));\n }\n\n return num;\n}\n\nfunction coerceInt(inputValue) {\n if (!isInteger(inputValue)) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(inspect(inputValue)));\n }\n\n if (inputValue > MAX_INT || inputValue < MIN_INT) {\n throw new GraphQLError(\"Int cannot represent non 32-bit signed integer value: \".concat(inputValue));\n }\n\n return inputValue;\n}\n\nexport var GraphQLInt = new GraphQLScalarType({\n name: 'Int',\n description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.',\n serialize: serializeInt,\n parseValue: coerceInt,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(print(valueNode)), valueNode);\n }\n\n var num = parseInt(valueNode.value, 10);\n\n if (num > MAX_INT || num < MIN_INT) {\n throw new GraphQLError(\"Int cannot represent non 32-bit signed integer value: \".concat(valueNode.value), valueNode);\n }\n\n return num;\n }\n});\n\nfunction serializeFloat(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n var num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (!isFinite(num)) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(inspect(coercedValue)));\n }\n\n return num;\n}\n\nfunction coerceFloat(inputValue) {\n if (!isFinite(inputValue)) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLFloat = new GraphQLScalarType({\n name: 'Float',\n description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).',\n serialize: serializeFloat,\n parseValue: coerceFloat,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(print(valueNode)), valueNode);\n }\n\n return parseFloat(valueNode.value);\n }\n}); // Support serializing objects with custom valueOf() or toJSON() functions -\n// a common way to represent a complex value which can be represented as\n// a string (ex: MongoDB id objects).\n\nfunction serializeObject(outputValue) {\n if (isObjectLike(outputValue)) {\n if (typeof outputValue.valueOf === 'function') {\n var valueOfResult = outputValue.valueOf();\n\n if (!isObjectLike(valueOfResult)) {\n return valueOfResult;\n }\n }\n\n if (typeof outputValue.toJSON === 'function') {\n // $FlowFixMe[incompatible-use]\n return outputValue.toJSON();\n }\n }\n\n return outputValue;\n}\n\nfunction serializeString(outputValue) {\n var coercedValue = serializeObject(outputValue); // Serialize string, boolean and number values to a string, but do not\n // attempt to coerce object, function, symbol, or other types as strings.\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 'true' : 'false';\n }\n\n if (isFinite(coercedValue)) {\n return coercedValue.toString();\n }\n\n throw new GraphQLError(\"String cannot represent value: \".concat(inspect(outputValue)));\n}\n\nfunction coerceString(inputValue) {\n if (typeof inputValue !== 'string') {\n throw new GraphQLError(\"String cannot represent a non string value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLString = new GraphQLScalarType({\n name: 'String',\n description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.',\n serialize: serializeString,\n parseValue: coerceString,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING) {\n throw new GraphQLError(\"String cannot represent a non string value: \".concat(print(valueNode)), valueNode);\n }\n\n return valueNode.value;\n }\n});\n\nfunction serializeBoolean(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue;\n }\n\n if (isFinite(coercedValue)) {\n return coercedValue !== 0;\n }\n\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(inspect(coercedValue)));\n}\n\nfunction coerceBoolean(inputValue) {\n if (typeof inputValue !== 'boolean') {\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLBoolean = new GraphQLScalarType({\n name: 'Boolean',\n description: 'The `Boolean` scalar type represents `true` or `false`.',\n serialize: serializeBoolean,\n parseValue: coerceBoolean,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.BOOLEAN) {\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(print(valueNode)), valueNode);\n }\n\n return valueNode.value;\n }\n});\n\nfunction serializeID(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (isInteger(coercedValue)) {\n return String(coercedValue);\n }\n\n throw new GraphQLError(\"ID cannot represent value: \".concat(inspect(outputValue)));\n}\n\nfunction coerceID(inputValue) {\n if (typeof inputValue === 'string') {\n return inputValue;\n }\n\n if (isInteger(inputValue)) {\n return inputValue.toString();\n }\n\n throw new GraphQLError(\"ID cannot represent value: \".concat(inspect(inputValue)));\n}\n\nexport var GraphQLID = new GraphQLScalarType({\n name: 'ID',\n description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.',\n serialize: serializeID,\n parseValue: coerceID,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) {\n throw new GraphQLError('ID cannot represent a non-string and non-integer value: ' + print(valueNode), valueNode);\n }\n\n return valueNode.value;\n }\n});\nexport var specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]);\nexport function isSpecifiedScalarType(type) {\n return specifiedScalarTypes.some(function (_ref) {\n var name = _ref.name;\n return type.name === name;\n });\n}\n","import isFinite from \"../polyfills/isFinite.mjs\";\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport safeArrayFrom from \"../jsutils/safeArrayFrom.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { GraphQLID } from \"../type/scalars.mjs\";\nimport { isLeafType, isEnumType, isInputObjectType, isListType, isNonNullType } from \"../type/definition.mjs\";\n/**\n * Produces a GraphQL Value AST given a JavaScript object.\n * Function will match JavaScript/JSON values to GraphQL AST schema format\n * by using suggested GraphQLInputType. For example:\n *\n * astFromValue(\"value\", GraphQLString)\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * JavaScript values.\n *\n * | JSON Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Number | Int / Float |\n * | Mixed | Enum Value |\n * | null | NullValue |\n *\n */\n\nexport function astFromValue(value, type) {\n if (isNonNullType(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (isListType(type)) {\n var itemType = type.ofType;\n var items = safeArrayFrom(value);\n\n if (items != null) {\n var valuesNodes = [];\n\n for (var _i2 = 0; _i2 < items.length; _i2++) {\n var item = items[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = objectValues(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: {\n kind: Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isLeafType(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && isFinite(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: Kind.INT,\n value: stringNum\n } : {\n kind: Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (isEnumType(type)) {\n return {\n kind: Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(inspect(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || invariant(0, 'Unexpected input type: ' + inspect(type));\n}\n/**\n * IntValue:\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit ( Digit+ )?\n */\n\nvar integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;\n","import objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { DirectiveLocation } from \"../language/directiveLocation.mjs\";\nimport { astFromValue } from \"../utilities/astFromValue.mjs\";\nimport { GraphQLString, GraphQLBoolean } from \"./scalars.mjs\";\nimport { GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLEnumType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isAbstractType } from \"./definition.mjs\";\nexport var __Schema = new GraphQLObjectType({\n name: '__Schema',\n description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.',\n fields: function fields() {\n return {\n description: {\n type: GraphQLString,\n resolve: function resolve(schema) {\n return schema.description;\n }\n },\n types: {\n description: 'A list of all types supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),\n resolve: function resolve(schema) {\n return objectValues(schema.getTypeMap());\n }\n },\n queryType: {\n description: 'The type that query operations will be rooted at.',\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(schema) {\n return schema.getQueryType();\n }\n },\n mutationType: {\n description: 'If this server supports mutation, the type that mutation operations will be rooted at.',\n type: __Type,\n resolve: function resolve(schema) {\n return schema.getMutationType();\n }\n },\n subscriptionType: {\n description: 'If this server support subscription, the type that subscription operations will be rooted at.',\n type: __Type,\n resolve: function resolve(schema) {\n return schema.getSubscriptionType();\n }\n },\n directives: {\n description: 'A list of all directives supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),\n resolve: function resolve(schema) {\n return schema.getDirectives();\n }\n }\n };\n }\n});\nexport var __Directive = new GraphQLObjectType({\n name: '__Directive',\n description: \"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\\n\\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.\",\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(directive) {\n return directive.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(directive) {\n return directive.description;\n }\n },\n isRepeatable: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(directive) {\n return directive.isRepeatable;\n }\n },\n locations: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),\n resolve: function resolve(directive) {\n return directive.locations;\n }\n },\n args: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),\n resolve: function resolve(directive) {\n return directive.args;\n }\n }\n };\n }\n});\nexport var __DirectiveLocation = new GraphQLEnumType({\n name: '__DirectiveLocation',\n description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.',\n values: {\n QUERY: {\n value: DirectiveLocation.QUERY,\n description: 'Location adjacent to a query operation.'\n },\n MUTATION: {\n value: DirectiveLocation.MUTATION,\n description: 'Location adjacent to a mutation operation.'\n },\n SUBSCRIPTION: {\n value: DirectiveLocation.SUBSCRIPTION,\n description: 'Location adjacent to a subscription operation.'\n },\n FIELD: {\n value: DirectiveLocation.FIELD,\n description: 'Location adjacent to a field.'\n },\n FRAGMENT_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_DEFINITION,\n description: 'Location adjacent to a fragment definition.'\n },\n FRAGMENT_SPREAD: {\n value: DirectiveLocation.FRAGMENT_SPREAD,\n description: 'Location adjacent to a fragment spread.'\n },\n INLINE_FRAGMENT: {\n value: DirectiveLocation.INLINE_FRAGMENT,\n description: 'Location adjacent to an inline fragment.'\n },\n VARIABLE_DEFINITION: {\n value: DirectiveLocation.VARIABLE_DEFINITION,\n description: 'Location adjacent to a variable definition.'\n },\n SCHEMA: {\n value: DirectiveLocation.SCHEMA,\n description: 'Location adjacent to a schema definition.'\n },\n SCALAR: {\n value: DirectiveLocation.SCALAR,\n description: 'Location adjacent to a scalar definition.'\n },\n OBJECT: {\n value: DirectiveLocation.OBJECT,\n description: 'Location adjacent to an object type definition.'\n },\n FIELD_DEFINITION: {\n value: DirectiveLocation.FIELD_DEFINITION,\n description: 'Location adjacent to a field definition.'\n },\n ARGUMENT_DEFINITION: {\n value: DirectiveLocation.ARGUMENT_DEFINITION,\n description: 'Location adjacent to an argument definition.'\n },\n INTERFACE: {\n value: DirectiveLocation.INTERFACE,\n description: 'Location adjacent to an interface definition.'\n },\n UNION: {\n value: DirectiveLocation.UNION,\n description: 'Location adjacent to a union definition.'\n },\n ENUM: {\n value: DirectiveLocation.ENUM,\n description: 'Location adjacent to an enum definition.'\n },\n ENUM_VALUE: {\n value: DirectiveLocation.ENUM_VALUE,\n description: 'Location adjacent to an enum value definition.'\n },\n INPUT_OBJECT: {\n value: DirectiveLocation.INPUT_OBJECT,\n description: 'Location adjacent to an input object type definition.'\n },\n INPUT_FIELD_DEFINITION: {\n value: DirectiveLocation.INPUT_FIELD_DEFINITION,\n description: 'Location adjacent to an input object field definition.'\n }\n }\n});\nexport var __Type = new GraphQLObjectType({\n name: '__Type',\n description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\\n\\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.',\n fields: function fields() {\n return {\n kind: {\n type: new GraphQLNonNull(__TypeKind),\n resolve: function resolve(type) {\n if (isScalarType(type)) {\n return TypeKind.SCALAR;\n }\n\n if (isObjectType(type)) {\n return TypeKind.OBJECT;\n }\n\n if (isInterfaceType(type)) {\n return TypeKind.INTERFACE;\n }\n\n if (isUnionType(type)) {\n return TypeKind.UNION;\n }\n\n if (isEnumType(type)) {\n return TypeKind.ENUM;\n }\n\n if (isInputObjectType(type)) {\n return TypeKind.INPUT_OBJECT;\n }\n\n if (isListType(type)) {\n return TypeKind.LIST;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isNonNullType(type)) {\n return TypeKind.NON_NULL;\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, \"Unexpected type: \\\"\".concat(inspect(type), \"\\\".\"));\n }\n },\n name: {\n type: GraphQLString,\n resolve: function resolve(type) {\n return type.name !== undefined ? type.name : undefined;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(type) {\n return type.description !== undefined ? type.description : undefined;\n }\n },\n specifiedByUrl: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.specifiedByUrl !== undefined ? obj.specifiedByUrl : undefined;\n }\n },\n fields: {\n type: new GraphQLList(new GraphQLNonNull(__Field)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref) {\n var includeDeprecated = _ref.includeDeprecated;\n\n if (isObjectType(type) || isInterfaceType(type)) {\n var fields = objectValues(type.getFields());\n return includeDeprecated ? fields : fields.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n interfaces: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve: function resolve(type) {\n if (isObjectType(type) || isInterfaceType(type)) {\n return type.getInterfaces();\n }\n }\n },\n possibleTypes: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve: function resolve(type, _args, _context, _ref2) {\n var schema = _ref2.schema;\n\n if (isAbstractType(type)) {\n return schema.getPossibleTypes(type);\n }\n }\n },\n enumValues: {\n type: new GraphQLList(new GraphQLNonNull(__EnumValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref3) {\n var includeDeprecated = _ref3.includeDeprecated;\n\n if (isEnumType(type)) {\n var values = type.getValues();\n return includeDeprecated ? values : values.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n inputFields: {\n type: new GraphQLList(new GraphQLNonNull(__InputValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref4) {\n var includeDeprecated = _ref4.includeDeprecated;\n\n if (isInputObjectType(type)) {\n var values = objectValues(type.getFields());\n return includeDeprecated ? values : values.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n ofType: {\n type: __Type,\n resolve: function resolve(type) {\n return type.ofType !== undefined ? type.ofType : undefined;\n }\n }\n };\n }\n});\nexport var __Field = new GraphQLObjectType({\n name: '__Field',\n description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(field) {\n return field.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(field) {\n return field.description;\n }\n },\n args: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(field, _ref5) {\n var includeDeprecated = _ref5.includeDeprecated;\n return includeDeprecated ? field.args : field.args.filter(function (arg) {\n return arg.deprecationReason == null;\n });\n }\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(field) {\n return field.type;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(field) {\n return field.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(field) {\n return field.deprecationReason;\n }\n }\n };\n }\n});\nexport var __InputValue = new GraphQLObjectType({\n name: '__InputValue',\n description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(inputValue) {\n return inputValue.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(inputValue) {\n return inputValue.description;\n }\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(inputValue) {\n return inputValue.type;\n }\n },\n defaultValue: {\n type: GraphQLString,\n description: 'A GraphQL-formatted string representing the default value for this input value.',\n resolve: function resolve(inputValue) {\n var type = inputValue.type,\n defaultValue = inputValue.defaultValue;\n var valueAST = astFromValue(defaultValue, type);\n return valueAST ? print(valueAST) : null;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(field) {\n return field.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.deprecationReason;\n }\n }\n };\n }\n});\nexport var __EnumValue = new GraphQLObjectType({\n name: '__EnumValue',\n description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(enumValue) {\n return enumValue.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(enumValue) {\n return enumValue.description;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(enumValue) {\n return enumValue.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(enumValue) {\n return enumValue.deprecationReason;\n }\n }\n };\n }\n});\nexport var TypeKind = Object.freeze({\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n INPUT_OBJECT: 'INPUT_OBJECT',\n LIST: 'LIST',\n NON_NULL: 'NON_NULL'\n});\nexport var __TypeKind = new GraphQLEnumType({\n name: '__TypeKind',\n description: 'An enum describing what kind of type a given `__Type` is.',\n values: {\n SCALAR: {\n value: TypeKind.SCALAR,\n description: 'Indicates this type is a scalar.'\n },\n OBJECT: {\n value: TypeKind.OBJECT,\n description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.'\n },\n INTERFACE: {\n value: TypeKind.INTERFACE,\n description: 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.'\n },\n UNION: {\n value: TypeKind.UNION,\n description: 'Indicates this type is a union. `possibleTypes` is a valid field.'\n },\n ENUM: {\n value: TypeKind.ENUM,\n description: 'Indicates this type is an enum. `enumValues` is a valid field.'\n },\n INPUT_OBJECT: {\n value: TypeKind.INPUT_OBJECT,\n description: 'Indicates this type is an input object. `inputFields` is a valid field.'\n },\n LIST: {\n value: TypeKind.LIST,\n description: 'Indicates this type is a list. `ofType` is a valid field.'\n },\n NON_NULL: {\n value: TypeKind.NON_NULL,\n description: 'Indicates this type is a non-null. `ofType` is a valid field.'\n }\n }\n});\n/**\n * Note that these are GraphQLField and not GraphQLFieldConfig,\n * so the format for args is different.\n */\n\nexport var SchemaMetaFieldDef = {\n name: '__schema',\n type: new GraphQLNonNull(__Schema),\n description: 'Access the current type schema of this server.',\n args: [],\n resolve: function resolve(_source, _args, _context, _ref6) {\n var schema = _ref6.schema;\n return schema;\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var TypeMetaFieldDef = {\n name: '__type',\n type: __Type,\n description: 'Request the type information of a single type.',\n args: [{\n name: 'name',\n description: undefined,\n type: new GraphQLNonNull(GraphQLString),\n defaultValue: undefined,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n }],\n resolve: function resolve(_source, _ref7, _context, _ref8) {\n var name = _ref7.name;\n var schema = _ref8.schema;\n return schema.getType(name);\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var TypeNameMetaFieldDef = {\n name: '__typename',\n type: new GraphQLNonNull(GraphQLString),\n description: 'The name of the current Object type at runtime.',\n args: [],\n resolve: function resolve(_source, _args, _context, _ref9) {\n var parentType = _ref9.parentType;\n return parentType.name;\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]);\nexport function isIntrospectionType(type) {\n return introspectionTypes.some(function (_ref10) {\n var name = _ref10.name;\n return type.name === name;\n });\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport objectEntries from \"../polyfills/objectEntries.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport defineInspect from \"../jsutils/defineInspect.mjs\";\nimport { DirectiveLocation } from \"../language/directiveLocation.mjs\";\nimport { GraphQLString, GraphQLBoolean } from \"./scalars.mjs\";\nimport { argsToArgsConfig, GraphQLNonNull } from \"./definition.mjs\";\n/**\n * Test if the given value is a GraphQL directive.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isDirective(directive) {\n return instanceOf(directive, GraphQLDirective);\n}\nexport function assertDirective(directive) {\n if (!isDirective(directive)) {\n throw new Error(\"Expected \".concat(inspect(directive), \" to be a GraphQL directive.\"));\n }\n\n return directive;\n}\n/**\n * Directives are used by the GraphQL runtime as a way of modifying execution\n * behavior. Type system creators will usually not create these directly.\n */\n\nexport var GraphQLDirective = /*#__PURE__*/function () {\n function GraphQLDirective(config) {\n var _config$isRepeatable, _config$args;\n\n this.name = config.name;\n this.description = config.description;\n this.locations = config.locations;\n this.isRepeatable = (_config$isRepeatable = config.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n config.name || devAssert(0, 'Directive must be named.');\n Array.isArray(config.locations) || devAssert(0, \"@\".concat(config.name, \" locations must be an Array.\"));\n var args = (_config$args = config.args) !== null && _config$args !== void 0 ? _config$args : {};\n isObjectLike(args) && !Array.isArray(args) || devAssert(0, \"@\".concat(config.name, \" args must be an object with argument names as keys.\"));\n this.args = objectEntries(args).map(function (_ref) {\n var argName = _ref[0],\n argConfig = _ref[1];\n return {\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions && toObjMap(argConfig.extensions),\n astNode: argConfig.astNode\n };\n });\n }\n\n var _proto = GraphQLDirective.prototype;\n\n _proto.toConfig = function toConfig() {\n return {\n name: this.name,\n description: this.description,\n locations: this.locations,\n args: argsToArgsConfig(this.args),\n isRepeatable: this.isRepeatable,\n extensions: this.extensions,\n astNode: this.astNode\n };\n };\n\n _proto.toString = function toString() {\n return '@' + this.name;\n };\n\n _proto.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLDirective, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLDirective';\n }\n }]);\n\n return GraphQLDirective;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLDirective);\n\n/**\n * Used to conditionally include fields or fragments.\n */\nexport var GraphQLIncludeDirective = new GraphQLDirective({\n name: 'include',\n description: 'Directs the executor to include this field or fragment only when the `if` argument is true.',\n locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Included when true.'\n }\n }\n});\n/**\n * Used to conditionally skip (exclude) fields or fragments.\n */\n\nexport var GraphQLSkipDirective = new GraphQLDirective({\n name: 'skip',\n description: 'Directs the executor to skip this field or fragment when the `if` argument is true.',\n locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Skipped when true.'\n }\n }\n});\n/**\n * Constant string used for default reason for a deprecation.\n */\n\nexport var DEFAULT_DEPRECATION_REASON = 'No longer supported';\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n */\n\nexport var GraphQLDeprecatedDirective = new GraphQLDirective({\n name: 'deprecated',\n description: 'Marks an element of a GraphQL schema as no longer supported.',\n locations: [DirectiveLocation.FIELD_DEFINITION, DirectiveLocation.ARGUMENT_DEFINITION, DirectiveLocation.INPUT_FIELD_DEFINITION, DirectiveLocation.ENUM_VALUE],\n args: {\n reason: {\n type: GraphQLString,\n description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).',\n defaultValue: DEFAULT_DEPRECATION_REASON\n }\n }\n});\n/**\n * Used to provide a URL for specifying the behaviour of custom scalar definitions.\n */\n\nexport var GraphQLSpecifiedByDirective = new GraphQLDirective({\n name: 'specifiedBy',\n description: 'Exposes a URL that specifies the behaviour of this scalar.',\n locations: [DirectiveLocation.SCALAR],\n args: {\n url: {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The URL that specifies the behaviour of this scalar.'\n }\n }\n});\n/**\n * The full list of specified directives.\n */\n\nexport var specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective]);\nexport function isSpecifiedDirective(directive) {\n return specifiedDirectives.some(function (_ref2) {\n var name = _ref2.name;\n return name === directive.name;\n });\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport find from \"../polyfills/find.mjs\";\nimport arrayFrom from \"../polyfills/arrayFrom.mjs\";\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { __Schema } from \"./introspection.mjs\";\nimport { GraphQLDirective, isDirective, specifiedDirectives } from \"./directives.mjs\";\nimport { isObjectType, isInterfaceType, isUnionType, isInputObjectType, getNamedType } from \"./definition.mjs\";\n/**\n * Test if the given value is a GraphQL schema.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSchema(schema) {\n return instanceOf(schema, GraphQLSchema);\n}\nexport function assertSchema(schema) {\n if (!isSchema(schema)) {\n throw new Error(\"Expected \".concat(inspect(schema), \" to be a GraphQL schema.\"));\n }\n\n return schema;\n}\n/**\n * Schema Definition\n *\n * A Schema is created by supplying the root types of each type of operation,\n * query and mutation (optional). A schema definition is then supplied to the\n * validator and executor.\n *\n * Example:\n *\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * mutation: MyAppMutationRootType,\n * })\n *\n * Note: When the schema is constructed, by default only the types that are\n * reachable by traversing the root types are included, other types must be\n * explicitly referenced.\n *\n * Example:\n *\n * const characterInterface = new GraphQLInterfaceType({\n * name: 'Character',\n * ...\n * });\n *\n * const humanType = new GraphQLObjectType({\n * name: 'Human',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const droidType = new GraphQLObjectType({\n * name: 'Droid',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * hero: { type: characterInterface, ... },\n * }\n * }),\n * ...\n * // Since this schema references only the `Character` interface it's\n * // necessary to explicitly list the types that implement it if\n * // you want them to be included in the final schema.\n * types: [humanType, droidType],\n * })\n *\n * Note: If an array of `directives` are provided to GraphQLSchema, that will be\n * the exact list of directives represented and allowed. If `directives` is not\n * provided then a default set of the specified directives (e.g. @include and\n * @skip) will be used. If you wish to provide *additional* directives to these\n * specified directives, you must explicitly declare them. Example:\n *\n * const MyAppSchema = new GraphQLSchema({\n * ...\n * directives: specifiedDirectives.concat([ myCustomDirective ]),\n * })\n *\n */\n\nexport var GraphQLSchema = /*#__PURE__*/function () {\n // Used as a cache for validateSchema().\n function GraphQLSchema(config) {\n var _config$directives;\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n isObjectLike(config) || devAssert(0, 'Must provide configuration object.');\n !config.types || Array.isArray(config.types) || devAssert(0, \"\\\"types\\\" must be Array if provided but got: \".concat(inspect(config.types), \".\"));\n !config.directives || Array.isArray(config.directives) || devAssert(0, '\"directives\" must be Array if provided but got: ' + \"\".concat(inspect(config.directives), \".\"));\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : specifiedDirectives; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n var allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2];\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) {\n var directive = _this$_directives2[_i4];\n\n // Directives are not validated until validateSchema() is called.\n if (isDirective(directive)) {\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (var _i8 = 0, _arrayFrom2 = arrayFrom(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) {\n var namedType = _arrayFrom2[_i8];\n\n if (namedType == null) {\n continue;\n }\n\n var typeName = namedType.name;\n typeName || devAssert(0, 'One of the provided types for building the Schema is missing a name.');\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\"Schema must contain uniquely named types but contains multiple types named \\\"\".concat(typeName, \"\\\".\"));\n }\n\n this._typeMap[typeName] = namedType;\n\n if (isInterfaceType(namedType)) {\n // Store implementations by interface.\n for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) {\n var iface = _namedType$getInterfa2[_i10];\n\n if (isInterfaceType(iface)) {\n var implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (isObjectType(namedType)) {\n // Store implementations by objects.\n for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) {\n var _iface = _namedType$getInterfa4[_i12];\n\n if (isInterfaceType(_iface)) {\n var _implementations = this._implementationsMap[_iface.name];\n\n if (_implementations === undefined) {\n _implementations = this._implementationsMap[_iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n _implementations.objects.push(namedType);\n }\n }\n }\n }\n }\n\n var _proto = GraphQLSchema.prototype;\n\n _proto.getQueryType = function getQueryType() {\n return this._queryType;\n };\n\n _proto.getMutationType = function getMutationType() {\n return this._mutationType;\n };\n\n _proto.getSubscriptionType = function getSubscriptionType() {\n return this._subscriptionType;\n };\n\n _proto.getTypeMap = function getTypeMap() {\n return this._typeMap;\n };\n\n _proto.getType = function getType(name) {\n return this.getTypeMap()[name];\n };\n\n _proto.getPossibleTypes = function getPossibleTypes(abstractType) {\n return isUnionType(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects;\n };\n\n _proto.getImplementations = function getImplementations(interfaceType) {\n var implementations = this._implementationsMap[interfaceType.name];\n return implementations !== null && implementations !== void 0 ? implementations : {\n objects: [],\n interfaces: []\n };\n } // @deprecated: use isSubType instead - will be removed in v16.\n ;\n\n _proto.isPossibleType = function isPossibleType(abstractType, possibleType) {\n return this.isSubType(abstractType, possibleType);\n };\n\n _proto.isSubType = function isSubType(abstractType, maybeSubType) {\n var map = this._subTypeMap[abstractType.name];\n\n if (map === undefined) {\n map = Object.create(null);\n\n if (isUnionType(abstractType)) {\n for (var _i14 = 0, _abstractType$getType2 = abstractType.getTypes(); _i14 < _abstractType$getType2.length; _i14++) {\n var type = _abstractType$getType2[_i14];\n map[type.name] = true;\n }\n } else {\n var implementations = this.getImplementations(abstractType);\n\n for (var _i16 = 0, _implementations$obje2 = implementations.objects; _i16 < _implementations$obje2.length; _i16++) {\n var _type = _implementations$obje2[_i16];\n map[_type.name] = true;\n }\n\n for (var _i18 = 0, _implementations$inte2 = implementations.interfaces; _i18 < _implementations$inte2.length; _i18++) {\n var _type2 = _implementations$inte2[_i18];\n map[_type2.name] = true;\n }\n }\n\n this._subTypeMap[abstractType.name] = map;\n }\n\n return map[maybeSubType.name] !== undefined;\n };\n\n _proto.getDirectives = function getDirectives() {\n return this._directives;\n };\n\n _proto.getDirective = function getDirective(name) {\n return find(this.getDirectives(), function (directive) {\n return directive.name === name;\n });\n };\n\n _proto.toConfig = function toConfig() {\n var _this$extensionASTNod;\n\n return {\n description: this.description,\n query: this.getQueryType(),\n mutation: this.getMutationType(),\n subscription: this.getSubscriptionType(),\n types: objectValues(this.getTypeMap()),\n directives: this.getDirectives().slice(),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : [],\n assumeValid: this.__validationErrors !== undefined\n };\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLSchema, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLSchema';\n }\n }]);\n\n return GraphQLSchema;\n}();\n\nfunction collectReferencedTypes(type, typeSet) {\n var namedType = getNamedType(type);\n\n if (!typeSet.has(namedType)) {\n typeSet.add(namedType);\n\n if (isUnionType(namedType)) {\n for (var _i20 = 0, _namedType$getTypes2 = namedType.getTypes(); _i20 < _namedType$getTypes2.length; _i20++) {\n var memberType = _namedType$getTypes2[_i20];\n collectReferencedTypes(memberType, typeSet);\n }\n } else if (isObjectType(namedType) || isInterfaceType(namedType)) {\n for (var _i22 = 0, _namedType$getInterfa6 = namedType.getInterfaces(); _i22 < _namedType$getInterfa6.length; _i22++) {\n var interfaceType = _namedType$getInterfa6[_i22];\n collectReferencedTypes(interfaceType, typeSet);\n }\n\n for (var _i24 = 0, _objectValues2 = objectValues(namedType.getFields()); _i24 < _objectValues2.length; _i24++) {\n var field = _objectValues2[_i24];\n collectReferencedTypes(field.type, typeSet);\n\n for (var _i26 = 0, _field$args2 = field.args; _i26 < _field$args2.length; _i26++) {\n var arg = _field$args2[_i26];\n collectReferencedTypes(arg.type, typeSet);\n }\n }\n } else if (isInputObjectType(namedType)) {\n for (var _i28 = 0, _objectValues4 = objectValues(namedType.getFields()); _i28 < _objectValues4.length; _i28++) {\n var _field = _objectValues4[_i28];\n collectReferencedTypes(_field.type, typeSet);\n }\n }\n }\n\n return typeSet;\n}\n","import find from \"../polyfills/find.mjs\";\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { locatedError } from \"../error/locatedError.mjs\";\nimport { isValidNameError } from \"../utilities/assertValidName.mjs\";\nimport { isEqualType, isTypeSubTypeOf } from \"../utilities/typeComparators.mjs\";\nimport { assertSchema } from \"./schema.mjs\";\nimport { isIntrospectionType } from \"./introspection.mjs\";\nimport { isDirective, GraphQLDeprecatedDirective } from \"./directives.mjs\";\nimport { isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isNamedType, isNonNullType, isInputType, isOutputType, isRequiredArgument, isRequiredInputField } from \"./definition.mjs\";\n/**\n * Implements the \"Type Validation\" sub-sections of the specification's\n * \"Type System\" section.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the Schema is valid.\n */\n\nexport function validateSchema(schema) {\n // First check to ensure the provided value is in fact a GraphQLSchema.\n assertSchema(schema); // If this Schema has already been validated, return the previous results.\n\n if (schema.__validationErrors) {\n return schema.__validationErrors;\n } // Validate the schema, producing a list of errors.\n\n\n var context = new SchemaValidationContext(schema);\n validateRootTypes(context);\n validateDirectives(context);\n validateTypes(context); // Persist the results of validation before returning to ensure validation\n // does not run multiple times for this schema.\n\n var errors = context.getErrors();\n schema.__validationErrors = errors;\n return errors;\n}\n/**\n * Utility function which asserts a schema is valid by throwing an error if\n * it is invalid.\n */\n\nexport function assertValidSchema(schema) {\n var errors = validateSchema(schema);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}\n\nvar SchemaValidationContext = /*#__PURE__*/function () {\n function SchemaValidationContext(schema) {\n this._errors = [];\n this.schema = schema;\n }\n\n var _proto = SchemaValidationContext.prototype;\n\n _proto.reportError = function reportError(message, nodes) {\n var _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes;\n\n this.addError(new GraphQLError(message, _nodes));\n };\n\n _proto.addError = function addError(error) {\n this._errors.push(error);\n };\n\n _proto.getErrors = function getErrors() {\n return this._errors;\n };\n\n return SchemaValidationContext;\n}();\n\nfunction validateRootTypes(context) {\n var schema = context.schema;\n var queryType = schema.getQueryType();\n\n if (!queryType) {\n context.reportError('Query root type must be provided.', schema.astNode);\n } else if (!isObjectType(queryType)) {\n var _getOperationTypeNode;\n\n context.reportError(\"Query root type must be Object type, it cannot be \".concat(inspect(queryType), \".\"), (_getOperationTypeNode = getOperationTypeNode(schema, 'query')) !== null && _getOperationTypeNode !== void 0 ? _getOperationTypeNode : queryType.astNode);\n }\n\n var mutationType = schema.getMutationType();\n\n if (mutationType && !isObjectType(mutationType)) {\n var _getOperationTypeNode2;\n\n context.reportError('Mutation root type must be Object type if provided, it cannot be ' + \"\".concat(inspect(mutationType), \".\"), (_getOperationTypeNode2 = getOperationTypeNode(schema, 'mutation')) !== null && _getOperationTypeNode2 !== void 0 ? _getOperationTypeNode2 : mutationType.astNode);\n }\n\n var subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType && !isObjectType(subscriptionType)) {\n var _getOperationTypeNode3;\n\n context.reportError('Subscription root type must be Object type if provided, it cannot be ' + \"\".concat(inspect(subscriptionType), \".\"), (_getOperationTypeNode3 = getOperationTypeNode(schema, 'subscription')) !== null && _getOperationTypeNode3 !== void 0 ? _getOperationTypeNode3 : subscriptionType.astNode);\n }\n}\n\nfunction getOperationTypeNode(schema, operation) {\n var operationNodes = getAllSubNodes(schema, function (node) {\n return node.operationTypes;\n });\n\n for (var _i2 = 0; _i2 < operationNodes.length; _i2++) {\n var node = operationNodes[_i2];\n\n if (node.operation === operation) {\n return node.type;\n }\n }\n\n return undefined;\n}\n\nfunction validateDirectives(context) {\n for (var _i4 = 0, _context$schema$getDi2 = context.schema.getDirectives(); _i4 < _context$schema$getDi2.length; _i4++) {\n var directive = _context$schema$getDi2[_i4];\n\n // Ensure all directives are in fact GraphQL directives.\n if (!isDirective(directive)) {\n context.reportError(\"Expected directive but got: \".concat(inspect(directive), \".\"), directive === null || directive === void 0 ? void 0 : directive.astNode);\n continue;\n } // Ensure they are named correctly.\n\n\n validateName(context, directive); // TODO: Ensure proper locations.\n // Ensure the arguments are valid.\n\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n // Ensure they are named correctly.\n validateName(context, arg); // Ensure the type is an input type.\n\n if (!isInputType(arg.type)) {\n context.reportError(\"The type of @\".concat(directive.name, \"(\").concat(arg.name, \":) must be Input Type \") + \"but got: \".concat(inspect(arg.type), \".\"), arg.astNode);\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n var _arg$astNode;\n\n context.reportError(\"Required argument @\".concat(directive.name, \"(\").concat(arg.name, \":) cannot be deprecated.\"), [getDeprecatedDirectiveNode(arg.astNode), // istanbul ignore next (TODO need to write coverage tests)\n (_arg$astNode = arg.astNode) === null || _arg$astNode === void 0 ? void 0 : _arg$astNode.type]);\n }\n }\n }\n}\n\nfunction validateName(context, node) {\n // Ensure names are valid, however introspection types opt out.\n var error = isValidNameError(node.name);\n\n if (error) {\n context.addError(locatedError(error, node.astNode));\n }\n}\n\nfunction validateTypes(context) {\n var validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context);\n var typeMap = context.schema.getTypeMap();\n\n for (var _i8 = 0, _objectValues2 = objectValues(typeMap); _i8 < _objectValues2.length; _i8++) {\n var type = _objectValues2[_i8];\n\n // Ensure all provided types are in fact GraphQL type.\n if (!isNamedType(type)) {\n context.reportError(\"Expected GraphQL named type but got: \".concat(inspect(type), \".\"), type.astNode);\n continue;\n } // Ensure it is named correctly (excluding introspection types).\n\n\n if (!isIntrospectionType(type)) {\n validateName(context, type);\n }\n\n if (isObjectType(type)) {\n // Ensure fields are valid\n validateFields(context, type); // Ensure objects implement the interfaces they claim to.\n\n validateInterfaces(context, type);\n } else if (isInterfaceType(type)) {\n // Ensure fields are valid.\n validateFields(context, type); // Ensure interfaces implement the interfaces they claim to.\n\n validateInterfaces(context, type);\n } else if (isUnionType(type)) {\n // Ensure Unions include valid member types.\n validateUnionMembers(context, type);\n } else if (isEnumType(type)) {\n // Ensure Enums have valid values.\n validateEnumValues(context, type);\n } else if (isInputObjectType(type)) {\n // Ensure Input Object fields are valid.\n validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references\n\n validateInputObjectCircularRefs(type);\n }\n }\n}\n\nfunction validateFields(context, type) {\n var fields = objectValues(type.getFields()); // Objects and Interfaces both must define one or more fields.\n\n if (fields.length === 0) {\n context.reportError(\"Type \".concat(type.name, \" must define one or more fields.\"), getAllNodes(type));\n }\n\n for (var _i10 = 0; _i10 < fields.length; _i10++) {\n var field = fields[_i10];\n // Ensure they are named correctly.\n validateName(context, field); // Ensure the type is an output type\n\n if (!isOutputType(field.type)) {\n var _field$astNode;\n\n context.reportError(\"The type of \".concat(type.name, \".\").concat(field.name, \" must be Output Type \") + \"but got: \".concat(inspect(field.type), \".\"), (_field$astNode = field.astNode) === null || _field$astNode === void 0 ? void 0 : _field$astNode.type);\n } // Ensure the arguments are valid\n\n\n for (var _i12 = 0, _field$args2 = field.args; _i12 < _field$args2.length; _i12++) {\n var arg = _field$args2[_i12];\n var argName = arg.name; // Ensure they are named correctly.\n\n validateName(context, arg); // Ensure the type is an input type\n\n if (!isInputType(arg.type)) {\n var _arg$astNode2;\n\n context.reportError(\"The type of \".concat(type.name, \".\").concat(field.name, \"(\").concat(argName, \":) must be Input \") + \"Type but got: \".concat(inspect(arg.type), \".\"), (_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 ? void 0 : _arg$astNode2.type);\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n var _arg$astNode3;\n\n context.reportError(\"Required argument \".concat(type.name, \".\").concat(field.name, \"(\").concat(argName, \":) cannot be deprecated.\"), [getDeprecatedDirectiveNode(arg.astNode), // istanbul ignore next (TODO need to write coverage tests)\n (_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0 ? void 0 : _arg$astNode3.type]);\n }\n }\n }\n}\n\nfunction validateInterfaces(context, type) {\n var ifaceTypeNames = Object.create(null);\n\n for (var _i14 = 0, _type$getInterfaces2 = type.getInterfaces(); _i14 < _type$getInterfaces2.length; _i14++) {\n var iface = _type$getInterfaces2[_i14];\n\n if (!isInterfaceType(iface)) {\n context.reportError(\"Type \".concat(inspect(type), \" must only implement Interface types, \") + \"it cannot implement \".concat(inspect(iface), \".\"), getAllImplementsInterfaceNodes(type, iface));\n continue;\n }\n\n if (type === iface) {\n context.reportError(\"Type \".concat(type.name, \" cannot implement itself because it would create a circular reference.\"), getAllImplementsInterfaceNodes(type, iface));\n continue;\n }\n\n if (ifaceTypeNames[iface.name]) {\n context.reportError(\"Type \".concat(type.name, \" can only implement \").concat(iface.name, \" once.\"), getAllImplementsInterfaceNodes(type, iface));\n continue;\n }\n\n ifaceTypeNames[iface.name] = true;\n validateTypeImplementsAncestors(context, type, iface);\n validateTypeImplementsInterface(context, type, iface);\n }\n}\n\nfunction validateTypeImplementsInterface(context, type, iface) {\n var typeFieldMap = type.getFields(); // Assert each interface field is implemented.\n\n for (var _i16 = 0, _objectValues4 = objectValues(iface.getFields()); _i16 < _objectValues4.length; _i16++) {\n var ifaceField = _objectValues4[_i16];\n var fieldName = ifaceField.name;\n var typeField = typeFieldMap[fieldName]; // Assert interface field exists on type.\n\n if (!typeField) {\n context.reportError(\"Interface field \".concat(iface.name, \".\").concat(fieldName, \" expected but \").concat(type.name, \" does not provide it.\"), [ifaceField.astNode].concat(getAllNodes(type)));\n continue;\n } // Assert interface field type is satisfied by type field type, by being\n // a valid subtype. (covariant)\n\n\n if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) {\n var _ifaceField$astNode, _typeField$astNode;\n\n context.reportError(\"Interface field \".concat(iface.name, \".\").concat(fieldName, \" expects type \") + \"\".concat(inspect(ifaceField.type), \" but \").concat(type.name, \".\").concat(fieldName, \" \") + \"is type \".concat(inspect(typeField.type), \".\"), [// istanbul ignore next (TODO need to write coverage tests)\n (_ifaceField$astNode = ifaceField.astNode) === null || _ifaceField$astNode === void 0 ? void 0 : _ifaceField$astNode.type, // istanbul ignore next (TODO need to write coverage tests)\n (_typeField$astNode = typeField.astNode) === null || _typeField$astNode === void 0 ? void 0 : _typeField$astNode.type]);\n } // Assert each interface field arg is implemented.\n\n\n var _loop = function _loop(_i18, _ifaceField$args2) {\n var ifaceArg = _ifaceField$args2[_i18];\n var argName = ifaceArg.name;\n var typeArg = find(typeField.args, function (arg) {\n return arg.name === argName;\n }); // Assert interface field arg exists on object field.\n\n if (!typeArg) {\n context.reportError(\"Interface field argument \".concat(iface.name, \".\").concat(fieldName, \"(\").concat(argName, \":) expected but \").concat(type.name, \".\").concat(fieldName, \" does not provide it.\"), [ifaceArg.astNode, typeField.astNode]);\n return \"continue\";\n } // Assert interface field arg type matches object field arg type.\n // (invariant)\n // TODO: change to contravariant?\n\n\n if (!isEqualType(ifaceArg.type, typeArg.type)) {\n var _ifaceArg$astNode, _typeArg$astNode;\n\n context.reportError(\"Interface field argument \".concat(iface.name, \".\").concat(fieldName, \"(\").concat(argName, \":) \") + \"expects type \".concat(inspect(ifaceArg.type), \" but \") + \"\".concat(type.name, \".\").concat(fieldName, \"(\").concat(argName, \":) is type \") + \"\".concat(inspect(typeArg.type), \".\"), [// istanbul ignore next (TODO need to write coverage tests)\n (_ifaceArg$astNode = ifaceArg.astNode) === null || _ifaceArg$astNode === void 0 ? void 0 : _ifaceArg$astNode.type, // istanbul ignore next (TODO need to write coverage tests)\n (_typeArg$astNode = typeArg.astNode) === null || _typeArg$astNode === void 0 ? void 0 : _typeArg$astNode.type]);\n } // TODO: validate default values?\n\n };\n\n for (var _i18 = 0, _ifaceField$args2 = ifaceField.args; _i18 < _ifaceField$args2.length; _i18++) {\n var _ret = _loop(_i18, _ifaceField$args2);\n\n if (_ret === \"continue\") continue;\n } // Assert additional arguments must not be required.\n\n\n var _loop2 = function _loop2(_i20, _typeField$args2) {\n var typeArg = _typeField$args2[_i20];\n var argName = typeArg.name;\n var ifaceArg = find(ifaceField.args, function (arg) {\n return arg.name === argName;\n });\n\n if (!ifaceArg && isRequiredArgument(typeArg)) {\n context.reportError(\"Object field \".concat(type.name, \".\").concat(fieldName, \" includes required argument \").concat(argName, \" that is missing from the Interface field \").concat(iface.name, \".\").concat(fieldName, \".\"), [typeArg.astNode, ifaceField.astNode]);\n }\n };\n\n for (var _i20 = 0, _typeField$args2 = typeField.args; _i20 < _typeField$args2.length; _i20++) {\n _loop2(_i20, _typeField$args2);\n }\n }\n}\n\nfunction validateTypeImplementsAncestors(context, type, iface) {\n var ifaceInterfaces = type.getInterfaces();\n\n for (var _i22 = 0, _iface$getInterfaces2 = iface.getInterfaces(); _i22 < _iface$getInterfaces2.length; _i22++) {\n var transitive = _iface$getInterfaces2[_i22];\n\n if (ifaceInterfaces.indexOf(transitive) === -1) {\n context.reportError(transitive === type ? \"Type \".concat(type.name, \" cannot implement \").concat(iface.name, \" because it would create a circular reference.\") : \"Type \".concat(type.name, \" must implement \").concat(transitive.name, \" because it is implemented by \").concat(iface.name, \".\"), [].concat(getAllImplementsInterfaceNodes(iface, transitive), getAllImplementsInterfaceNodes(type, iface)));\n }\n }\n}\n\nfunction validateUnionMembers(context, union) {\n var memberTypes = union.getTypes();\n\n if (memberTypes.length === 0) {\n context.reportError(\"Union type \".concat(union.name, \" must define one or more member types.\"), getAllNodes(union));\n }\n\n var includedTypeNames = Object.create(null);\n\n for (var _i24 = 0; _i24 < memberTypes.length; _i24++) {\n var memberType = memberTypes[_i24];\n\n if (includedTypeNames[memberType.name]) {\n context.reportError(\"Union type \".concat(union.name, \" can only include type \").concat(memberType.name, \" once.\"), getUnionMemberTypeNodes(union, memberType.name));\n continue;\n }\n\n includedTypeNames[memberType.name] = true;\n\n if (!isObjectType(memberType)) {\n context.reportError(\"Union type \".concat(union.name, \" can only include Object types, \") + \"it cannot include \".concat(inspect(memberType), \".\"), getUnionMemberTypeNodes(union, String(memberType)));\n }\n }\n}\n\nfunction validateEnumValues(context, enumType) {\n var enumValues = enumType.getValues();\n\n if (enumValues.length === 0) {\n context.reportError(\"Enum type \".concat(enumType.name, \" must define one or more values.\"), getAllNodes(enumType));\n }\n\n for (var _i26 = 0; _i26 < enumValues.length; _i26++) {\n var enumValue = enumValues[_i26];\n var valueName = enumValue.name; // Ensure valid name.\n\n validateName(context, enumValue);\n\n if (valueName === 'true' || valueName === 'false' || valueName === 'null') {\n context.reportError(\"Enum type \".concat(enumType.name, \" cannot include value: \").concat(valueName, \".\"), enumValue.astNode);\n }\n }\n}\n\nfunction validateInputFields(context, inputObj) {\n var fields = objectValues(inputObj.getFields());\n\n if (fields.length === 0) {\n context.reportError(\"Input Object type \".concat(inputObj.name, \" must define one or more fields.\"), getAllNodes(inputObj));\n } // Ensure the arguments are valid\n\n\n for (var _i28 = 0; _i28 < fields.length; _i28++) {\n var field = fields[_i28];\n // Ensure they are named correctly.\n validateName(context, field); // Ensure the type is an input type\n\n if (!isInputType(field.type)) {\n var _field$astNode2;\n\n context.reportError(\"The type of \".concat(inputObj.name, \".\").concat(field.name, \" must be Input Type \") + \"but got: \".concat(inspect(field.type), \".\"), (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0 ? void 0 : _field$astNode2.type);\n }\n\n if (isRequiredInputField(field) && field.deprecationReason != null) {\n var _field$astNode3;\n\n context.reportError(\"Required input field \".concat(inputObj.name, \".\").concat(field.name, \" cannot be deprecated.\"), [getDeprecatedDirectiveNode(field.astNode), // istanbul ignore next (TODO need to write coverage tests)\n (_field$astNode3 = field.astNode) === null || _field$astNode3 === void 0 ? void 0 : _field$astNode3.type]);\n }\n }\n}\n\nfunction createInputObjectCircularRefsValidator(context) {\n // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'.\n // Tracks already visited types to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n var visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors\n\n var fieldPath = []; // Position in the type path\n\n var fieldPathIndexByTypeName = Object.create(null);\n return detectCycleRecursive; // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n\n function detectCycleRecursive(inputObj) {\n if (visitedTypes[inputObj.name]) {\n return;\n }\n\n visitedTypes[inputObj.name] = true;\n fieldPathIndexByTypeName[inputObj.name] = fieldPath.length;\n var fields = objectValues(inputObj.getFields());\n\n for (var _i30 = 0; _i30 < fields.length; _i30++) {\n var field = fields[_i30];\n\n if (isNonNullType(field.type) && isInputObjectType(field.type.ofType)) {\n var fieldType = field.type.ofType;\n var cycleIndex = fieldPathIndexByTypeName[fieldType.name];\n fieldPath.push(field);\n\n if (cycleIndex === undefined) {\n detectCycleRecursive(fieldType);\n } else {\n var cyclePath = fieldPath.slice(cycleIndex);\n var pathStr = cyclePath.map(function (fieldObj) {\n return fieldObj.name;\n }).join('.');\n context.reportError(\"Cannot reference Input Object \\\"\".concat(fieldType.name, \"\\\" within itself through a series of non-null fields: \\\"\").concat(pathStr, \"\\\".\"), cyclePath.map(function (fieldObj) {\n return fieldObj.astNode;\n }));\n }\n\n fieldPath.pop();\n }\n }\n\n fieldPathIndexByTypeName[inputObj.name] = undefined;\n }\n}\n\nfunction getAllNodes(object) {\n var astNode = object.astNode,\n extensionASTNodes = object.extensionASTNodes;\n return astNode ? extensionASTNodes ? [astNode].concat(extensionASTNodes) : [astNode] : extensionASTNodes !== null && extensionASTNodes !== void 0 ? extensionASTNodes : [];\n}\n\nfunction getAllSubNodes(object, getter) {\n var subNodes = [];\n\n for (var _i32 = 0, _getAllNodes2 = getAllNodes(object); _i32 < _getAllNodes2.length; _i32++) {\n var _getter;\n\n var node = _getAllNodes2[_i32];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n subNodes = subNodes.concat((_getter = getter(node)) !== null && _getter !== void 0 ? _getter : []);\n }\n\n return subNodes;\n}\n\nfunction getAllImplementsInterfaceNodes(type, iface) {\n return getAllSubNodes(type, function (typeNode) {\n return typeNode.interfaces;\n }).filter(function (ifaceNode) {\n return ifaceNode.name.value === iface.name;\n });\n}\n\nfunction getUnionMemberTypeNodes(union, typeName) {\n return getAllSubNodes(union, function (unionNode) {\n return unionNode.types;\n }).filter(function (typeNode) {\n return typeNode.name.value === typeName;\n });\n}\n\nfunction getDeprecatedDirectiveNode(definitionNode) {\n var _definitionNode$direc;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n return definitionNode === null || definitionNode === void 0 ? void 0 : (_definitionNode$direc = definitionNode.directives) === null || _definitionNode$direc === void 0 ? void 0 : _definitionNode$direc.find(function (node) {\n return node.name.value === GraphQLDeprecatedDirective.name;\n });\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { GraphQLList, GraphQLNonNull } from \"../type/definition.mjs\";\n/**\n * Given a Schema and an AST node describing a type, return a GraphQLType\n * definition which applies to that type. For example, if provided the parsed\n * AST node for `[User]`, a GraphQLList instance will be returned, containing\n * the type called \"User\" found in the schema. If a type called \"User\" is not\n * found in the schema, then undefined will be returned.\n */\n\n/* eslint-disable no-redeclare */\n\nexport function typeFromAST(schema, typeNode) {\n /* eslint-enable no-redeclare */\n var innerType;\n\n if (typeNode.kind === Kind.LIST_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLList(innerType);\n }\n\n if (typeNode.kind === Kind.NON_NULL_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLNonNull(innerType);\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (typeNode.kind === Kind.NAMED_TYPE) {\n return schema.getType(typeNode.name.value);\n } // istanbul ignore next (Not reachable. All possible type nodes have been considered)\n\n\n false || invariant(0, 'Unexpected type node: ' + inspect(typeNode));\n}\n","import find from \"../polyfills/find.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { isNode } from \"../language/ast.mjs\";\nimport { getVisitFn } from \"../language/visitor.mjs\";\nimport { isObjectType, isInterfaceType, isEnumType, isInputObjectType, isListType, isCompositeType, isInputType, isOutputType, getNullableType, getNamedType } from \"../type/definition.mjs\";\nimport { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from \"../type/introspection.mjs\";\nimport { typeFromAST } from \"./typeFromAST.mjs\";\n/**\n * TypeInfo is a utility class which, given a GraphQL schema, can keep track\n * of the current field and type definitions at any point in a GraphQL document\n * AST during a recursive descent by calling `enter(node)` and `leave(node)`.\n */\n\nexport var TypeInfo = /*#__PURE__*/function () {\n function TypeInfo(schema, // NOTE: this experimental optional second parameter is only needed in order\n // to support non-spec-compliant code bases. You should never need to use it.\n // It may disappear in the future.\n getFieldDefFn, // Initial type may be provided in rare cases to facilitate traversals\n // beginning somewhere other than documents.\n initialType) {\n this._schema = schema;\n this._typeStack = [];\n this._parentTypeStack = [];\n this._inputTypeStack = [];\n this._fieldDefStack = [];\n this._defaultValueStack = [];\n this._directive = null;\n this._argument = null;\n this._enumValue = null;\n this._getFieldDef = getFieldDefFn !== null && getFieldDefFn !== void 0 ? getFieldDefFn : getFieldDef;\n\n if (initialType) {\n if (isInputType(initialType)) {\n this._inputTypeStack.push(initialType);\n }\n\n if (isCompositeType(initialType)) {\n this._parentTypeStack.push(initialType);\n }\n\n if (isOutputType(initialType)) {\n this._typeStack.push(initialType);\n }\n }\n }\n\n var _proto = TypeInfo.prototype;\n\n _proto.getType = function getType() {\n if (this._typeStack.length > 0) {\n return this._typeStack[this._typeStack.length - 1];\n }\n };\n\n _proto.getParentType = function getParentType() {\n if (this._parentTypeStack.length > 0) {\n return this._parentTypeStack[this._parentTypeStack.length - 1];\n }\n };\n\n _proto.getInputType = function getInputType() {\n if (this._inputTypeStack.length > 0) {\n return this._inputTypeStack[this._inputTypeStack.length - 1];\n }\n };\n\n _proto.getParentInputType = function getParentInputType() {\n if (this._inputTypeStack.length > 1) {\n return this._inputTypeStack[this._inputTypeStack.length - 2];\n }\n };\n\n _proto.getFieldDef = function getFieldDef() {\n if (this._fieldDefStack.length > 0) {\n return this._fieldDefStack[this._fieldDefStack.length - 1];\n }\n };\n\n _proto.getDefaultValue = function getDefaultValue() {\n if (this._defaultValueStack.length > 0) {\n return this._defaultValueStack[this._defaultValueStack.length - 1];\n }\n };\n\n _proto.getDirective = function getDirective() {\n return this._directive;\n };\n\n _proto.getArgument = function getArgument() {\n return this._argument;\n };\n\n _proto.getEnumValue = function getEnumValue() {\n return this._enumValue;\n };\n\n _proto.enter = function enter(node) {\n var schema = this._schema; // Note: many of the types below are explicitly typed as \"mixed\" to drop\n // any assumptions of a valid schema to ensure runtime types are properly\n // checked before continuing since TypeInfo is used as part of validation\n // which occurs before guarantees of schema and document validity.\n\n switch (node.kind) {\n case Kind.SELECTION_SET:\n {\n var namedType = getNamedType(this.getType());\n\n this._parentTypeStack.push(isCompositeType(namedType) ? namedType : undefined);\n\n break;\n }\n\n case Kind.FIELD:\n {\n var parentType = this.getParentType();\n var fieldDef;\n var fieldType;\n\n if (parentType) {\n fieldDef = this._getFieldDef(schema, parentType, node);\n\n if (fieldDef) {\n fieldType = fieldDef.type;\n }\n }\n\n this._fieldDefStack.push(fieldDef);\n\n this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined);\n\n break;\n }\n\n case Kind.DIRECTIVE:\n this._directive = schema.getDirective(node.name.value);\n break;\n\n case Kind.OPERATION_DEFINITION:\n {\n var type;\n\n switch (node.operation) {\n case 'query':\n type = schema.getQueryType();\n break;\n\n case 'mutation':\n type = schema.getMutationType();\n break;\n\n case 'subscription':\n type = schema.getSubscriptionType();\n break;\n }\n\n this._typeStack.push(isObjectType(type) ? type : undefined);\n\n break;\n }\n\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n {\n var typeConditionAST = node.typeCondition;\n var outputType = typeConditionAST ? typeFromAST(schema, typeConditionAST) : getNamedType(this.getType());\n\n this._typeStack.push(isOutputType(outputType) ? outputType : undefined);\n\n break;\n }\n\n case Kind.VARIABLE_DEFINITION:\n {\n var inputType = typeFromAST(schema, node.type);\n\n this._inputTypeStack.push(isInputType(inputType) ? inputType : undefined);\n\n break;\n }\n\n case Kind.ARGUMENT:\n {\n var _this$getDirective;\n\n var argDef;\n var argType;\n var fieldOrDirective = (_this$getDirective = this.getDirective()) !== null && _this$getDirective !== void 0 ? _this$getDirective : this.getFieldDef();\n\n if (fieldOrDirective) {\n argDef = find(fieldOrDirective.args, function (arg) {\n return arg.name === node.name.value;\n });\n\n if (argDef) {\n argType = argDef.type;\n }\n }\n\n this._argument = argDef;\n\n this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined);\n\n this._inputTypeStack.push(isInputType(argType) ? argType : undefined);\n\n break;\n }\n\n case Kind.LIST:\n {\n var listType = getNullableType(this.getInputType());\n var itemType = isListType(listType) ? listType.ofType : listType; // List positions never have a default value.\n\n this._defaultValueStack.push(undefined);\n\n this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined);\n\n break;\n }\n\n case Kind.OBJECT_FIELD:\n {\n var objectType = getNamedType(this.getInputType());\n var inputFieldType;\n var inputField;\n\n if (isInputObjectType(objectType)) {\n inputField = objectType.getFields()[node.name.value];\n\n if (inputField) {\n inputFieldType = inputField.type;\n }\n }\n\n this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined);\n\n this._inputTypeStack.push(isInputType(inputFieldType) ? inputFieldType : undefined);\n\n break;\n }\n\n case Kind.ENUM:\n {\n var enumType = getNamedType(this.getInputType());\n var enumValue;\n\n if (isEnumType(enumType)) {\n enumValue = enumType.getValue(node.value);\n }\n\n this._enumValue = enumValue;\n break;\n }\n }\n };\n\n _proto.leave = function leave(node) {\n switch (node.kind) {\n case Kind.SELECTION_SET:\n this._parentTypeStack.pop();\n\n break;\n\n case Kind.FIELD:\n this._fieldDefStack.pop();\n\n this._typeStack.pop();\n\n break;\n\n case Kind.DIRECTIVE:\n this._directive = null;\n break;\n\n case Kind.OPERATION_DEFINITION:\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n this._typeStack.pop();\n\n break;\n\n case Kind.VARIABLE_DEFINITION:\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.ARGUMENT:\n this._argument = null;\n\n this._defaultValueStack.pop();\n\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.LIST:\n case Kind.OBJECT_FIELD:\n this._defaultValueStack.pop();\n\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.ENUM:\n this._enumValue = null;\n break;\n }\n };\n\n return TypeInfo;\n}();\n/**\n * Not exactly the same as the executor's definition of getFieldDef, in this\n * statically evaluated environment we do not always have an Object type,\n * and need to handle Interface and Union types.\n */\n\nfunction getFieldDef(schema, parentType, fieldNode) {\n var name = fieldNode.name.value;\n\n if (name === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n return SchemaMetaFieldDef;\n }\n\n if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return TypeMetaFieldDef;\n }\n\n if (name === TypeNameMetaFieldDef.name && isCompositeType(parentType)) {\n return TypeNameMetaFieldDef;\n }\n\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n return parentType.getFields()[name];\n }\n}\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\n\n\nexport function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}\n","import { Kind } from \"./kinds.mjs\";\nexport function isDefinitionNode(node) {\n return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node);\n}\nexport function isExecutableDefinitionNode(node) {\n return node.kind === Kind.OPERATION_DEFINITION || node.kind === Kind.FRAGMENT_DEFINITION;\n}\nexport function isSelectionNode(node) {\n return node.kind === Kind.FIELD || node.kind === Kind.FRAGMENT_SPREAD || node.kind === Kind.INLINE_FRAGMENT;\n}\nexport function isValueNode(node) {\n return node.kind === Kind.VARIABLE || node.kind === Kind.INT || node.kind === Kind.FLOAT || node.kind === Kind.STRING || node.kind === Kind.BOOLEAN || node.kind === Kind.NULL || node.kind === Kind.ENUM || node.kind === Kind.LIST || node.kind === Kind.OBJECT;\n}\nexport function isTypeNode(node) {\n return node.kind === Kind.NAMED_TYPE || node.kind === Kind.LIST_TYPE || node.kind === Kind.NON_NULL_TYPE;\n}\nexport function isTypeSystemDefinitionNode(node) {\n return node.kind === Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === Kind.DIRECTIVE_DEFINITION;\n}\nexport function isTypeDefinitionNode(node) {\n return node.kind === Kind.SCALAR_TYPE_DEFINITION || node.kind === Kind.OBJECT_TYPE_DEFINITION || node.kind === Kind.INTERFACE_TYPE_DEFINITION || node.kind === Kind.UNION_TYPE_DEFINITION || node.kind === Kind.ENUM_TYPE_DEFINITION || node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION;\n}\nexport function isTypeSystemExtensionNode(node) {\n return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node);\n}\nexport function isTypeExtensionNode(node) {\n return node.kind === Kind.SCALAR_TYPE_EXTENSION || node.kind === Kind.OBJECT_TYPE_EXTENSION || node.kind === Kind.INTERFACE_TYPE_EXTENSION || node.kind === Kind.UNION_TYPE_EXTENSION || node.kind === Kind.ENUM_TYPE_EXTENSION || node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION;\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { isExecutableDefinitionNode } from \"../../language/predicates.mjs\";\n\n/**\n * Executable definitions\n *\n * A GraphQL document is only valid for execution if all definitions are either\n * operation or fragment definitions.\n */\nexport function ExecutableDefinitionsRule(context) {\n return {\n Document: function Document(node) {\n for (var _i2 = 0, _node$definitions2 = node.definitions; _i2 < _node$definitions2.length; _i2++) {\n var definition = _node$definitions2[_i2];\n\n if (!isExecutableDefinitionNode(definition)) {\n var defName = definition.kind === Kind.SCHEMA_DEFINITION || definition.kind === Kind.SCHEMA_EXTENSION ? 'schema' : '\"' + definition.name.value + '\"';\n context.reportError(new GraphQLError(\"The \".concat(defName, \" definition is not executable.\"), definition));\n }\n }\n\n return false;\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique operation names\n *\n * A GraphQL document is only valid if all defined operations have unique names.\n */\nexport function UniqueOperationNamesRule(context) {\n var knownOperationNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition(node) {\n var operationName = node.name;\n\n if (operationName) {\n if (knownOperationNames[operationName.value]) {\n context.reportError(new GraphQLError(\"There can be only one operation named \\\"\".concat(operationName.value, \"\\\".\"), [knownOperationNames[operationName.value], operationName]));\n } else {\n knownOperationNames[operationName.value] = operationName;\n }\n }\n\n return false;\n },\n FragmentDefinition: function FragmentDefinition() {\n return false;\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\n\n/**\n * Lone anonymous operation\n *\n * A GraphQL document is only valid if when it contains an anonymous operation\n * (the query short-hand) that it contains only that one operation definition.\n */\nexport function LoneAnonymousOperationRule(context) {\n var operationCount = 0;\n return {\n Document: function Document(node) {\n operationCount = node.definitions.filter(function (definition) {\n return definition.kind === Kind.OPERATION_DEFINITION;\n }).length;\n },\n OperationDefinition: function OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(new GraphQLError('This anonymous operation must be the only defined operation.', node));\n }\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Subscriptions must only include one field.\n *\n * A GraphQL subscription is valid only if it contains a single root field.\n */\nexport function SingleFieldSubscriptionsRule(context) {\n return {\n OperationDefinition: function OperationDefinition(node) {\n if (node.operation === 'subscription') {\n if (node.selectionSet.selections.length !== 1) {\n context.reportError(new GraphQLError(node.name ? \"Subscription \\\"\".concat(node.name.value, \"\\\" must select only one top level field.\") : 'Anonymous Subscription must select only one top level field.', node.selectionSet.selections.slice(1)));\n }\n }\n }\n };\n}\n","import didYouMean from \"../../jsutils/didYouMean.mjs\";\nimport suggestionList from \"../../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { isTypeDefinitionNode, isTypeSystemDefinitionNode, isTypeSystemExtensionNode } from \"../../language/predicates.mjs\";\nimport { specifiedScalarTypes } from \"../../type/scalars.mjs\";\nimport { introspectionTypes } from \"../../type/introspection.mjs\";\n\n/**\n * Known type names\n *\n * A GraphQL document is only valid if referenced types (specifically\n * variable definitions and fragment conditions) are defined by the type schema.\n */\nexport function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (isTypeDefinitionNode(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isStandardTypeName(typeName)) {\n return;\n }\n\n var suggestedTypes = suggestionList(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames);\n context.reportError(new GraphQLError(\"Unknown type \\\"\".concat(typeName, \"\\\".\") + didYouMean(suggestedTypes), node));\n }\n }\n };\n}\nvar standardTypeNames = [].concat(specifiedScalarTypes, introspectionTypes).map(function (type) {\n return type.name;\n});\n\nfunction isStandardTypeName(typeName) {\n return standardTypeNames.indexOf(typeName) !== -1;\n}\n\nfunction isSDLNode(value) {\n return !Array.isArray(value) && (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value));\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { print } from \"../../language/printer.mjs\";\nimport { isCompositeType } from \"../../type/definition.mjs\";\nimport { typeFromAST } from \"../../utilities/typeFromAST.mjs\";\n\n/**\n * Fragments on composite type\n *\n * Fragments use a type condition to determine if they apply, since fragments\n * can only be spread into a composite type (object, interface, or union), the\n * type condition must also be a composite type.\n */\nexport function FragmentsOnCompositeTypesRule(context) {\n return {\n InlineFragment: function InlineFragment(node) {\n var typeCondition = node.typeCondition;\n\n if (typeCondition) {\n var type = typeFromAST(context.getSchema(), typeCondition);\n\n if (type && !isCompositeType(type)) {\n var typeStr = print(typeCondition);\n context.reportError(new GraphQLError(\"Fragment cannot condition on non composite type \\\"\".concat(typeStr, \"\\\".\"), typeCondition));\n }\n }\n },\n FragmentDefinition: function FragmentDefinition(node) {\n var type = typeFromAST(context.getSchema(), node.typeCondition);\n\n if (type && !isCompositeType(type)) {\n var typeStr = print(node.typeCondition);\n context.reportError(new GraphQLError(\"Fragment \\\"\".concat(node.name.value, \"\\\" cannot condition on non composite type \\\"\").concat(typeStr, \"\\\".\"), node.typeCondition));\n }\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { print } from \"../../language/printer.mjs\";\nimport { isInputType } from \"../../type/definition.mjs\";\nimport { typeFromAST } from \"../../utilities/typeFromAST.mjs\";\n\n/**\n * Variables are input types\n *\n * A GraphQL operation is only valid if all the variables it defines are of\n * input types (scalar, enum, or input object).\n */\nexport function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = typeFromAST(context.getSchema(), node.type);\n\n if (type && !isInputType(type)) {\n var variableName = node.variable.name.value;\n var typeName = print(node.type);\n context.reportError(new GraphQLError(\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}\n","import inspect from \"../../jsutils/inspect.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { getNamedType, isLeafType } from \"../../type/definition.mjs\";\n\n/**\n * Scalar leafs\n *\n * A GraphQL document is valid only if all leaf fields (fields without\n * sub selections) are of scalar or enum types.\n */\nexport function ScalarLeafsRule(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n var selectionSet = node.selectionSet;\n\n if (type) {\n if (isLeafType(getNamedType(type))) {\n if (selectionSet) {\n var fieldName = node.name.value;\n var typeStr = inspect(type);\n context.reportError(new GraphQLError(\"Field \\\"\".concat(fieldName, \"\\\" must not have a selection since type \\\"\").concat(typeStr, \"\\\" has no subfields.\"), selectionSet));\n }\n } else if (!selectionSet) {\n var _fieldName = node.name.value;\n\n var _typeStr = inspect(type);\n\n context.reportError(new GraphQLError(\"Field \\\"\".concat(_fieldName, \"\\\" of type \\\"\").concat(_typeStr, \"\\\" must have a selection of subfields. Did you mean \\\"\").concat(_fieldName, \" { ... }\\\"?\"), node));\n }\n }\n }\n };\n}\n","import arrayFrom from \"../../polyfills/arrayFrom.mjs\";\nimport didYouMean from \"../../jsutils/didYouMean.mjs\";\nimport suggestionList from \"../../jsutils/suggestionList.mjs\";\nimport naturalCompare from \"../../jsutils/naturalCompare.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { isObjectType, isInterfaceType, isAbstractType } from \"../../type/definition.mjs\";\n\n/**\n * Fields on correct type\n *\n * A GraphQL document is only valid if all fields selected are defined by the\n * parent type, or are an allowed meta field such as __typename.\n */\nexport function FieldsOnCorrectTypeRule(context) {\n return {\n Field: function Field(node) {\n var type = context.getParentType();\n\n if (type) {\n var fieldDef = context.getFieldDef();\n\n if (!fieldDef) {\n // This field doesn't exist, lets look for suggestions.\n var schema = context.getSchema();\n var fieldName = node.name.value; // First determine if there are any suggested types to condition on.\n\n var suggestion = didYouMean('to use an inline fragment on', getSuggestedTypeNames(schema, type, fieldName)); // If there are no suggested types, then perhaps this was a typo?\n\n if (suggestion === '') {\n suggestion = didYouMean(getSuggestedFieldNames(type, fieldName));\n } // Report an error, including helpful suggestions.\n\n\n context.reportError(new GraphQLError(\"Cannot query field \\\"\".concat(fieldName, \"\\\" on type \\\"\").concat(type.name, \"\\\".\") + suggestion, node));\n }\n }\n }\n };\n}\n/**\n * Go through all of the implementations of type, as well as the interfaces that\n * they implement. If any of those types include the provided field, suggest them,\n * sorted by how often the type is referenced.\n */\n\nfunction getSuggestedTypeNames(schema, type, fieldName) {\n if (!isAbstractType(type)) {\n // Must be an Object type, which does not have possible fields.\n return [];\n }\n\n var suggestedTypes = new Set();\n var usageCount = Object.create(null);\n\n for (var _i2 = 0, _schema$getPossibleTy2 = schema.getPossibleTypes(type); _i2 < _schema$getPossibleTy2.length; _i2++) {\n var possibleType = _schema$getPossibleTy2[_i2];\n\n if (!possibleType.getFields()[fieldName]) {\n continue;\n } // This object type defines this field.\n\n\n suggestedTypes.add(possibleType);\n usageCount[possibleType.name] = 1;\n\n for (var _i4 = 0, _possibleType$getInte2 = possibleType.getInterfaces(); _i4 < _possibleType$getInte2.length; _i4++) {\n var _usageCount$possibleI;\n\n var possibleInterface = _possibleType$getInte2[_i4];\n\n if (!possibleInterface.getFields()[fieldName]) {\n continue;\n } // This interface type defines this field.\n\n\n suggestedTypes.add(possibleInterface);\n usageCount[possibleInterface.name] = ((_usageCount$possibleI = usageCount[possibleInterface.name]) !== null && _usageCount$possibleI !== void 0 ? _usageCount$possibleI : 0) + 1;\n }\n }\n\n return arrayFrom(suggestedTypes).sort(function (typeA, typeB) {\n // Suggest both interface and object types based on how common they are.\n var usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name];\n\n if (usageCountDiff !== 0) {\n return usageCountDiff;\n } // Suggest super types first followed by subtypes\n\n\n if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) {\n return -1;\n }\n\n if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) {\n return 1;\n }\n\n return naturalCompare(typeA.name, typeB.name);\n }).map(function (x) {\n return x.name;\n });\n}\n/**\n * For the field name provided, determine if there are any similar field names\n * that may be the result of a typo.\n */\n\n\nfunction getSuggestedFieldNames(type, fieldName) {\n if (isObjectType(type) || isInterfaceType(type)) {\n var possibleFieldNames = Object.keys(type.getFields());\n return suggestionList(fieldName, possibleFieldNames);\n } // Otherwise, must be a Union type, which does not define fields.\n\n\n return [];\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique fragment names\n *\n * A GraphQL document is only valid if all defined fragments have unique names.\n */\nexport function UniqueFragmentNamesRule(context) {\n var knownFragmentNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n return false;\n },\n FragmentDefinition: function FragmentDefinition(node) {\n var fragmentName = node.name.value;\n\n if (knownFragmentNames[fragmentName]) {\n context.reportError(new GraphQLError(\"There can be only one fragment named \\\"\".concat(fragmentName, \"\\\".\"), [knownFragmentNames[fragmentName], node.name]));\n } else {\n knownFragmentNames[fragmentName] = node.name;\n }\n\n return false;\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Known fragment names\n *\n * A GraphQL document is only valid if all `...Fragment` fragment spreads refer\n * to fragments defined in the same document.\n */\nexport function KnownFragmentNamesRule(context) {\n return {\n FragmentSpread: function FragmentSpread(node) {\n var fragmentName = node.name.value;\n var fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n context.reportError(new GraphQLError(\"Unknown fragment \\\"\".concat(fragmentName, \"\\\".\"), node.name));\n }\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * No unused fragments\n *\n * A GraphQL document is only valid if all fragment definitions are spread\n * within operations, or spread within other fragments spread within operations.\n */\nexport function NoUnusedFragmentsRule(context) {\n var operationDefs = [];\n var fragmentDefs = [];\n return {\n OperationDefinition: function OperationDefinition(node) {\n operationDefs.push(node);\n return false;\n },\n FragmentDefinition: function FragmentDefinition(node) {\n fragmentDefs.push(node);\n return false;\n },\n Document: {\n leave: function leave() {\n var fragmentNameUsed = Object.create(null);\n\n for (var _i2 = 0; _i2 < operationDefs.length; _i2++) {\n var operation = operationDefs[_i2];\n\n for (var _i4 = 0, _context$getRecursive2 = context.getRecursivelyReferencedFragments(operation); _i4 < _context$getRecursive2.length; _i4++) {\n var fragment = _context$getRecursive2[_i4];\n fragmentNameUsed[fragment.name.value] = true;\n }\n }\n\n for (var _i6 = 0; _i6 < fragmentDefs.length; _i6++) {\n var fragmentDef = fragmentDefs[_i6];\n var fragName = fragmentDef.name.value;\n\n if (fragmentNameUsed[fragName] !== true) {\n context.reportError(new GraphQLError(\"Fragment \\\"\".concat(fragName, \"\\\" is never used.\"), fragmentDef));\n }\n }\n }\n }\n };\n}\n","import inspect from \"../../jsutils/inspect.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { isCompositeType } from \"../../type/definition.mjs\";\nimport { typeFromAST } from \"../../utilities/typeFromAST.mjs\";\nimport { doTypesOverlap } from \"../../utilities/typeComparators.mjs\";\n\n/**\n * Possible fragment spread\n *\n * A fragment spread is only valid if the type condition could ever possibly\n * be true: if there is a non-empty intersection of the possible parent types,\n * and possible types which pass the type condition.\n */\nexport function PossibleFragmentSpreadsRule(context) {\n return {\n InlineFragment: function InlineFragment(node) {\n var fragType = context.getType();\n var parentType = context.getParentType();\n\n if (isCompositeType(fragType) && isCompositeType(parentType) && !doTypesOverlap(context.getSchema(), fragType, parentType)) {\n var parentTypeStr = inspect(parentType);\n var fragTypeStr = inspect(fragType);\n context.reportError(new GraphQLError(\"Fragment cannot be spread here as objects of type \\\"\".concat(parentTypeStr, \"\\\" can never be of type \\\"\").concat(fragTypeStr, \"\\\".\"), node));\n }\n },\n FragmentSpread: function FragmentSpread(node) {\n var fragName = node.name.value;\n var fragType = getFragmentType(context, fragName);\n var parentType = context.getParentType();\n\n if (fragType && parentType && !doTypesOverlap(context.getSchema(), fragType, parentType)) {\n var parentTypeStr = inspect(parentType);\n var fragTypeStr = inspect(fragType);\n context.reportError(new GraphQLError(\"Fragment \\\"\".concat(fragName, \"\\\" cannot be spread here as objects of type \\\"\").concat(parentTypeStr, \"\\\" can never be of type \\\"\").concat(fragTypeStr, \"\\\".\"), node));\n }\n }\n };\n}\n\nfunction getFragmentType(context, name) {\n var frag = context.getFragment(name);\n\n if (frag) {\n var type = typeFromAST(context.getSchema(), frag.typeCondition);\n\n if (isCompositeType(type)) {\n return type;\n }\n }\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nexport function NoFragmentCyclesRule(context) {\n // Tracks already visited fragments to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n var visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors\n\n var spreadPath = []; // Position in the spread path\n\n var spreadPathIndexByName = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n return false;\n },\n FragmentDefinition: function FragmentDefinition(node) {\n detectCycleRecursive(node);\n return false;\n }\n }; // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n\n function detectCycleRecursive(fragment) {\n if (visitedFrags[fragment.name.value]) {\n return;\n }\n\n var fragmentName = fragment.name.value;\n visitedFrags[fragmentName] = true;\n var spreadNodes = context.getFragmentSpreads(fragment.selectionSet);\n\n if (spreadNodes.length === 0) {\n return;\n }\n\n spreadPathIndexByName[fragmentName] = spreadPath.length;\n\n for (var _i2 = 0; _i2 < spreadNodes.length; _i2++) {\n var spreadNode = spreadNodes[_i2];\n var spreadName = spreadNode.name.value;\n var cycleIndex = spreadPathIndexByName[spreadName];\n spreadPath.push(spreadNode);\n\n if (cycleIndex === undefined) {\n var spreadFragment = context.getFragment(spreadName);\n\n if (spreadFragment) {\n detectCycleRecursive(spreadFragment);\n }\n } else {\n var cyclePath = spreadPath.slice(cycleIndex);\n var viaPath = cyclePath.slice(0, -1).map(function (s) {\n return '\"' + s.name.value + '\"';\n }).join(', ');\n context.reportError(new GraphQLError(\"Cannot spread fragment \\\"\".concat(spreadName, \"\\\" within itself\") + (viaPath !== '' ? \" via \".concat(viaPath, \".\") : '.'), cyclePath));\n }\n\n spreadPath.pop();\n }\n\n spreadPathIndexByName[fragmentName] = undefined;\n }\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique variable names\n *\n * A GraphQL operation is only valid if all its variables are uniquely named.\n */\nexport function UniqueVariableNamesRule(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new GraphQLError(\"There can be only one variable named \\\"$\".concat(variableName, \"\\\".\"), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * No undefined variables\n *\n * A GraphQL operation is only valid if all variables encountered, both directly\n * and via fragment spreads, are defined by that operation.\n */\nexport function NoUndefinedVariablesRule(context) {\n var variableNameDefined = Object.create(null);\n return {\n OperationDefinition: {\n enter: function enter() {\n variableNameDefined = Object.create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n\n for (var _i2 = 0; _i2 < usages.length; _i2++) {\n var _ref2 = usages[_i2];\n var node = _ref2.node;\n var varName = node.name.value;\n\n if (variableNameDefined[varName] !== true) {\n context.reportError(new GraphQLError(operation.name ? \"Variable \\\"$\".concat(varName, \"\\\" is not defined by operation \\\"\").concat(operation.name.value, \"\\\".\") : \"Variable \\\"$\".concat(varName, \"\\\" is not defined.\"), [node, operation]));\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(node) {\n variableNameDefined[node.variable.name.value] = true;\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * No unused variables\n *\n * A GraphQL operation is only valid if all variables defined by an operation\n * are used, either directly or within a spread fragment.\n */\nexport function NoUnusedVariablesRule(context) {\n var variableDefs = [];\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = Object.create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n\n for (var _i2 = 0; _i2 < usages.length; _i2++) {\n var _ref2 = usages[_i2];\n var node = _ref2.node;\n variableNameUsed[node.name.value] = true;\n }\n\n for (var _i4 = 0, _variableDefs2 = variableDefs; _i4 < _variableDefs2.length; _i4++) {\n var variableDef = _variableDefs2[_i4];\n var variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new GraphQLError(operation.name ? \"Variable \\\"$\".concat(variableName, \"\\\" is never used in operation \\\"\").concat(operation.name.value, \"\\\".\") : \"Variable \\\"$\".concat(variableName, \"\\\" is never used.\"), variableDef));\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}\n","import inspect from \"../../jsutils/inspect.mjs\";\nimport invariant from \"../../jsutils/invariant.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { DirectiveLocation } from \"../../language/directiveLocation.mjs\";\nimport { specifiedDirectives } from \"../../type/directives.mjs\";\n\n/**\n * Known directives\n *\n * A GraphQL document is only valid if all `@directives` are known by the\n * schema and legally positioned.\n */\nexport function KnownDirectivesRule(context) {\n var locationsMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n locationsMap[directive.name] = directive.locations;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n locationsMap[def.name.value] = def.locations.map(function (name) {\n return name.value;\n });\n }\n }\n\n return {\n Directive: function Directive(node, _key, _parent, _path, ancestors) {\n var name = node.name.value;\n var locations = locationsMap[name];\n\n if (!locations) {\n context.reportError(new GraphQLError(\"Unknown directive \\\"@\".concat(name, \"\\\".\"), node));\n return;\n }\n\n var candidateLocation = getDirectiveLocationForASTPath(ancestors);\n\n if (candidateLocation && locations.indexOf(candidateLocation) === -1) {\n context.reportError(new GraphQLError(\"Directive \\\"@\".concat(name, \"\\\" may not be used on \").concat(candidateLocation, \".\"), node));\n }\n }\n };\n}\n\nfunction getDirectiveLocationForASTPath(ancestors) {\n var appliedTo = ancestors[ancestors.length - 1];\n !Array.isArray(appliedTo) || invariant(0);\n\n switch (appliedTo.kind) {\n case Kind.OPERATION_DEFINITION:\n return getDirectiveLocationForOperation(appliedTo.operation);\n\n case Kind.FIELD:\n return DirectiveLocation.FIELD;\n\n case Kind.FRAGMENT_SPREAD:\n return DirectiveLocation.FRAGMENT_SPREAD;\n\n case Kind.INLINE_FRAGMENT:\n return DirectiveLocation.INLINE_FRAGMENT;\n\n case Kind.FRAGMENT_DEFINITION:\n return DirectiveLocation.FRAGMENT_DEFINITION;\n\n case Kind.VARIABLE_DEFINITION:\n return DirectiveLocation.VARIABLE_DEFINITION;\n\n case Kind.SCHEMA_DEFINITION:\n case Kind.SCHEMA_EXTENSION:\n return DirectiveLocation.SCHEMA;\n\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_EXTENSION:\n return DirectiveLocation.SCALAR;\n\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.OBJECT;\n\n case Kind.FIELD_DEFINITION:\n return DirectiveLocation.FIELD_DEFINITION;\n\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_EXTENSION:\n return DirectiveLocation.INTERFACE;\n\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.UNION_TYPE_EXTENSION:\n return DirectiveLocation.UNION;\n\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_EXTENSION:\n return DirectiveLocation.ENUM;\n\n case Kind.ENUM_VALUE_DEFINITION:\n return DirectiveLocation.ENUM_VALUE;\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.INPUT_OBJECT;\n\n case Kind.INPUT_VALUE_DEFINITION:\n {\n var parentNode = ancestors[ancestors.length - 3];\n return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ? DirectiveLocation.INPUT_FIELD_DEFINITION : DirectiveLocation.ARGUMENT_DEFINITION;\n }\n }\n}\n\nfunction getDirectiveLocationForOperation(operation) {\n switch (operation) {\n case 'query':\n return DirectiveLocation.QUERY;\n\n case 'mutation':\n return DirectiveLocation.MUTATION;\n\n case 'subscription':\n return DirectiveLocation.SUBSCRIPTION;\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected operation: ' + inspect(operation));\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { isTypeDefinitionNode, isTypeExtensionNode } from \"../../language/predicates.mjs\";\nimport { specifiedDirectives } from \"../../type/directives.mjs\";\n\n/**\n * Unique directive names per location\n *\n * A GraphQL document is only valid if all non-repeatable directives at\n * a given location are uniquely named.\n */\nexport function UniqueDirectivesPerLocationRule(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n var schemaDirectives = Object.create(null);\n var typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n if (node.directives == null) {\n return;\n }\n\n var seenDirectives;\n\n if (node.kind === Kind.SCHEMA_DEFINITION || node.kind === Kind.SCHEMA_EXTENSION) {\n seenDirectives = schemaDirectives;\n } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) {\n var typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) {\n var _directive = _node$directives2[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(new GraphQLError(\"The directive \\\"@\".concat(directiveName, \"\\\" can only be used once at this location.\"), [seenDirectives[directiveName], _directive]));\n } else {\n seenDirectives[directiveName] = _directive;\n }\n }\n }\n }\n };\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport didYouMean from \"../../jsutils/didYouMean.mjs\";\nimport suggestionList from \"../../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { specifiedDirectives } from \"../../type/directives.mjs\";\n\n/**\n * Known argument names\n *\n * A GraphQL field is only valid if all supplied arguments are defined by\n * that field.\n */\nexport function KnownArgumentNamesRule(context) {\n return _objectSpread(_objectSpread({}, KnownArgumentNamesOnDirectivesRule(context)), {}, {\n Argument: function Argument(argNode) {\n var argDef = context.getArgument();\n var fieldDef = context.getFieldDef();\n var parentType = context.getParentType();\n\n if (!argDef && fieldDef && parentType) {\n var argName = argNode.name.value;\n var knownArgsNames = fieldDef.args.map(function (arg) {\n return arg.name;\n });\n var suggestions = suggestionList(argName, knownArgsNames);\n context.reportError(new GraphQLError(\"Unknown argument \\\"\".concat(argName, \"\\\" on field \\\"\").concat(parentType.name, \".\").concat(fieldDef.name, \"\\\".\") + didYouMean(suggestions), argNode));\n }\n }\n });\n}\n/**\n * @internal\n */\n\nexport function KnownArgumentNamesOnDirectivesRule(context) {\n var directiveArgs = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n directiveArgs[directive.name] = directive.args.map(function (arg) {\n return arg.name;\n });\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n var _def$arguments;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var argsNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : [];\n directiveArgs[def.name.value] = argsNodes.map(function (arg) {\n return arg.name.value;\n });\n }\n }\n\n return {\n Directive: function Directive(directiveNode) {\n var directiveName = directiveNode.name.value;\n var knownArgs = directiveArgs[directiveName];\n\n if (directiveNode.arguments && knownArgs) {\n for (var _i6 = 0, _directiveNode$argume2 = directiveNode.arguments; _i6 < _directiveNode$argume2.length; _i6++) {\n var argNode = _directiveNode$argume2[_i6];\n var argName = argNode.name.value;\n\n if (knownArgs.indexOf(argName) === -1) {\n var suggestions = suggestionList(argName, knownArgs);\n context.reportError(new GraphQLError(\"Unknown argument \\\"\".concat(argName, \"\\\" on directive \\\"@\").concat(directiveName, \"\\\".\") + didYouMean(suggestions), argNode));\n }\n }\n }\n\n return false;\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique argument names\n *\n * A GraphQL field or directive is only valid if all supplied arguments are\n * uniquely named.\n */\nexport function UniqueArgumentNamesRule(context) {\n var knownArgNames = Object.create(null);\n return {\n Field: function Field() {\n knownArgNames = Object.create(null);\n },\n Directive: function Directive() {\n knownArgNames = Object.create(null);\n },\n Argument: function Argument(node) {\n var argName = node.name.value;\n\n if (knownArgNames[argName]) {\n context.reportError(new GraphQLError(\"There can be only one argument named \\\"\".concat(argName, \"\\\".\"), [knownArgNames[argName], node.name]));\n } else {\n knownArgNames[argName] = node.name;\n }\n\n return false;\n }\n };\n}\n","import objectValues from \"../../polyfills/objectValues.mjs\";\nimport keyMap from \"../../jsutils/keyMap.mjs\";\nimport inspect from \"../../jsutils/inspect.mjs\";\nimport didYouMean from \"../../jsutils/didYouMean.mjs\";\nimport suggestionList from \"../../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { print } from \"../../language/printer.mjs\";\nimport { isLeafType, isInputObjectType, isListType, isNonNullType, isRequiredInputField, getNullableType, getNamedType } from \"../../type/definition.mjs\";\n\n/**\n * Value literals of correct type\n *\n * A GraphQL document is only valid if all value literals are of the type\n * expected at their position.\n */\nexport function ValuesOfCorrectTypeRule(context) {\n return {\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = getNullableType(context.getParentInputType());\n\n if (!isListType(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = getNamedType(context.getInputType());\n\n if (!isInputObjectType(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = keyMap(node.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i2 = 0, _objectValues2 = objectValues(type.getFields()); _i2 < _objectValues2.length; _i2++) {\n var fieldDef = _objectValues2[_i2];\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && isRequiredInputField(fieldDef)) {\n var typeStr = inspect(fieldDef.type);\n context.reportError(new GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldDef.name, \"\\\" of required type \\\"\").concat(typeStr, \"\\\" was not provided.\"), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = getNamedType(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && isInputObjectType(parentType)) {\n var suggestions = suggestionList(node.name.value, Object.keys(parentType.getFields()));\n context.reportError(new GraphQLError(\"Field \\\"\".concat(node.name.value, \"\\\" is not defined by type \\\"\").concat(parentType.name, \"\\\".\") + didYouMean(suggestions), node));\n }\n },\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if (isNonNullType(type)) {\n context.reportError(new GraphQLError(\"Expected value of type \\\"\".concat(inspect(type), \"\\\", found \").concat(print(node), \".\"), node));\n }\n },\n EnumValue: function EnumValue(node) {\n return isValidValueNode(context, node);\n },\n IntValue: function IntValue(node) {\n return isValidValueNode(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidValueNode(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidValueNode(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidValueNode(context, node);\n }\n };\n}\n/**\n * Any value literal may be a valid representation of a Scalar, depending on\n * that scalar type.\n */\n\nfunction isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = getNamedType(locationType);\n\n if (!isLeafType(type)) {\n var typeStr = inspect(locationType);\n context.reportError(new GraphQLError(\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat(print(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = inspect(locationType);\n\n context.reportError(new GraphQLError(\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat(print(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = inspect(locationType);\n\n if (error instanceof GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(new GraphQLError(\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat(print(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport inspect from \"../../jsutils/inspect.mjs\";\nimport keyMap from \"../../jsutils/keyMap.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { print } from \"../../language/printer.mjs\";\nimport { specifiedDirectives } from \"../../type/directives.mjs\";\nimport { isType, isRequiredArgument } from \"../../type/definition.mjs\";\n\n/**\n * Provided required arguments\n *\n * A field or directive is only valid if all required (non-null without a\n * default value) field arguments have been provided.\n */\nexport function ProvidedRequiredArgumentsRule(context) {\n return _objectSpread(_objectSpread({}, ProvidedRequiredArgumentsOnDirectivesRule(context)), {}, {\n Field: {\n // Validate on leave to allow for deeper errors to appear first.\n leave: function leave(fieldNode) {\n var _fieldNode$arguments;\n\n var fieldDef = context.getFieldDef();\n\n if (!fieldDef) {\n return false;\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n\n var argNodes = (_fieldNode$arguments = fieldNode.arguments) !== null && _fieldNode$arguments !== void 0 ? _fieldNode$arguments : [];\n var argNodeMap = keyMap(argNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var _i2 = 0, _fieldDef$args2 = fieldDef.args; _i2 < _fieldDef$args2.length; _i2++) {\n var argDef = _fieldDef$args2[_i2];\n var argNode = argNodeMap[argDef.name];\n\n if (!argNode && isRequiredArgument(argDef)) {\n var argTypeStr = inspect(argDef.type);\n context.reportError(new GraphQLError(\"Field \\\"\".concat(fieldDef.name, \"\\\" argument \\\"\").concat(argDef.name, \"\\\" of type \\\"\").concat(argTypeStr, \"\\\" is required, but it was not provided.\"), fieldNode));\n }\n }\n }\n }\n });\n}\n/**\n * @internal\n */\n\nexport function ProvidedRequiredArgumentsOnDirectivesRule(context) {\n var requiredArgsMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n\n for (var _i4 = 0; _i4 < definedDirectives.length; _i4++) {\n var directive = definedDirectives[_i4];\n requiredArgsMap[directive.name] = keyMap(directive.args.filter(isRequiredArgument), function (arg) {\n return arg.name;\n });\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i6 = 0; _i6 < astDefinitions.length; _i6++) {\n var def = astDefinitions[_i6];\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n var _def$arguments;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var argNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : [];\n requiredArgsMap[def.name.value] = keyMap(argNodes.filter(isRequiredArgumentNode), function (arg) {\n return arg.name.value;\n });\n }\n }\n\n return {\n Directive: {\n // Validate on leave to allow for deeper errors to appear first.\n leave: function leave(directiveNode) {\n var directiveName = directiveNode.name.value;\n var requiredArgs = requiredArgsMap[directiveName];\n\n if (requiredArgs) {\n var _directiveNode$argume;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var _argNodes = (_directiveNode$argume = directiveNode.arguments) !== null && _directiveNode$argume !== void 0 ? _directiveNode$argume : [];\n\n var argNodeMap = keyMap(_argNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var _i8 = 0, _Object$keys2 = Object.keys(requiredArgs); _i8 < _Object$keys2.length; _i8++) {\n var argName = _Object$keys2[_i8];\n\n if (!argNodeMap[argName]) {\n var argType = requiredArgs[argName].type;\n var argTypeStr = isType(argType) ? inspect(argType) : print(argType);\n context.reportError(new GraphQLError(\"Directive \\\"@\".concat(directiveName, \"\\\" argument \\\"\").concat(argName, \"\\\" of type \\\"\").concat(argTypeStr, \"\\\" is required, but it was not provided.\"), directiveNode));\n }\n }\n }\n }\n }\n };\n}\n\nfunction isRequiredArgumentNode(arg) {\n return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null;\n}\n","import inspect from \"../../jsutils/inspect.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { isNonNullType } from \"../../type/definition.mjs\";\nimport { typeFromAST } from \"../../utilities/typeFromAST.mjs\";\nimport { isTypeSubTypeOf } from \"../../utilities/typeComparators.mjs\";\n\n/**\n * Variables passed to field arguments conform to type\n */\nexport function VariablesInAllowedPositionRule(context) {\n var varDefMap = Object.create(null);\n return {\n OperationDefinition: {\n enter: function enter() {\n varDefMap = Object.create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n\n for (var _i2 = 0; _i2 < usages.length; _i2++) {\n var _ref2 = usages[_i2];\n var node = _ref2.node;\n var type = _ref2.type;\n var defaultValue = _ref2.defaultValue;\n var varName = node.name.value;\n var varDef = varDefMap[varName];\n\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n var schema = context.getSchema();\n var varType = typeFromAST(schema, varDef.type);\n\n if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) {\n var varTypeStr = inspect(varType);\n var typeStr = inspect(type);\n context.reportError(new GraphQLError(\"Variable \\\"$\".concat(varName, \"\\\" of type \\\"\").concat(varTypeStr, \"\\\" used in position expecting type \\\"\").concat(typeStr, \"\\\".\"), [varDef, node]));\n }\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(node) {\n varDefMap[node.variable.name.value] = node;\n }\n };\n}\n/**\n * Returns true if the variable is allowed in the location it was found,\n * which includes considering if default values exist for either the variable\n * or the location at which it is located.\n */\n\nfunction allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {\n if (isNonNullType(locationType) && !isNonNullType(varType)) {\n var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== Kind.NULL;\n var hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n var nullableLocationType = locationType.ofType;\n return isTypeSubTypeOf(schema, varType, nullableLocationType);\n }\n\n return isTypeSubTypeOf(schema, varType, locationType);\n}\n","import find from \"../../polyfills/find.mjs\";\nimport objectEntries from \"../../polyfills/objectEntries.mjs\";\nimport inspect from \"../../jsutils/inspect.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { print } from \"../../language/printer.mjs\";\nimport { getNamedType, isNonNullType, isLeafType, isObjectType, isListType, isInterfaceType } from \"../../type/definition.mjs\";\nimport { typeFromAST } from \"../../utilities/typeFromAST.mjs\";\n\nfunction reasonMessage(reason) {\n if (Array.isArray(reason)) {\n return reason.map(function (_ref) {\n var responseName = _ref[0],\n subReason = _ref[1];\n return \"subfields \\\"\".concat(responseName, \"\\\" conflict because \") + reasonMessage(subReason);\n }).join(' and ');\n }\n\n return reason;\n}\n/**\n * Overlapping fields can be merged\n *\n * A selection set is only valid if all fields (including spreading any\n * fragments) either correspond to distinct response names or can be merged\n * without ambiguity.\n */\n\n\nexport function OverlappingFieldsCanBeMergedRule(context) {\n // A memoization for when two fragments are compared \"between\" each other for\n // conflicts. Two fragments may be compared many times, so memoizing this can\n // dramatically improve the performance of this validator.\n var comparedFragmentPairs = new PairSet(); // A cache for the \"field map\" and list of fragment names found in any given\n // selection set. Selection sets may be asked for this information multiple\n // times, so this improves the performance of this validator.\n\n var cachedFieldsAndFragmentNames = new Map();\n return {\n SelectionSet: function SelectionSet(selectionSet) {\n var conflicts = findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, context.getParentType(), selectionSet);\n\n for (var _i2 = 0; _i2 < conflicts.length; _i2++) {\n var _ref3 = conflicts[_i2];\n var _ref2$ = _ref3[0];\n var responseName = _ref2$[0];\n var reason = _ref2$[1];\n var fields1 = _ref3[1];\n var fields2 = _ref3[2];\n var reasonMsg = reasonMessage(reason);\n context.reportError(new GraphQLError(\"Fields \\\"\".concat(responseName, \"\\\" conflict because \").concat(reasonMsg, \". Use different aliases on the fields to fetch both if this was intentional.\"), fields1.concat(fields2)));\n }\n }\n };\n}\n\n/**\n * Algorithm:\n *\n * Conflicts occur when two fields exist in a query which will produce the same\n * response name, but represent differing values, thus creating a conflict.\n * The algorithm below finds all conflicts via making a series of comparisons\n * between fields. In order to compare as few fields as possible, this makes\n * a series of comparisons \"within\" sets of fields and \"between\" sets of fields.\n *\n * Given any selection set, a collection produces both a set of fields by\n * also including all inline fragments, as well as a list of fragments\n * referenced by fragment spreads.\n *\n * A) Each selection set represented in the document first compares \"within\" its\n * collected set of fields, finding any conflicts between every pair of\n * overlapping fields.\n * Note: This is the *only time* that a the fields \"within\" a set are compared\n * to each other. After this only fields \"between\" sets are compared.\n *\n * B) Also, if any fragment is referenced in a selection set, then a\n * comparison is made \"between\" the original set of fields and the\n * referenced fragment.\n *\n * C) Also, if multiple fragments are referenced, then comparisons\n * are made \"between\" each referenced fragment.\n *\n * D) When comparing \"between\" a set of fields and a referenced fragment, first\n * a comparison is made between each field in the original set of fields and\n * each field in the the referenced set of fields.\n *\n * E) Also, if any fragment is referenced in the referenced selection set,\n * then a comparison is made \"between\" the original set of fields and the\n * referenced fragment (recursively referring to step D).\n *\n * F) When comparing \"between\" two fragments, first a comparison is made between\n * each field in the first referenced set of fields and each field in the the\n * second referenced set of fields.\n *\n * G) Also, any fragments referenced by the first must be compared to the\n * second, and any fragments referenced by the second must be compared to the\n * first (recursively referring to step F).\n *\n * H) When comparing two fields, if both have selection sets, then a comparison\n * is made \"between\" both selection sets, first comparing the set of fields in\n * the first selection set with the set of fields in the second.\n *\n * I) Also, if any fragment is referenced in either selection set, then a\n * comparison is made \"between\" the other set of fields and the\n * referenced fragment.\n *\n * J) Also, if two fragments are referenced in both selection sets, then a\n * comparison is made \"between\" the two fragments.\n *\n */\n// Find all conflicts found \"within\" a selection set, including those found\n// via spreading in fragments. Called when visiting each SelectionSet in the\n// GraphQL Document.\nfunction findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentType, selectionSet) {\n var conflicts = [];\n\n var _getFieldsAndFragment = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet),\n fieldMap = _getFieldsAndFragment[0],\n fragmentNames = _getFieldsAndFragment[1]; // (A) Find find all conflicts \"within\" the fields of this selection set.\n // Note: this is the *only place* `collectConflictsWithin` is called.\n\n\n collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap);\n\n if (fragmentNames.length !== 0) {\n // (B) Then collect conflicts between these fields and those represented by\n // each spread fragment name found.\n for (var i = 0; i < fragmentNames.length; i++) {\n collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fieldMap, fragmentNames[i]); // (C) Then compare this fragment with all other fragments found in this\n // selection set to collect conflicts between fragments spread together.\n // This compares each item in the list of fragment names to every other\n // item in that same list (except for itself).\n\n for (var j = i + 1; j < fragmentNames.length; j++) {\n collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fragmentNames[i], fragmentNames[j]);\n }\n }\n }\n\n return conflicts;\n} // Collect all conflicts found between a set of fields and a fragment reference\n// including via spreading in any nested fragments.\n\n\nfunction collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) {\n var fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n return;\n }\n\n var _getReferencedFieldsA = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment),\n fieldMap2 = _getReferencedFieldsA[0],\n fragmentNames2 = _getReferencedFieldsA[1]; // Do not compare a fragment's fieldMap to itself.\n\n\n if (fieldMap === fieldMap2) {\n return;\n } // (D) First collect any conflicts between the provided collection of fields\n // and the collection of fields represented by the given fragment.\n\n\n collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fieldMap2); // (E) Then collect any conflicts between the provided collection of fields\n // and any fragment names found in the given fragment.\n\n for (var i = 0; i < fragmentNames2.length; i++) {\n collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentNames2[i]);\n }\n} // Collect all conflicts found between two fragments, including via spreading in\n// any nested fragments.\n\n\nfunction collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2) {\n // No need to compare a fragment to itself.\n if (fragmentName1 === fragmentName2) {\n return;\n } // Memoize so two fragments are not compared for conflicts more than once.\n\n\n if (comparedFragmentPairs.has(fragmentName1, fragmentName2, areMutuallyExclusive)) {\n return;\n }\n\n comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive);\n var fragment1 = context.getFragment(fragmentName1);\n var fragment2 = context.getFragment(fragmentName2);\n\n if (!fragment1 || !fragment2) {\n return;\n }\n\n var _getReferencedFieldsA2 = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment1),\n fieldMap1 = _getReferencedFieldsA2[0],\n fragmentNames1 = _getReferencedFieldsA2[1];\n\n var _getReferencedFieldsA3 = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment2),\n fieldMap2 = _getReferencedFieldsA3[0],\n fragmentNames2 = _getReferencedFieldsA3[1]; // (F) First, collect all conflicts between these two collections of fields\n // (not including any nested fragments).\n\n\n collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (G) Then collect conflicts between the first fragment and any nested\n // fragments spread in the second fragment.\n\n for (var j = 0; j < fragmentNames2.length; j++) {\n collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentNames2[j]);\n } // (G) Then collect conflicts between the second fragment and any nested\n // fragments spread in the first fragment.\n\n\n for (var i = 0; i < fragmentNames1.length; i++) {\n collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[i], fragmentName2);\n }\n} // Find all conflicts found between two selection sets, including those found\n// via spreading in fragments. Called when determining if conflicts exist\n// between the sub-fields of two overlapping fields.\n\n\nfunction findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, parentType2, selectionSet2) {\n var conflicts = [];\n\n var _getFieldsAndFragment2 = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType1, selectionSet1),\n fieldMap1 = _getFieldsAndFragment2[0],\n fragmentNames1 = _getFieldsAndFragment2[1];\n\n var _getFieldsAndFragment3 = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType2, selectionSet2),\n fieldMap2 = _getFieldsAndFragment3[0],\n fragmentNames2 = _getFieldsAndFragment3[1]; // (H) First, collect all conflicts between these two collections of field.\n\n\n collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (I) Then collect conflicts between the first collection of fields and\n // those referenced by each fragment name associated with the second.\n\n if (fragmentNames2.length !== 0) {\n for (var j = 0; j < fragmentNames2.length; j++) {\n collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentNames2[j]);\n }\n } // (I) Then collect conflicts between the second collection of fields and\n // those referenced by each fragment name associated with the first.\n\n\n if (fragmentNames1.length !== 0) {\n for (var i = 0; i < fragmentNames1.length; i++) {\n collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap2, fragmentNames1[i]);\n }\n } // (J) Also collect conflicts between any fragment names by the first and\n // fragment names by the second. This compares each item in the first set of\n // names to each item in the second set of names.\n\n\n for (var _i3 = 0; _i3 < fragmentNames1.length; _i3++) {\n for (var _j = 0; _j < fragmentNames2.length; _j++) {\n collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[_i3], fragmentNames2[_j]);\n }\n }\n\n return conflicts;\n} // Collect all Conflicts \"within\" one collection of fields.\n\n\nfunction collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap) {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For every response name, if there are multiple fields, they\n // must be compared to find a potential conflict.\n for (var _i5 = 0, _objectEntries2 = objectEntries(fieldMap); _i5 < _objectEntries2.length; _i5++) {\n var _ref5 = _objectEntries2[_i5];\n var responseName = _ref5[0];\n var fields = _ref5[1];\n\n // This compares every field in the list to every other field in this list\n // (except to itself). If the list only has one item, nothing needs to\n // be compared.\n if (fields.length > 1) {\n for (var i = 0; i < fields.length; i++) {\n for (var j = i + 1; j < fields.length; j++) {\n var conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, // within one collection is never mutually exclusive\n responseName, fields[i], fields[j]);\n\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n} // Collect all Conflicts between two collections of fields. This is similar to,\n// but different from the `collectConflictsWithin` function above. This check\n// assumes that `collectConflictsWithin` has already been called on each\n// provided collection of fields. This is true because this validator traverses\n// each individual selection set.\n\n\nfunction collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, fieldMap2) {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For any response name which appears in both provided field\n // maps, each field from the first field map must be compared to every field\n // in the second field map to find potential conflicts.\n for (var _i7 = 0, _Object$keys2 = Object.keys(fieldMap1); _i7 < _Object$keys2.length; _i7++) {\n var responseName = _Object$keys2[_i7];\n var fields2 = fieldMap2[responseName];\n\n if (fields2) {\n var fields1 = fieldMap1[responseName];\n\n for (var i = 0; i < fields1.length; i++) {\n for (var j = 0; j < fields2.length; j++) {\n var conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, fields1[i], fields2[j]);\n\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n} // Determines if there is a conflict between two particular fields, including\n// comparing their sub-fields.\n\n\nfunction findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2) {\n var parentType1 = field1[0],\n node1 = field1[1],\n def1 = field1[2];\n var parentType2 = field2[0],\n node2 = field2[1],\n def2 = field2[2]; // If it is known that two fields could not possibly apply at the same\n // time, due to the parent types, then it is safe to permit them to diverge\n // in aliased field or arguments used as they will not present any ambiguity\n // by differing.\n // It is known that two parent types could never overlap if they are\n // different Object types. Interface or Union types might overlap - if not\n // in the current state of the schema, then perhaps in some future version,\n // thus may not safely diverge.\n\n var areMutuallyExclusive = parentFieldsAreMutuallyExclusive || parentType1 !== parentType2 && isObjectType(parentType1) && isObjectType(parentType2);\n\n if (!areMutuallyExclusive) {\n var _node1$arguments, _node2$arguments;\n\n // Two aliases must refer to the same field.\n var name1 = node1.name.value;\n var name2 = node2.name.value;\n\n if (name1 !== name2) {\n return [[responseName, \"\\\"\".concat(name1, \"\\\" and \\\"\").concat(name2, \"\\\" are different fields\")], [node1], [node2]];\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n\n var args1 = (_node1$arguments = node1.arguments) !== null && _node1$arguments !== void 0 ? _node1$arguments : []; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n var args2 = (_node2$arguments = node2.arguments) !== null && _node2$arguments !== void 0 ? _node2$arguments : []; // Two field calls must have the same arguments.\n\n if (!sameArguments(args1, args2)) {\n return [[responseName, 'they have differing arguments'], [node1], [node2]];\n }\n } // The return type for each field.\n\n\n var type1 = def1 === null || def1 === void 0 ? void 0 : def1.type;\n var type2 = def2 === null || def2 === void 0 ? void 0 : def2.type;\n\n if (type1 && type2 && doTypesConflict(type1, type2)) {\n return [[responseName, \"they return conflicting types \\\"\".concat(inspect(type1), \"\\\" and \\\"\").concat(inspect(type2), \"\\\"\")], [node1], [node2]];\n } // Collect and compare sub-fields. Use the same \"visited fragment names\" list\n // for both collections so fields in a fragment reference are never\n // compared to themselves.\n\n\n var selectionSet1 = node1.selectionSet;\n var selectionSet2 = node2.selectionSet;\n\n if (selectionSet1 && selectionSet2) {\n var conflicts = findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, getNamedType(type1), selectionSet1, getNamedType(type2), selectionSet2);\n return subfieldConflicts(conflicts, responseName, node1, node2);\n }\n}\n\nfunction sameArguments(arguments1, arguments2) {\n if (arguments1.length !== arguments2.length) {\n return false;\n }\n\n return arguments1.every(function (argument1) {\n var argument2 = find(arguments2, function (argument) {\n return argument.name.value === argument1.name.value;\n });\n\n if (!argument2) {\n return false;\n }\n\n return sameValue(argument1.value, argument2.value);\n });\n}\n\nfunction sameValue(value1, value2) {\n return print(value1) === print(value2);\n} // Two types conflict if both types could not apply to a value simultaneously.\n// Composite types are ignored as their individual field types will be compared\n// later recursively. However List and Non-Null types must match.\n\n\nfunction doTypesConflict(type1, type2) {\n if (isListType(type1)) {\n return isListType(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n\n if (isListType(type2)) {\n return true;\n }\n\n if (isNonNullType(type1)) {\n return isNonNullType(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n\n if (isNonNullType(type2)) {\n return true;\n }\n\n if (isLeafType(type1) || isLeafType(type2)) {\n return type1 !== type2;\n }\n\n return false;\n} // Given a selection set, return the collection of fields (a mapping of response\n// name to field nodes and definitions) as well as a list of fragment names\n// referenced via fragment spreads.\n\n\nfunction getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet) {\n var cached = cachedFieldsAndFragmentNames.get(selectionSet);\n\n if (!cached) {\n var nodeAndDefs = Object.create(null);\n var fragmentNames = Object.create(null);\n\n _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames);\n\n cached = [nodeAndDefs, Object.keys(fragmentNames)];\n cachedFieldsAndFragmentNames.set(selectionSet, cached);\n }\n\n return cached;\n} // Given a reference to a fragment, return the represented collection of fields\n// as well as a list of nested fragment names referenced via fragment spreads.\n\n\nfunction getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment) {\n // Short-circuit building a type from the node if possible.\n var cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet);\n\n if (cached) {\n return cached;\n }\n\n var fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition);\n return getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragmentType, fragment.selectionSet);\n}\n\nfunction _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames) {\n for (var _i9 = 0, _selectionSet$selecti2 = selectionSet.selections; _i9 < _selectionSet$selecti2.length; _i9++) {\n var selection = _selectionSet$selecti2[_i9];\n\n switch (selection.kind) {\n case Kind.FIELD:\n {\n var fieldName = selection.name.value;\n var fieldDef = void 0;\n\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n fieldDef = parentType.getFields()[fieldName];\n }\n\n var responseName = selection.alias ? selection.alias.value : fieldName;\n\n if (!nodeAndDefs[responseName]) {\n nodeAndDefs[responseName] = [];\n }\n\n nodeAndDefs[responseName].push([parentType, selection, fieldDef]);\n break;\n }\n\n case Kind.FRAGMENT_SPREAD:\n fragmentNames[selection.name.value] = true;\n break;\n\n case Kind.INLINE_FRAGMENT:\n {\n var typeCondition = selection.typeCondition;\n var inlineFragmentType = typeCondition ? typeFromAST(context.getSchema(), typeCondition) : parentType;\n\n _collectFieldsAndFragmentNames(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentNames);\n\n break;\n }\n }\n }\n} // Given a series of Conflicts which occurred between two sub-fields, generate\n// a single Conflict.\n\n\nfunction subfieldConflicts(conflicts, responseName, node1, node2) {\n if (conflicts.length > 0) {\n return [[responseName, conflicts.map(function (_ref6) {\n var reason = _ref6[0];\n return reason;\n })], conflicts.reduce(function (allFields, _ref7) {\n var fields1 = _ref7[1];\n return allFields.concat(fields1);\n }, [node1]), conflicts.reduce(function (allFields, _ref8) {\n var fields2 = _ref8[2];\n return allFields.concat(fields2);\n }, [node2])];\n }\n}\n/**\n * A way to keep track of pairs of things when the ordering of the pair does\n * not matter. We do this by maintaining a sort of double adjacency sets.\n */\n\n\nvar PairSet = /*#__PURE__*/function () {\n function PairSet() {\n this._data = Object.create(null);\n }\n\n var _proto = PairSet.prototype;\n\n _proto.has = function has(a, b, areMutuallyExclusive) {\n var first = this._data[a];\n var result = first && first[b];\n\n if (result === undefined) {\n return false;\n } // areMutuallyExclusive being false is a superset of being true,\n // hence if we want to know if this PairSet \"has\" these two with no\n // exclusivity, we have to ensure it was added as such.\n\n\n if (areMutuallyExclusive === false) {\n return result === false;\n }\n\n return true;\n };\n\n _proto.add = function add(a, b, areMutuallyExclusive) {\n this._pairSetAdd(a, b, areMutuallyExclusive);\n\n this._pairSetAdd(b, a, areMutuallyExclusive);\n };\n\n _proto._pairSetAdd = function _pairSetAdd(a, b, areMutuallyExclusive) {\n var map = this._data[a];\n\n if (!map) {\n map = Object.create(null);\n this._data[a] = map;\n }\n\n map[b] = areMutuallyExclusive;\n };\n\n return PairSet;\n}();\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique input field names\n *\n * A GraphQL input object value is only valid if all supplied fields are\n * uniquely named.\n */\nexport function UniqueInputFieldNamesRule(context) {\n var knownNameStack = [];\n var knownNames = Object.create(null);\n return {\n ObjectValue: {\n enter: function enter() {\n knownNameStack.push(knownNames);\n knownNames = Object.create(null);\n },\n leave: function leave() {\n knownNames = knownNameStack.pop();\n }\n },\n ObjectField: function ObjectField(node) {\n var fieldName = node.name.value;\n\n if (knownNames[fieldName]) {\n context.reportError(new GraphQLError(\"There can be only one input field named \\\"\".concat(fieldName, \"\\\".\"), [knownNames[fieldName], node.name]));\n } else {\n knownNames[fieldName] = node.name;\n }\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Lone Schema definition\n *\n * A GraphQL document is only valid if it contains only one schema definition.\n */\nexport function LoneSchemaDefinitionRule(context) {\n var _ref, _ref2, _oldSchema$astNode;\n\n var oldSchema = context.getSchema();\n var alreadyDefined = (_ref = (_ref2 = (_oldSchema$astNode = oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0 ? _oldSchema$astNode : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getQueryType()) !== null && _ref2 !== void 0 ? _ref2 : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getMutationType()) !== null && _ref !== void 0 ? _ref : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getSubscriptionType();\n var schemaDefinitionsCount = 0;\n return {\n SchemaDefinition: function SchemaDefinition(node) {\n if (alreadyDefined) {\n context.reportError(new GraphQLError('Cannot define a new schema within a schema extension.', node));\n return;\n }\n\n if (schemaDefinitionsCount > 0) {\n context.reportError(new GraphQLError('Must provide only one schema definition.', node));\n }\n\n ++schemaDefinitionsCount;\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique operation types\n *\n * A GraphQL document is only valid if it has only one type per operation.\n */\nexport function UniqueOperationTypesRule(context) {\n var schema = context.getSchema();\n var definedOperationTypes = Object.create(null);\n var existingOperationTypes = schema ? {\n query: schema.getQueryType(),\n mutation: schema.getMutationType(),\n subscription: schema.getSubscriptionType()\n } : {};\n return {\n SchemaDefinition: checkOperationTypes,\n SchemaExtension: checkOperationTypes\n };\n\n function checkOperationTypes(node) {\n var _node$operationTypes;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : [];\n\n for (var _i2 = 0; _i2 < operationTypesNodes.length; _i2++) {\n var operationType = operationTypesNodes[_i2];\n var operation = operationType.operation;\n var alreadyDefinedOperationType = definedOperationTypes[operation];\n\n if (existingOperationTypes[operation]) {\n context.reportError(new GraphQLError(\"Type for \".concat(operation, \" already defined in the schema. It cannot be redefined.\"), operationType));\n } else if (alreadyDefinedOperationType) {\n context.reportError(new GraphQLError(\"There can be only one \".concat(operation, \" type in schema.\"), [alreadyDefinedOperationType, operationType]));\n } else {\n definedOperationTypes[operation] = operationType;\n }\n }\n\n return false;\n }\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique type names\n *\n * A GraphQL document is only valid if all defined types have unique names.\n */\nexport function UniqueTypeNamesRule(context) {\n var knownTypeNames = Object.create(null);\n var schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName\n };\n\n function checkTypeName(node) {\n var typeName = node.name.value;\n\n if (schema !== null && schema !== void 0 && schema.getType(typeName)) {\n context.reportError(new GraphQLError(\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also be defined in this type definition.\"), node.name));\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(new GraphQLError(\"There can be only one type named \\\"\".concat(typeName, \"\\\".\"), [knownTypeNames[typeName], node.name]));\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { isEnumType } from \"../../type/definition.mjs\";\n\n/**\n * Unique enum value names\n *\n * A GraphQL enum type is only valid if all its values are uniquely named.\n */\nexport function UniqueEnumValueNamesRule(context) {\n var schema = context.getSchema();\n var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n var knownValueNames = Object.create(null);\n return {\n EnumTypeDefinition: checkValueUniqueness,\n EnumTypeExtension: checkValueUniqueness\n };\n\n function checkValueUniqueness(node) {\n var _node$values;\n\n var typeName = node.name.value;\n\n if (!knownValueNames[typeName]) {\n knownValueNames[typeName] = Object.create(null);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n\n var valueNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : [];\n var valueNames = knownValueNames[typeName];\n\n for (var _i2 = 0; _i2 < valueNodes.length; _i2++) {\n var valueDef = valueNodes[_i2];\n var valueName = valueDef.name.value;\n var existingType = existingTypeMap[typeName];\n\n if (isEnumType(existingType) && existingType.getValue(valueName)) {\n context.reportError(new GraphQLError(\"Enum value \\\"\".concat(typeName, \".\").concat(valueName, \"\\\" already exists in the schema. It cannot also be defined in this type extension.\"), valueDef.name));\n } else if (valueNames[valueName]) {\n context.reportError(new GraphQLError(\"Enum value \\\"\".concat(typeName, \".\").concat(valueName, \"\\\" can only be defined once.\"), [valueNames[valueName], valueDef.name]));\n } else {\n valueNames[valueName] = valueDef.name;\n }\n }\n\n return false;\n }\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { isObjectType, isInterfaceType, isInputObjectType } from \"../../type/definition.mjs\";\n\n/**\n * Unique field definition names\n *\n * A GraphQL complex type is only valid if all its fields are uniquely named.\n */\nexport function UniqueFieldDefinitionNamesRule(context) {\n var schema = context.getSchema();\n var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n var knownFieldNames = Object.create(null);\n return {\n InputObjectTypeDefinition: checkFieldUniqueness,\n InputObjectTypeExtension: checkFieldUniqueness,\n InterfaceTypeDefinition: checkFieldUniqueness,\n InterfaceTypeExtension: checkFieldUniqueness,\n ObjectTypeDefinition: checkFieldUniqueness,\n ObjectTypeExtension: checkFieldUniqueness\n };\n\n function checkFieldUniqueness(node) {\n var _node$fields;\n\n var typeName = node.name.value;\n\n if (!knownFieldNames[typeName]) {\n knownFieldNames[typeName] = Object.create(null);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n\n var fieldNodes = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : [];\n var fieldNames = knownFieldNames[typeName];\n\n for (var _i2 = 0; _i2 < fieldNodes.length; _i2++) {\n var fieldDef = fieldNodes[_i2];\n var fieldName = fieldDef.name.value;\n\n if (hasField(existingTypeMap[typeName], fieldName)) {\n context.reportError(new GraphQLError(\"Field \\\"\".concat(typeName, \".\").concat(fieldName, \"\\\" already exists in the schema. It cannot also be defined in this type extension.\"), fieldDef.name));\n } else if (fieldNames[fieldName]) {\n context.reportError(new GraphQLError(\"Field \\\"\".concat(typeName, \".\").concat(fieldName, \"\\\" can only be defined once.\"), [fieldNames[fieldName], fieldDef.name]));\n } else {\n fieldNames[fieldName] = fieldDef.name;\n }\n }\n\n return false;\n }\n}\n\nfunction hasField(type, fieldName) {\n if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) {\n return type.getFields()[fieldName] != null;\n }\n\n return false;\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique directive names\n *\n * A GraphQL document is only valid if all defined directives have unique names.\n */\nexport function UniqueDirectiveNamesRule(context) {\n var knownDirectiveNames = Object.create(null);\n var schema = context.getSchema();\n return {\n DirectiveDefinition: function DirectiveDefinition(node) {\n var directiveName = node.name.value;\n\n if (schema !== null && schema !== void 0 && schema.getDirective(directiveName)) {\n context.reportError(new GraphQLError(\"Directive \\\"@\".concat(directiveName, \"\\\" already exists in the schema. It cannot be redefined.\"), node.name));\n return;\n }\n\n if (knownDirectiveNames[directiveName]) {\n context.reportError(new GraphQLError(\"There can be only one directive named \\\"@\".concat(directiveName, \"\\\".\"), [knownDirectiveNames[directiveName], node.name]));\n } else {\n knownDirectiveNames[directiveName] = node.name;\n }\n\n return false;\n }\n };\n}\n","var _defKindToExtKind;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport inspect from \"../../jsutils/inspect.mjs\";\nimport invariant from \"../../jsutils/invariant.mjs\";\nimport didYouMean from \"../../jsutils/didYouMean.mjs\";\nimport suggestionList from \"../../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { isTypeDefinitionNode } from \"../../language/predicates.mjs\";\nimport { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from \"../../type/definition.mjs\";\n\n/**\n * Possible type extension\n *\n * A type extension is only valid if the type is defined and has the same kind.\n */\nexport function PossibleTypeExtensionsRule(context) {\n var schema = context.getSchema();\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (isTypeDefinitionNode(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension\n };\n\n function checkExtension(node) {\n var typeName = node.name.value;\n var defNode = definedTypes[typeName];\n var existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n var expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n var kindStr = extensionKindToTypeName(node.kind);\n context.reportError(new GraphQLError(\"Cannot extend non-\".concat(kindStr, \" type \\\"\").concat(typeName, \"\\\".\"), defNode ? [defNode, node] : node));\n }\n } else {\n var allTypeNames = Object.keys(definedTypes);\n\n if (schema) {\n allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap()));\n }\n\n var suggestedTypes = suggestionList(typeName, allTypeNames);\n context.reportError(new GraphQLError(\"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\") + didYouMean(suggestedTypes), node.name));\n }\n }\n}\nvar defKindToExtKind = (_defKindToExtKind = {}, _defineProperty(_defKindToExtKind, Kind.SCALAR_TYPE_DEFINITION, Kind.SCALAR_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.OBJECT_TYPE_DEFINITION, Kind.OBJECT_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.INTERFACE_TYPE_DEFINITION, Kind.INTERFACE_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.UNION_TYPE_DEFINITION, Kind.UNION_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.ENUM_TYPE_DEFINITION, Kind.ENUM_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.INPUT_OBJECT_TYPE_DEFINITION, Kind.INPUT_OBJECT_TYPE_EXTENSION), _defKindToExtKind);\n\nfunction typeToExtKind(type) {\n if (isScalarType(type)) {\n return Kind.SCALAR_TYPE_EXTENSION;\n }\n\n if (isObjectType(type)) {\n return Kind.OBJECT_TYPE_EXTENSION;\n }\n\n if (isInterfaceType(type)) {\n return Kind.INTERFACE_TYPE_EXTENSION;\n }\n\n if (isUnionType(type)) {\n return Kind.UNION_TYPE_EXTENSION;\n }\n\n if (isEnumType(type)) {\n return Kind.ENUM_TYPE_EXTENSION;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isInputObjectType(type)) {\n return Kind.INPUT_OBJECT_TYPE_EXTENSION;\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected type: ' + inspect(type));\n}\n\nfunction extensionKindToTypeName(kind) {\n switch (kind) {\n case Kind.SCALAR_TYPE_EXTENSION:\n return 'scalar';\n\n case Kind.OBJECT_TYPE_EXTENSION:\n return 'object';\n\n case Kind.INTERFACE_TYPE_EXTENSION:\n return 'interface';\n\n case Kind.UNION_TYPE_EXTENSION:\n return 'union';\n\n case Kind.ENUM_TYPE_EXTENSION:\n return 'enum';\n\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return 'input object';\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected kind: ' + inspect(kind));\n}\n","// Spec Section: \"Executable Definitions\"\nimport { ExecutableDefinitionsRule } from \"./rules/ExecutableDefinitionsRule.mjs\"; // Spec Section: \"Operation Name Uniqueness\"\n\nimport { UniqueOperationNamesRule } from \"./rules/UniqueOperationNamesRule.mjs\"; // Spec Section: \"Lone Anonymous Operation\"\n\nimport { LoneAnonymousOperationRule } from \"./rules/LoneAnonymousOperationRule.mjs\"; // Spec Section: \"Subscriptions with Single Root Field\"\n\nimport { SingleFieldSubscriptionsRule } from \"./rules/SingleFieldSubscriptionsRule.mjs\"; // Spec Section: \"Fragment Spread Type Existence\"\n\nimport { KnownTypeNamesRule } from \"./rules/KnownTypeNamesRule.mjs\"; // Spec Section: \"Fragments on Composite Types\"\n\nimport { FragmentsOnCompositeTypesRule } from \"./rules/FragmentsOnCompositeTypesRule.mjs\"; // Spec Section: \"Variables are Input Types\"\n\nimport { VariablesAreInputTypesRule } from \"./rules/VariablesAreInputTypesRule.mjs\"; // Spec Section: \"Leaf Field Selections\"\n\nimport { ScalarLeafsRule } from \"./rules/ScalarLeafsRule.mjs\"; // Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\n\nimport { FieldsOnCorrectTypeRule } from \"./rules/FieldsOnCorrectTypeRule.mjs\"; // Spec Section: \"Fragment Name Uniqueness\"\n\nimport { UniqueFragmentNamesRule } from \"./rules/UniqueFragmentNamesRule.mjs\"; // Spec Section: \"Fragment spread target defined\"\n\nimport { KnownFragmentNamesRule } from \"./rules/KnownFragmentNamesRule.mjs\"; // Spec Section: \"Fragments must be used\"\n\nimport { NoUnusedFragmentsRule } from \"./rules/NoUnusedFragmentsRule.mjs\"; // Spec Section: \"Fragment spread is possible\"\n\nimport { PossibleFragmentSpreadsRule } from \"./rules/PossibleFragmentSpreadsRule.mjs\"; // Spec Section: \"Fragments must not form cycles\"\n\nimport { NoFragmentCyclesRule } from \"./rules/NoFragmentCyclesRule.mjs\"; // Spec Section: \"Variable Uniqueness\"\n\nimport { UniqueVariableNamesRule } from \"./rules/UniqueVariableNamesRule.mjs\"; // Spec Section: \"All Variable Used Defined\"\n\nimport { NoUndefinedVariablesRule } from \"./rules/NoUndefinedVariablesRule.mjs\"; // Spec Section: \"All Variables Used\"\n\nimport { NoUnusedVariablesRule } from \"./rules/NoUnusedVariablesRule.mjs\"; // Spec Section: \"Directives Are Defined\"\n\nimport { KnownDirectivesRule } from \"./rules/KnownDirectivesRule.mjs\"; // Spec Section: \"Directives Are Unique Per Location\"\n\nimport { UniqueDirectivesPerLocationRule } from \"./rules/UniqueDirectivesPerLocationRule.mjs\"; // Spec Section: \"Argument Names\"\n\nimport { KnownArgumentNamesRule, KnownArgumentNamesOnDirectivesRule } from \"./rules/KnownArgumentNamesRule.mjs\"; // Spec Section: \"Argument Uniqueness\"\n\nimport { UniqueArgumentNamesRule } from \"./rules/UniqueArgumentNamesRule.mjs\"; // Spec Section: \"Value Type Correctness\"\n\nimport { ValuesOfCorrectTypeRule } from \"./rules/ValuesOfCorrectTypeRule.mjs\"; // Spec Section: \"Argument Optionality\"\n\nimport { ProvidedRequiredArgumentsRule, ProvidedRequiredArgumentsOnDirectivesRule } from \"./rules/ProvidedRequiredArgumentsRule.mjs\"; // Spec Section: \"All Variable Usages Are Allowed\"\n\nimport { VariablesInAllowedPositionRule } from \"./rules/VariablesInAllowedPositionRule.mjs\"; // Spec Section: \"Field Selection Merging\"\n\nimport { OverlappingFieldsCanBeMergedRule } from \"./rules/OverlappingFieldsCanBeMergedRule.mjs\"; // Spec Section: \"Input Object Field Uniqueness\"\n\nimport { UniqueInputFieldNamesRule } from \"./rules/UniqueInputFieldNamesRule.mjs\"; // SDL-specific validation rules\n\nimport { LoneSchemaDefinitionRule } from \"./rules/LoneSchemaDefinitionRule.mjs\";\nimport { UniqueOperationTypesRule } from \"./rules/UniqueOperationTypesRule.mjs\";\nimport { UniqueTypeNamesRule } from \"./rules/UniqueTypeNamesRule.mjs\";\nimport { UniqueEnumValueNamesRule } from \"./rules/UniqueEnumValueNamesRule.mjs\";\nimport { UniqueFieldDefinitionNamesRule } from \"./rules/UniqueFieldDefinitionNamesRule.mjs\";\nimport { UniqueDirectiveNamesRule } from \"./rules/UniqueDirectiveNamesRule.mjs\";\nimport { PossibleTypeExtensionsRule } from \"./rules/PossibleTypeExtensionsRule.mjs\";\n/**\n * This set includes all validation rules defined by the GraphQL spec.\n *\n * The order of the rules in this list has been adjusted to lead to the\n * most clear output when encountering multiple validation errors.\n */\n\nexport var specifiedRules = Object.freeze([ExecutableDefinitionsRule, UniqueOperationNamesRule, LoneAnonymousOperationRule, SingleFieldSubscriptionsRule, KnownTypeNamesRule, FragmentsOnCompositeTypesRule, VariablesAreInputTypesRule, ScalarLeafsRule, FieldsOnCorrectTypeRule, UniqueFragmentNamesRule, KnownFragmentNamesRule, NoUnusedFragmentsRule, PossibleFragmentSpreadsRule, NoFragmentCyclesRule, UniqueVariableNamesRule, NoUndefinedVariablesRule, NoUnusedVariablesRule, KnownDirectivesRule, UniqueDirectivesPerLocationRule, KnownArgumentNamesRule, UniqueArgumentNamesRule, ValuesOfCorrectTypeRule, ProvidedRequiredArgumentsRule, VariablesInAllowedPositionRule, OverlappingFieldsCanBeMergedRule, UniqueInputFieldNamesRule]);\n/**\n * @internal\n */\n\nexport var specifiedSDLRules = Object.freeze([LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueDirectiveNamesRule, KnownTypeNamesRule, KnownDirectivesRule, UniqueDirectivesPerLocationRule, PossibleTypeExtensionsRule, KnownArgumentNamesOnDirectivesRule, UniqueArgumentNamesRule, UniqueInputFieldNamesRule, ProvidedRequiredArgumentsOnDirectivesRule]);\n","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nimport { Kind } from \"../language/kinds.mjs\";\nimport { visit } from \"../language/visitor.mjs\";\nimport { TypeInfo, visitWithTypeInfo } from \"../utilities/TypeInfo.mjs\";\n\n/**\n * An instance of this class is passed as the \"this\" context to all validators,\n * allowing access to commonly useful contextual information from within a\n * validation rule.\n */\nexport var ASTValidationContext = /*#__PURE__*/function () {\n function ASTValidationContext(ast, onError) {\n this._ast = ast;\n this._fragments = undefined;\n this._fragmentSpreads = new Map();\n this._recursivelyReferencedFragments = new Map();\n this._onError = onError;\n }\n\n var _proto = ASTValidationContext.prototype;\n\n _proto.reportError = function reportError(error) {\n this._onError(error);\n };\n\n _proto.getDocument = function getDocument() {\n return this._ast;\n };\n\n _proto.getFragment = function getFragment(name) {\n var fragments = this._fragments;\n\n if (!fragments) {\n this._fragments = fragments = this.getDocument().definitions.reduce(function (frags, statement) {\n if (statement.kind === Kind.FRAGMENT_DEFINITION) {\n frags[statement.name.value] = statement;\n }\n\n return frags;\n }, Object.create(null));\n }\n\n return fragments[name];\n };\n\n _proto.getFragmentSpreads = function getFragmentSpreads(node) {\n var spreads = this._fragmentSpreads.get(node);\n\n if (!spreads) {\n spreads = [];\n var setsToVisit = [node];\n\n while (setsToVisit.length !== 0) {\n var set = setsToVisit.pop();\n\n for (var _i2 = 0, _set$selections2 = set.selections; _i2 < _set$selections2.length; _i2++) {\n var selection = _set$selections2[_i2];\n\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n spreads.push(selection);\n } else if (selection.selectionSet) {\n setsToVisit.push(selection.selectionSet);\n }\n }\n }\n\n this._fragmentSpreads.set(node, spreads);\n }\n\n return spreads;\n };\n\n _proto.getRecursivelyReferencedFragments = function getRecursivelyReferencedFragments(operation) {\n var fragments = this._recursivelyReferencedFragments.get(operation);\n\n if (!fragments) {\n fragments = [];\n var collectedNames = Object.create(null);\n var nodesToVisit = [operation.selectionSet];\n\n while (nodesToVisit.length !== 0) {\n var node = nodesToVisit.pop();\n\n for (var _i4 = 0, _this$getFragmentSpre2 = this.getFragmentSpreads(node); _i4 < _this$getFragmentSpre2.length; _i4++) {\n var spread = _this$getFragmentSpre2[_i4];\n var fragName = spread.name.value;\n\n if (collectedNames[fragName] !== true) {\n collectedNames[fragName] = true;\n var fragment = this.getFragment(fragName);\n\n if (fragment) {\n fragments.push(fragment);\n nodesToVisit.push(fragment.selectionSet);\n }\n }\n }\n }\n\n this._recursivelyReferencedFragments.set(operation, fragments);\n }\n\n return fragments;\n };\n\n return ASTValidationContext;\n}();\nexport var SDLValidationContext = /*#__PURE__*/function (_ASTValidationContext) {\n _inheritsLoose(SDLValidationContext, _ASTValidationContext);\n\n function SDLValidationContext(ast, schema, onError) {\n var _this;\n\n _this = _ASTValidationContext.call(this, ast, onError) || this;\n _this._schema = schema;\n return _this;\n }\n\n var _proto2 = SDLValidationContext.prototype;\n\n _proto2.getSchema = function getSchema() {\n return this._schema;\n };\n\n return SDLValidationContext;\n}(ASTValidationContext);\nexport var ValidationContext = /*#__PURE__*/function (_ASTValidationContext2) {\n _inheritsLoose(ValidationContext, _ASTValidationContext2);\n\n function ValidationContext(schema, ast, typeInfo, onError) {\n var _this2;\n\n _this2 = _ASTValidationContext2.call(this, ast, onError) || this;\n _this2._schema = schema;\n _this2._typeInfo = typeInfo;\n _this2._variableUsages = new Map();\n _this2._recursiveVariableUsages = new Map();\n return _this2;\n }\n\n var _proto3 = ValidationContext.prototype;\n\n _proto3.getSchema = function getSchema() {\n return this._schema;\n };\n\n _proto3.getVariableUsages = function getVariableUsages(node) {\n var usages = this._variableUsages.get(node);\n\n if (!usages) {\n var newUsages = [];\n var typeInfo = new TypeInfo(this._schema);\n visit(node, visitWithTypeInfo(typeInfo, {\n VariableDefinition: function VariableDefinition() {\n return false;\n },\n Variable: function Variable(variable) {\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n defaultValue: typeInfo.getDefaultValue()\n });\n }\n }));\n usages = newUsages;\n\n this._variableUsages.set(node, usages);\n }\n\n return usages;\n };\n\n _proto3.getRecursiveVariableUsages = function getRecursiveVariableUsages(operation) {\n var usages = this._recursiveVariableUsages.get(operation);\n\n if (!usages) {\n usages = this.getVariableUsages(operation);\n\n for (var _i6 = 0, _this$getRecursivelyR2 = this.getRecursivelyReferencedFragments(operation); _i6 < _this$getRecursivelyR2.length; _i6++) {\n var frag = _this$getRecursivelyR2[_i6];\n usages = usages.concat(this.getVariableUsages(frag));\n }\n\n this._recursiveVariableUsages.set(operation, usages);\n }\n\n return usages;\n };\n\n _proto3.getType = function getType() {\n return this._typeInfo.getType();\n };\n\n _proto3.getParentType = function getParentType() {\n return this._typeInfo.getParentType();\n };\n\n _proto3.getInputType = function getInputType() {\n return this._typeInfo.getInputType();\n };\n\n _proto3.getParentInputType = function getParentInputType() {\n return this._typeInfo.getParentInputType();\n };\n\n _proto3.getFieldDef = function getFieldDef() {\n return this._typeInfo.getFieldDef();\n };\n\n _proto3.getDirective = function getDirective() {\n return this._typeInfo.getDirective();\n };\n\n _proto3.getArgument = function getArgument() {\n return this._typeInfo.getArgument();\n };\n\n _proto3.getEnumValue = function getEnumValue() {\n return this._typeInfo.getEnumValue();\n };\n\n return ValidationContext;\n}(ASTValidationContext);\n","import devAssert from \"../jsutils/devAssert.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { visit, visitInParallel } from \"../language/visitor.mjs\";\nimport { assertValidSchema } from \"../type/validate.mjs\";\nimport { TypeInfo, visitWithTypeInfo } from \"../utilities/TypeInfo.mjs\";\nimport { specifiedRules, specifiedSDLRules } from \"./specifiedRules.mjs\";\nimport { SDLValidationContext, ValidationContext } from \"./ValidationContext.mjs\";\n/**\n * Implements the \"Validation\" section of the spec.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the document is valid.\n *\n * A list of specific validation rules may be provided. If not provided, the\n * default list of rules defined by the GraphQL specification will be used.\n *\n * Each validation rules is a function which returns a visitor\n * (see the language/visitor API). Visitor methods are expected to return\n * GraphQLErrors, or Arrays of GraphQLErrors when invalid.\n *\n * Optionally a custom TypeInfo instance may be provided. If not provided, one\n * will be created from the provided schema.\n */\n\nexport function validate(schema, documentAST) {\n var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedRules;\n var typeInfo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new TypeInfo(schema);\n var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n maxErrors: undefined\n };\n documentAST || devAssert(0, 'Must provide document.'); // If the schema used for validation is invalid, throw an error.\n\n assertValidSchema(schema);\n var abortObj = Object.freeze({});\n var errors = [];\n var context = new ValidationContext(schema, documentAST, typeInfo, function (error) {\n if (options.maxErrors != null && errors.length >= options.maxErrors) {\n errors.push(new GraphQLError('Too many validation errors, error limit reached. Validation aborted.'));\n throw abortObj;\n }\n\n errors.push(error);\n }); // This uses a specialized visitor which runs multiple visitors in parallel,\n // while maintaining the visitor skip and break API.\n\n var visitor = visitInParallel(rules.map(function (rule) {\n return rule(context);\n })); // Visit the whole document with each instance of all provided rules.\n\n try {\n visit(documentAST, visitWithTypeInfo(typeInfo, visitor));\n } catch (e) {\n if (e !== abortObj) {\n throw e;\n }\n }\n\n return errors;\n}\n/**\n * @internal\n */\n\nexport function validateSDL(documentAST, schemaToExtend) {\n var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedSDLRules;\n var errors = [];\n var context = new SDLValidationContext(documentAST, schemaToExtend, function (error) {\n errors.push(error);\n });\n var visitors = rules.map(function (rule) {\n return rule(context);\n });\n visit(documentAST, visitInParallel(visitors));\n return errors;\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDLExtension(documentAST, schema) {\n var errors = validateSDL(documentAST, schema);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}\n","/**\n * Memoizes the provided three-argument function.\n */\nexport default function memoize3(fn) {\n var cache0;\n return function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn(a1, a2, a3);\n cache2.set(a3, newValue);\n return newValue;\n };\n}\n","import isPromise from \"./isPromise.mjs\";\n/**\n * Similar to Array.prototype.reduce(), however the reducing callback may return\n * a Promise, in which case reduction will continue after each promise resolves.\n *\n * If the callback does not return a Promise, then this function will also not\n * return a Promise.\n */\n\nexport default function promiseReduce(values, callback, initialValue) {\n return values.reduce(function (previous, value) {\n return isPromise(previous) ? previous.then(function (resolved) {\n return callback(resolved, value);\n }) : callback(previous, value);\n }, initialValue);\n}\n","/**\n * This function transforms a JS object `ObjMap>` into\n * a `Promise>`\n *\n * This is akin to bluebird's `Promise.props`, but implemented only using\n * `Promise.all` so it will work with any implementation of ES6 promises.\n */\nexport default function promiseForObject(object) {\n var keys = Object.keys(object);\n var valuesAndPromises = keys.map(function (name) {\n return object[name];\n });\n return Promise.all(valuesAndPromises).then(function (values) {\n return values.reduce(function (resolvedObject, value, i) {\n resolvedObject[keys[i]] = value;\n return resolvedObject;\n }, Object.create(null));\n });\n}\n","/**\n * Given a Path and a key, return a new Path containing the new key.\n */\nexport function addPath(prev, key, typename) {\n return {\n prev: prev,\n key: key,\n typename: typename\n };\n}\n/**\n * Given a Path, return an Array of the path keys.\n */\n\nexport function pathToArray(path) {\n var flattened = [];\n var curr = path;\n\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n\n return flattened.reverse();\n}\n","import { GraphQLError } from \"../error/GraphQLError.mjs\";\n\n/**\n * Extracts the root type of the operation from the schema.\n */\nexport function getOperationRootType(schema, operation) {\n if (operation.operation === 'query') {\n var queryType = schema.getQueryType();\n\n if (!queryType) {\n throw new GraphQLError('Schema does not define the required query root type.', operation);\n }\n\n return queryType;\n }\n\n if (operation.operation === 'mutation') {\n var mutationType = schema.getMutationType();\n\n if (!mutationType) {\n throw new GraphQLError('Schema is not configured for mutations.', operation);\n }\n\n return mutationType;\n }\n\n if (operation.operation === 'subscription') {\n var subscriptionType = schema.getSubscriptionType();\n\n if (!subscriptionType) {\n throw new GraphQLError('Schema is not configured for subscriptions.', operation);\n }\n\n return subscriptionType;\n }\n\n throw new GraphQLError('Can only have query, mutation and subscription operations.', operation);\n}\n","/**\n * Build a string describing the path.\n */\nexport default function printPathArray(path) {\n return path.map(function (key) {\n return typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key;\n }).join('');\n}\n","import objectValues from \"../polyfills/objectValues.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { isLeafType, isInputObjectType, isListType, isNonNullType } from \"../type/definition.mjs\";\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | JSON Value |\n * | -------------------- | ------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Number |\n * | Enum Value | Mixed |\n * | NullValue | null |\n *\n */\n\nexport function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (isListType(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === Kind.LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (isNonNullType(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = keyMap(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = objectValues(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isLeafType(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || invariant(0, 'Unexpected input type: ' + inspect(type));\n} // Returns true if the provided valueNode is a variable which is not defined\n// in the set of variables.\n\nfunction isMissingVariable(valueNode, variables) {\n return valueNode.kind === Kind.VARIABLE && (variables == null || variables[valueNode.name.value] === undefined);\n}\n","import objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport didYouMean from \"../jsutils/didYouMean.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport safeArrayFrom from \"../jsutils/safeArrayFrom.mjs\";\nimport suggestionList from \"../jsutils/suggestionList.mjs\";\nimport printPathArray from \"../jsutils/printPathArray.mjs\";\nimport { addPath, pathToArray } from \"../jsutils/Path.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { isLeafType, isInputObjectType, isListType, isNonNullType } from \"../type/definition.mjs\";\n\n/**\n * Coerces a JavaScript value given a GraphQL Input Type.\n */\nexport function coerceInputValue(inputValue, type) {\n var onError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultOnError;\n return coerceInputValueImpl(inputValue, type, onError);\n}\n\nfunction defaultOnError(path, invalidValue, error) {\n var errorPrefix = 'Invalid value ' + inspect(invalidValue);\n\n if (path.length > 0) {\n errorPrefix += \" at \\\"value\".concat(printPathArray(path), \"\\\"\");\n }\n\n error.message = errorPrefix + ': ' + error.message;\n throw error;\n}\n\nfunction coerceInputValueImpl(inputValue, type, onError, path) {\n if (isNonNullType(type)) {\n if (inputValue != null) {\n return coerceInputValueImpl(inputValue, type.ofType, onError, path);\n }\n\n onError(pathToArray(path), inputValue, new GraphQLError(\"Expected non-nullable type \\\"\".concat(inspect(type), \"\\\" not to be null.\")));\n return;\n }\n\n if (inputValue == null) {\n // Explicitly return the value null.\n return null;\n }\n\n if (isListType(type)) {\n var itemType = type.ofType;\n var coercedList = safeArrayFrom(inputValue, function (itemValue, index) {\n var itemPath = addPath(path, index, undefined);\n return coerceInputValueImpl(itemValue, itemType, onError, itemPath);\n });\n\n if (coercedList != null) {\n return coercedList;\n } // Lists accept a non-list value as a list of one.\n\n\n return [coerceInputValueImpl(inputValue, itemType, onError, path)];\n }\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(inputValue)) {\n onError(pathToArray(path), inputValue, new GraphQLError(\"Expected type \\\"\".concat(type.name, \"\\\" to be an object.\")));\n return;\n }\n\n var coercedValue = {};\n var fieldDefs = type.getFields();\n\n for (var _i2 = 0, _objectValues2 = objectValues(fieldDefs); _i2 < _objectValues2.length; _i2++) {\n var field = _objectValues2[_i2];\n var fieldValue = inputValue[field.name];\n\n if (fieldValue === undefined) {\n if (field.defaultValue !== undefined) {\n coercedValue[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n var typeStr = inspect(field.type);\n onError(pathToArray(path), inputValue, new GraphQLError(\"Field \\\"\".concat(field.name, \"\\\" of required type \\\"\").concat(typeStr, \"\\\" was not provided.\")));\n }\n\n continue;\n }\n\n coercedValue[field.name] = coerceInputValueImpl(fieldValue, field.type, onError, addPath(path, field.name, type.name));\n } // Ensure every provided field is defined.\n\n\n for (var _i4 = 0, _Object$keys2 = Object.keys(inputValue); _i4 < _Object$keys2.length; _i4++) {\n var fieldName = _Object$keys2[_i4];\n\n if (!fieldDefs[fieldName]) {\n var suggestions = suggestionList(fieldName, Object.keys(type.getFields()));\n onError(pathToArray(path), inputValue, new GraphQLError(\"Field \\\"\".concat(fieldName, \"\\\" is not defined by type \\\"\").concat(type.name, \"\\\".\") + didYouMean(suggestions)));\n }\n }\n\n return coercedValue;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isLeafType(type)) {\n var parseResult; // Scalars and Enums determine if a input value is valid via parseValue(),\n // which can throw to indicate failure. If it throws, maintain a reference\n // to the original error.\n\n try {\n parseResult = type.parseValue(inputValue);\n } catch (error) {\n if (error instanceof GraphQLError) {\n onError(pathToArray(path), inputValue, error);\n } else {\n onError(pathToArray(path), inputValue, new GraphQLError(\"Expected type \\\"\".concat(type.name, \"\\\". \") + error.message, undefined, undefined, undefined, undefined, error));\n }\n\n return;\n }\n\n if (parseResult === undefined) {\n onError(pathToArray(path), inputValue, new GraphQLError(\"Expected type \\\"\".concat(type.name, \"\\\".\")));\n }\n\n return parseResult;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || invariant(0, 'Unexpected input type: ' + inspect(type));\n}\n","import find from \"../polyfills/find.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport printPathArray from \"../jsutils/printPathArray.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { isInputType, isNonNullType } from \"../type/definition.mjs\";\nimport { typeFromAST } from \"../utilities/typeFromAST.mjs\";\nimport { valueFromAST } from \"../utilities/valueFromAST.mjs\";\nimport { coerceInputValue } from \"../utilities/coerceInputValue.mjs\";\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n *\n * @internal\n */\nexport function getVariableValues(schema, varDefNodes, inputs, options) {\n var errors = [];\n var maxErrors = options === null || options === void 0 ? void 0 : options.maxErrors;\n\n try {\n var coerced = coerceVariableValues(schema, varDefNodes, inputs, function (error) {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError('Too many errors processing variables, error limit reached. Execution aborted.');\n }\n\n errors.push(error);\n });\n\n if (errors.length === 0) {\n return {\n coerced: coerced\n };\n }\n } catch (error) {\n errors.push(error);\n }\n\n return {\n errors: errors\n };\n}\n\nfunction coerceVariableValues(schema, varDefNodes, inputs, onError) {\n var coercedValues = {};\n\n var _loop = function _loop(_i2) {\n var varDefNode = varDefNodes[_i2];\n var varName = varDefNode.variable.name.value;\n var varType = typeFromAST(schema, varDefNode.type);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n var varTypeStr = print(varDefNode.type);\n onError(new GraphQLError(\"Variable \\\"$\".concat(varName, \"\\\" expected value of type \\\"\").concat(varTypeStr, \"\\\" which cannot be used as an input type.\"), varDefNode.type));\n return \"continue\";\n }\n\n if (!hasOwnProperty(inputs, varName)) {\n if (varDefNode.defaultValue) {\n coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);\n } else if (isNonNullType(varType)) {\n var _varTypeStr = inspect(varType);\n\n onError(new GraphQLError(\"Variable \\\"$\".concat(varName, \"\\\" of required type \\\"\").concat(_varTypeStr, \"\\\" was not provided.\"), varDefNode));\n }\n\n return \"continue\";\n }\n\n var value = inputs[varName];\n\n if (value === null && isNonNullType(varType)) {\n var _varTypeStr2 = inspect(varType);\n\n onError(new GraphQLError(\"Variable \\\"$\".concat(varName, \"\\\" of non-null type \\\"\").concat(_varTypeStr2, \"\\\" must not be null.\"), varDefNode));\n return \"continue\";\n }\n\n coercedValues[varName] = coerceInputValue(value, varType, function (path, invalidValue, error) {\n var prefix = \"Variable \\\"$\".concat(varName, \"\\\" got invalid value \") + inspect(invalidValue);\n\n if (path.length > 0) {\n prefix += \" at \\\"\".concat(varName).concat(printPathArray(path), \"\\\"\");\n }\n\n onError(new GraphQLError(prefix + '; ' + error.message, varDefNode, undefined, undefined, undefined, error.originalError));\n });\n };\n\n for (var _i2 = 0; _i2 < varDefNodes.length; _i2++) {\n var _ret = _loop(_i2);\n\n if (_ret === \"continue\") continue;\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n *\n * @internal\n */\n\n\nexport function getArgumentValues(def, node, variableValues) {\n var _node$arguments;\n\n var coercedValues = {}; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n var argumentNodes = (_node$arguments = node.arguments) !== null && _node$arguments !== void 0 ? _node$arguments : [];\n var argNodeMap = keyMap(argumentNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) {\n var argDef = _def$args2[_i4];\n var name = argDef.name;\n var argType = argDef.type;\n var argumentNode = argNodeMap[name];\n\n if (!argumentNode) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(inspect(argType), \"\\\" \") + 'was not provided.', node);\n }\n\n continue;\n }\n\n var valueNode = argumentNode.value;\n var isNull = valueNode.kind === Kind.NULL;\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variableValues == null || !hasOwnProperty(variableValues, variableName)) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(inspect(argType), \"\\\" \") + \"was provided the variable \\\"$\".concat(variableName, \"\\\" which was not provided a runtime value.\"), valueNode);\n }\n\n continue;\n }\n\n isNull = variableValues[variableName] == null;\n }\n\n if (isNull && isNonNullType(argType)) {\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of non-null type \\\"\").concat(inspect(argType), \"\\\" \") + 'must not be null.', valueNode);\n }\n\n var coercedValue = valueFromAST(valueNode, argType, variableValues);\n\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" has invalid value \").concat(print(valueNode), \".\"), valueNode);\n }\n\n coercedValues[name] = coercedValue;\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\n\nexport function getDirectiveValues(directiveDef, node, variableValues) {\n var directiveNode = node.directives && find(node.directives, function (directive) {\n return directive.name.value === directiveDef.name;\n });\n\n if (directiveNode) {\n return getArgumentValues(directiveDef, directiveNode, variableValues);\n }\n}\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport memoize3 from \"../jsutils/memoize3.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport isPromise from \"../jsutils/isPromise.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport safeArrayFrom from \"../jsutils/safeArrayFrom.mjs\";\nimport promiseReduce from \"../jsutils/promiseReduce.mjs\";\nimport promiseForObject from \"../jsutils/promiseForObject.mjs\";\nimport { addPath, pathToArray } from \"../jsutils/Path.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { locatedError } from \"../error/locatedError.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { assertValidSchema } from \"../type/validate.mjs\";\nimport { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from \"../type/introspection.mjs\";\nimport { GraphQLIncludeDirective, GraphQLSkipDirective } from \"../type/directives.mjs\";\nimport { isNamedType, isObjectType, isAbstractType, isLeafType, isListType, isNonNullType } from \"../type/definition.mjs\";\nimport { typeFromAST } from \"../utilities/typeFromAST.mjs\";\nimport { getOperationRootType } from \"../utilities/getOperationRootType.mjs\";\nimport { getVariableValues, getArgumentValues, getDirectiveValues } from \"./values.mjs\";\n/**\n * Terminology\n *\n * \"Definitions\" are the generic name for top-level statements in the document.\n * Examples of this include:\n * 1) Operations (such as a query)\n * 2) Fragments\n *\n * \"Operations\" are a generic name for requests in the document.\n * Examples of this include:\n * 1) query,\n * 2) mutation\n *\n * \"Selections\" are the definitions that can appear legally and at\n * single level of the query. These include:\n * 1) field references e.g \"a\"\n * 2) fragment \"spreads\" e.g. \"...c\"\n * 3) inline fragment \"spreads\" e.g. \"...on Type { a }\"\n */\n\n/**\n * Data that must be available at all points during query execution.\n *\n * Namely, schema of the type system that is currently executing,\n * and the fragments defined in the query document\n */\n\nexport function execute(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {\n /* eslint-enable no-redeclare */\n // Extract arguments from object args if provided.\n return arguments.length === 1 ? executeImpl(argsOrSchema) : executeImpl({\n schema: argsOrSchema,\n document: document,\n rootValue: rootValue,\n contextValue: contextValue,\n variableValues: variableValues,\n operationName: operationName,\n fieldResolver: fieldResolver,\n typeResolver: typeResolver\n });\n}\n/**\n * Also implements the \"Evaluating requests\" section of the GraphQL specification.\n * However, it guarantees to complete synchronously (or throw an error) assuming\n * that all field resolvers are also synchronous.\n */\n\nexport function executeSync(args) {\n var result = executeImpl(args); // Assert that the execution was synchronous.\n\n if (isPromise(result)) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n\nfunction executeImpl(args) {\n var schema = args.schema,\n document = args.document,\n rootValue = args.rootValue,\n contextValue = args.contextValue,\n variableValues = args.variableValues,\n operationName = args.operationName,\n fieldResolver = args.fieldResolver,\n typeResolver = args.typeResolver; // If arguments are missing or incorrect, throw an error.\n\n assertValidExecutionArguments(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments,\n // a \"Response\" with only errors is returned.\n\n var exeContext = buildExecutionContext(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver); // Return early errors if execution context failed.\n\n if (Array.isArray(exeContext)) {\n return {\n errors: exeContext\n };\n } // Return a Promise that will eventually resolve to the data described by\n // The \"Response\" section of the GraphQL specification.\n //\n // If errors are encountered while executing a GraphQL field, only that\n // field and its descendants will be omitted, and sibling fields will still\n // be executed. An execution which encounters errors will still result in a\n // resolved Promise.\n\n\n var data = executeOperation(exeContext, exeContext.operation, rootValue);\n return buildResponse(exeContext, data);\n}\n/**\n * Given a completed execution context and data, build the { errors, data }\n * response defined by the \"Response\" section of the GraphQL specification.\n */\n\n\nfunction buildResponse(exeContext, data) {\n if (isPromise(data)) {\n return data.then(function (resolved) {\n return buildResponse(exeContext, resolved);\n });\n }\n\n return exeContext.errors.length === 0 ? {\n data: data\n } : {\n errors: exeContext.errors,\n data: data\n };\n}\n/**\n * Essential assertions before executing to provide developer feedback for\n * improper use of the GraphQL library.\n *\n * @internal\n */\n\n\nexport function assertValidExecutionArguments(schema, document, rawVariableValues) {\n document || devAssert(0, 'Must provide document.'); // If the schema used for execution is invalid, throw an error.\n\n assertValidSchema(schema); // Variables, if provided, must be an object.\n\n rawVariableValues == null || isObjectLike(rawVariableValues) || devAssert(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.');\n}\n/**\n * Constructs a ExecutionContext object from the arguments passed to\n * execute, which we will pass throughout the other execution methods.\n *\n * Throws a GraphQLError if a valid execution context cannot be created.\n *\n * @internal\n */\n\nexport function buildExecutionContext(schema, document, rootValue, contextValue, rawVariableValues, operationName, fieldResolver, typeResolver) {\n var _definition$name, _operation$variableDe;\n\n var operation;\n var fragments = Object.create(null);\n\n for (var _i2 = 0, _document$definitions2 = document.definitions; _i2 < _document$definitions2.length; _i2++) {\n var definition = _document$definitions2[_i2];\n\n switch (definition.kind) {\n case Kind.OPERATION_DEFINITION:\n if (operationName == null) {\n if (operation !== undefined) {\n return [new GraphQLError('Must provide operation name if query contains multiple operations.')];\n }\n\n operation = definition;\n } else if (((_definition$name = definition.name) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) {\n operation = definition;\n }\n\n break;\n\n case Kind.FRAGMENT_DEFINITION:\n fragments[definition.name.value] = definition;\n break;\n }\n }\n\n if (!operation) {\n if (operationName != null) {\n return [new GraphQLError(\"Unknown operation named \\\"\".concat(operationName, \"\\\".\"))];\n }\n\n return [new GraphQLError('Must provide an operation.')];\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n\n var variableDefinitions = (_operation$variableDe = operation.variableDefinitions) !== null && _operation$variableDe !== void 0 ? _operation$variableDe : [];\n var coercedVariableValues = getVariableValues(schema, variableDefinitions, rawVariableValues !== null && rawVariableValues !== void 0 ? rawVariableValues : {}, {\n maxErrors: 50\n });\n\n if (coercedVariableValues.errors) {\n return coercedVariableValues.errors;\n }\n\n return {\n schema: schema,\n fragments: fragments,\n rootValue: rootValue,\n contextValue: contextValue,\n operation: operation,\n variableValues: coercedVariableValues.coerced,\n fieldResolver: fieldResolver !== null && fieldResolver !== void 0 ? fieldResolver : defaultFieldResolver,\n typeResolver: typeResolver !== null && typeResolver !== void 0 ? typeResolver : defaultTypeResolver,\n errors: []\n };\n}\n/**\n * Implements the \"Evaluating operations\" section of the spec.\n */\n\nfunction executeOperation(exeContext, operation, rootValue) {\n var type = getOperationRootType(exeContext.schema, operation);\n var fields = collectFields(exeContext, type, operation.selectionSet, Object.create(null), Object.create(null));\n var path = undefined; // Errors from sub-fields of a NonNull type may propagate to the top level,\n // at which point we still log the error and null the parent field, which\n // in this case is the entire response.\n\n try {\n var result = operation.operation === 'mutation' ? executeFieldsSerially(exeContext, type, rootValue, path, fields) : executeFields(exeContext, type, rootValue, path, fields);\n\n if (isPromise(result)) {\n return result.then(undefined, function (error) {\n exeContext.errors.push(error);\n return Promise.resolve(null);\n });\n }\n\n return result;\n } catch (error) {\n exeContext.errors.push(error);\n return null;\n }\n}\n/**\n * Implements the \"Evaluating selection sets\" section of the spec\n * for \"write\" mode.\n */\n\n\nfunction executeFieldsSerially(exeContext, parentType, sourceValue, path, fields) {\n return promiseReduce(Object.keys(fields), function (results, responseName) {\n var fieldNodes = fields[responseName];\n var fieldPath = addPath(path, responseName, parentType.name);\n var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath);\n\n if (result === undefined) {\n return results;\n }\n\n if (isPromise(result)) {\n return result.then(function (resolvedResult) {\n results[responseName] = resolvedResult;\n return results;\n });\n }\n\n results[responseName] = result;\n return results;\n }, Object.create(null));\n}\n/**\n * Implements the \"Evaluating selection sets\" section of the spec\n * for \"read\" mode.\n */\n\n\nfunction executeFields(exeContext, parentType, sourceValue, path, fields) {\n var results = Object.create(null);\n var containsPromise = false;\n\n for (var _i4 = 0, _Object$keys2 = Object.keys(fields); _i4 < _Object$keys2.length; _i4++) {\n var responseName = _Object$keys2[_i4];\n var fieldNodes = fields[responseName];\n var fieldPath = addPath(path, responseName, parentType.name);\n var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath);\n\n if (result !== undefined) {\n results[responseName] = result;\n\n if (isPromise(result)) {\n containsPromise = true;\n }\n }\n } // If there are no promises, we can just return the object\n\n\n if (!containsPromise) {\n return results;\n } // Otherwise, results is a map from field name to the result of resolving that\n // field, which is possibly a promise. Return a promise that will return this\n // same map, but with any promises replaced with the values they resolved to.\n\n\n return promiseForObject(results);\n}\n/**\n * Given a selectionSet, adds all of the fields in that selection to\n * the passed in map of fields, and returns it at the end.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field which\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * Object type returned by that field.\n *\n * @internal\n */\n\n\nexport function collectFields(exeContext, runtimeType, selectionSet, fields, visitedFragmentNames) {\n for (var _i6 = 0, _selectionSet$selecti2 = selectionSet.selections; _i6 < _selectionSet$selecti2.length; _i6++) {\n var selection = _selectionSet$selecti2[_i6];\n\n switch (selection.kind) {\n case Kind.FIELD:\n {\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n\n var name = getFieldEntryKey(selection);\n\n if (!fields[name]) {\n fields[name] = [];\n }\n\n fields[name].push(selection);\n break;\n }\n\n case Kind.INLINE_FRAGMENT:\n {\n if (!shouldIncludeNode(exeContext, selection) || !doesFragmentConditionMatch(exeContext, selection, runtimeType)) {\n continue;\n }\n\n collectFields(exeContext, runtimeType, selection.selectionSet, fields, visitedFragmentNames);\n break;\n }\n\n case Kind.FRAGMENT_SPREAD:\n {\n var fragName = selection.name.value;\n\n if (visitedFragmentNames[fragName] || !shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n\n visitedFragmentNames[fragName] = true;\n var fragment = exeContext.fragments[fragName];\n\n if (!fragment || !doesFragmentConditionMatch(exeContext, fragment, runtimeType)) {\n continue;\n }\n\n collectFields(exeContext, runtimeType, fragment.selectionSet, fields, visitedFragmentNames);\n break;\n }\n }\n }\n\n return fields;\n}\n/**\n * Determines if a field should be included based on the @include and @skip\n * directives, where @skip has higher precedence than @include.\n */\n\nfunction shouldIncludeNode(exeContext, node) {\n var skip = getDirectiveValues(GraphQLSkipDirective, node, exeContext.variableValues);\n\n if ((skip === null || skip === void 0 ? void 0 : skip.if) === true) {\n return false;\n }\n\n var include = getDirectiveValues(GraphQLIncludeDirective, node, exeContext.variableValues);\n\n if ((include === null || include === void 0 ? void 0 : include.if) === false) {\n return false;\n }\n\n return true;\n}\n/**\n * Determines if a fragment is applicable to the given type.\n */\n\n\nfunction doesFragmentConditionMatch(exeContext, fragment, type) {\n var typeConditionNode = fragment.typeCondition;\n\n if (!typeConditionNode) {\n return true;\n }\n\n var conditionalType = typeFromAST(exeContext.schema, typeConditionNode);\n\n if (conditionalType === type) {\n return true;\n }\n\n if (isAbstractType(conditionalType)) {\n return exeContext.schema.isSubType(conditionalType, type);\n }\n\n return false;\n}\n/**\n * Implements the logic to compute the key of a given field's entry\n */\n\n\nfunction getFieldEntryKey(node) {\n return node.alias ? node.alias.value : node.name.value;\n}\n/**\n * Resolves the field on the given source object. In particular, this\n * figures out the value that the field returns by calling its resolve function,\n * then calls completeValue to complete promises, serialize scalars, or execute\n * the sub-selection-set for objects.\n */\n\n\nfunction resolveField(exeContext, parentType, source, fieldNodes, path) {\n var _fieldDef$resolve;\n\n var fieldNode = fieldNodes[0];\n var fieldName = fieldNode.name.value;\n var fieldDef = getFieldDef(exeContext.schema, parentType, fieldName);\n\n if (!fieldDef) {\n return;\n }\n\n var returnType = fieldDef.type;\n var resolveFn = (_fieldDef$resolve = fieldDef.resolve) !== null && _fieldDef$resolve !== void 0 ? _fieldDef$resolve : exeContext.fieldResolver;\n var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path); // Get the resolve function, regardless of if its result is normal or abrupt (error).\n\n try {\n // Build a JS object of arguments from the field.arguments AST, using the\n // variables scope to fulfill any variable references.\n // TODO: find a way to memoize, in case this field is within a List type.\n var args = getArgumentValues(fieldDef, fieldNodes[0], exeContext.variableValues); // The resolve function's optional third argument is a context value that\n // is provided to every resolve function within an execution. It is commonly\n // used to represent an authenticated user, or request-specific caches.\n\n var _contextValue = exeContext.contextValue;\n var result = resolveFn(source, args, _contextValue, info);\n var completed;\n\n if (isPromise(result)) {\n completed = result.then(function (resolved) {\n return completeValue(exeContext, returnType, fieldNodes, info, path, resolved);\n });\n } else {\n completed = completeValue(exeContext, returnType, fieldNodes, info, path, result);\n }\n\n if (isPromise(completed)) {\n // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n return completed.then(undefined, function (rawError) {\n var error = locatedError(rawError, fieldNodes, pathToArray(path));\n return handleFieldError(error, returnType, exeContext);\n });\n }\n\n return completed;\n } catch (rawError) {\n var error = locatedError(rawError, fieldNodes, pathToArray(path));\n return handleFieldError(error, returnType, exeContext);\n }\n}\n/**\n * @internal\n */\n\n\nexport function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path) {\n // The resolve function's optional fourth argument is a collection of\n // information about the current execution state.\n return {\n fieldName: fieldDef.name,\n fieldNodes: fieldNodes,\n returnType: fieldDef.type,\n parentType: parentType,\n path: path,\n schema: exeContext.schema,\n fragments: exeContext.fragments,\n rootValue: exeContext.rootValue,\n operation: exeContext.operation,\n variableValues: exeContext.variableValues\n };\n}\n\nfunction handleFieldError(error, returnType, exeContext) {\n // If the field type is non-nullable, then it is resolved without any\n // protection from errors, however it still properly locates the error.\n if (isNonNullType(returnType)) {\n throw error;\n } // Otherwise, error protection is applied, logging the error and resolving\n // a null value for this field if one is encountered.\n\n\n exeContext.errors.push(error);\n return null;\n}\n/**\n * Implements the instructions for completeValue as defined in the\n * \"Field entries\" section of the spec.\n *\n * If the field type is Non-Null, then this recursively completes the value\n * for the inner type. It throws a field error if that completion returns null,\n * as per the \"Nullability\" section of the spec.\n *\n * If the field type is a List, then this recursively completes the value\n * for the inner type on each item in the list.\n *\n * If the field type is a Scalar or Enum, ensures the completed value is a legal\n * value of the type by calling the `serialize` method of GraphQL type\n * definition.\n *\n * If the field is an abstract type, determine the runtime type of the value\n * and then complete based on that type\n *\n * Otherwise, the field type expects a sub-selection set, and will complete the\n * value by evaluating all sub-selections.\n */\n\n\nfunction completeValue(exeContext, returnType, fieldNodes, info, path, result) {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n } // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n\n\n if (isNonNullType(returnType)) {\n var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result);\n\n if (completed === null) {\n throw new Error(\"Cannot return null for non-nullable field \".concat(info.parentType.name, \".\").concat(info.fieldName, \".\"));\n }\n\n return completed;\n } // If result value is null or undefined then return null.\n\n\n if (result == null) {\n return null;\n } // If field type is List, complete each item in the list with the inner type\n\n\n if (isListType(returnType)) {\n return completeListValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is a leaf type, Scalar or Enum, serialize to a valid value,\n // returning null if serialization is not possible.\n\n\n if (isLeafType(returnType)) {\n return completeLeafValue(returnType, result);\n } // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n\n\n if (isAbstractType(returnType)) {\n return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is Object, execute and complete all sub-selections.\n // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isObjectType(returnType)) {\n return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result);\n } // istanbul ignore next (Not reachable. All possible output types have been considered)\n\n\n false || invariant(0, 'Cannot complete value of unexpected output type: ' + inspect(returnType));\n}\n/**\n * Complete a list value by completing each item in the list with the\n * inner type\n */\n\n\nfunction completeListValue(exeContext, returnType, fieldNodes, info, path, result) {\n // This is specified as a simple map, however we're optimizing the path\n // where the list contains no Promises by avoiding creating another Promise.\n var itemType = returnType.ofType;\n var containsPromise = false;\n var completedResults = safeArrayFrom(result, function (item, index) {\n // No need to modify the info object containing the path,\n // since from here on it is not ever accessed by resolver functions.\n var itemPath = addPath(path, index, undefined);\n\n try {\n var completedItem;\n\n if (isPromise(item)) {\n completedItem = item.then(function (resolved) {\n return completeValue(exeContext, itemType, fieldNodes, info, itemPath, resolved);\n });\n } else {\n completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item);\n }\n\n if (isPromise(completedItem)) {\n containsPromise = true; // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n\n return completedItem.then(undefined, function (rawError) {\n var error = locatedError(rawError, fieldNodes, pathToArray(itemPath));\n return handleFieldError(error, itemType, exeContext);\n });\n }\n\n return completedItem;\n } catch (rawError) {\n var error = locatedError(rawError, fieldNodes, pathToArray(itemPath));\n return handleFieldError(error, itemType, exeContext);\n }\n });\n\n if (completedResults == null) {\n throw new GraphQLError(\"Expected Iterable, but did not find one for field \\\"\".concat(info.parentType.name, \".\").concat(info.fieldName, \"\\\".\"));\n }\n\n return containsPromise ? Promise.all(completedResults) : completedResults;\n}\n/**\n * Complete a Scalar or Enum by serializing to a valid value, returning\n * null if serialization is not possible.\n */\n\n\nfunction completeLeafValue(returnType, result) {\n var serializedResult = returnType.serialize(result);\n\n if (serializedResult === undefined) {\n throw new Error(\"Expected a value of type \\\"\".concat(inspect(returnType), \"\\\" but \") + \"received: \".concat(inspect(result)));\n }\n\n return serializedResult;\n}\n/**\n * Complete a value of an abstract type by determining the runtime object type\n * of that value, then complete the value for that type.\n */\n\n\nfunction completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result) {\n var _returnType$resolveTy;\n\n var resolveTypeFn = (_returnType$resolveTy = returnType.resolveType) !== null && _returnType$resolveTy !== void 0 ? _returnType$resolveTy : exeContext.typeResolver;\n var contextValue = exeContext.contextValue;\n var runtimeType = resolveTypeFn(result, contextValue, info, returnType);\n\n if (isPromise(runtimeType)) {\n return runtimeType.then(function (resolvedRuntimeType) {\n return completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result);\n });\n }\n\n return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result);\n}\n\nfunction ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes, info, result) {\n if (runtimeTypeOrName == null) {\n throw new GraphQLError(\"Abstract type \\\"\".concat(returnType.name, \"\\\" must resolve to an Object type at runtime for field \\\"\").concat(info.parentType.name, \".\").concat(info.fieldName, \"\\\". Either the \\\"\").concat(returnType.name, \"\\\" type should provide a \\\"resolveType\\\" function or each possible type should provide an \\\"isTypeOf\\\" function.\"), fieldNodes);\n } // FIXME: temporary workaround until support for passing object types would be removed in v16.0.0\n\n\n var runtimeTypeName = isNamedType(runtimeTypeOrName) ? runtimeTypeOrName.name : runtimeTypeOrName;\n\n if (typeof runtimeTypeName !== 'string') {\n throw new GraphQLError(\"Abstract type \\\"\".concat(returnType.name, \"\\\" must resolve to an Object type at runtime for field \\\"\").concat(info.parentType.name, \".\").concat(info.fieldName, \"\\\" with \") + \"value \".concat(inspect(result), \", received \\\"\").concat(inspect(runtimeTypeOrName), \"\\\".\"));\n }\n\n var runtimeType = exeContext.schema.getType(runtimeTypeName);\n\n if (runtimeType == null) {\n throw new GraphQLError(\"Abstract type \\\"\".concat(returnType.name, \"\\\" was resolve to a type \\\"\").concat(runtimeTypeName, \"\\\" that does not exist inside schema.\"), fieldNodes);\n }\n\n if (!isObjectType(runtimeType)) {\n throw new GraphQLError(\"Abstract type \\\"\".concat(returnType.name, \"\\\" was resolve to a non-object type \\\"\").concat(runtimeTypeName, \"\\\".\"), fieldNodes);\n }\n\n if (!exeContext.schema.isSubType(returnType, runtimeType)) {\n throw new GraphQLError(\"Runtime Object type \\\"\".concat(runtimeType.name, \"\\\" is not a possible type for \\\"\").concat(returnType.name, \"\\\".\"), fieldNodes);\n }\n\n return runtimeType;\n}\n/**\n * Complete an Object value by executing all sub-selections.\n */\n\n\nfunction completeObjectValue(exeContext, returnType, fieldNodes, info, path, result) {\n // If there is an isTypeOf predicate function, call it with the\n // current result. If isTypeOf returns false, then raise an error rather\n // than continuing execution.\n if (returnType.isTypeOf) {\n var isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info);\n\n if (isPromise(isTypeOf)) {\n return isTypeOf.then(function (resolvedIsTypeOf) {\n if (!resolvedIsTypeOf) {\n throw invalidReturnTypeError(returnType, result, fieldNodes);\n }\n\n return collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result);\n });\n }\n\n if (!isTypeOf) {\n throw invalidReturnTypeError(returnType, result, fieldNodes);\n }\n }\n\n return collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result);\n}\n\nfunction invalidReturnTypeError(returnType, result, fieldNodes) {\n return new GraphQLError(\"Expected value of type \\\"\".concat(returnType.name, \"\\\" but got: \").concat(inspect(result), \".\"), fieldNodes);\n}\n\nfunction collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result) {\n // Collect sub-fields to execute to complete this value.\n var subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes);\n return executeFields(exeContext, returnType, result, path, subFieldNodes);\n}\n/**\n * A memoized collection of relevant subfields with regard to the return\n * type. Memoizing ensures the subfields are not repeatedly calculated, which\n * saves overhead when resolving lists of values.\n */\n\n\nvar collectSubfields = memoize3(_collectSubfields);\n\nfunction _collectSubfields(exeContext, returnType, fieldNodes) {\n var subFieldNodes = Object.create(null);\n var visitedFragmentNames = Object.create(null);\n\n for (var _i8 = 0; _i8 < fieldNodes.length; _i8++) {\n var node = fieldNodes[_i8];\n\n if (node.selectionSet) {\n subFieldNodes = collectFields(exeContext, returnType, node.selectionSet, subFieldNodes, visitedFragmentNames);\n }\n }\n\n return subFieldNodes;\n}\n/**\n * If a resolveType function is not given, then a default resolve behavior is\n * used which attempts two strategies:\n *\n * First, See if the provided value has a `__typename` field defined, if so, use\n * that value as name of the resolved type.\n *\n * Otherwise, test each possible type for the abstract type by calling\n * isTypeOf for the object being coerced, returning the first type that matches.\n */\n\n\nexport var defaultTypeResolver = function defaultTypeResolver(value, contextValue, info, abstractType) {\n // First, look for `__typename`.\n if (isObjectLike(value) && typeof value.__typename === 'string') {\n return value.__typename;\n } // Otherwise, test each possible type.\n\n\n var possibleTypes = info.schema.getPossibleTypes(abstractType);\n var promisedIsTypeOfResults = [];\n\n for (var i = 0; i < possibleTypes.length; i++) {\n var type = possibleTypes[i];\n\n if (type.isTypeOf) {\n var isTypeOfResult = type.isTypeOf(value, contextValue, info);\n\n if (isPromise(isTypeOfResult)) {\n promisedIsTypeOfResults[i] = isTypeOfResult;\n } else if (isTypeOfResult) {\n return type.name;\n }\n }\n }\n\n if (promisedIsTypeOfResults.length) {\n return Promise.all(promisedIsTypeOfResults).then(function (isTypeOfResults) {\n for (var _i9 = 0; _i9 < isTypeOfResults.length; _i9++) {\n if (isTypeOfResults[_i9]) {\n return possibleTypes[_i9].name;\n }\n }\n });\n }\n};\n/**\n * If a resolve function is not given, then a default resolve behavior is used\n * which takes the property of the source object of the same name as the field\n * and returns it as the result, or if it's a function, returns the result\n * of calling that function while passing along args and context value.\n */\n\nexport var defaultFieldResolver = function defaultFieldResolver(source, args, contextValue, info) {\n // ensure source is a value for which property access is acceptable.\n if (isObjectLike(source) || typeof source === 'function') {\n var property = source[info.fieldName];\n\n if (typeof property === 'function') {\n return source[info.fieldName](args, contextValue, info);\n }\n\n return property;\n }\n};\n/**\n * This method looks up the field on the given type definition.\n * It has special casing for the three introspection fields,\n * __schema, __type and __typename. __typename is special because\n * it can always be queried as a field, even in situations where no\n * other fields are allowed, like on a Union. __schema and __type\n * could get automatically added to the query type, but that would\n * require mutating type definitions, which would cause issues.\n *\n * @internal\n */\n\nexport function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n return SchemaMetaFieldDef;\n } else if (fieldName === TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return TypeMetaFieldDef;\n } else if (fieldName === TypeNameMetaFieldDef.name) {\n return TypeNameMetaFieldDef;\n }\n\n return parentType.getFields()[fieldName];\n}\n","import isPromise from \"./jsutils/isPromise.mjs\";\nimport { parse } from \"./language/parser.mjs\";\nimport { validate } from \"./validation/validate.mjs\";\nimport { validateSchema } from \"./type/validate.mjs\";\nimport { execute } from \"./execution/execute.mjs\";\n/**\n * This is the primary entry point function for fulfilling GraphQL operations\n * by parsing, validating, and executing a GraphQL document along side a\n * GraphQL schema.\n *\n * More sophisticated GraphQL servers, such as those which persist queries,\n * may wish to separate the validation and execution phases to a static time\n * tooling step, and a server runtime step.\n *\n * Accepts either an object with named arguments, or individual arguments:\n *\n * schema:\n * The GraphQL type system to use when validating and executing a query.\n * source:\n * A GraphQL language formatted string representing the requested operation.\n * rootValue:\n * The value provided as the first argument to resolver functions on the top\n * level type (e.g. the query object type).\n * contextValue:\n * The context value is provided as an argument to resolver functions after\n * field arguments. It is used to pass shared information useful at any point\n * during executing this query, for example the currently logged in user and\n * connections to databases or other services.\n * variableValues:\n * A mapping of variable name to runtime value to use for all variables\n * defined in the requestString.\n * operationName:\n * The name of the operation to use if requestString contains multiple\n * possible operations. Can be omitted if requestString contains only\n * one operation.\n * fieldResolver:\n * A resolver function to use when one is not provided by the schema.\n * If not provided, the default field resolver is used (which looks for a\n * value or method on the source value with the field's name).\n * typeResolver:\n * A type resolver function to use when none is provided by the schema.\n * If not provided, the default type resolver is used (which looks for a\n * `__typename` field or alternatively calls the `isTypeOf` method).\n */\n\nexport function graphql(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {\n var _arguments = arguments;\n\n /* eslint-enable no-redeclare */\n // Always return a Promise for a consistent API.\n return new Promise(function (resolve) {\n return resolve( // Extract arguments from object args if provided.\n _arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({\n schema: argsOrSchema,\n source: source,\n rootValue: rootValue,\n contextValue: contextValue,\n variableValues: variableValues,\n operationName: operationName,\n fieldResolver: fieldResolver,\n typeResolver: typeResolver\n }));\n });\n}\n/**\n * The graphqlSync function also fulfills GraphQL operations by parsing,\n * validating, and executing a GraphQL document along side a GraphQL schema.\n * However, it guarantees to complete synchronously (or throw an error) assuming\n * that all field resolvers are also synchronous.\n */\n\nexport function graphqlSync(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {\n /* eslint-enable no-redeclare */\n // Extract arguments from object args if provided.\n var result = arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({\n schema: argsOrSchema,\n source: source,\n rootValue: rootValue,\n contextValue: contextValue,\n variableValues: variableValues,\n operationName: operationName,\n fieldResolver: fieldResolver,\n typeResolver: typeResolver\n }); // Assert that the execution was synchronous.\n\n if (isPromise(result)) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n\nfunction graphqlImpl(args) {\n var schema = args.schema,\n source = args.source,\n rootValue = args.rootValue,\n contextValue = args.contextValue,\n variableValues = args.variableValues,\n operationName = args.operationName,\n fieldResolver = args.fieldResolver,\n typeResolver = args.typeResolver; // Validate Schema\n\n var schemaValidationErrors = validateSchema(schema);\n\n if (schemaValidationErrors.length > 0) {\n return {\n errors: schemaValidationErrors\n };\n } // Parse\n\n\n var document;\n\n try {\n document = parse(source);\n } catch (syntaxError) {\n return {\n errors: [syntaxError]\n };\n } // Validate\n\n\n var validationErrors = validate(schema, document);\n\n if (validationErrors.length > 0) {\n return {\n errors: validationErrors\n };\n } // Execute\n\n\n return execute({\n schema: schema,\n document: document,\n rootValue: rootValue,\n contextValue: contextValue,\n variableValues: variableValues,\n operationName: operationName,\n fieldResolver: fieldResolver,\n typeResolver: typeResolver\n });\n}\n","export { // Predicate\nisSchema // Assertion\n, assertSchema // GraphQL Schema definition\n, GraphQLSchema } from \"./schema.mjs\";\nexport { // Predicates\nisType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField // Assertions\n, assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType // Un-modifiers\n, getNullableType, getNamedType // Definitions\n, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType // Type Wrappers\n, GraphQLList, GraphQLNonNull } from \"./definition.mjs\";\nexport { // Predicate\nisDirective // Assertion\n, assertDirective // Directives Definition\n, GraphQLDirective // Built-in Directives defined by the Spec\n, isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective // Constant Deprecation Reason\n, DEFAULT_DEPRECATION_REASON } from \"./directives.mjs\";\n// Common built-in scalar instances.\nexport { // Predicate\nisSpecifiedScalarType // Standard GraphQL Scalars\n, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID } from \"./scalars.mjs\";\nexport { // Predicate\nisIntrospectionType // GraphQL Types for introspection.\n, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind // \"Enum\" of Type Kinds\n, TypeKind // Meta-field definitions.\n, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from \"./introspection.mjs\";\n// Validate GraphQL schema.\nexport { validateSchema, assertValidSchema } from \"./validate.mjs\";\n","export { Source } from \"./source.mjs\";\nexport { getLocation } from \"./location.mjs\";\nexport { printLocation, printSourceLocation } from \"./printLocation.mjs\";\nexport { Kind } from \"./kinds.mjs\";\nexport { TokenKind } from \"./tokenKind.mjs\";\nexport { Lexer } from \"./lexer.mjs\";\nexport { parse, parseValue, parseType } from \"./parser.mjs\";\nexport { print } from \"./printer.mjs\";\nexport { visit, visitInParallel, getVisitFn, BREAK } from \"./visitor.mjs\";\nexport { Location, Token } from \"./ast.mjs\";\nexport { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from \"./predicates.mjs\";\nexport { DirectiveLocation } from \"./directiveLocation.mjs\";\n","export { pathToArray as responsePathAsArray } from \"../jsutils/Path.mjs\";\nexport { execute, executeSync, defaultFieldResolver, defaultTypeResolver } from \"./execute.mjs\";\nexport { getDirectiveValues } from \"./values.mjs\";\n","import { SYMBOL_ASYNC_ITERATOR } from \"../polyfills/symbols.mjs\";\n/**\n * Returns true if the provided object implements the AsyncIterator protocol via\n * either implementing a `Symbol.asyncIterator` or `\"@@asyncIterator\"` method.\n */\n\n// eslint-disable-next-line no-redeclare\nexport default function isAsyncIterable(maybeAsyncIterable) {\n return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[SYMBOL_ASYNC_ITERATOR]) === 'function';\n}\n","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { SYMBOL_ASYNC_ITERATOR } from \"../polyfills/symbols.mjs\";\n\n/**\n * Given an AsyncIterable and a callback function, return an AsyncIterator\n * which produces values mapped via calling the callback function.\n */\nexport default function mapAsyncIterator(iterable, callback, rejectCallback) {\n // $FlowFixMe[prop-missing]\n var iteratorMethod = iterable[SYMBOL_ASYNC_ITERATOR];\n var iterator = iteratorMethod.call(iterable);\n var $return;\n var abruptClose;\n\n if (typeof iterator.return === 'function') {\n $return = iterator.return;\n\n abruptClose = function abruptClose(error) {\n var rethrow = function rethrow() {\n return Promise.reject(error);\n };\n\n return $return.call(iterator).then(rethrow, rethrow);\n };\n }\n\n function mapResult(result) {\n return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);\n }\n\n var mapReject;\n\n if (rejectCallback) {\n // Capture rejectCallback to ensure it cannot be null.\n var reject = rejectCallback;\n\n mapReject = function mapReject(error) {\n return asyncMapValue(error, reject).then(iteratorResult, abruptClose);\n };\n }\n /* TODO: Flow doesn't support symbols as keys:\n https://github.com/facebook/flow/issues/3258 */\n\n\n return _defineProperty({\n next: function next() {\n return iterator.next().then(mapResult, mapReject);\n },\n return: function _return() {\n return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({\n value: undefined,\n done: true\n });\n },\n throw: function _throw(error) {\n if (typeof iterator.throw === 'function') {\n return iterator.throw(error).then(mapResult, mapReject);\n }\n\n return Promise.reject(error).catch(abruptClose);\n }\n }, SYMBOL_ASYNC_ITERATOR, function () {\n return this;\n });\n}\n\nfunction asyncMapValue(value, callback) {\n return new Promise(function (resolve) {\n return resolve(callback(value));\n });\n}\n\nfunction iteratorResult(value) {\n return {\n value: value,\n done: false\n };\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport isAsyncIterable from \"../jsutils/isAsyncIterable.mjs\";\nimport { addPath, pathToArray } from \"../jsutils/Path.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { locatedError } from \"../error/locatedError.mjs\";\nimport { getArgumentValues } from \"../execution/values.mjs\";\nimport { assertValidExecutionArguments, buildExecutionContext, buildResolveInfo, collectFields, execute, getFieldDef } from \"../execution/execute.mjs\";\nimport { getOperationRootType } from \"../utilities/getOperationRootType.mjs\";\nimport mapAsyncIterator from \"./mapAsyncIterator.mjs\";\nexport function subscribe(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver) {\n /* eslint-enable no-redeclare */\n // Extract arguments from object args if provided.\n return arguments.length === 1 ? subscribeImpl(argsOrSchema) : subscribeImpl({\n schema: argsOrSchema,\n document: document,\n rootValue: rootValue,\n contextValue: contextValue,\n variableValues: variableValues,\n operationName: operationName,\n fieldResolver: fieldResolver,\n subscribeFieldResolver: subscribeFieldResolver\n });\n}\n/**\n * This function checks if the error is a GraphQLError. If it is, report it as\n * an ExecutionResult, containing only errors and no data. Otherwise treat the\n * error as a system-class error and re-throw it.\n */\n\nfunction reportGraphQLError(error) {\n if (error instanceof GraphQLError) {\n return {\n errors: [error]\n };\n }\n\n throw error;\n}\n\nfunction subscribeImpl(args) {\n var schema = args.schema,\n document = args.document,\n rootValue = args.rootValue,\n contextValue = args.contextValue,\n variableValues = args.variableValues,\n operationName = args.operationName,\n fieldResolver = args.fieldResolver,\n subscribeFieldResolver = args.subscribeFieldResolver;\n var sourcePromise = createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver); // For each payload yielded from a subscription, map it over the normal\n // GraphQL `execute` function, with `payload` as the rootValue.\n // This implements the \"MapSourceToResponseEvent\" algorithm described in\n // the GraphQL specification. The `execute` function provides the\n // \"ExecuteSubscriptionEvent\" algorithm, as it is nearly identical to the\n // \"ExecuteQuery\" algorithm, for which `execute` is also used.\n\n var mapSourceToResponse = function mapSourceToResponse(payload) {\n return execute({\n schema: schema,\n document: document,\n rootValue: payload,\n contextValue: contextValue,\n variableValues: variableValues,\n operationName: operationName,\n fieldResolver: fieldResolver\n });\n }; // Resolve the Source Stream, then map every source value to a\n // ExecutionResult value as described above.\n\n\n return sourcePromise.then(function (resultOrStream) {\n return (// Note: Flow can't refine isAsyncIterable, so explicit casts are used.\n isAsyncIterable(resultOrStream) ? mapAsyncIterator(resultOrStream, mapSourceToResponse, reportGraphQLError) : resultOrStream\n );\n });\n}\n/**\n * Implements the \"CreateSourceEventStream\" algorithm described in the\n * GraphQL specification, resolving the subscription source event stream.\n *\n * Returns a Promise which resolves to either an AsyncIterable (if successful)\n * or an ExecutionResult (error). The promise will be rejected if the schema or\n * other arguments to this function are invalid, or if the resolved event stream\n * is not an async iterable.\n *\n * If the client-provided arguments to this function do not result in a\n * compliant subscription, a GraphQL Response (ExecutionResult) with\n * descriptive errors and no data will be returned.\n *\n * If the the source stream could not be created due to faulty subscription\n * resolver logic or underlying systems, the promise will resolve to a single\n * ExecutionResult containing `errors` and no `data`.\n *\n * If the operation succeeded, the promise resolves to the AsyncIterable for the\n * event stream returned by the resolver.\n *\n * A Source Event Stream represents a sequence of events, each of which triggers\n * a GraphQL execution for that event.\n *\n * This may be useful when hosting the stateful subscription service in a\n * different process or machine than the stateless GraphQL execution engine,\n * or otherwise separating these two steps. For more on this, see the\n * \"Supporting Subscriptions at Scale\" information in the GraphQL specification.\n */\n\n\nexport function createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver) {\n // If arguments are missing or incorrectly typed, this is an internal\n // developer mistake which should throw an early error.\n assertValidExecutionArguments(schema, document, variableValues);\n return new Promise(function (resolve) {\n // If a valid context cannot be created due to incorrect arguments,\n // this will throw an error.\n var exeContext = buildExecutionContext(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver);\n resolve( // Return early errors if execution context failed.\n Array.isArray(exeContext) ? {\n errors: exeContext\n } : executeSubscription(exeContext));\n }).catch(reportGraphQLError);\n}\n\nfunction executeSubscription(exeContext) {\n var schema = exeContext.schema,\n operation = exeContext.operation,\n variableValues = exeContext.variableValues,\n rootValue = exeContext.rootValue;\n var type = getOperationRootType(schema, operation);\n var fields = collectFields(exeContext, type, operation.selectionSet, Object.create(null), Object.create(null));\n var responseNames = Object.keys(fields);\n var responseName = responseNames[0];\n var fieldNodes = fields[responseName];\n var fieldNode = fieldNodes[0];\n var fieldName = fieldNode.name.value;\n var fieldDef = getFieldDef(schema, type, fieldName);\n\n if (!fieldDef) {\n throw new GraphQLError(\"The subscription field \\\"\".concat(fieldName, \"\\\" is not defined.\"), fieldNodes);\n }\n\n var path = addPath(undefined, responseName, type.name);\n var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, type, path); // Coerce to Promise for easier error handling and consistent return type.\n\n return new Promise(function (resolveResult) {\n var _fieldDef$subscribe;\n\n // Implements the \"ResolveFieldEventStream\" algorithm from GraphQL specification.\n // It differs from \"ResolveFieldValue\" due to providing a different `resolveFn`.\n // Build a JS object of arguments from the field.arguments AST, using the\n // variables scope to fulfill any variable references.\n var args = getArgumentValues(fieldDef, fieldNodes[0], variableValues); // The resolve function's optional third argument is a context value that\n // is provided to every resolve function within an execution. It is commonly\n // used to represent an authenticated user, or request-specific caches.\n\n var contextValue = exeContext.contextValue; // Call the `subscribe()` resolver or the default resolver to produce an\n // AsyncIterable yielding raw payloads.\n\n var resolveFn = (_fieldDef$subscribe = fieldDef.subscribe) !== null && _fieldDef$subscribe !== void 0 ? _fieldDef$subscribe : exeContext.fieldResolver;\n resolveResult(resolveFn(rootValue, args, contextValue, info));\n }).then(function (eventStream) {\n if (eventStream instanceof Error) {\n throw locatedError(eventStream, fieldNodes, pathToArray(path));\n } // Assert field returned an event stream, otherwise yield an error.\n\n\n if (!isAsyncIterable(eventStream)) {\n throw new Error('Subscription field must return Async Iterable. ' + \"Received: \".concat(inspect(eventStream), \".\"));\n }\n\n return eventStream;\n }, function (error) {\n throw locatedError(error, fieldNodes, pathToArray(path));\n });\n}\n","export { subscribe, createSourceEventStream } from \"./subscribe.mjs\";\n","import invariant from \"../../../jsutils/invariant.mjs\";\nimport { GraphQLError } from \"../../../error/GraphQLError.mjs\";\nimport { getNamedType, isInputObjectType } from \"../../../type/definition.mjs\";\n\n/**\n * No deprecated\n *\n * A GraphQL document is only valid if all selected fields and all used enum values have not been\n * deprecated.\n *\n * Note: This rule is optional and is not part of the Validation section of the GraphQL\n * Specification. The main purpose of this rule is detection of deprecated usages and not\n * necessarily to forbid their use when querying a service.\n */\nexport function NoDeprecatedCustomRule(context) {\n return {\n Field: function Field(node) {\n var fieldDef = context.getFieldDef();\n var deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason;\n\n if (fieldDef && deprecationReason != null) {\n var parentType = context.getParentType();\n parentType != null || invariant(0);\n context.reportError(new GraphQLError(\"The field \".concat(parentType.name, \".\").concat(fieldDef.name, \" is deprecated. \").concat(deprecationReason), node));\n }\n },\n Argument: function Argument(node) {\n var argDef = context.getArgument();\n var deprecationReason = argDef === null || argDef === void 0 ? void 0 : argDef.deprecationReason;\n\n if (argDef && deprecationReason != null) {\n var directiveDef = context.getDirective();\n\n if (directiveDef != null) {\n context.reportError(new GraphQLError(\"Directive \\\"@\".concat(directiveDef.name, \"\\\" argument \\\"\").concat(argDef.name, \"\\\" is deprecated. \").concat(deprecationReason), node));\n } else {\n var parentType = context.getParentType();\n var fieldDef = context.getFieldDef();\n parentType != null && fieldDef != null || invariant(0);\n context.reportError(new GraphQLError(\"Field \\\"\".concat(parentType.name, \".\").concat(fieldDef.name, \"\\\" argument \\\"\").concat(argDef.name, \"\\\" is deprecated. \").concat(deprecationReason), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var inputObjectDef = getNamedType(context.getParentInputType());\n\n if (isInputObjectType(inputObjectDef)) {\n var inputFieldDef = inputObjectDef.getFields()[node.name.value]; // flowlint-next-line unnecessary-optional-chain:off\n\n var deprecationReason = inputFieldDef === null || inputFieldDef === void 0 ? void 0 : inputFieldDef.deprecationReason;\n\n if (deprecationReason != null) {\n context.reportError(new GraphQLError(\"The input field \".concat(inputObjectDef.name, \".\").concat(inputFieldDef.name, \" is deprecated. \").concat(deprecationReason), node));\n }\n }\n },\n EnumValue: function EnumValue(node) {\n var enumValueDef = context.getEnumValue();\n var deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason;\n\n if (enumValueDef && deprecationReason != null) {\n var enumTypeDef = getNamedType(context.getInputType());\n enumTypeDef != null || invariant(0);\n context.reportError(new GraphQLError(\"The enum value \\\"\".concat(enumTypeDef.name, \".\").concat(enumValueDef.name, \"\\\" is deprecated. \").concat(deprecationReason), node));\n }\n }\n };\n}\n","import { GraphQLError } from \"../../../error/GraphQLError.mjs\";\nimport { getNamedType } from \"../../../type/definition.mjs\";\nimport { isIntrospectionType } from \"../../../type/introspection.mjs\";\n\n/**\n * Prohibit introspection queries\n *\n * A GraphQL document is only valid if all fields selected are not fields that\n * return an introspection type.\n *\n * Note: This rule is optional and is not part of the Validation section of the\n * GraphQL Specification. This rule effectively disables introspection, which\n * does not reflect best practices and should only be done if absolutely necessary.\n */\nexport function NoSchemaIntrospectionCustomRule(context) {\n return {\n Field: function Field(node) {\n var type = getNamedType(context.getType());\n\n if (type && isIntrospectionType(type)) {\n context.reportError(new GraphQLError(\"GraphQL introspection has been disabled, but the requested query contained the field \\\"\".concat(node.name.value, \"\\\".\"), node));\n }\n }\n };\n}\n","export { validate } from \"./validate.mjs\";\nexport { ValidationContext } from \"./ValidationContext.mjs\";\n// All validation rules in the GraphQL Specification.\nexport { specifiedRules } from \"./specifiedRules.mjs\"; // Spec Section: \"Executable Definitions\"\n\nexport { ExecutableDefinitionsRule } from \"./rules/ExecutableDefinitionsRule.mjs\"; // Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\n\nexport { FieldsOnCorrectTypeRule } from \"./rules/FieldsOnCorrectTypeRule.mjs\"; // Spec Section: \"Fragments on Composite Types\"\n\nexport { FragmentsOnCompositeTypesRule } from \"./rules/FragmentsOnCompositeTypesRule.mjs\"; // Spec Section: \"Argument Names\"\n\nexport { KnownArgumentNamesRule } from \"./rules/KnownArgumentNamesRule.mjs\"; // Spec Section: \"Directives Are Defined\"\n\nexport { KnownDirectivesRule } from \"./rules/KnownDirectivesRule.mjs\"; // Spec Section: \"Fragment spread target defined\"\n\nexport { KnownFragmentNamesRule } from \"./rules/KnownFragmentNamesRule.mjs\"; // Spec Section: \"Fragment Spread Type Existence\"\n\nexport { KnownTypeNamesRule } from \"./rules/KnownTypeNamesRule.mjs\"; // Spec Section: \"Lone Anonymous Operation\"\n\nexport { LoneAnonymousOperationRule } from \"./rules/LoneAnonymousOperationRule.mjs\"; // Spec Section: \"Fragments must not form cycles\"\n\nexport { NoFragmentCyclesRule } from \"./rules/NoFragmentCyclesRule.mjs\"; // Spec Section: \"All Variable Used Defined\"\n\nexport { NoUndefinedVariablesRule } from \"./rules/NoUndefinedVariablesRule.mjs\"; // Spec Section: \"Fragments must be used\"\n\nexport { NoUnusedFragmentsRule } from \"./rules/NoUnusedFragmentsRule.mjs\"; // Spec Section: \"All Variables Used\"\n\nexport { NoUnusedVariablesRule } from \"./rules/NoUnusedVariablesRule.mjs\"; // Spec Section: \"Field Selection Merging\"\n\nexport { OverlappingFieldsCanBeMergedRule } from \"./rules/OverlappingFieldsCanBeMergedRule.mjs\"; // Spec Section: \"Fragment spread is possible\"\n\nexport { PossibleFragmentSpreadsRule } from \"./rules/PossibleFragmentSpreadsRule.mjs\"; // Spec Section: \"Argument Optionality\"\n\nexport { ProvidedRequiredArgumentsRule } from \"./rules/ProvidedRequiredArgumentsRule.mjs\"; // Spec Section: \"Leaf Field Selections\"\n\nexport { ScalarLeafsRule } from \"./rules/ScalarLeafsRule.mjs\"; // Spec Section: \"Subscriptions with Single Root Field\"\n\nexport { SingleFieldSubscriptionsRule } from \"./rules/SingleFieldSubscriptionsRule.mjs\"; // Spec Section: \"Argument Uniqueness\"\n\nexport { UniqueArgumentNamesRule } from \"./rules/UniqueArgumentNamesRule.mjs\"; // Spec Section: \"Directives Are Unique Per Location\"\n\nexport { UniqueDirectivesPerLocationRule } from \"./rules/UniqueDirectivesPerLocationRule.mjs\"; // Spec Section: \"Fragment Name Uniqueness\"\n\nexport { UniqueFragmentNamesRule } from \"./rules/UniqueFragmentNamesRule.mjs\"; // Spec Section: \"Input Object Field Uniqueness\"\n\nexport { UniqueInputFieldNamesRule } from \"./rules/UniqueInputFieldNamesRule.mjs\"; // Spec Section: \"Operation Name Uniqueness\"\n\nexport { UniqueOperationNamesRule } from \"./rules/UniqueOperationNamesRule.mjs\"; // Spec Section: \"Variable Uniqueness\"\n\nexport { UniqueVariableNamesRule } from \"./rules/UniqueVariableNamesRule.mjs\"; // Spec Section: \"Values Type Correctness\"\n\nexport { ValuesOfCorrectTypeRule } from \"./rules/ValuesOfCorrectTypeRule.mjs\"; // Spec Section: \"Variables are Input Types\"\n\nexport { VariablesAreInputTypesRule } from \"./rules/VariablesAreInputTypesRule.mjs\"; // Spec Section: \"All Variable Usages Are Allowed\"\n\nexport { VariablesInAllowedPositionRule } from \"./rules/VariablesInAllowedPositionRule.mjs\"; // SDL-specific validation rules\n\nexport { LoneSchemaDefinitionRule } from \"./rules/LoneSchemaDefinitionRule.mjs\";\nexport { UniqueOperationTypesRule } from \"./rules/UniqueOperationTypesRule.mjs\";\nexport { UniqueTypeNamesRule } from \"./rules/UniqueTypeNamesRule.mjs\";\nexport { UniqueEnumValueNamesRule } from \"./rules/UniqueEnumValueNamesRule.mjs\";\nexport { UniqueFieldDefinitionNamesRule } from \"./rules/UniqueFieldDefinitionNamesRule.mjs\";\nexport { UniqueDirectiveNamesRule } from \"./rules/UniqueDirectiveNamesRule.mjs\";\nexport { PossibleTypeExtensionsRule } from \"./rules/PossibleTypeExtensionsRule.mjs\"; // Optional rules not defined by the GraphQL Specification\n\nexport { NoDeprecatedCustomRule } from \"./rules/custom/NoDeprecatedCustomRule.mjs\";\nexport { NoSchemaIntrospectionCustomRule } from \"./rules/custom/NoSchemaIntrospectionCustomRule.mjs\";\n","import devAssert from \"../jsutils/devAssert.mjs\";\n\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n */\nexport function formatError(error) {\n var _error$message;\n\n error || devAssert(0, 'Received null or undefined error.');\n var message = (_error$message = error.message) !== null && _error$message !== void 0 ? _error$message : 'An unknown error occurred.';\n var locations = error.locations;\n var path = error.path;\n var extensions = error.extensions;\n return extensions ? {\n message: message,\n locations: locations,\n path: path,\n extensions: extensions\n } : {\n message: message,\n locations: locations,\n path: path\n };\n}\n/**\n * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors\n */\n","export { GraphQLError, printError } from \"./GraphQLError.mjs\";\nexport { syntaxError } from \"./syntaxError.mjs\";\nexport { locatedError } from \"./locatedError.mjs\";\nexport { formatError } from \"./formatError.mjs\";\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nexport function getIntrospectionQuery(options) {\n var optionsWithDefault = _objectSpread({\n descriptions: true,\n specifiedByUrl: false,\n directiveIsRepeatable: false,\n schemaDescription: false,\n inputValueDeprecation: false\n }, options);\n\n var descriptions = optionsWithDefault.descriptions ? 'description' : '';\n var specifiedByUrl = optionsWithDefault.specifiedByUrl ? 'specifiedByUrl' : '';\n var directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable ? 'isRepeatable' : '';\n var schemaDescription = optionsWithDefault.schemaDescription ? descriptions : '';\n\n function inputDeprecation(str) {\n return optionsWithDefault.inputValueDeprecation ? str : '';\n }\n\n return \"\\n query IntrospectionQuery {\\n __schema {\\n \".concat(schemaDescription, \"\\n queryType { name }\\n mutationType { name }\\n subscriptionType { name }\\n types {\\n ...FullType\\n }\\n directives {\\n name\\n \").concat(descriptions, \"\\n \").concat(directiveIsRepeatable, \"\\n locations\\n args\").concat(inputDeprecation('(includeDeprecated: true)'), \" {\\n ...InputValue\\n }\\n }\\n }\\n }\\n\\n fragment FullType on __Type {\\n kind\\n name\\n \").concat(descriptions, \"\\n \").concat(specifiedByUrl, \"\\n fields(includeDeprecated: true) {\\n name\\n \").concat(descriptions, \"\\n args\").concat(inputDeprecation('(includeDeprecated: true)'), \" {\\n ...InputValue\\n }\\n type {\\n ...TypeRef\\n }\\n isDeprecated\\n deprecationReason\\n }\\n inputFields\").concat(inputDeprecation('(includeDeprecated: true)'), \" {\\n ...InputValue\\n }\\n interfaces {\\n ...TypeRef\\n }\\n enumValues(includeDeprecated: true) {\\n name\\n \").concat(descriptions, \"\\n isDeprecated\\n deprecationReason\\n }\\n possibleTypes {\\n ...TypeRef\\n }\\n }\\n\\n fragment InputValue on __InputValue {\\n name\\n \").concat(descriptions, \"\\n type { ...TypeRef }\\n defaultValue\\n \").concat(inputDeprecation('isDeprecated'), \"\\n \").concat(inputDeprecation('deprecationReason'), \"\\n }\\n\\n fragment TypeRef on __Type {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n }\\n }\\n }\\n }\\n }\\n }\\n }\\n }\\n \");\n}\n","import { Kind } from \"../language/kinds.mjs\";\n/**\n * Returns an operation AST given a document AST and optionally an operation\n * name. If a name is not provided, an operation is only returned if only one is\n * provided in the document.\n */\n\nexport function getOperationAST(documentAST, operationName) {\n var operation = null;\n\n for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) {\n var definition = _documentAST$definiti2[_i2];\n\n if (definition.kind === Kind.OPERATION_DEFINITION) {\n var _definition$name;\n\n if (operationName == null) {\n // If no operation name was provided, only return an Operation if there\n // is one defined in the document. Upon encountering the second, return\n // null.\n if (operation) {\n return null;\n }\n\n operation = definition;\n } else if (((_definition$name = definition.name) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) {\n return definition;\n }\n }\n }\n\n return operation;\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { parse } from \"../language/parser.mjs\";\nimport { executeSync } from \"../execution/execute.mjs\";\nimport { getIntrospectionQuery } from \"./getIntrospectionQuery.mjs\";\n/**\n * Build an IntrospectionQuery from a GraphQLSchema\n *\n * IntrospectionQuery is useful for utilities that care about type and field\n * relationships, but do not need to traverse through those relationships.\n *\n * This is the inverse of buildClientSchema. The primary use case is outside\n * of the server context, for instance when doing schema comparisons.\n */\n\nexport function introspectionFromSchema(schema, options) {\n var optionsWithDefaults = _objectSpread({\n specifiedByUrl: true,\n directiveIsRepeatable: true,\n schemaDescription: true,\n inputValueDeprecation: true\n }, options);\n\n var document = parse(getIntrospectionQuery(optionsWithDefaults));\n var result = executeSync({\n schema: schema,\n document: document\n });\n !result.errors && result.data || invariant(0);\n return result.data;\n}\n","import objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport keyValMap from \"../jsutils/keyValMap.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { parseValue } from \"../language/parser.mjs\";\nimport { GraphQLSchema } from \"../type/schema.mjs\";\nimport { GraphQLDirective } from \"../type/directives.mjs\";\nimport { specifiedScalarTypes } from \"../type/scalars.mjs\";\nimport { introspectionTypes, TypeKind } from \"../type/introspection.mjs\";\nimport { isInputType, isOutputType, GraphQLList, GraphQLNonNull, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, assertNullableType, assertObjectType, assertInterfaceType } from \"../type/definition.mjs\";\nimport { valueFromAST } from \"./valueFromAST.mjs\";\n/**\n * Build a GraphQLSchema for use by client tools.\n *\n * Given the result of a client running the introspection query, creates and\n * returns a GraphQLSchema instance which can be then used with all graphql-js\n * tools, but cannot be used to execute a query, as introspection does not\n * represent the \"resolver\", \"parse\" or \"serialize\" functions or any other\n * server-internal mechanisms.\n *\n * This function expects a complete introspection result. Don't forget to check\n * the \"errors\" field of a server response before calling this function.\n */\n\nexport function buildClientSchema(introspection, options) {\n isObjectLike(introspection) && isObjectLike(introspection.__schema) || devAssert(0, \"Invalid or incomplete introspection result. Ensure that you are passing \\\"data\\\" property of introspection response and no \\\"errors\\\" was returned alongside: \".concat(inspect(introspection), \".\")); // Get the schema from the introspection result.\n\n var schemaIntrospection = introspection.__schema; // Iterate through all types, getting the type definition for each.\n\n var typeMap = keyValMap(schemaIntrospection.types, function (typeIntrospection) {\n return typeIntrospection.name;\n }, function (typeIntrospection) {\n return buildType(typeIntrospection);\n }); // Include standard types only if they are used.\n\n for (var _i2 = 0, _ref2 = [].concat(specifiedScalarTypes, introspectionTypes); _i2 < _ref2.length; _i2++) {\n var stdType = _ref2[_i2];\n\n if (typeMap[stdType.name]) {\n typeMap[stdType.name] = stdType;\n }\n } // Get the root Query, Mutation, and Subscription types.\n\n\n var queryType = schemaIntrospection.queryType ? getObjectType(schemaIntrospection.queryType) : null;\n var mutationType = schemaIntrospection.mutationType ? getObjectType(schemaIntrospection.mutationType) : null;\n var subscriptionType = schemaIntrospection.subscriptionType ? getObjectType(schemaIntrospection.subscriptionType) : null; // Get the directives supported by Introspection, assuming empty-set if\n // directives were not queried for.\n\n var directives = schemaIntrospection.directives ? schemaIntrospection.directives.map(buildDirective) : []; // Then produce and return a Schema with these types.\n\n return new GraphQLSchema({\n description: schemaIntrospection.description,\n query: queryType,\n mutation: mutationType,\n subscription: subscriptionType,\n types: objectValues(typeMap),\n directives: directives,\n assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid\n }); // Given a type reference in introspection, return the GraphQLType instance.\n // preferring cached instances before building new instances.\n\n function getType(typeRef) {\n if (typeRef.kind === TypeKind.LIST) {\n var itemRef = typeRef.ofType;\n\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n return new GraphQLList(getType(itemRef));\n }\n\n if (typeRef.kind === TypeKind.NON_NULL) {\n var nullableRef = typeRef.ofType;\n\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n var nullableType = getType(nullableRef);\n return new GraphQLNonNull(assertNullableType(nullableType));\n }\n\n return getNamedType(typeRef);\n }\n\n function getNamedType(typeRef) {\n var typeName = typeRef.name;\n\n if (!typeName) {\n throw new Error(\"Unknown type reference: \".concat(inspect(typeRef), \".\"));\n }\n\n var type = typeMap[typeName];\n\n if (!type) {\n throw new Error(\"Invalid or incomplete schema, unknown type: \".concat(typeName, \". Ensure that a full introspection query is used in order to build a client schema.\"));\n }\n\n return type;\n }\n\n function getObjectType(typeRef) {\n return assertObjectType(getNamedType(typeRef));\n }\n\n function getInterfaceType(typeRef) {\n return assertInterfaceType(getNamedType(typeRef));\n } // Given a type's introspection result, construct the correct\n // GraphQLType instance.\n\n\n function buildType(type) {\n if (type != null && type.name != null && type.kind != null) {\n switch (type.kind) {\n case TypeKind.SCALAR:\n return buildScalarDef(type);\n\n case TypeKind.OBJECT:\n return buildObjectDef(type);\n\n case TypeKind.INTERFACE:\n return buildInterfaceDef(type);\n\n case TypeKind.UNION:\n return buildUnionDef(type);\n\n case TypeKind.ENUM:\n return buildEnumDef(type);\n\n case TypeKind.INPUT_OBJECT:\n return buildInputObjectDef(type);\n }\n }\n\n var typeStr = inspect(type);\n throw new Error(\"Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: \".concat(typeStr, \".\"));\n }\n\n function buildScalarDef(scalarIntrospection) {\n return new GraphQLScalarType({\n name: scalarIntrospection.name,\n description: scalarIntrospection.description,\n specifiedByUrl: scalarIntrospection.specifiedByUrl\n });\n }\n\n function buildImplementationsList(implementingIntrospection) {\n // TODO: Temporary workaround until GraphQL ecosystem will fully support\n // 'interfaces' on interface types.\n if (implementingIntrospection.interfaces === null && implementingIntrospection.kind === TypeKind.INTERFACE) {\n return [];\n }\n\n if (!implementingIntrospection.interfaces) {\n var implementingIntrospectionStr = inspect(implementingIntrospection);\n throw new Error(\"Introspection result missing interfaces: \".concat(implementingIntrospectionStr, \".\"));\n }\n\n return implementingIntrospection.interfaces.map(getInterfaceType);\n }\n\n function buildObjectDef(objectIntrospection) {\n return new GraphQLObjectType({\n name: objectIntrospection.name,\n description: objectIntrospection.description,\n interfaces: function interfaces() {\n return buildImplementationsList(objectIntrospection);\n },\n fields: function fields() {\n return buildFieldDefMap(objectIntrospection);\n }\n });\n }\n\n function buildInterfaceDef(interfaceIntrospection) {\n return new GraphQLInterfaceType({\n name: interfaceIntrospection.name,\n description: interfaceIntrospection.description,\n interfaces: function interfaces() {\n return buildImplementationsList(interfaceIntrospection);\n },\n fields: function fields() {\n return buildFieldDefMap(interfaceIntrospection);\n }\n });\n }\n\n function buildUnionDef(unionIntrospection) {\n if (!unionIntrospection.possibleTypes) {\n var unionIntrospectionStr = inspect(unionIntrospection);\n throw new Error(\"Introspection result missing possibleTypes: \".concat(unionIntrospectionStr, \".\"));\n }\n\n return new GraphQLUnionType({\n name: unionIntrospection.name,\n description: unionIntrospection.description,\n types: function types() {\n return unionIntrospection.possibleTypes.map(getObjectType);\n }\n });\n }\n\n function buildEnumDef(enumIntrospection) {\n if (!enumIntrospection.enumValues) {\n var enumIntrospectionStr = inspect(enumIntrospection);\n throw new Error(\"Introspection result missing enumValues: \".concat(enumIntrospectionStr, \".\"));\n }\n\n return new GraphQLEnumType({\n name: enumIntrospection.name,\n description: enumIntrospection.description,\n values: keyValMap(enumIntrospection.enumValues, function (valueIntrospection) {\n return valueIntrospection.name;\n }, function (valueIntrospection) {\n return {\n description: valueIntrospection.description,\n deprecationReason: valueIntrospection.deprecationReason\n };\n })\n });\n }\n\n function buildInputObjectDef(inputObjectIntrospection) {\n if (!inputObjectIntrospection.inputFields) {\n var inputObjectIntrospectionStr = inspect(inputObjectIntrospection);\n throw new Error(\"Introspection result missing inputFields: \".concat(inputObjectIntrospectionStr, \".\"));\n }\n\n return new GraphQLInputObjectType({\n name: inputObjectIntrospection.name,\n description: inputObjectIntrospection.description,\n fields: function fields() {\n return buildInputValueDefMap(inputObjectIntrospection.inputFields);\n }\n });\n }\n\n function buildFieldDefMap(typeIntrospection) {\n if (!typeIntrospection.fields) {\n throw new Error(\"Introspection result missing fields: \".concat(inspect(typeIntrospection), \".\"));\n }\n\n return keyValMap(typeIntrospection.fields, function (fieldIntrospection) {\n return fieldIntrospection.name;\n }, buildField);\n }\n\n function buildField(fieldIntrospection) {\n var type = getType(fieldIntrospection.type);\n\n if (!isOutputType(type)) {\n var typeStr = inspect(type);\n throw new Error(\"Introspection must provide output type for fields, but received: \".concat(typeStr, \".\"));\n }\n\n if (!fieldIntrospection.args) {\n var fieldIntrospectionStr = inspect(fieldIntrospection);\n throw new Error(\"Introspection result missing field args: \".concat(fieldIntrospectionStr, \".\"));\n }\n\n return {\n description: fieldIntrospection.description,\n deprecationReason: fieldIntrospection.deprecationReason,\n type: type,\n args: buildInputValueDefMap(fieldIntrospection.args)\n };\n }\n\n function buildInputValueDefMap(inputValueIntrospections) {\n return keyValMap(inputValueIntrospections, function (inputValue) {\n return inputValue.name;\n }, buildInputValue);\n }\n\n function buildInputValue(inputValueIntrospection) {\n var type = getType(inputValueIntrospection.type);\n\n if (!isInputType(type)) {\n var typeStr = inspect(type);\n throw new Error(\"Introspection must provide input type for arguments, but received: \".concat(typeStr, \".\"));\n }\n\n var defaultValue = inputValueIntrospection.defaultValue != null ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type) : undefined;\n return {\n description: inputValueIntrospection.description,\n type: type,\n defaultValue: defaultValue,\n deprecationReason: inputValueIntrospection.deprecationReason\n };\n }\n\n function buildDirective(directiveIntrospection) {\n if (!directiveIntrospection.args) {\n var directiveIntrospectionStr = inspect(directiveIntrospection);\n throw new Error(\"Introspection result missing directive args: \".concat(directiveIntrospectionStr, \".\"));\n }\n\n if (!directiveIntrospection.locations) {\n var _directiveIntrospectionStr = inspect(directiveIntrospection);\n\n throw new Error(\"Introspection result missing directive locations: \".concat(_directiveIntrospectionStr, \".\"));\n }\n\n return new GraphQLDirective({\n name: directiveIntrospection.name,\n description: directiveIntrospection.description,\n isRepeatable: directiveIntrospection.isRepeatable,\n locations: directiveIntrospection.locations.slice(),\n args: buildInputValueDefMap(directiveIntrospection.args)\n });\n }\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport mapValue from \"../jsutils/mapValue.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { TokenKind } from \"../language/tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"../language/blockString.mjs\";\nimport { isTypeDefinitionNode, isTypeExtensionNode } from \"../language/predicates.mjs\";\nimport { assertValidSDLExtension } from \"../validation/validate.mjs\";\nimport { getDirectiveValues } from \"../execution/values.mjs\";\nimport { assertSchema, GraphQLSchema } from \"../type/schema.mjs\";\nimport { specifiedScalarTypes, isSpecifiedScalarType } from \"../type/scalars.mjs\";\nimport { introspectionTypes, isIntrospectionType } from \"../type/introspection.mjs\";\nimport { GraphQLDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective } from \"../type/directives.mjs\";\nimport { isScalarType, isObjectType, isInterfaceType, isUnionType, isListType, isNonNullType, isEnumType, isInputObjectType, GraphQLList, GraphQLNonNull, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType } from \"../type/definition.mjs\";\nimport { valueFromAST } from \"./valueFromAST.mjs\";\n\n/**\n * Produces a new schema given an existing schema and a document which may\n * contain GraphQL type extensions and definitions. The original schema will\n * remain unaltered.\n *\n * Because a schema represents a graph of references, a schema cannot be\n * extended without effectively making an entire copy. We do not know until it's\n * too late if subgraphs remain unchanged.\n *\n * This algorithm copies the provided schema, applying extensions while\n * producing the copy. The original schema remains unaltered.\n *\n * Accepts options as a third argument:\n *\n * - commentDescriptions:\n * Provide true to use preceding comments as the description.\n *\n */\nexport function extendSchema(schema, documentAST, options) {\n assertSchema(schema);\n documentAST != null && documentAST.kind === Kind.DOCUMENT || devAssert(0, 'Must provide valid Document AST.');\n\n if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) {\n assertValidSDLExtension(documentAST, schema);\n }\n\n var schemaConfig = schema.toConfig();\n var extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options);\n return schemaConfig === extendedConfig ? schema : new GraphQLSchema(extendedConfig);\n}\n/**\n * @internal\n */\n\nexport function extendSchemaImpl(schemaConfig, documentAST, options) {\n var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid;\n\n // Collect the type definitions and extensions found in the document.\n var typeDefs = [];\n var typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefs = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExtensions = [];\n\n for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) {\n var def = _documentAST$definiti2[_i2];\n\n if (def.kind === Kind.SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === Kind.SCHEMA_EXTENSION) {\n schemaExtensions.push(def);\n } else if (isTypeDefinitionNode(def)) {\n typeDefs.push(def);\n } else if (isTypeExtensionNode(def)) {\n var extendedTypeName = def.name.value;\n var existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];\n } else if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n directiveDefs.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n\n if (Object.keys(typeExtensionsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExtensions.length === 0 && schemaDef == null) {\n return schemaConfig;\n }\n\n var typeMap = Object.create(null);\n\n for (var _i4 = 0, _schemaConfig$types2 = schemaConfig.types; _i4 < _schemaConfig$types2.length; _i4++) {\n var existingType = _schemaConfig$types2[_i4];\n typeMap[existingType.name] = extendNamedType(existingType);\n }\n\n for (var _i6 = 0; _i6 < typeDefs.length; _i6++) {\n var _stdTypeMap$name;\n\n var typeNode = typeDefs[_i6];\n var name = typeNode.name.value;\n typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode);\n }\n\n var operationTypes = _objectSpread(_objectSpread({\n // Get the extended root operation types.\n query: schemaConfig.query && replaceNamedType(schemaConfig.query),\n mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation),\n subscription: schemaConfig.subscription && replaceNamedType(schemaConfig.subscription)\n }, schemaDef && getOperationTypes([schemaDef])), getOperationTypes(schemaExtensions)); // Then produce and return a Schema config with these types.\n\n\n return _objectSpread(_objectSpread({\n description: (_schemaDef = schemaDef) === null || _schemaDef === void 0 ? void 0 : (_schemaDef$descriptio = _schemaDef.description) === null || _schemaDef$descriptio === void 0 ? void 0 : _schemaDef$descriptio.value\n }, operationTypes), {}, {\n types: objectValues(typeMap),\n directives: [].concat(schemaConfig.directives.map(replaceDirective), directiveDefs.map(buildDirective)),\n extensions: undefined,\n astNode: (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0 ? _schemaDef2 : schemaConfig.astNode,\n extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions),\n assumeValid: (_options$assumeValid = options === null || options === void 0 ? void 0 : options.assumeValid) !== null && _options$assumeValid !== void 0 ? _options$assumeValid : false\n }); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function replaceType(type) {\n if (isListType(type)) {\n // $FlowFixMe[incompatible-return]\n return new GraphQLList(replaceType(type.ofType));\n }\n\n if (isNonNullType(type)) {\n // $FlowFixMe[incompatible-return]\n return new GraphQLNonNull(replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n return typeMap[type.name];\n }\n\n function replaceDirective(directive) {\n var config = directive.toConfig();\n return new GraphQLDirective(_objectSpread(_objectSpread({}, config), {}, {\n args: mapValue(config.args, extendArg)\n }));\n }\n\n function extendNamedType(type) {\n if (isIntrospectionType(type) || isSpecifiedScalarType(type)) {\n // Builtin types are not extended.\n return type;\n }\n\n if (isScalarType(type)) {\n return extendScalarType(type);\n }\n\n if (isObjectType(type)) {\n return extendObjectType(type);\n }\n\n if (isInterfaceType(type)) {\n return extendInterfaceType(type);\n }\n\n if (isUnionType(type)) {\n return extendUnionType(type);\n }\n\n if (isEnumType(type)) {\n return extendEnumType(type);\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isInputObjectType(type)) {\n return extendInputObjectType(type);\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected type: ' + inspect(type));\n }\n\n function extendInputObjectType(type) {\n var _typeExtensionsMap$co;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];\n return new GraphQLInputObjectType(_objectSpread(_objectSpread({}, config), {}, {\n fields: function fields() {\n return _objectSpread(_objectSpread({}, mapValue(config.fields, function (field) {\n return _objectSpread(_objectSpread({}, field), {}, {\n type: replaceType(field.type)\n });\n })), buildInputFieldMap(extensions));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendEnumType(type) {\n var _typeExtensionsMap$ty;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];\n return new GraphQLEnumType(_objectSpread(_objectSpread({}, config), {}, {\n values: _objectSpread(_objectSpread({}, config.values), buildEnumValueMap(extensions)),\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendScalarType(type) {\n var _typeExtensionsMap$co2;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];\n var specifiedByUrl = config.specifiedByUrl;\n\n for (var _i8 = 0; _i8 < extensions.length; _i8++) {\n var _getSpecifiedByUrl;\n\n var extensionNode = extensions[_i8];\n specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl;\n }\n\n return new GraphQLScalarType(_objectSpread(_objectSpread({}, config), {}, {\n specifiedByUrl: specifiedByUrl,\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendObjectType(type) {\n var _typeExtensionsMap$co3;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];\n return new GraphQLObjectType(_objectSpread(_objectSpread({}, config), {}, {\n interfaces: function interfaces() {\n return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));\n },\n fields: function fields() {\n return _objectSpread(_objectSpread({}, mapValue(config.fields, extendField)), buildFieldMap(extensions));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendInterfaceType(type) {\n var _typeExtensionsMap$co4;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];\n return new GraphQLInterfaceType(_objectSpread(_objectSpread({}, config), {}, {\n interfaces: function interfaces() {\n return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));\n },\n fields: function fields() {\n return _objectSpread(_objectSpread({}, mapValue(config.fields, extendField)), buildFieldMap(extensions));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendUnionType(type) {\n var _typeExtensionsMap$co5;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];\n return new GraphQLUnionType(_objectSpread(_objectSpread({}, config), {}, {\n types: function types() {\n return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendField(field) {\n return _objectSpread(_objectSpread({}, field), {}, {\n type: replaceType(field.type),\n // $FlowFixMe[incompatible-call]\n args: mapValue(field.args, extendArg)\n });\n }\n\n function extendArg(arg) {\n return _objectSpread(_objectSpread({}, arg), {}, {\n type: replaceType(arg.type)\n });\n }\n\n function getOperationTypes(nodes) {\n var opTypes = {};\n\n for (var _i10 = 0; _i10 < nodes.length; _i10++) {\n var _node$operationTypes;\n\n var node = nodes[_i10];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : [];\n\n for (var _i12 = 0; _i12 < operationTypesNodes.length; _i12++) {\n var operationType = operationTypesNodes[_i12];\n opTypes[operationType.operation] = getNamedType(operationType.type);\n }\n } // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n\n return opTypes;\n }\n\n function getNamedType(node) {\n var _stdTypeMap$name2;\n\n var name = node.name.value;\n var type = (_stdTypeMap$name2 = stdTypeMap[name]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name];\n\n if (type === undefined) {\n throw new Error(\"Unknown type: \\\"\".concat(name, \"\\\".\"));\n }\n\n return type;\n }\n\n function getWrappedType(node) {\n if (node.kind === Kind.LIST_TYPE) {\n return new GraphQLList(getWrappedType(node.type));\n }\n\n if (node.kind === Kind.NON_NULL_TYPE) {\n return new GraphQLNonNull(getWrappedType(node.type));\n }\n\n return getNamedType(node);\n }\n\n function buildDirective(node) {\n var locations = node.locations.map(function (_ref) {\n var value = _ref.value;\n return value;\n });\n return new GraphQLDirective({\n name: node.name.value,\n description: getDescription(node, options),\n locations: locations,\n isRepeatable: node.repeatable,\n args: buildArgumentMap(node.arguments),\n astNode: node\n });\n }\n\n function buildFieldMap(nodes) {\n var fieldConfigMap = Object.create(null);\n\n for (var _i14 = 0; _i14 < nodes.length; _i14++) {\n var _node$fields;\n\n var node = nodes[_i14];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var nodeFields = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : [];\n\n for (var _i16 = 0; _i16 < nodeFields.length; _i16++) {\n var field = nodeFields[_i16];\n fieldConfigMap[field.name.value] = {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n type: getWrappedType(field.type),\n description: getDescription(field, options),\n args: buildArgumentMap(field.arguments),\n deprecationReason: getDeprecationReason(field),\n astNode: field\n };\n }\n }\n\n return fieldConfigMap;\n }\n\n function buildArgumentMap(args) {\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var argsNodes = args !== null && args !== void 0 ? args : [];\n var argConfigMap = Object.create(null);\n\n for (var _i18 = 0; _i18 < argsNodes.length; _i18++) {\n var arg = argsNodes[_i18];\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n var type = getWrappedType(arg.type);\n argConfigMap[arg.name.value] = {\n type: type,\n description: getDescription(arg, options),\n defaultValue: valueFromAST(arg.defaultValue, type),\n deprecationReason: getDeprecationReason(arg),\n astNode: arg\n };\n }\n\n return argConfigMap;\n }\n\n function buildInputFieldMap(nodes) {\n var inputFieldMap = Object.create(null);\n\n for (var _i20 = 0; _i20 < nodes.length; _i20++) {\n var _node$fields2;\n\n var node = nodes[_i20];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var fieldsNodes = (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0 ? _node$fields2 : [];\n\n for (var _i22 = 0; _i22 < fieldsNodes.length; _i22++) {\n var field = fieldsNodes[_i22];\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n var type = getWrappedType(field.type);\n inputFieldMap[field.name.value] = {\n type: type,\n description: getDescription(field, options),\n defaultValue: valueFromAST(field.defaultValue, type),\n deprecationReason: getDeprecationReason(field),\n astNode: field\n };\n }\n }\n\n return inputFieldMap;\n }\n\n function buildEnumValueMap(nodes) {\n var enumValueMap = Object.create(null);\n\n for (var _i24 = 0; _i24 < nodes.length; _i24++) {\n var _node$values;\n\n var node = nodes[_i24];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var valuesNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : [];\n\n for (var _i26 = 0; _i26 < valuesNodes.length; _i26++) {\n var value = valuesNodes[_i26];\n enumValueMap[value.name.value] = {\n description: getDescription(value, options),\n deprecationReason: getDeprecationReason(value),\n astNode: value\n };\n }\n }\n\n return enumValueMap;\n }\n\n function buildInterfaces(nodes) {\n var interfaces = [];\n\n for (var _i28 = 0; _i28 < nodes.length; _i28++) {\n var _node$interfaces;\n\n var node = nodes[_i28];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var interfacesNodes = (_node$interfaces = node.interfaces) !== null && _node$interfaces !== void 0 ? _node$interfaces : [];\n\n for (var _i30 = 0; _i30 < interfacesNodes.length; _i30++) {\n var type = interfacesNodes[_i30];\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable\n // results.\n interfaces.push(getNamedType(type));\n }\n }\n\n return interfaces;\n }\n\n function buildUnionTypes(nodes) {\n var types = [];\n\n for (var _i32 = 0; _i32 < nodes.length; _i32++) {\n var _node$types;\n\n var node = nodes[_i32];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];\n\n for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {\n var type = typeNodes[_i34];\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable\n // results.\n types.push(getNamedType(type));\n }\n }\n\n return types;\n }\n\n function buildType(astNode) {\n var _typeExtensionsMap$na;\n\n var name = astNode.name.value;\n var description = getDescription(astNode, options);\n var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : [];\n\n switch (astNode.kind) {\n case Kind.OBJECT_TYPE_DEFINITION:\n {\n var extensionASTNodes = extensionNodes;\n var allNodes = [astNode].concat(extensionASTNodes);\n return new GraphQLObjectType({\n name: name,\n description: description,\n interfaces: function interfaces() {\n return buildInterfaces(allNodes);\n },\n fields: function fields() {\n return buildFieldMap(allNodes);\n },\n astNode: astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n case Kind.INTERFACE_TYPE_DEFINITION:\n {\n var _extensionASTNodes = extensionNodes;\n\n var _allNodes = [astNode].concat(_extensionASTNodes);\n\n return new GraphQLInterfaceType({\n name: name,\n description: description,\n interfaces: function interfaces() {\n return buildInterfaces(_allNodes);\n },\n fields: function fields() {\n return buildFieldMap(_allNodes);\n },\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes\n });\n }\n\n case Kind.ENUM_TYPE_DEFINITION:\n {\n var _extensionASTNodes2 = extensionNodes;\n\n var _allNodes2 = [astNode].concat(_extensionASTNodes2);\n\n return new GraphQLEnumType({\n name: name,\n description: description,\n values: buildEnumValueMap(_allNodes2),\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes2\n });\n }\n\n case Kind.UNION_TYPE_DEFINITION:\n {\n var _extensionASTNodes3 = extensionNodes;\n\n var _allNodes3 = [astNode].concat(_extensionASTNodes3);\n\n return new GraphQLUnionType({\n name: name,\n description: description,\n types: function types() {\n return buildUnionTypes(_allNodes3);\n },\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes3\n });\n }\n\n case Kind.SCALAR_TYPE_DEFINITION:\n {\n var _extensionASTNodes4 = extensionNodes;\n return new GraphQLScalarType({\n name: name,\n description: description,\n specifiedByUrl: getSpecifiedByUrl(astNode),\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes4\n });\n }\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n {\n var _extensionASTNodes5 = extensionNodes;\n\n var _allNodes4 = [astNode].concat(_extensionASTNodes5);\n\n return new GraphQLInputObjectType({\n name: name,\n description: description,\n fields: function fields() {\n return buildInputFieldMap(_allNodes4);\n },\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes5\n });\n }\n } // istanbul ignore next (Not reachable. All possible type definition nodes have been considered)\n\n\n false || invariant(0, 'Unexpected type definition node: ' + inspect(astNode));\n }\n}\nvar stdTypeMap = keyMap(specifiedScalarTypes.concat(introspectionTypes), function (type) {\n return type.name;\n});\n/**\n * Given a field or enum value node, returns the string value for the\n * deprecation reason.\n */\n\nfunction getDeprecationReason(node) {\n var deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node);\n return deprecated === null || deprecated === void 0 ? void 0 : deprecated.reason;\n}\n/**\n * Given a scalar node, returns the string value for the specifiedByUrl.\n */\n\n\nfunction getSpecifiedByUrl(node) {\n var specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node);\n return specifiedBy === null || specifiedBy === void 0 ? void 0 : specifiedBy.url;\n}\n/**\n * Given an ast node, returns its string description.\n * @deprecated: provided to ease adoption and will be removed in v16.\n *\n * Accepts options as a second argument:\n *\n * - commentDescriptions:\n * Provide true to use preceding comments as the description.\n *\n */\n\n\nexport function getDescription(node, options) {\n if (node.description) {\n return node.description.value;\n }\n\n if ((options === null || options === void 0 ? void 0 : options.commentDescriptions) === true) {\n var rawValue = getLeadingCommentBlock(node);\n\n if (rawValue !== undefined) {\n return dedentBlockStringValue('\\n' + rawValue);\n }\n }\n}\n\nfunction getLeadingCommentBlock(node) {\n var loc = node.loc;\n\n if (!loc) {\n return;\n }\n\n var comments = [];\n var token = loc.startToken.prev;\n\n while (token != null && token.kind === TokenKind.COMMENT && token.next && token.prev && token.line + 1 === token.next.line && token.line !== token.prev.line) {\n var value = String(token.value);\n comments.push(value);\n token = token.prev;\n }\n\n return comments.length > 0 ? comments.reverse().join('\\n') : undefined;\n}\n","import devAssert from \"../jsutils/devAssert.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { parse } from \"../language/parser.mjs\";\nimport { assertValidSDL } from \"../validation/validate.mjs\";\nimport { GraphQLSchema } from \"../type/schema.mjs\";\nimport { specifiedDirectives } from \"../type/directives.mjs\";\nimport { extendSchemaImpl } from \"./extendSchema.mjs\";\n\n/**\n * This takes the ast of a schema document produced by the parse function in\n * src/language/parser.js.\n *\n * If no schema definition is provided, then it will look for types named Query\n * and Mutation.\n *\n * Given that AST it constructs a GraphQLSchema. The resulting schema\n * has no resolve methods, so execution will use default resolvers.\n *\n * Accepts options as a second argument:\n *\n * - commentDescriptions:\n * Provide true to use preceding comments as the description.\n *\n */\nexport function buildASTSchema(documentAST, options) {\n documentAST != null && documentAST.kind === Kind.DOCUMENT || devAssert(0, 'Must provide valid Document AST.');\n\n if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) {\n assertValidSDL(documentAST);\n }\n\n var emptySchemaConfig = {\n description: undefined,\n types: [],\n directives: [],\n extensions: undefined,\n extensionASTNodes: [],\n assumeValid: false\n };\n var config = extendSchemaImpl(emptySchemaConfig, documentAST, options);\n\n if (config.astNode == null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2];\n\n switch (type.name) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n case 'Query':\n config.query = type;\n break;\n\n case 'Mutation':\n config.mutation = type;\n break;\n\n case 'Subscription':\n config.subscription = type;\n break;\n }\n }\n }\n\n var directives = config.directives; // If specified directives were not explicitly declared, add them.\n\n var _loop = function _loop(_i4) {\n var stdDirective = specifiedDirectives[_i4];\n\n if (directives.every(function (directive) {\n return directive.name !== stdDirective.name;\n })) {\n directives.push(stdDirective);\n }\n };\n\n for (var _i4 = 0; _i4 < specifiedDirectives.length; _i4++) {\n _loop(_i4);\n }\n\n return new GraphQLSchema(config);\n}\n/**\n * A helper function to build a GraphQLSchema directly from a source\n * document.\n */\n\nexport function buildSchema(source, options) {\n var document = parse(source, {\n noLocation: options === null || options === void 0 ? void 0 : options.noLocation,\n allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields,\n allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces,\n experimentalFragmentVariables: options === null || options === void 0 ? void 0 : options.experimentalFragmentVariables\n });\n return buildASTSchema(document, {\n commentDescriptions: options === null || options === void 0 ? void 0 : options.commentDescriptions,\n assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL,\n assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid\n });\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport keyValMap from \"../jsutils/keyValMap.mjs\";\nimport naturalCompare from \"../jsutils/naturalCompare.mjs\";\nimport { GraphQLSchema } from \"../type/schema.mjs\";\nimport { GraphQLDirective } from \"../type/directives.mjs\";\nimport { isIntrospectionType } from \"../type/introspection.mjs\";\nimport { GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, isListType, isNonNullType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from \"../type/definition.mjs\";\n/**\n * Sort GraphQLSchema.\n *\n * This function returns a sorted copy of the given GraphQLSchema.\n */\n\nexport function lexicographicSortSchema(schema) {\n var schemaConfig = schema.toConfig();\n var typeMap = keyValMap(sortByName(schemaConfig.types), function (type) {\n return type.name;\n }, sortNamedType);\n return new GraphQLSchema(_objectSpread(_objectSpread({}, schemaConfig), {}, {\n types: objectValues(typeMap),\n directives: sortByName(schemaConfig.directives).map(sortDirective),\n query: replaceMaybeType(schemaConfig.query),\n mutation: replaceMaybeType(schemaConfig.mutation),\n subscription: replaceMaybeType(schemaConfig.subscription)\n }));\n\n function replaceType(type) {\n if (isListType(type)) {\n // $FlowFixMe[incompatible-return]\n return new GraphQLList(replaceType(type.ofType));\n } else if (isNonNullType(type)) {\n // $FlowFixMe[incompatible-return]\n return new GraphQLNonNull(replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n return typeMap[type.name];\n }\n\n function replaceMaybeType(maybeType) {\n return maybeType && replaceNamedType(maybeType);\n }\n\n function sortDirective(directive) {\n var config = directive.toConfig();\n return new GraphQLDirective(_objectSpread(_objectSpread({}, config), {}, {\n locations: sortBy(config.locations, function (x) {\n return x;\n }),\n args: sortArgs(config.args)\n }));\n }\n\n function sortArgs(args) {\n return sortObjMap(args, function (arg) {\n return _objectSpread(_objectSpread({}, arg), {}, {\n type: replaceType(arg.type)\n });\n });\n }\n\n function sortFields(fieldsMap) {\n return sortObjMap(fieldsMap, function (field) {\n return _objectSpread(_objectSpread({}, field), {}, {\n type: replaceType(field.type),\n args: sortArgs(field.args)\n });\n });\n }\n\n function sortInputFields(fieldsMap) {\n return sortObjMap(fieldsMap, function (field) {\n return _objectSpread(_objectSpread({}, field), {}, {\n type: replaceType(field.type)\n });\n });\n }\n\n function sortTypes(arr) {\n return sortByName(arr).map(replaceNamedType);\n }\n\n function sortNamedType(type) {\n if (isScalarType(type) || isIntrospectionType(type)) {\n return type;\n }\n\n if (isObjectType(type)) {\n var config = type.toConfig();\n return new GraphQLObjectType(_objectSpread(_objectSpread({}, config), {}, {\n interfaces: function interfaces() {\n return sortTypes(config.interfaces);\n },\n fields: function fields() {\n return sortFields(config.fields);\n }\n }));\n }\n\n if (isInterfaceType(type)) {\n var _config = type.toConfig();\n\n return new GraphQLInterfaceType(_objectSpread(_objectSpread({}, _config), {}, {\n interfaces: function interfaces() {\n return sortTypes(_config.interfaces);\n },\n fields: function fields() {\n return sortFields(_config.fields);\n }\n }));\n }\n\n if (isUnionType(type)) {\n var _config2 = type.toConfig();\n\n return new GraphQLUnionType(_objectSpread(_objectSpread({}, _config2), {}, {\n types: function types() {\n return sortTypes(_config2.types);\n }\n }));\n }\n\n if (isEnumType(type)) {\n var _config3 = type.toConfig();\n\n return new GraphQLEnumType(_objectSpread(_objectSpread({}, _config3), {}, {\n values: sortObjMap(_config3.values)\n }));\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isInputObjectType(type)) {\n var _config4 = type.toConfig();\n\n return new GraphQLInputObjectType(_objectSpread(_objectSpread({}, _config4), {}, {\n fields: function fields() {\n return sortInputFields(_config4.fields);\n }\n }));\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected type: ' + inspect(type));\n }\n}\n\nfunction sortObjMap(map, sortValueFn) {\n var sortedMap = Object.create(null);\n var sortedKeys = sortBy(Object.keys(map), function (x) {\n return x;\n });\n\n for (var _i2 = 0; _i2 < sortedKeys.length; _i2++) {\n var key = sortedKeys[_i2];\n var value = map[key];\n sortedMap[key] = sortValueFn ? sortValueFn(value) : value;\n }\n\n return sortedMap;\n}\n\nfunction sortByName(array) {\n return sortBy(array, function (obj) {\n return obj.name;\n });\n}\n\nfunction sortBy(array, mapToKey) {\n return array.slice().sort(function (obj1, obj2) {\n var key1 = mapToKey(obj1);\n var key2 = mapToKey(obj2);\n return naturalCompare(key1, key2);\n });\n}\n","import objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { printBlockString } from \"../language/blockString.mjs\";\nimport { isIntrospectionType } from \"../type/introspection.mjs\";\nimport { GraphQLString, isSpecifiedScalarType } from \"../type/scalars.mjs\";\nimport { DEFAULT_DEPRECATION_REASON, isSpecifiedDirective } from \"../type/directives.mjs\";\nimport { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from \"../type/definition.mjs\";\nimport { astFromValue } from \"./astFromValue.mjs\";\n\n/**\n * Accepts options as a second argument:\n *\n * - commentDescriptions:\n * Provide true to use preceding comments as the description.\n *\n */\nexport function printSchema(schema, options) {\n return printFilteredSchema(schema, function (n) {\n return !isSpecifiedDirective(n);\n }, isDefinedType, options);\n}\nexport function printIntrospectionSchema(schema, options) {\n return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType, options);\n}\n\nfunction isDefinedType(type) {\n return !isSpecifiedScalarType(type) && !isIntrospectionType(type);\n}\n\nfunction printFilteredSchema(schema, directiveFilter, typeFilter, options) {\n var directives = schema.getDirectives().filter(directiveFilter);\n var types = objectValues(schema.getTypeMap()).filter(typeFilter);\n return [printSchemaDefinition(schema)].concat(directives.map(function (directive) {\n return printDirective(directive, options);\n }), types.map(function (type) {\n return printType(type, options);\n })).filter(Boolean).join('\\n\\n') + '\\n';\n}\n\nfunction printSchemaDefinition(schema) {\n if (schema.description == null && isSchemaOfCommonNames(schema)) {\n return;\n }\n\n var operationTypes = [];\n var queryType = schema.getQueryType();\n\n if (queryType) {\n operationTypes.push(\" query: \".concat(queryType.name));\n }\n\n var mutationType = schema.getMutationType();\n\n if (mutationType) {\n operationTypes.push(\" mutation: \".concat(mutationType.name));\n }\n\n var subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType) {\n operationTypes.push(\" subscription: \".concat(subscriptionType.name));\n }\n\n return printDescription({}, schema) + \"schema {\\n\".concat(operationTypes.join('\\n'), \"\\n}\");\n}\n/**\n * GraphQL schema define root types for each type of operation. These types are\n * the same as any other type and can be named in any manner, however there is\n * a common naming convention:\n *\n * schema {\n * query: Query\n * mutation: Mutation\n * }\n *\n * When using this naming convention, the schema description can be omitted.\n */\n\n\nfunction isSchemaOfCommonNames(schema) {\n var queryType = schema.getQueryType();\n\n if (queryType && queryType.name !== 'Query') {\n return false;\n }\n\n var mutationType = schema.getMutationType();\n\n if (mutationType && mutationType.name !== 'Mutation') {\n return false;\n }\n\n var subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType && subscriptionType.name !== 'Subscription') {\n return false;\n }\n\n return true;\n}\n\nexport function printType(type, options) {\n if (isScalarType(type)) {\n return printScalar(type, options);\n }\n\n if (isObjectType(type)) {\n return printObject(type, options);\n }\n\n if (isInterfaceType(type)) {\n return printInterface(type, options);\n }\n\n if (isUnionType(type)) {\n return printUnion(type, options);\n }\n\n if (isEnumType(type)) {\n return printEnum(type, options);\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isInputObjectType(type)) {\n return printInputObject(type, options);\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected type: ' + inspect(type));\n}\n\nfunction printScalar(type, options) {\n return printDescription(options, type) + \"scalar \".concat(type.name) + printSpecifiedByUrl(type);\n}\n\nfunction printImplementedInterfaces(type) {\n var interfaces = type.getInterfaces();\n return interfaces.length ? ' implements ' + interfaces.map(function (i) {\n return i.name;\n }).join(' & ') : '';\n}\n\nfunction printObject(type, options) {\n return printDescription(options, type) + \"type \".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);\n}\n\nfunction printInterface(type, options) {\n return printDescription(options, type) + \"interface \".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);\n}\n\nfunction printUnion(type, options) {\n var types = type.getTypes();\n var possibleTypes = types.length ? ' = ' + types.join(' | ') : '';\n return printDescription(options, type) + 'union ' + type.name + possibleTypes;\n}\n\nfunction printEnum(type, options) {\n var values = type.getValues().map(function (value, i) {\n return printDescription(options, value, ' ', !i) + ' ' + value.name + printDeprecated(value.deprecationReason);\n });\n return printDescription(options, type) + \"enum \".concat(type.name) + printBlock(values);\n}\n\nfunction printInputObject(type, options) {\n var fields = objectValues(type.getFields()).map(function (f, i) {\n return printDescription(options, f, ' ', !i) + ' ' + printInputValue(f);\n });\n return printDescription(options, type) + \"input \".concat(type.name) + printBlock(fields);\n}\n\nfunction printFields(options, type) {\n var fields = objectValues(type.getFields()).map(function (f, i) {\n return printDescription(options, f, ' ', !i) + ' ' + f.name + printArgs(options, f.args, ' ') + ': ' + String(f.type) + printDeprecated(f.deprecationReason);\n });\n return printBlock(fields);\n}\n\nfunction printBlock(items) {\n return items.length !== 0 ? ' {\\n' + items.join('\\n') + '\\n}' : '';\n}\n\nfunction printArgs(options, args) {\n var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n\n if (args.length === 0) {\n return '';\n } // If every arg does not have a description, print them on one line.\n\n\n if (args.every(function (arg) {\n return !arg.description;\n })) {\n return '(' + args.map(printInputValue).join(', ') + ')';\n }\n\n return '(\\n' + args.map(function (arg, i) {\n return printDescription(options, arg, ' ' + indentation, !i) + ' ' + indentation + printInputValue(arg);\n }).join('\\n') + '\\n' + indentation + ')';\n}\n\nfunction printInputValue(arg) {\n var defaultAST = astFromValue(arg.defaultValue, arg.type);\n var argDecl = arg.name + ': ' + String(arg.type);\n\n if (defaultAST) {\n argDecl += \" = \".concat(print(defaultAST));\n }\n\n return argDecl + printDeprecated(arg.deprecationReason);\n}\n\nfunction printDirective(directive, options) {\n return printDescription(options, directive) + 'directive @' + directive.name + printArgs(options, directive.args) + (directive.isRepeatable ? ' repeatable' : '') + ' on ' + directive.locations.join(' | ');\n}\n\nfunction printDeprecated(reason) {\n if (reason == null) {\n return '';\n }\n\n var reasonAST = astFromValue(reason, GraphQLString);\n\n if (reasonAST && reason !== DEFAULT_DEPRECATION_REASON) {\n return ' @deprecated(reason: ' + print(reasonAST) + ')';\n }\n\n return ' @deprecated';\n}\n\nfunction printSpecifiedByUrl(scalar) {\n if (scalar.specifiedByUrl == null) {\n return '';\n }\n\n var url = scalar.specifiedByUrl;\n var urlAST = astFromValue(url, GraphQLString);\n urlAST || invariant(0, 'Unexpected null value returned from `astFromValue` for specifiedByUrl');\n return ' @specifiedBy(url: ' + print(urlAST) + ')';\n}\n\nfunction printDescription(options, def) {\n var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n var firstInBlock = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var description = def.description;\n\n if (description == null) {\n return '';\n }\n\n if ((options === null || options === void 0 ? void 0 : options.commentDescriptions) === true) {\n return printDescriptionWithComments(description, indentation, firstInBlock);\n }\n\n var preferMultipleLines = description.length > 70;\n var blockString = printBlockString(description, '', preferMultipleLines);\n var prefix = indentation && !firstInBlock ? '\\n' + indentation : indentation;\n return prefix + blockString.replace(/\\n/g, '\\n' + indentation) + '\\n';\n}\n\nfunction printDescriptionWithComments(description, indentation, firstInBlock) {\n var prefix = indentation && !firstInBlock ? '\\n' : '';\n var comment = description.split('\\n').map(function (line) {\n return indentation + (line !== '' ? '# ' + line : '#');\n }).join('\\n');\n return prefix + comment + '\\n';\n}\n","/**\n * Provided a collection of ASTs, presumably each from different files,\n * concatenate the ASTs together into batched AST, useful for validating many\n * GraphQL source files which together represent one conceptual application.\n */\nexport function concatAST(documents) {\n var definitions = [];\n\n for (var _i2 = 0; _i2 < documents.length; _i2++) {\n var doc = documents[_i2];\n definitions = definitions.concat(doc.definitions);\n }\n\n return {\n kind: 'Document',\n definitions: definitions\n };\n}\n","import { Kind } from \"../language/kinds.mjs\";\nimport { visit } from \"../language/visitor.mjs\";\n/**\n * separateOperations accepts a single AST document which may contain many\n * operations and fragments and returns a collection of AST documents each of\n * which contains a single operation as well the fragment definitions it\n * refers to.\n */\n\nexport function separateOperations(documentAST) {\n var operations = [];\n var depGraph = Object.create(null); // Populate metadata and build a dependency graph.\n\n for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) {\n var definitionNode = _documentAST$definiti2[_i2];\n\n switch (definitionNode.kind) {\n case Kind.OPERATION_DEFINITION:\n operations.push(definitionNode);\n break;\n\n case Kind.FRAGMENT_DEFINITION:\n depGraph[definitionNode.name.value] = collectDependencies(definitionNode.selectionSet);\n break;\n }\n } // For each operation, produce a new synthesized AST which includes only what\n // is necessary for completing that operation.\n\n\n var separatedDocumentASTs = Object.create(null);\n\n var _loop = function _loop(_i4) {\n var operation = operations[_i4];\n var dependencies = new Set();\n\n for (var _i6 = 0, _collectDependencies2 = collectDependencies(operation.selectionSet); _i6 < _collectDependencies2.length; _i6++) {\n var fragmentName = _collectDependencies2[_i6];\n collectTransitiveDependencies(dependencies, depGraph, fragmentName);\n } // Provides the empty string for anonymous operations.\n\n\n var operationName = operation.name ? operation.name.value : ''; // The list of definition nodes to be included for this operation, sorted\n // to retain the same order as the original document.\n\n separatedDocumentASTs[operationName] = {\n kind: Kind.DOCUMENT,\n definitions: documentAST.definitions.filter(function (node) {\n return node === operation || node.kind === Kind.FRAGMENT_DEFINITION && dependencies.has(node.name.value);\n })\n };\n };\n\n for (var _i4 = 0; _i4 < operations.length; _i4++) {\n _loop(_i4);\n }\n\n return separatedDocumentASTs;\n}\n\n// From a dependency graph, collects a list of transitive dependencies by\n// recursing through a dependency graph.\nfunction collectTransitiveDependencies(collected, depGraph, fromName) {\n if (!collected.has(fromName)) {\n collected.add(fromName);\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps !== undefined) {\n for (var _i8 = 0; _i8 < immediateDeps.length; _i8++) {\n var toName = immediateDeps[_i8];\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}\n\nfunction collectDependencies(selectionSet) {\n var dependencies = [];\n visit(selectionSet, {\n FragmentSpread: function FragmentSpread(node) {\n dependencies.push(node.name.value);\n }\n });\n return dependencies;\n}\n","import { Source, isSource } from \"../language/source.mjs\";\nimport { TokenKind } from \"../language/tokenKind.mjs\";\nimport { Lexer, isPunctuatorTokenKind } from \"../language/lexer.mjs\";\nimport { dedentBlockStringValue, getBlockStringIndentation } from \"../language/blockString.mjs\";\n/**\n * Strips characters that are not significant to the validity or execution\n * of a GraphQL document:\n * - UnicodeBOM\n * - WhiteSpace\n * - LineTerminator\n * - Comment\n * - Comma\n * - BlockString indentation\n *\n * Note: It is required to have a delimiter character between neighboring\n * non-punctuator tokens and this function always uses single space as delimiter.\n *\n * It is guaranteed that both input and output documents if parsed would result\n * in the exact same AST except for nodes location.\n *\n * Warning: It is guaranteed that this function will always produce stable results.\n * However, it's not guaranteed that it will stay the same between different\n * releases due to bugfixes or changes in the GraphQL specification.\n *\n * Query example:\n *\n * query SomeQuery($foo: String!, $bar: String) {\n * someField(foo: $foo, bar: $bar) {\n * a\n * b {\n * c\n * d\n * }\n * }\n * }\n *\n * Becomes:\n *\n * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}}\n *\n * SDL example:\n *\n * \"\"\"\n * Type description\n * \"\"\"\n * type Foo {\n * \"\"\"\n * Field description\n * \"\"\"\n * bar: String\n * }\n *\n * Becomes:\n *\n * \"\"\"Type description\"\"\" type Foo{\"\"\"Field description\"\"\" bar:String}\n */\n\nexport function stripIgnoredCharacters(source) {\n var sourceObj = isSource(source) ? source : new Source(source);\n var body = sourceObj.body;\n var lexer = new Lexer(sourceObj);\n var strippedBody = '';\n var wasLastAddedTokenNonPunctuator = false;\n\n while (lexer.advance().kind !== TokenKind.EOF) {\n var currentToken = lexer.token;\n var tokenKind = currentToken.kind;\n /**\n * Every two non-punctuator tokens should have space between them.\n * Also prevent case of non-punctuator token following by spread resulting\n * in invalid token (e.g. `1...` is invalid Float token).\n */\n\n var isNonPunctuator = !isPunctuatorTokenKind(currentToken.kind);\n\n if (wasLastAddedTokenNonPunctuator) {\n if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) {\n strippedBody += ' ';\n }\n }\n\n var tokenBody = body.slice(currentToken.start, currentToken.end);\n\n if (tokenKind === TokenKind.BLOCK_STRING) {\n strippedBody += dedentBlockString(tokenBody);\n } else {\n strippedBody += tokenBody;\n }\n\n wasLastAddedTokenNonPunctuator = isNonPunctuator;\n }\n\n return strippedBody;\n}\n\nfunction dedentBlockString(blockStr) {\n // skip leading and trailing triple quotations\n var rawStr = blockStr.slice(3, -3);\n var body = dedentBlockStringValue(rawStr);\n\n if (getBlockStringIndentation(body) > 0) {\n body = '\\n' + body;\n }\n\n var lastChar = body[body.length - 1];\n var hasTrailingQuote = lastChar === '\"' && body.slice(-4) !== '\\\\\"\"\"';\n\n if (hasTrailingQuote || lastChar === '\\\\') {\n body += '\\n';\n }\n\n return '\"\"\"' + body + '\"\"\"';\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport naturalCompare from \"../jsutils/naturalCompare.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { visit } from \"../language/visitor.mjs\";\nimport { isSpecifiedScalarType } from \"../type/scalars.mjs\";\nimport { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isNonNullType, isListType, isNamedType, isRequiredArgument, isRequiredInputField } from \"../type/definition.mjs\";\nimport { astFromValue } from \"./astFromValue.mjs\";\nexport var BreakingChangeType = Object.freeze({\n TYPE_REMOVED: 'TYPE_REMOVED',\n TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND',\n TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION',\n VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM',\n REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED',\n IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED',\n FIELD_REMOVED: 'FIELD_REMOVED',\n FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND',\n REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED',\n ARG_REMOVED: 'ARG_REMOVED',\n ARG_CHANGED_KIND: 'ARG_CHANGED_KIND',\n DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED',\n DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED',\n REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED',\n DIRECTIVE_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED',\n DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED'\n});\nexport var DangerousChangeType = Object.freeze({\n VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM',\n TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION',\n OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED',\n OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED',\n IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED',\n ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE'\n});\n\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of breaking changes covered by the other functions down below.\n */\nexport function findBreakingChanges(oldSchema, newSchema) {\n var breakingChanges = findSchemaChanges(oldSchema, newSchema).filter(function (change) {\n return change.type in BreakingChangeType;\n });\n return breakingChanges;\n}\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of potentially dangerous changes covered by the other functions down below.\n */\n\nexport function findDangerousChanges(oldSchema, newSchema) {\n var dangerousChanges = findSchemaChanges(oldSchema, newSchema).filter(function (change) {\n return change.type in DangerousChangeType;\n });\n return dangerousChanges;\n}\n\nfunction findSchemaChanges(oldSchema, newSchema) {\n return [].concat(findTypeChanges(oldSchema, newSchema), findDirectiveChanges(oldSchema, newSchema));\n}\n\nfunction findDirectiveChanges(oldSchema, newSchema) {\n var schemaChanges = [];\n var directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives());\n\n for (var _i2 = 0, _directivesDiff$remov2 = directivesDiff.removed; _i2 < _directivesDiff$remov2.length; _i2++) {\n var oldDirective = _directivesDiff$remov2[_i2];\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_REMOVED,\n description: \"\".concat(oldDirective.name, \" was removed.\")\n });\n }\n\n for (var _i4 = 0, _directivesDiff$persi2 = directivesDiff.persisted; _i4 < _directivesDiff$persi2.length; _i4++) {\n var _ref2 = _directivesDiff$persi2[_i4];\n var _oldDirective = _ref2[0];\n var newDirective = _ref2[1];\n var argsDiff = diff(_oldDirective.args, newDirective.args);\n\n for (var _i6 = 0, _argsDiff$added2 = argsDiff.added; _i6 < _argsDiff$added2.length; _i6++) {\n var newArg = _argsDiff$added2[_i6];\n\n if (isRequiredArgument(newArg)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,\n description: \"A required arg \".concat(newArg.name, \" on directive \").concat(_oldDirective.name, \" was added.\")\n });\n }\n }\n\n for (var _i8 = 0, _argsDiff$removed2 = argsDiff.removed; _i8 < _argsDiff$removed2.length; _i8++) {\n var oldArg = _argsDiff$removed2[_i8];\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_ARG_REMOVED,\n description: \"\".concat(oldArg.name, \" was removed from \").concat(_oldDirective.name, \".\")\n });\n }\n\n if (_oldDirective.isRepeatable && !newDirective.isRepeatable) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED,\n description: \"Repeatable flag was removed from \".concat(_oldDirective.name, \".\")\n });\n }\n\n for (var _i10 = 0, _oldDirective$locatio2 = _oldDirective.locations; _i10 < _oldDirective$locatio2.length; _i10++) {\n var location = _oldDirective$locatio2[_i10];\n\n if (newDirective.locations.indexOf(location) === -1) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,\n description: \"\".concat(location, \" was removed from \").concat(_oldDirective.name, \".\")\n });\n }\n }\n }\n\n return schemaChanges;\n}\n\nfunction findTypeChanges(oldSchema, newSchema) {\n var schemaChanges = [];\n var typesDiff = diff(objectValues(oldSchema.getTypeMap()), objectValues(newSchema.getTypeMap()));\n\n for (var _i12 = 0, _typesDiff$removed2 = typesDiff.removed; _i12 < _typesDiff$removed2.length; _i12++) {\n var oldType = _typesDiff$removed2[_i12];\n schemaChanges.push({\n type: BreakingChangeType.TYPE_REMOVED,\n description: isSpecifiedScalarType(oldType) ? \"Standard scalar \".concat(oldType.name, \" was removed because it is not referenced anymore.\") : \"\".concat(oldType.name, \" was removed.\")\n });\n }\n\n for (var _i14 = 0, _typesDiff$persisted2 = typesDiff.persisted; _i14 < _typesDiff$persisted2.length; _i14++) {\n var _ref4 = _typesDiff$persisted2[_i14];\n var _oldType = _ref4[0];\n var newType = _ref4[1];\n\n if (isEnumType(_oldType) && isEnumType(newType)) {\n schemaChanges.push.apply(schemaChanges, findEnumTypeChanges(_oldType, newType));\n } else if (isUnionType(_oldType) && isUnionType(newType)) {\n schemaChanges.push.apply(schemaChanges, findUnionTypeChanges(_oldType, newType));\n } else if (isInputObjectType(_oldType) && isInputObjectType(newType)) {\n schemaChanges.push.apply(schemaChanges, findInputObjectTypeChanges(_oldType, newType));\n } else if (isObjectType(_oldType) && isObjectType(newType)) {\n schemaChanges.push.apply(schemaChanges, findFieldChanges(_oldType, newType).concat(findImplementedInterfacesChanges(_oldType, newType)));\n } else if (isInterfaceType(_oldType) && isInterfaceType(newType)) {\n schemaChanges.push.apply(schemaChanges, findFieldChanges(_oldType, newType).concat(findImplementedInterfacesChanges(_oldType, newType)));\n } else if (_oldType.constructor !== newType.constructor) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_CHANGED_KIND,\n description: \"\".concat(_oldType.name, \" changed from \") + \"\".concat(typeKindName(_oldType), \" to \").concat(typeKindName(newType), \".\")\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findInputObjectTypeChanges(oldType, newType) {\n var schemaChanges = [];\n var fieldsDiff = diff(objectValues(oldType.getFields()), objectValues(newType.getFields()));\n\n for (var _i16 = 0, _fieldsDiff$added2 = fieldsDiff.added; _i16 < _fieldsDiff$added2.length; _i16++) {\n var newField = _fieldsDiff$added2[_i16];\n\n if (isRequiredInputField(newField)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,\n description: \"A required field \".concat(newField.name, \" on input type \").concat(oldType.name, \" was added.\")\n });\n } else {\n schemaChanges.push({\n type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,\n description: \"An optional field \".concat(newField.name, \" on input type \").concat(oldType.name, \" was added.\")\n });\n }\n }\n\n for (var _i18 = 0, _fieldsDiff$removed2 = fieldsDiff.removed; _i18 < _fieldsDiff$removed2.length; _i18++) {\n var oldField = _fieldsDiff$removed2[_i18];\n schemaChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: \"\".concat(oldType.name, \".\").concat(oldField.name, \" was removed.\")\n });\n }\n\n for (var _i20 = 0, _fieldsDiff$persisted2 = fieldsDiff.persisted; _i20 < _fieldsDiff$persisted2.length; _i20++) {\n var _ref6 = _fieldsDiff$persisted2[_i20];\n var _oldField = _ref6[0];\n var _newField = _ref6[1];\n var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldField.type, _newField.type);\n\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description: \"\".concat(oldType.name, \".\").concat(_oldField.name, \" changed type from \") + \"\".concat(String(_oldField.type), \" to \").concat(String(_newField.type), \".\")\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findUnionTypeChanges(oldType, newType) {\n var schemaChanges = [];\n var possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes());\n\n for (var _i22 = 0, _possibleTypesDiff$ad2 = possibleTypesDiff.added; _i22 < _possibleTypesDiff$ad2.length; _i22++) {\n var newPossibleType = _possibleTypesDiff$ad2[_i22];\n schemaChanges.push({\n type: DangerousChangeType.TYPE_ADDED_TO_UNION,\n description: \"\".concat(newPossibleType.name, \" was added to union type \").concat(oldType.name, \".\")\n });\n }\n\n for (var _i24 = 0, _possibleTypesDiff$re2 = possibleTypesDiff.removed; _i24 < _possibleTypesDiff$re2.length; _i24++) {\n var oldPossibleType = _possibleTypesDiff$re2[_i24];\n schemaChanges.push({\n type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,\n description: \"\".concat(oldPossibleType.name, \" was removed from union type \").concat(oldType.name, \".\")\n });\n }\n\n return schemaChanges;\n}\n\nfunction findEnumTypeChanges(oldType, newType) {\n var schemaChanges = [];\n var valuesDiff = diff(oldType.getValues(), newType.getValues());\n\n for (var _i26 = 0, _valuesDiff$added2 = valuesDiff.added; _i26 < _valuesDiff$added2.length; _i26++) {\n var newValue = _valuesDiff$added2[_i26];\n schemaChanges.push({\n type: DangerousChangeType.VALUE_ADDED_TO_ENUM,\n description: \"\".concat(newValue.name, \" was added to enum type \").concat(oldType.name, \".\")\n });\n }\n\n for (var _i28 = 0, _valuesDiff$removed2 = valuesDiff.removed; _i28 < _valuesDiff$removed2.length; _i28++) {\n var oldValue = _valuesDiff$removed2[_i28];\n schemaChanges.push({\n type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,\n description: \"\".concat(oldValue.name, \" was removed from enum type \").concat(oldType.name, \".\")\n });\n }\n\n return schemaChanges;\n}\n\nfunction findImplementedInterfacesChanges(oldType, newType) {\n var schemaChanges = [];\n var interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces());\n\n for (var _i30 = 0, _interfacesDiff$added2 = interfacesDiff.added; _i30 < _interfacesDiff$added2.length; _i30++) {\n var newInterface = _interfacesDiff$added2[_i30];\n schemaChanges.push({\n type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED,\n description: \"\".concat(newInterface.name, \" added to interfaces implemented by \").concat(oldType.name, \".\")\n });\n }\n\n for (var _i32 = 0, _interfacesDiff$remov2 = interfacesDiff.removed; _i32 < _interfacesDiff$remov2.length; _i32++) {\n var oldInterface = _interfacesDiff$remov2[_i32];\n schemaChanges.push({\n type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED,\n description: \"\".concat(oldType.name, \" no longer implements interface \").concat(oldInterface.name, \".\")\n });\n }\n\n return schemaChanges;\n}\n\nfunction findFieldChanges(oldType, newType) {\n var schemaChanges = [];\n var fieldsDiff = diff(objectValues(oldType.getFields()), objectValues(newType.getFields()));\n\n for (var _i34 = 0, _fieldsDiff$removed4 = fieldsDiff.removed; _i34 < _fieldsDiff$removed4.length; _i34++) {\n var oldField = _fieldsDiff$removed4[_i34];\n schemaChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: \"\".concat(oldType.name, \".\").concat(oldField.name, \" was removed.\")\n });\n }\n\n for (var _i36 = 0, _fieldsDiff$persisted4 = fieldsDiff.persisted; _i36 < _fieldsDiff$persisted4.length; _i36++) {\n var _ref8 = _fieldsDiff$persisted4[_i36];\n var _oldField2 = _ref8[0];\n var newField = _ref8[1];\n schemaChanges.push.apply(schemaChanges, findArgChanges(oldType, _oldField2, newField));\n var isSafe = isChangeSafeForObjectOrInterfaceField(_oldField2.type, newField.type);\n\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description: \"\".concat(oldType.name, \".\").concat(_oldField2.name, \" changed type from \") + \"\".concat(String(_oldField2.type), \" to \").concat(String(newField.type), \".\")\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findArgChanges(oldType, oldField, newField) {\n var schemaChanges = [];\n var argsDiff = diff(oldField.args, newField.args);\n\n for (var _i38 = 0, _argsDiff$removed4 = argsDiff.removed; _i38 < _argsDiff$removed4.length; _i38++) {\n var oldArg = _argsDiff$removed4[_i38];\n schemaChanges.push({\n type: BreakingChangeType.ARG_REMOVED,\n description: \"\".concat(oldType.name, \".\").concat(oldField.name, \" arg \").concat(oldArg.name, \" was removed.\")\n });\n }\n\n for (var _i40 = 0, _argsDiff$persisted2 = argsDiff.persisted; _i40 < _argsDiff$persisted2.length; _i40++) {\n var _ref10 = _argsDiff$persisted2[_i40];\n var _oldArg = _ref10[0];\n var newArg = _ref10[1];\n var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldArg.type, newArg.type);\n\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_CHANGED_KIND,\n description: \"\".concat(oldType.name, \".\").concat(oldField.name, \" arg \").concat(_oldArg.name, \" has changed type from \") + \"\".concat(String(_oldArg.type), \" to \").concat(String(newArg.type), \".\")\n });\n } else if (_oldArg.defaultValue !== undefined) {\n if (newArg.defaultValue === undefined) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: \"\".concat(oldType.name, \".\").concat(oldField.name, \" arg \").concat(_oldArg.name, \" defaultValue was removed.\")\n });\n } else {\n // Since we looking only for client's observable changes we should\n // compare default values in the same representation as they are\n // represented inside introspection.\n var oldValueStr = stringifyValue(_oldArg.defaultValue, _oldArg.type);\n var newValueStr = stringifyValue(newArg.defaultValue, newArg.type);\n\n if (oldValueStr !== newValueStr) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: \"\".concat(oldType.name, \".\").concat(oldField.name, \" arg \").concat(_oldArg.name, \" has changed defaultValue from \").concat(oldValueStr, \" to \").concat(newValueStr, \".\")\n });\n }\n }\n }\n }\n\n for (var _i42 = 0, _argsDiff$added4 = argsDiff.added; _i42 < _argsDiff$added4.length; _i42++) {\n var _newArg = _argsDiff$added4[_i42];\n\n if (isRequiredArgument(_newArg)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_ARG_ADDED,\n description: \"A required arg \".concat(_newArg.name, \" on \").concat(oldType.name, \".\").concat(oldField.name, \" was added.\")\n });\n } else {\n schemaChanges.push({\n type: DangerousChangeType.OPTIONAL_ARG_ADDED,\n description: \"An optional arg \".concat(_newArg.name, \" on \").concat(oldType.name, \".\").concat(oldField.name, \" was added.\")\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction isChangeSafeForObjectOrInterfaceField(oldType, newType) {\n if (isListType(oldType)) {\n return (// if they're both lists, make sure the underlying types are compatible\n isListType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) || // moving from nullable to non-null of the same underlying type is safe\n isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)\n );\n }\n\n if (isNonNullType(oldType)) {\n // if they're both non-null, make sure the underlying types are compatible\n return isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType);\n }\n\n return (// if they're both named types, see if their names are equivalent\n isNamedType(newType) && oldType.name === newType.name || // moving from nullable to non-null of the same underlying type is safe\n isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)\n );\n}\n\nfunction isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) {\n if (isListType(oldType)) {\n // if they're both lists, make sure the underlying types are compatible\n return isListType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType);\n }\n\n if (isNonNullType(oldType)) {\n return (// if they're both non-null, make sure the underlying types are\n // compatible\n isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) || // moving from non-null to nullable of the same underlying type is safe\n !isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType)\n );\n } // if they're both named types, see if their names are equivalent\n\n\n return isNamedType(newType) && oldType.name === newType.name;\n}\n\nfunction typeKindName(type) {\n if (isScalarType(type)) {\n return 'a Scalar type';\n }\n\n if (isObjectType(type)) {\n return 'an Object type';\n }\n\n if (isInterfaceType(type)) {\n return 'an Interface type';\n }\n\n if (isUnionType(type)) {\n return 'a Union type';\n }\n\n if (isEnumType(type)) {\n return 'an Enum type';\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isInputObjectType(type)) {\n return 'an Input type';\n } // istanbul ignore next (Not reachable. All possible named types have been considered)\n\n\n false || invariant(0, 'Unexpected type: ' + inspect(type));\n}\n\nfunction stringifyValue(value, type) {\n var ast = astFromValue(value, type);\n ast != null || invariant(0);\n var sortedAST = visit(ast, {\n ObjectValue: function ObjectValue(objectNode) {\n // Make a copy since sort mutates array\n var fields = [].concat(objectNode.fields);\n fields.sort(function (fieldA, fieldB) {\n return naturalCompare(fieldA.name.value, fieldB.name.value);\n });\n return _objectSpread(_objectSpread({}, objectNode), {}, {\n fields: fields\n });\n }\n });\n return print(sortedAST);\n}\n\nfunction diff(oldArray, newArray) {\n var added = [];\n var removed = [];\n var persisted = [];\n var oldMap = keyMap(oldArray, function (_ref11) {\n var name = _ref11.name;\n return name;\n });\n var newMap = keyMap(newArray, function (_ref12) {\n var name = _ref12.name;\n return name;\n });\n\n for (var _i44 = 0; _i44 < oldArray.length; _i44++) {\n var oldItem = oldArray[_i44];\n var newItem = newMap[oldItem.name];\n\n if (newItem === undefined) {\n removed.push(oldItem);\n } else {\n persisted.push([oldItem, newItem]);\n }\n }\n\n for (var _i46 = 0; _i46 < newArray.length; _i46++) {\n var _newItem = newArray[_i46];\n\n if (oldMap[_newItem.name] === undefined) {\n added.push(_newItem);\n }\n }\n\n return {\n added: added,\n persisted: persisted,\n removed: removed\n };\n}\n","import { validate } from \"../validation/validate.mjs\";\nimport { NoDeprecatedCustomRule } from \"../validation/rules/custom/NoDeprecatedCustomRule.mjs\";\n/**\n * A validation rule which reports deprecated usages.\n *\n * Returns a list of GraphQLError instances describing each deprecated use.\n *\n * @deprecated Please use `validate` with `NoDeprecatedCustomRule` instead:\n *\n * ```\n * import { validate, NoDeprecatedCustomRule } from 'graphql'\n *\n * const errors = validate(schema, document, [NoDeprecatedCustomRule])\n * ```\n */\n\nexport function findDeprecatedUsages(schema, ast) {\n return validate(schema, ast, [NoDeprecatedCustomRule]);\n}\n","// Produce the GraphQL query recommended for a full schema introspection.\n// Accepts optional IntrospectionOptions.\nexport { getIntrospectionQuery } from \"./getIntrospectionQuery.mjs\";\n// Gets the target Operation from a Document.\nexport { getOperationAST } from \"./getOperationAST.mjs\"; // Gets the Type for the target Operation AST.\n\nexport { getOperationRootType } from \"./getOperationRootType.mjs\"; // Convert a GraphQLSchema to an IntrospectionQuery.\n\nexport { introspectionFromSchema } from \"./introspectionFromSchema.mjs\"; // Build a GraphQLSchema from an introspection result.\n\nexport { buildClientSchema } from \"./buildClientSchema.mjs\"; // Build a GraphQLSchema from GraphQL Schema language.\n\nexport { buildASTSchema, buildSchema } from \"./buildASTSchema.mjs\";\n// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.\nexport { extendSchema // @deprecated: Get the description from a schema AST node and supports legacy\n// syntax for specifying descriptions - will be removed in v16.\n, getDescription } from \"./extendSchema.mjs\"; // Sort a GraphQLSchema.\n\nexport { lexicographicSortSchema } from \"./lexicographicSortSchema.mjs\"; // Print a GraphQLSchema to GraphQL Schema language.\n\nexport { printSchema, printType, printIntrospectionSchema } from \"./printSchema.mjs\"; // Create a GraphQLType from a GraphQL language AST.\n\nexport { typeFromAST } from \"./typeFromAST.mjs\"; // Create a JavaScript value from a GraphQL language AST with a type.\n\nexport { valueFromAST } from \"./valueFromAST.mjs\"; // Create a JavaScript value from a GraphQL language AST without a type.\n\nexport { valueFromASTUntyped } from \"./valueFromASTUntyped.mjs\"; // Create a GraphQL language AST from a JavaScript value.\n\nexport { astFromValue } from \"./astFromValue.mjs\"; // A helper to use within recursive-descent visitors which need to be aware of\n// the GraphQL type system.\n\nexport { TypeInfo, visitWithTypeInfo } from \"./TypeInfo.mjs\"; // Coerces a JavaScript value to a GraphQL type, or produces errors.\n\nexport { coerceInputValue } from \"./coerceInputValue.mjs\"; // Concatenates multiple AST together.\n\nexport { concatAST } from \"./concatAST.mjs\"; // Separates an AST into an AST per Operation.\n\nexport { separateOperations } from \"./separateOperations.mjs\"; // Strips characters that are not significant to the validity or execution\n// of a GraphQL document.\n\nexport { stripIgnoredCharacters } from \"./stripIgnoredCharacters.mjs\"; // Comparators for types\n\nexport { isEqualType, isTypeSubTypeOf, doTypesOverlap } from \"./typeComparators.mjs\"; // Asserts that a string is a valid GraphQL name\n\nexport { assertValidName, isValidNameError } from \"./assertValidName.mjs\"; // Compares two GraphQLSchemas and detects breaking changes.\n\nexport { BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges } from \"./findBreakingChanges.mjs\";\n// @deprecated: Report all deprecated usage within a GraphQL document.\nexport { findDeprecatedUsages } from \"./findDeprecatedUsages.mjs\";\n","/**\n * GraphQL.js provides a reference implementation for the GraphQL specification\n * but is also a useful utility for operating on GraphQL files and building\n * sophisticated tools.\n *\n * This primary module exports a general purpose function for fulfilling all\n * steps of the GraphQL specification in a single operation, but also includes\n * utilities for every part of the GraphQL specification:\n *\n * - Parsing the GraphQL language.\n * - Building a GraphQL type schema.\n * - Validating a GraphQL request against a type schema.\n * - Executing a GraphQL request against a type schema.\n *\n * This also includes utility functions for operating on GraphQL types and\n * GraphQL documents to facilitate building tools.\n *\n * You may also import from each sub-directory directly. For example, the\n * following two import statements are equivalent:\n *\n * import { parse } from 'graphql';\n * import { parse } from 'graphql/language';\n */\n// The GraphQL.js version info.\nexport { version, versionInfo } from \"./version.mjs\"; // The primary entry point into fulfilling a GraphQL request.\n\nexport { graphql, graphqlSync } from \"./graphql.mjs\"; // Create and operate on GraphQL type definitions and schema.\n\nexport { // Definitions\nGraphQLSchema, GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull // Standard GraphQL Scalars\n, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID // Built-in Directives defined by the Spec\n, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective // \"Enum\" of Type Kinds\n, TypeKind // Constant Deprecation Reason\n, DEFAULT_DEPRECATION_REASON // GraphQL Types for introspection.\n, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind // Meta-field definitions.\n, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef // Predicates\n, isSchema, isDirective, isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective // Assertions\n, assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType // Un-modifiers\n, getNullableType, getNamedType // Validate GraphQL schema.\n, validateSchema, assertValidSchema } from \"./type/index.mjs\";\n// Parse and operate on GraphQL language source files.\nexport { Token, Source, Location, getLocation // Print source location\n, printLocation, printSourceLocation // Lex\n, Lexer, TokenKind // Parse\n, parse, parseValue, parseType // Print\n, print // Visit\n, visit, visitInParallel, getVisitFn, BREAK, Kind, DirectiveLocation // Predicates\n, isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from \"./language/index.mjs\";\n// Execute GraphQL queries.\nexport { execute, executeSync, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getDirectiveValues } from \"./execution/index.mjs\";\nexport { subscribe, createSourceEventStream } from \"./subscription/index.mjs\";\n// Validate GraphQL documents.\nexport { validate, ValidationContext // All validation rules in the GraphQL Specification.\n, specifiedRules // Individual validation rules.\n, ExecutableDefinitionsRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule // SDL-specific validation rules\n, LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueDirectiveNamesRule, PossibleTypeExtensionsRule // Custom validation rules\n, NoDeprecatedCustomRule, NoSchemaIntrospectionCustomRule } from \"./validation/index.mjs\";\n// Create, format, and print GraphQL errors.\nexport { GraphQLError, syntaxError, locatedError, printError, formatError } from \"./error/index.mjs\";\n// Utilities for operating on GraphQL type schema and parsed sources.\nexport { // Produce the GraphQL query recommended for a full schema introspection.\n// Accepts optional IntrospectionOptions.\ngetIntrospectionQuery // Gets the target Operation from a Document.\n, getOperationAST // Gets the Type for the target Operation AST.\n, getOperationRootType // Convert a GraphQLSchema to an IntrospectionQuery.\n, introspectionFromSchema // Build a GraphQLSchema from an introspection result.\n, buildClientSchema // Build a GraphQLSchema from a parsed GraphQL Schema language AST.\n, buildASTSchema // Build a GraphQLSchema from a GraphQL schema language document.\n, buildSchema // @deprecated: Get the description from a schema AST node and supports legacy\n// syntax for specifying descriptions - will be removed in v16.\n, getDescription // Extends an existing GraphQLSchema from a parsed GraphQL Schema\n// language AST.\n, extendSchema // Sort a GraphQLSchema.\n, lexicographicSortSchema // Print a GraphQLSchema to GraphQL Schema language.\n, printSchema // Print a GraphQLType to GraphQL Schema language.\n, printType // Prints the built-in introspection schema in the Schema Language\n// format.\n, printIntrospectionSchema // Create a GraphQLType from a GraphQL language AST.\n, typeFromAST // Create a JavaScript value from a GraphQL language AST with a Type.\n, valueFromAST // Create a JavaScript value from a GraphQL language AST without a Type.\n, valueFromASTUntyped // Create a GraphQL language AST from a JavaScript value.\n, astFromValue // A helper to use within recursive-descent visitors which need to be aware of\n// the GraphQL type system.\n, TypeInfo, visitWithTypeInfo // Coerces a JavaScript value to a GraphQL type, or produces errors.\n, coerceInputValue // Concatenates multiple AST together.\n, concatAST // Separates an AST into an AST per Operation.\n, separateOperations // Strips characters that are not significant to the validity or execution\n// of a GraphQL document.\n, stripIgnoredCharacters // Comparators for types\n, isEqualType, isTypeSubTypeOf, doTypesOverlap // Asserts a string is a valid GraphQL name.\n, assertValidName // Determine if a string is a valid GraphQL name.\n, isValidNameError // Compares two GraphQLSchemas and detects breaking changes.\n, BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges // @deprecated: Report all deprecated usage within a GraphQL document.\n, findDeprecatedUsages } from \"./utilities/index.mjs\";\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n ASTNode,\n visit,\n} from 'graphql';\n\nimport { invariant } from 'ts-invariant';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function shouldInclude(\n { directives }: SelectionNode,\n variables?: Record,\n): boolean {\n if (!directives || !directives.length) {\n return true;\n }\n return getInclusionDirectives(\n directives\n ).every(({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables && variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directive.name.value} directive.`,\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\n\nexport function getDirectiveNames(root: ASTNode) {\n const names: string[] = [];\n\n visit(root, {\n Directive(node: DirectiveNode) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], root: ASTNode) {\n return getDirectiveNames(root).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === 'skip' || value === 'include';\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray,\n): InclusionDirectives {\n const result: InclusionDirectives = [];\n\n if (directives && directives.length) {\n directives.forEach(directive => {\n if (!isInclusionDirective(directive)) return;\n\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments![0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n\n result.push({ directive, ifArgument });\n });\n }\n\n return result;\n}\n\n","import {\n DocumentNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionNode\n} from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n return symTable;\n}\n\nexport function getFragmentFromSelection(\n selection: SelectionNode,\n fragmentMap?: FragmentMap,\n): InlineFragmentNode | FragmentDefinitionNode | null {\n switch (selection.kind) {\n case 'InlineFragment':\n return selection;\n case 'FragmentSpread': {\n const fragment = fragmentMap && fragmentMap[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n return fragment!;\n }\n default:\n return null;\n }\n}\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\nimport { FragmentMap, getFragmentFromSelection } from './fragments';\n\nexport interface Reference {\n readonly __ref: string;\n}\n\nexport function makeReference(id: string): Reference {\n return { __ref: String(id) };\n}\n\nexport function isReference(obj: any): obj is Reference {\n return Boolean(obj && typeof obj === 'object' && typeof obj.__ref === 'string');\n}\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | Reference\n | Reference[]\n | null\n | undefined\n | void\n | Object;\n\nexport interface StoreObject {\n __typename?: string;\n [storeFieldName: string]: StoreValue;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Record | null,\n directives?: Directives,\n): string {\n if (\n args &&\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = args[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables?: Record,\n): Object | null {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function getTypenameFromResult(\n result: Record,\n selectionSet: SelectionSetNode,\n fragmentMap?: FragmentMap,\n): string | undefined {\n if (typeof result.__typename === 'string') {\n return result.__typename;\n }\n\n for (const selection of selectionSet.selections) {\n if (isField(selection)) {\n if (selection.name.value === '__typename') {\n return result[resultKeyNameFromField(selection)];\n }\n } else {\n const typename = getTypenameFromResult(\n result,\n getFragmentFromSelection(selection, fragmentMap)!.selectionSet,\n fragmentMap,\n );\n if (typeof typename === 'string') {\n return typename;\n }\n }\n }\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { valueToObjectRepresentation } from './storeUtils';\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x!.name!.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): Record {\n const defaultValues = Object.create(null);\n const defs = definition && definition.variableDefinitions;\n if (defs && defs.length) {\n defs.forEach(def => {\n if (def.defaultValue) {\n valueToObjectRepresentation(\n defaultValues,\n def.variable.name,\n def.defaultValue as ValueNode,\n );\n }\n });\n }\n return defaultValues;\n}\n","export function filterInPlace(\n array: T[],\n test: (elem: T) => boolean,\n context?: any,\n): T[] {\n let target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n visit,\n} from 'graphql';\nimport { invariant } from 'ts-invariant';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from '../common/filterInPlace';\nimport { isField, isInlineFragment } from './storeUtils';\nimport {\n createFragmentMap,\n FragmentMap,\n} from './fragments';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll first check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // document.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !!v.name && !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !!fs.name && !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // If this SelectionSet is @export-ed as an input variable, it should\n // not have a __typename field (see issue #4691).\n const field = parent as FieldNode;\n if (\n isField(field) &&\n field.directives &&\n field.directives.some(d => d.name.value === 'export')\n ) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nexport interface addTypenameToDocument {\n added(field: FieldNode): boolean;\n}\naddTypenameToDocument.added = function (field: FieldNode) {\n return field === TYPENAME_FIELD;\n};\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n invariant.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode | undefined,\n nestedCheck = true,\n): boolean {\n return (\n !!selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (!isField(selection)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions ? node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ) : [],\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n if (node.arguments) {\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n }\n\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection =>\n isField(selection) && selection.name.value === '__typename',\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || ({} as T);\n const count = sources.length;\n if (count > 1) {\n const merger = new DeepMerger();\n for (let i = 1; i < count; ++i) {\n target = merger.merge(target, sources[i]);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nexport type ReconcilerFunction = (\n this: DeepMerger,\n target: Record,\n source: Record,\n property: string | number,\n ...context: TContextArgs\n) => any;\n\nconst defaultReconciler: ReconcilerFunction =\n function (target, source, property) {\n return this.merge(target[property], source[property]);\n };\n\nexport class DeepMerger {\n constructor(\n private reconciler: ReconcilerFunction = defaultReconciler,\n ) {}\n\n public merge(target: any, source: any, ...context: TContextArgs): any {\n if (isObject(source) && isObject(target)) {\n Object.keys(source).forEach(sourceKey => {\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (source[sourceKey] !== targetValue) {\n const result = this.reconciler(target, source, sourceKey, ...context);\n // A well-implemented reconciler may return targetValue to indicate\n // the merge changed nothing about the structure of the target.\n if (result !== targetValue) {\n target = this.shallowCopyForMerge(target);\n target[sourceKey] = result;\n }\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target = this.shallowCopyForMerge(target);\n target[sourceKey] = source[sourceKey];\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n }\n\n public isObject = isObject;\n\n private pastCopies = new Set();\n\n public shallowCopyForMerge(value: T): T {\n if (isObject(value) && !this.pastCopies.has(value)) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n this.pastCopies.add(value);\n }\n return value;\n }\n}\n","import { __rest } from \"tslib\";\n\nimport { FieldPolicy, Reference } from '../../cache';\nimport { mergeDeep } from '../common/mergeDeep';\n\ntype KeyArgs = FieldPolicy[\"keyArgs\"];\n\n// A very basic pagination field policy that always concatenates new\n// results onto the existing array, without examining options.args.\nexport function concatPagination(\n keyArgs: KeyArgs = false,\n): FieldPolicy {\n return {\n keyArgs,\n merge(existing, incoming) {\n return existing ? [\n ...existing,\n ...incoming,\n ] : incoming;\n },\n };\n}\n\n// A basic field policy that uses options.args.{offset,limit} to splice\n// the incoming data into the existing array. If your arguments are called\n// something different (like args.{start,count}), feel free to copy/paste\n// this implementation and make the appropriate changes.\nexport function offsetLimitPagination(\n keyArgs: KeyArgs = false,\n): FieldPolicy {\n return {\n keyArgs,\n merge(existing, incoming, { args }) {\n const merged = existing ? existing.slice(0) : [];\n if (args) {\n // Assume an offset of 0 if args.offset omitted.\n const { offset = 0 } = args;\n for (let i = 0; i < incoming.length; ++i) {\n merged[offset + i] = incoming[i];\n }\n } else {\n // It's unusual (probably a mistake) for a paginated field not\n // to receive any arguments, so you might prefer to throw an\n // exception here, instead of recovering by appending incoming\n // onto the existing array.\n merged.push.apply(merged, incoming);\n }\n return merged;\n },\n };\n}\n\n// Whether TRelayEdge is a normalized Reference or a non-normalized\n// object, it needs a .cursor property where the relayStylePagination\n// merge function can store cursor strings taken from pageInfo. Storing an\n// extra reference.cursor property should be safe, and is easier than\n// attempting to update the cursor field of the normalized StoreObject\n// that the reference refers to, or managing edge wrapper objects\n// (something I attempted in #7023, but abandoned because of #7088).\nexport type TRelayEdge = {\n cursor?: string;\n node: TNode;\n} | (Reference & { cursor?: string });\n\nexport type TRelayPageInfo = {\n hasPreviousPage: boolean;\n hasNextPage: boolean;\n startCursor: string;\n endCursor: string;\n};\n\nexport type TExistingRelay = Readonly<{\n edges: TRelayEdge[];\n pageInfo: TRelayPageInfo;\n}>;\n\nexport type TIncomingRelay = {\n edges?: TRelayEdge[];\n pageInfo?: TRelayPageInfo;\n};\n\nexport type RelayFieldPolicy = FieldPolicy<\n TExistingRelay,\n TIncomingRelay,\n TIncomingRelay\n>;\n\n// As proof of the flexibility of field policies, this function generates\n// one that handles Relay-style pagination, without Apollo Client knowing\n// anything about connections, edges, cursors, or pageInfo objects.\nexport function relayStylePagination(\n keyArgs: KeyArgs = false,\n): RelayFieldPolicy {\n return {\n keyArgs,\n\n read(existing, { canRead, readField }) {\n if (!existing) return;\n\n const edges: TRelayEdge[] = [];\n let startCursor = \"\";\n let endCursor = \"\";\n existing.edges.forEach(edge => {\n // Edges themselves could be Reference objects, so it's important\n // to use readField to access the edge.edge.node property.\n if (canRead(readField(\"node\", edge))) {\n edges.push(edge);\n if (edge.cursor) {\n startCursor = startCursor || edge.cursor;\n endCursor = edge.cursor;\n }\n }\n });\n\n return {\n // Some implementations return additional Connection fields, such\n // as existing.totalCount. These fields are saved by the merge\n // function, so the read function should also preserve them.\n ...getExtras(existing),\n edges,\n pageInfo: {\n ...existing.pageInfo,\n startCursor,\n endCursor,\n },\n };\n },\n\n merge(existing = makeEmptyData(), incoming, { args, isReference, readField }) {\n const incomingEdges = incoming.edges ? incoming.edges.map(edge => {\n if (isReference(edge = { ...edge })) {\n // In case edge is a Reference, we read out its cursor field and\n // store it as an extra property of the Reference object.\n edge.cursor = readField(\"cursor\", edge);\n }\n return edge;\n }) : [];\n\n if (incoming.pageInfo) {\n const { pageInfo } = incoming;\n const { startCursor, endCursor } = pageInfo;\n const firstEdge = incomingEdges[0];\n const lastEdge = incomingEdges[incomingEdges.length - 1];\n // In case we did not request the cursor field for edges in this\n // query, we can still infer cursors from pageInfo.\n if (firstEdge && startCursor) {\n firstEdge.cursor = startCursor;\n }\n if (lastEdge && endCursor) {\n lastEdge.cursor = endCursor;\n }\n // Cursors can also come from edges, so we default\n // pageInfo.{start,end}Cursor to {first,last}Edge.cursor.\n const firstCursor = firstEdge && firstEdge.cursor;\n if (firstCursor && !startCursor) {\n incoming = mergeDeep(incoming, {\n pageInfo: {\n startCursor: firstCursor,\n },\n });\n }\n const lastCursor = lastEdge && lastEdge.cursor;\n if (lastCursor && !endCursor) {\n incoming = mergeDeep(incoming, {\n pageInfo: {\n endCursor: lastCursor,\n },\n });\n }\n }\n\n let prefix = existing.edges;\n let suffix: typeof prefix = [];\n\n if (args && args.after) {\n // This comparison does not need to use readField(\"cursor\", edge),\n // because we stored the cursor field of any Reference edges as an\n // extra property of the Reference object.\n const index = prefix.findIndex(edge => edge.cursor === args.after);\n if (index >= 0) {\n prefix = prefix.slice(0, index + 1);\n // suffix = []; // already true\n }\n } else if (args && args.before) {\n const index = prefix.findIndex(edge => edge.cursor === args.before);\n suffix = index < 0 ? prefix : prefix.slice(index);\n prefix = [];\n } else if (incoming.edges) {\n // If we have neither args.after nor args.before, the incoming\n // edges cannot be spliced into the existing edges, so they must\n // replace the existing edges. See #6592 for a motivating example.\n prefix = [];\n }\n\n const edges = [\n ...prefix,\n ...incomingEdges,\n ...suffix,\n ];\n\n const pageInfo: TRelayPageInfo = {\n // The ordering of these two ...spreads may be surprising, but it\n // makes sense because we want to combine PageInfo properties with a\n // preference for existing values, *unless* the existing values are\n // overridden by the logic below, which is permitted only when the\n // incoming page falls at the beginning or end of the data.\n ...incoming.pageInfo,\n ...existing.pageInfo,\n };\n\n if (incoming.pageInfo) {\n const {\n hasPreviousPage, hasNextPage,\n startCursor, endCursor,\n ...extras\n } = incoming.pageInfo;\n\n // If incoming.pageInfo had any extra non-standard properties,\n // assume they should take precedence over any existing properties\n // of the same name, regardless of where this page falls with\n // respect to the existing data.\n Object.assign(pageInfo, extras);\n\n // Keep existing.pageInfo.has{Previous,Next}Page unless the\n // placement of the incoming edges means incoming.hasPreviousPage\n // or incoming.hasNextPage should become the new values for those\n // properties in existing.pageInfo. Note that these updates are\n // only permitted when the beginning or end of the incoming page\n // coincides with the beginning or end of the existing data, as\n // determined using prefix.length and suffix.length.\n if (!prefix.length) {\n if (void 0 !== hasPreviousPage) pageInfo.hasPreviousPage = hasPreviousPage;\n if (void 0 !== startCursor) pageInfo.startCursor = startCursor;\n }\n if (!suffix.length) {\n if (void 0 !== hasNextPage) pageInfo.hasNextPage = hasNextPage;\n if (void 0 !== endCursor) pageInfo.endCursor = endCursor;\n }\n }\n\n return {\n ...getExtras(existing),\n ...getExtras(incoming),\n edges,\n pageInfo,\n };\n },\n };\n}\n\n// Returns any unrecognized properties of the given object.\nconst getExtras = (obj: Record) => __rest(obj, notExtras);\nconst notExtras = [\"edges\", \"pageInfo\"];\n\nfunction makeEmptyData(): TExistingRelay {\n return {\n edges: [],\n pageInfo: {\n hasPreviousPage: false,\n hasNextPage: true,\n startCursor: \"\",\n endCursor: \"\",\n },\n };\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Observable = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// === Symbol Support ===\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\n\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\n\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species'); // === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n if (value == null) return undefined;\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n\n if (ctor === null) {\n ctor = undefined;\n }\n }\n\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n\n if (!queue) {\n return;\n }\n\n subscription._queue = undefined;\n subscription._state = 'ready';\n\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({\n type: type,\n value: value\n });\n\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{\n type: type,\n value: value\n }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription =\n/*#__PURE__*/\nfunction () {\n function Subscription(observer, subscriber) {\n _classCallCheck(this, Subscription);\n\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n _createClass(Subscription, [{\n key: \"unsubscribe\",\n value: function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n }\n }, {\n key: \"closed\",\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver =\n/*#__PURE__*/\nfunction () {\n function SubscriptionObserver(subscription) {\n _classCallCheck(this, SubscriptionObserver);\n\n this._subscription = subscription;\n }\n\n _createClass(SubscriptionObserver, [{\n key: \"next\",\n value: function next(value) {\n onNotify(this._subscription, 'next', value);\n }\n }, {\n key: \"error\",\n value: function error(value) {\n onNotify(this._subscription, 'error', value);\n }\n }, {\n key: \"complete\",\n value: function complete() {\n onNotify(this._subscription, 'complete');\n }\n }, {\n key: \"closed\",\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable =\n/*#__PURE__*/\nfunction () {\n function Observable(subscriber) {\n _classCallCheck(this, Observable);\n\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n this._subscriber = subscriber;\n }\n\n _createClass(Observable, [{\n key: \"subscribe\",\n value: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n\n return new Subscription(observer, this._subscriber);\n }\n }, {\n key: \"forEach\",\n value: function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n }, {\n key: \"map\",\n value: function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"filter\",\n value: function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"reduce\",\n value: function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n observer.next(acc);\n observer.complete();\n }\n });\n });\n }\n }, {\n key: \"concat\",\n value: function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscription;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n }\n }, {\n key: \"flatMap\",\n value: function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n }\n }, {\n key: SymbolObservable,\n value: function () {\n return this;\n }\n }], [{\n key: \"from\",\n value: function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n if (x == null) throw new TypeError(x + ' is not an object');\n var method = getMethod(x, SymbolObservable);\n\n if (method) {\n var observable = method.call(x);\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n if (isObservable(observable) && observable.constructor === C) return observable;\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _item = _step.value;\n observer.next(_item);\n if (observer.closed) return;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n }\n }, {\n key: \"of\",\n value: function of() {\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n }, {\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nexports.Observable = Observable;\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}","module.exports = require('./lib/Observable.js').Observable;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\n\t\t\t// This just needs to be something that won't trample other user's Symbol.for use\n\t\t\t// It also will guide people to the source of their issues, if this is problematic.\n\t\t\t// META: It's a resource locator!\n\t\t\tresult = Symbol.for('https://github.com/benlesh/symbol-observable');\n\t\t\ttry {\n\t\t\t\tSymbol.observable = result;\n\t\t\t} catch (err) {\n\t\t\t\t// Do nothing. In some environments, users have frozen `Symbol` for security reasons,\n\t\t\t\t// if it is frozen assigning to it will throw. In this case, we don't care, because\n\t\t\t\t// they will need to use the returned value from the ponyfill.\n\t\t\t}\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","import Observable from 'zen-observable';\n\n// This simplified polyfill attempts to follow the ECMAScript Observable\n// proposal (https://github.com/zenparsing/es-observable)\nimport 'symbol-observable';\n\nexport type ObservableSubscription = ZenObservable.Subscription;\nexport type Observer = ZenObservable.Observer;\nexport type Subscriber = ZenObservable.Subscriber;\n\n// The zen-observable package defines Observable.prototype[Symbol.observable]\n// when Symbol is supported, but RxJS interop depends on also setting this fake\n// '@@observable' string as a polyfill for Symbol.observable.\nconst { prototype } = Observable;\nconst fakeObsSymbol = '@@observable' as keyof typeof prototype;\nif (!prototype[fakeObsSymbol]) {\n prototype[fakeObsSymbol] = function () { return this; };\n}\n\nexport { Observable };\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value);\n}\n\nfunction cloneDeepHelper(val: T, seen?: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n seen = seen || new Map;\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n seen = seen || new Map;\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { isDevelopment, isTest } from './environment';\n\nfunction isObject(value: any) {\n return value !== null && typeof value === \"object\";\n}\n\nfunction deepFreeze(value: any) {\n const workSet = new Set([value]);\n workSet.forEach(obj => {\n if (isObject(obj)) {\n if (!Object.isFrozen(obj)) Object.freeze(obj);\n Object.getOwnPropertyNames(obj).forEach(name => {\n if (isObject(obj[name])) workSet.add(obj[name]);\n });\n }\n });\n return value;\n}\n\nexport function maybeDeepFreeze(obj: T): T {\n if (process.env.NODE_ENV !== \"production\" && (isDevelopment() || isTest())) {\n deepFreeze(obj);\n }\n return obj;\n}\n","import { Observer } from \"./Observable\";\n\nexport function iterateObserversSafely(\n observers: Set>,\n method: keyof Observer,\n argument?: A,\n) {\n // In case observers is modified during iteration, we need to commit to the\n // original elements, which also provides an opportunity to filter them down\n // to just the observers with the given method.\n const observersWithMethod: Observer[] = [];\n observers.forEach(obs => obs[method] && observersWithMethod.push(obs));\n observersWithMethod.forEach(obs => (obs as any)[method](argument));\n}\n","import { Observable, Observer } from \"./Observable\";\n\n// Like Observable.prototype.map, except that the mapping function can\n// optionally return a Promise (or be async).\nexport function asyncMap(\n observable: Observable,\n mapFn: (value: V) => R | PromiseLike,\n catchFn?: (error: any) => R | PromiseLike,\n): Observable {\n return new Observable(observer => {\n const { next, error, complete } = observer;\n let activeCallbackCount = 0;\n let completed = false;\n let promiseQueue = {\n // Normally we would initialize promiseQueue to Promise.resolve(), but\n // in this case, for backwards compatibility, we need to be careful to\n // invoke the first callback synchronously.\n then(callback: () => any) {\n return new Promise(resolve => resolve(callback()));\n },\n } as Promise;\n\n function makeCallback(\n examiner: typeof mapFn | typeof catchFn,\n delegate: typeof next | typeof error,\n ): (arg: any) => void {\n if (examiner) {\n return arg => {\n ++activeCallbackCount;\n const both = () => examiner(arg);\n promiseQueue = promiseQueue.then(both, both).then(\n result => {\n --activeCallbackCount;\n next && next.call(observer, result);\n if (completed) {\n handler.complete!();\n }\n },\n error => {\n --activeCallbackCount;\n throw error;\n },\n ).catch(caught => {\n error && error.call(observer, caught);\n });\n };\n } else {\n return arg => delegate && delegate.call(observer, arg);\n }\n }\n\n const handler: Observer = {\n next: makeCallback(mapFn, next),\n error: makeCallback(catchFn, error),\n complete() {\n completed = true;\n if (!activeCallbackCount) {\n complete && complete.call(observer);\n }\n },\n };\n\n const sub = observable.subscribe(handler);\n return () => sub.unsubscribe();\n });\n}\n","import { Observable } from \"./Observable\";\n\n// Generic implementations of Observable.prototype methods like map and\n// filter need to know how to create a new Observable from an Observable\n// subclass (like Concast or ObservableQuery). Those methods assume\n// (perhaps unwisely?) that they can call the subtype's constructor with a\n// Subscriber function, even though the subclass constructor might expect\n// different parameters. Defining this static Symbol.species property on\n// the subclass is a hint to generic Observable code to use the default\n// constructor instead of trying to do `new Subclass(observer => ...)`.\nexport function fixObservableSubclass<\n S extends new (...args: any[]) => Observable,\n>(subclass: S): S {\n function set(key: symbol | string) {\n // Object.defineProperty is necessary because the Symbol.species\n // property is a getter by default in modern JS environments, so we\n // can't assign to it with a normal assignment expression.\n Object.defineProperty(subclass, key, { value: Observable });\n }\n if (typeof Symbol === \"function\" && Symbol.species) {\n set(Symbol.species);\n }\n // The \"@@species\" string is used as a fake Symbol.species value in some\n // polyfill systems (including the SymbolSpecies variable used by\n // zen-observable), so we should set it as well, to be safe.\n set(\"@@species\");\n return subclass;\n}\n","import { Observable, Observer, ObservableSubscription, Subscriber } from \"./Observable\";\nimport { iterateObserversSafely } from \"./iteration\";\nimport { fixObservableSubclass } from \"./subclassing\";\n\ntype MaybeAsync = T | PromiseLike;\n\nfunction isPromiseLike(value: MaybeAsync): value is PromiseLike {\n return value && typeof (value as any).then === \"function\";\n}\n\n// Any individual Source can be an Observable or a promise for one.\ntype Source = MaybeAsync>;\n\nexport type ConcastSourcesIterable = Iterable>;\n\n// A Concast observable concatenates the given sources into a single\n// non-overlapping sequence of Ts, automatically unwrapping any promises,\n// and broadcasts the T elements of that sequence to any number of\n// subscribers, all without creating a bunch of intermediary Observable\n// wrapper objects.\n//\n// Even though any number of observers can subscribe to the Concast, each\n// source observable is guaranteed to receive at most one subscribe call,\n// and the results are multicast to all observers.\n//\n// In addition to broadcasting every next/error message to this.observers,\n// the Concast stores the most recent message using this.latest, so any\n// new observers can immediately receive the latest message, even if it\n// was originally delivered in the past. This behavior means we can assume\n// every active observer in this.observers has received the same most\n// recent message.\n//\n// With the exception of this.latest replay, a Concast is a \"hot\"\n// observable in the sense that it does not replay past results from the\n// beginning of time for each new observer.\n//\n// Could we have used some existing RxJS class instead? Concast is\n// similar to a BehaviorSubject, because it is multicast and redelivers\n// the latest next/error message to new subscribers. Unlike Subject,\n// Concast does not expose an Observer interface (this.handlers is\n// intentionally private), since Concast gets its inputs from the\n// concatenated sources. If we ever switch to RxJS, there may be some\n// value in reusing their code, but for now we use zen-observable, which\n// does not contain any Subject implementations.\nexport class Concast extends Observable {\n // Active observers receiving broadcast messages. Thanks to this.latest,\n // we can assume all observers in this Set have received the same most\n // recent message, though possibly at different times in the past.\n private observers = new Set>();\n\n // This property starts off undefined to indicate the initial\n // subscription has not yet begun, then points to each source\n // subscription in turn, and finally becomes null after the sources have\n // been exhausted. After that, it stays null.\n private sub?: ObservableSubscription | null;\n\n // Not only can the individual elements of the iterable be promises, but\n // also the iterable itself can be wrapped in a promise.\n constructor(sources: MaybeAsync> | Subscriber) {\n super(observer => {\n this.addObserver(observer);\n return () => this.removeObserver(observer);\n });\n\n // Suppress rejection warnings for this.promise, since it's perfectly\n // acceptable to pay no attention to this.promise if you're consuming\n // the results through the normal observable API.\n this.promise.catch(_ => {});\n\n // If someone accidentally tries to create a Concast using a subscriber\n // function, recover by creating an Observable from that subscriber and\n // using it as the source.\n if (typeof sources === \"function\") {\n sources = [new Observable(sources)];\n }\n\n if (isPromiseLike(sources)) {\n sources.then(\n iterable => this.start(iterable),\n this.handlers.error,\n );\n } else {\n this.start(sources);\n }\n }\n\n // A consumable array of source observables, incrementally consumed\n // each time this.handlers.complete is called.\n private sources: Source[];\n\n private start(sources: ConcastSourcesIterable) {\n if (this.sub !== void 0) return;\n\n // In practice, sources is most often simply an Array of observables.\n // TODO Consider using sources[Symbol.iterator]() to take advantage\n // of the laziness of non-Array iterables.\n this.sources = Array.from(sources);\n\n // Calling this.handlers.complete() kicks off consumption of the first\n // source observable. It's tempting to do this step lazily in\n // addObserver, but this.promise can be accessed without calling\n // addObserver, so consumption needs to begin eagerly.\n this.handlers.complete();\n }\n\n private deliverLastMessage(observer: Observer) {\n if (this.latest) {\n const nextOrError = this.latest[0];\n const method = observer[nextOrError];\n if (method) {\n method.call(observer, this.latest[1]);\n }\n // If the subscription is already closed, and the last message was\n // a 'next' message, simulate delivery of the final 'complete'\n // message again.\n if (this.sub === null &&\n nextOrError === \"next\" &&\n observer.complete) {\n observer.complete();\n }\n }\n }\n\n // Note: cleanup observers do not count towards this total.\n private addCount = 0;\n\n public addObserver(observer: Observer) {\n if (!this.observers.has(observer)) {\n // Immediately deliver the most recent message, so we can always\n // be sure all observers have the latest information.\n this.deliverLastMessage(observer);\n this.observers.add(observer);\n ++this.addCount;\n }\n }\n\n public removeObserver(\n observer: Observer,\n quietly?: boolean,\n ) {\n if (this.observers.delete(observer) &&\n --this.addCount < 1 &&\n !quietly) {\n // In case there are still any cleanup observers in this.observers,\n // and no error or completion has been broadcast yet, make sure\n // those observers receive an error that terminates them.\n this.handlers.error(new Error(\"Observable cancelled prematurely\"));\n }\n }\n\n // Any Concast object can be trivially converted to a Promise, without\n // having to create a new wrapper Observable. This promise provides an\n // easy way to observe the final state of the Concast.\n private resolve: (result?: T | PromiseLike) => void;\n private reject: (reason: any) => void;\n public readonly promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n\n // Name and argument of the most recently invoked observer method, used\n // to deliver latest results immediately to new observers.\n private latest?: [\"next\" | \"error\", any];\n\n // Bound handler functions that can be reused for every internal\n // subscription.\n private handlers = {\n next: (result: T) => {\n if (this.sub !== null) {\n this.latest = [\"next\", result];\n iterateObserversSafely(this.observers, \"next\", result);\n }\n },\n\n error: (error: any) => {\n const { sub } = this;\n if (sub !== null) {\n // Delay unsubscribing from the underlying subscription slightly,\n // so that immediately subscribing another observer can keep the\n // subscription active.\n if (sub) Promise.resolve().then(() => sub.unsubscribe());\n this.sub = null;\n this.latest = [\"error\", error];\n this.reject(error);\n iterateObserversSafely(this.observers, \"error\", error);\n }\n },\n\n complete: () => {\n if (this.sub !== null) {\n const value = this.sources.shift();\n if (!value) {\n this.sub = null;\n if (this.latest &&\n this.latest[0] === \"next\") {\n this.resolve(this.latest[1]);\n } else {\n this.resolve();\n }\n // We do not store this.latest = [\"complete\"], because doing so\n // discards useful information about the previous next (or\n // error) message. Instead, if new observers subscribe after\n // this Concast has completed, they will receive the final\n // 'next' message (unless there was an error) immediately\n // followed by a 'complete' message (see addObserver).\n iterateObserversSafely(this.observers, \"complete\");\n } else if (isPromiseLike(value)) {\n value.then(obs => this.sub = obs.subscribe(this.handlers));\n } else {\n this.sub = value.subscribe(this.handlers);\n }\n }\n },\n };\n\n public cleanup(callback: () => any) {\n let called = false;\n const once = () => {\n if (!called) {\n called = true;\n // Removing a cleanup observer should not unsubscribe from the\n // underlying Observable, so the only removeObserver behavior we\n // need here is to delete observer from this.observers.\n this.observers.delete(observer);\n callback();\n }\n }\n const observer = {\n next: once,\n error: once,\n complete: once,\n };\n const count = this.addCount;\n this.addObserver(observer);\n // Normally addObserver increments this.addCount, but we can \"hide\"\n // cleanup observers by restoring this.addCount to its previous value\n // after adding any cleanup observer.\n this.addCount = count;\n }\n\n // A public way to abort observation and broadcast.\n public cancel = (reason: any) => {\n this.reject(reason);\n this.sources = [];\n this.handlers.complete();\n }\n}\n\n// Necessary because the Concast constructor has a different signature\n// than the Observable constructor.\nfixObservableSubclass(Concast);\n","export function isNonEmptyArray(value?: ArrayLike): value is Array {\n return Array.isArray(value) && value.length > 0;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function graphQLResultHasError(result: ExecutionResult): boolean {\n return (result.errors && result.errors.length > 0) || false;\n}\n","export const canUseWeakMap = typeof WeakMap === 'function' && !(\n typeof navigator === 'object' &&\n navigator.product === 'ReactNative'\n);\n","import { TupleToIntersection } from './mergeDeep';\n\n/**\n * Merges the provided objects shallowly and removes\n * all properties with an `undefined` value\n */\nexport function compact(\n ...objects: TArgs\n): TupleToIntersection {\n const result = Object.create(null);\n\n objects.forEach(obj => {\n if (!obj) return;\n Object.keys(obj).forEach(key => {\n const value = (obj as any)[key];\n if (value !== void 0) {\n result[key] = value;\n }\n });\n });\n\n return result;\n}\n","export {\n DirectiveInfo,\n InclusionDirectives,\n shouldInclude,\n hasDirectives,\n hasClientExports,\n getDirectiveNames,\n getInclusionDirectives,\n} from './graphql/directives';\n\nexport {\n FragmentMap,\n createFragmentMap,\n getFragmentQueryDocument,\n getFragmentFromSelection,\n} from './graphql/fragments';\n\nexport {\n checkDocument,\n getOperationDefinition,\n getOperationName,\n getFragmentDefinitions,\n getQueryDefinition,\n getFragmentDefinition,\n getMainDefinition,\n getDefaultValues,\n} from './graphql/getFromAST';\n\nexport {\n StoreObject,\n Reference,\n StoreValue,\n Directives,\n VariableValue,\n makeReference,\n isReference,\n isField,\n isInlineFragment,\n valueToObjectRepresentation,\n storeKeyNameFromField,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getStoreKeyName,\n getTypenameFromResult,\n} from './graphql/storeUtils';\n\nexport {\n RemoveNodeConfig,\n GetNodeConfig,\n RemoveDirectiveConfig,\n GetDirectiveConfig,\n RemoveArgumentsConfig,\n GetFragmentSpreadConfig,\n RemoveFragmentSpreadConfig,\n RemoveFragmentDefinitionConfig,\n RemoveVariableDefinitionConfig,\n addTypenameToDocument,\n buildQueryFromSelectionSet,\n removeDirectivesFromDocument,\n removeConnectionDirectiveFromDocument,\n removeArgumentsFromDocument,\n removeFragmentSpreadFromDocument,\n removeClientSetsFromDocument,\n} from './graphql/transform';\n\nexport {\n concatPagination,\n offsetLimitPagination,\n relayStylePagination,\n} from './policies/pagination';\n\nexport {\n Observable,\n Observer,\n ObservableSubscription\n} from './observables/Observable';\n\nexport * from './common/mergeDeep';\nexport * from './common/cloneDeep';\nexport * from './common/maybeDeepFreeze';\nexport * from './observables/iteration';\nexport * from './observables/asyncMap';\nexport * from './observables/Concast';\nexport * from './observables/subclassing';\nexport * from './common/arrays';\nexport * from './common/errorHandling';\nexport * from './common/canUse';\nexport * from './common/compact';\n","import { Observable } from '../../utilities';\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n","import { invariant } from 'ts-invariant';\n\nimport { Observable } from '../../utilities';\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n invariant.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n","import { Observable } from '../../utilities';\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n","export type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\nexport const throwServerError = (\n response: Response,\n result: any,\n message: string\n) => {\n const error = new Error(message) as ServerError;\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\n","import { InvariantError } from 'ts-invariant';\n\nimport { GraphQLRequest } from '../core';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n","import { GraphQLRequest, Operation } from '../core';\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = (next: any) => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n return operation as Operation;\n}\n","import { GraphQLRequest, Operation } from '../core';\nimport { getOperationName } from '../../utilities';\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // Best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n\n return transformedOperation as Operation;\n}\n","export { fromError } from './fromError';\nexport { toPromise } from './toPromise';\nexport { fromPromise } from './fromPromise';\nexport { ServerError, throwServerError } from './throwServerError';\nexport { validateOperation } from './validateOperation';\nexport { createOperation } from './createOperation';\nexport { transformOperation } from './transformOperation';\n","import { InvariantError, invariant } from 'ts-invariant';\n\nimport { Observable } from '../../utilities';\nimport {\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n GraphQLRequest\n} from './types';\nimport {\n validateOperation,\n createOperation,\n transformOperation,\n} from '../utils';\n\nfunction passthrough(op: Operation, forward: NextLink) {\n return (forward ? forward(op) : Observable.of()) as Observable;\n}\n\nfunction toLink(handler: RequestHandler | ApolloLink) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\n\nfunction isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nclass LinkError extends Error {\n public link?: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport class ApolloLink {\n public static empty(): ApolloLink {\n return new ApolloLink(() => Observable.of());\n }\n\n public static from(links: (ApolloLink | RequestHandler)[]): ApolloLink {\n if (links.length === 0) return ApolloLink.empty();\n return links.map(toLink).reduce((x, y) => x.concat(y)) as ApolloLink;\n }\n\n public static split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n ): ApolloLink {\n const leftLink = toLink(left);\n const rightLink = toLink(right || new ApolloLink(passthrough));\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n }\n\n public static execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n ): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n }\n\n public static concat(\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n ) {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n invariant.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n }\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n ): ApolloLink {\n return this.concat(\n ApolloLink.split(test, left, right || new ApolloLink(passthrough))\n );\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return ApolloLink.concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new InvariantError('request is not implemented');\n }\n\n protected onError(\n error: any,\n observer?: ZenObservable.Observer,\n ): false | void {\n if (observer && observer.error) {\n observer.error(error);\n // Returning false indicates that observer.error does not need to be\n // called again, since it was already called (on the previous line).\n // Calling observer.error again would not cause any real problems,\n // since only the first call matters, but custom onError functions\n // might have other reasons for wanting to prevent the default\n // behavior by returning false.\n return false;\n }\n // Throw errors will be passed to observer.error.\n throw error;\n }\n\n public setOnError(fn: ApolloLink[\"onError\"]): this {\n this.onError = fn;\n return this;\n }\n}\n","import { ApolloLink } from './ApolloLink';\n\nexport const empty = ApolloLink.empty;\n","import { ApolloLink } from './ApolloLink';\n\nexport const from = ApolloLink.from;\n","import { ApolloLink } from './ApolloLink';\n\nexport const split = ApolloLink.split;\n","import { ApolloLink } from './ApolloLink';\n\nexport const concat = ApolloLink.concat;\n","import { ApolloLink } from './ApolloLink';\n\nexport const execute = ApolloLink.execute;\n","export { empty } from './empty';\nexport { from } from './from';\nexport { split } from './split';\nexport { concat } from './concat';\nexport { execute } from './execute';\nexport { ApolloLink } from './ApolloLink';\n\nexport * from './types';\n","export const version = 'local';\n","import { Operation } from '../core';\nimport { throwServerError } from '../utils';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport function parseAndCheckHttpResponse(\n operations: Operation | Operation[],\n) {\n return (response: Response) => response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n throw parseError;\n }\n })\n .then((result: any) => {\n if (response.status >= 300) {\n // Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n\n if (\n !Array.isArray(result) &&\n !hasOwnProperty.call(result, 'data') &&\n !hasOwnProperty.call(result, 'errors')\n ) {\n // Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n });\n}\n","import { InvariantError } from 'ts-invariant';\n\nexport type ClientParseError = InvariantError & {\n parseError: Error;\n};\n\nexport const serializeFetchParameter = (p: any, label: string) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new InvariantError(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n","import { print } from 'graphql';\n\nimport { Operation } from '../core';\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: WindowOrWorkerGlobalScope['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n\n /**\n * If set to true, the default behavior of stripping unused variables\n * from the request will be disabled.\n *\n * Unused variables are likely to trigger server-side validation errors,\n * per https://spec.graphql.org/draft/#sec-All-Variables-Used, but this\n * includeUnusedVariables option can be useful if your server deviates\n * from the GraphQL specification by not strictly enforcing that rule.\n */\n includeUnusedVariables?: boolean;\n}\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any;\n credentials?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http || {};\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n","import { InvariantError } from 'ts-invariant';\n\nexport const checkFetcher = (fetcher: WindowOrWorkerGlobalScope['fetch'] | undefined) => {\n if (!fetcher && typeof fetch === 'undefined') {\n throw new InvariantError(`\n\"fetch\" has not been found globally and no fetcher has been \\\nconfigured. To fix this, install a fetch package (like \\\nhttps://www.npmjs.com/package/cross-fetch), instantiate the \\\nfetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n `);\n }\n};\n","export const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n","import { Operation } from '../core';\n\nexport const selectURI = (\n operation: Operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n","import { serializeFetchParameter } from './serializeFetchParameter';\nimport { Body } from './selectHttpOptionsAndBody';\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nexport function rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams: string[] = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\n\n if ('query' in body) {\n addQueryParam('query', body.query!);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n","import { visit, DefinitionNode, VariableDefinitionNode } from 'graphql';\n\nimport { ApolloLink } from '../core';\nimport { Observable } from '../../utilities';\nimport { serializeFetchParameter } from './serializeFetchParameter';\nimport { selectURI } from './selectURI';\nimport { parseAndCheckHttpResponse } from './parseAndCheckHttpResponse';\nimport { checkFetcher } from './checkFetcher';\nimport {\n selectHttpOptionsAndBody,\n fallbackHttpConfig,\n HttpOptions\n} from './selectHttpOptionsAndBody';\nimport { createSignalIfSupported } from './createSignalIfSupported';\nimport { rewriteURIForGET } from './rewriteURIForGET';\nimport { fromError } from '../utils';\n\nexport const createHttpLink = (linkOptions: HttpOptions = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch if nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n includeUnusedVariables = false,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n // `apollographql-client-*` headers are automatically set if a\n // `clientAwareness` object is found in the context. These headers are\n // set first, followed by the rest of the headers pulled from\n // `context.headers`. If desired, `apollographql-client-*` headers set by\n // the `clientAwareness` object can be overridden by\n // `apollographql-client-*` headers set in `context.headers`.\n const clientAwarenessHeaders: {\n 'apollographql-client-name'?: string;\n 'apollographql-client-version'?: string;\n } = {};\n\n if (context.clientAwareness) {\n const { name, version } = context.clientAwareness;\n if (name) {\n clientAwarenessHeaders['apollographql-client-name'] = name;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n\n const contextHeaders = { ...clientAwarenessHeaders, ...context.headers };\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n if (body.variables && !includeUnusedVariables) {\n const unusedNames = new Set(Object.keys(body.variables));\n visit(operation.query, {\n Variable(node, _key, parent) {\n // A variable type definition at the top level of a query is not\n // enough to silence server-side errors about the variable being\n // unused, so variable definitions do not count as usage.\n // https://spec.graphql.org/draft/#sec-All-Variables-Used\n if (parent && (parent as VariableDefinitionNode).kind !== 'VariableDefinition') {\n unusedNames.delete(node.name.value);\n }\n },\n });\n if (unusedNames.size) {\n // Make a shallow copy of body.variables (with keys in the same\n // order) and then delete unused variables from the copy.\n body.variables = { ...body.variables };\n unusedNames.forEach(name => {\n delete body.variables![name];\n });\n }\n }\n\n let controller: any;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher!(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so it's already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we don't call next, the UI can only show networkError because AC didn't\n // get any graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n","import { ApolloLink, RequestHandler } from '../core';\nimport { HttpOptions } from './selectHttpOptionsAndBody';\nimport { createHttpLink } from './createHttpLink';\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(public options: HttpOptions = {}) {\n super(createHttpLink(options).request);\n }\n}\n","export {\n parseAndCheckHttpResponse,\n ServerParseError\n} from './parseAndCheckHttpResponse';\nexport {\n serializeFetchParameter,\n ClientParseError\n} from './serializeFetchParameter';\nexport {\n HttpOptions,\n fallbackHttpConfig,\n selectHttpOptionsAndBody,\n UriFunction\n} from './selectHttpOptionsAndBody';\nexport { checkFetcher } from './checkFetcher';\nexport { createSignalIfSupported } from './createSignalIfSupported';\nexport { selectURI } from './selectURI';\nexport { createHttpLink } from './createHttpLink';\nexport { HttpLink } from './HttpLink';\nexport { rewriteURIForGET } from './rewriteURIForGET';\n","const { toString, hasOwnProperty } = Object.prototype;\nconst fnToStr = Function.prototype.toString;\nconst previousComparisons = new Map>();\n\n/**\n * Performs a deep equality check on two JavaScript values, tolerating cycles.\n */\nexport function equal(a: any, b: any): boolean {\n try {\n return check(a, b);\n } finally {\n previousComparisons.clear();\n }\n}\n\n// Allow default imports as well.\nexport default equal;\n\nfunction check(a: any, b: any): boolean {\n // If the two values are strictly equal, our job is easy.\n if (a === b) {\n return true;\n }\n\n // Object.prototype.toString returns a representation of the runtime type of\n // the given value that is considerably more precise than typeof.\n const aTag = toString.call(a);\n const bTag = toString.call(b);\n\n // If the runtime types of a and b are different, they could maybe be equal\n // under some interpretation of equality, but for simplicity and performance\n // we just return false instead.\n if (aTag !== bTag) {\n return false;\n }\n\n switch (aTag) {\n case '[object Array]':\n // Arrays are a lot like other objects, but we can cheaply compare their\n // lengths as a short-cut before comparing their elements.\n if (a.length !== b.length) return false;\n // Fall through to object case...\n case '[object Object]': {\n if (previouslyCompared(a, b)) return true;\n\n const aKeys = definedKeys(a);\n const bKeys = definedKeys(b);\n\n // If `a` and `b` have a different number of enumerable keys, they\n // must be different.\n const keyCount = aKeys.length;\n if (keyCount !== bKeys.length) return false;\n\n // Now make sure they have the same keys.\n for (let k = 0; k < keyCount; ++k) {\n if (!hasOwnProperty.call(b, aKeys[k])) {\n return false;\n }\n }\n\n // Finally, check deep equality of all child properties.\n for (let k = 0; k < keyCount; ++k) {\n const key = aKeys[k];\n if (!check(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n case '[object Error]':\n return a.name === b.name && a.message === b.message;\n\n case '[object Number]':\n // Handle NaN, which is !== itself.\n if (a !== a) return b !== b;\n // Fall through to shared +a === +b case...\n case '[object Boolean]':\n case '[object Date]':\n return +a === +b;\n\n case '[object RegExp]':\n case '[object String]':\n return a == `${b}`;\n\n case '[object Map]':\n case '[object Set]': {\n if (a.size !== b.size) return false;\n if (previouslyCompared(a, b)) return true;\n\n const aIterator = a.entries();\n const isMap = aTag === '[object Map]';\n\n while (true) {\n const info = aIterator.next();\n if (info.done) break;\n\n // If a instanceof Set, aValue === aKey.\n const [aKey, aValue] = info.value;\n\n // So this works the same way for both Set and Map.\n if (!b.has(aKey)) {\n return false;\n }\n\n // However, we care about deep equality of values only when dealing\n // with Map structures.\n if (isMap && !check(aValue, b.get(aKey))) {\n return false;\n }\n }\n\n return true;\n }\n\n case '[object AsyncFunction]':\n case '[object GeneratorFunction]':\n case '[object AsyncGeneratorFunction]':\n case '[object Function]': {\n const aCode = fnToStr.call(a);\n if (aCode !== fnToStr.call(b)) {\n return false;\n }\n\n // We consider non-native functions equal if they have the same code\n // (native functions require === because their code is censored).\n // Note that this behavior is not entirely sound, since !== function\n // objects with the same code can behave differently depending on\n // their closure scope. However, any function can behave differently\n // depending on the values of its input arguments (including this)\n // and its calling context (including its closure scope), even\n // though the function object is === to itself; and it is entirely\n // possible for functions that are not === to behave exactly the\n // same under all conceivable circumstances. Because none of these\n // factors are statically decidable in JavaScript, JS function\n // equality is not well-defined. This ambiguity allows us to\n // consider the best possible heuristic among various imperfect\n // options, and equating non-native functions that have the same\n // code has enormous practical benefits, such as when comparing\n // functions that are repeatedly passed as fresh function\n // expressions within objects that are otherwise deeply equal. Since\n // any function created from the same syntactic expression (in the\n // same code location) will always stringify to the same code\n // according to fnToStr.call, we can reasonably expect these\n // repeatedly passed function expressions to have the same code, and\n // thus behave \"the same\" (with all the caveats mentioned above),\n // even though the runtime function objects are !== to one another.\n return !endsWith(aCode, nativeCodeSuffix);\n }\n }\n\n // Otherwise the values are not equal.\n return false;\n}\n\nfunction definedKeys(obj: TObject) {\n // Remember that the second argument to Array.prototype.filter will be\n // used as `this` within the callback function.\n return Object.keys(obj).filter(isDefinedKey, obj);\n}\nfunction isDefinedKey(\n this: TObject,\n key: keyof TObject,\n) {\n return this[key] !== void 0;\n}\n\nconst nativeCodeSuffix = \"{ [native code] }\";\n\nfunction endsWith(full: string, suffix: string) {\n const fromIndex = full.length - suffix.length;\n return fromIndex >= 0 &&\n full.indexOf(suffix, fromIndex) === fromIndex;\n}\n\nfunction previouslyCompared(a: object, b: object): boolean {\n // Though cyclic references can make an object graph appear infinite from the\n // perspective of a depth-first traversal, the graph still contains a finite\n // number of distinct object references. We use the previousComparisons cache\n // to avoid comparing the same pair of object references more than once, which\n // guarantees termination (even if we end up comparing every object in one\n // graph to every object in the other graph, which is extremely unlikely),\n // while still allowing weird isomorphic structures (like rings with different\n // lengths) a chance to pass the equality test.\n let bSet = previousComparisons.get(a);\n if (bSet) {\n // Return true here because we can be sure false will be returned somewhere\n // else if the objects are not equivalent.\n if (bSet.has(b)) return true;\n } else {\n previousComparisons.set(a, bSet = new Set);\n }\n bSet.add(b);\n return false;\n}\n","import { GraphQLError } from 'graphql';\n\nimport { isNonEmptyArray } from '../utilities';\nimport { ServerParseError } from '../link/http';\nimport { ServerError } from '../link/utils';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach((graphQLError: GraphQLError) => {\n const errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += `${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += `${err.networkError.message}\\n`;\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray;\n public networkError: Error | ServerParseError | ServerError | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | ServerParseError | ServerError | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.networkError = networkError || null;\n this.message = errorMessage || generateErrorMessage(this);\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n","/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus?: NetworkStatus,\n): boolean {\n return networkStatus ? networkStatus < 7 : false;\n}\n","import { WatchQueryOptions } from './watchQueryOptions';\nimport { NetworkStatus } from './networkStatus';\nimport { ApolloQueryResult } from './types';\nimport { Observer, Concast, compact } from '../utilities';\nimport { invariant } from 'ts-invariant';\n\n// Given that QueryManager#fetchQueryObservable returns only a single\n// query's worth of results, other code must be responsible for repeatedly\n// calling fetchQueryObservable, while ensuring that the ObservableQuery\n// consuming those results remains subscribed to the concatenation of all\n// the observables returned by fetchQueryObservable. That responsibility\n// falls to this Reobserver class. As a bonus, the Reobserver class is\n// perfectly poised to handle polling logic, since polling is essentially\n// repeated reobservation. In principle, this code could have remained in\n// the ObservableQuery class, but I felt it would be easier to explain and\n// understand reobservation if it was confined to a separate class.\nexport class Reobserver {\n constructor(\n private observer: Observer>,\n private options: WatchQueryOptions,\n // Almost certainly just a wrapper function around\n // QueryManager#fetchQueryObservable, but this small dose of\n // indirection means the Reobserver doesn't have to know/assume\n // anything about the QueryManager class.\n private fetch: (\n options: WatchQueryOptions,\n newNetworkStatus?: NetworkStatus,\n ) => Concast>,\n // If we're polling, there may be times when we should avoid fetching,\n // such as when the query is already in flight, or polling has been\n // completely disabled for server-side rendering. Passing false for\n // this parameter disables polling completely, and passing a boolean\n // function allows determining fetch safety dynamically.\n private shouldFetch: false | (() => boolean),\n ) {}\n\n private concast?: Concast>;\n\n public reobserve(\n newOptions?: Partial>,\n newNetworkStatus?: NetworkStatus,\n ): Promise> {\n if (newOptions) {\n this.updateOptions(newOptions);\n } else {\n // When we call this.updateOptions(newOptions) in the branch above,\n // it takes care of calling this.updatePolling(). In this branch, we\n // still need to update polling, even if there were no newOptions.\n this.updatePolling();\n }\n\n const concast = this.fetch(this.options, newNetworkStatus);\n\n if (this.concast) {\n // We use the {add,remove}Observer methods directly to avoid\n // wrapping observer with an unnecessary SubscriptionObserver\n // object, in part so that we can remove it here without triggering\n // any unsubscriptions, because we just want to ignore the old\n // observable, not prematurely shut it down, since other consumers\n // may be awaiting this.concast.promise.\n this.concast.removeObserver(this.observer, true);\n }\n\n concast.addObserver(this.observer);\n\n return (this.concast = concast).promise;\n }\n\n public updateOptions(newOptions: Partial>) {\n Object.assign(this.options, compact(newOptions));\n this.updatePolling();\n return this;\n }\n\n public stop() {\n if (this.concast) {\n this.concast.removeObserver(this.observer);\n delete this.concast;\n }\n\n if (this.pollingInfo) {\n clearTimeout(this.pollingInfo.timeout);\n this.options.pollInterval = 0;\n this.updatePolling();\n }\n }\n\n private pollingInfo?: {\n interval: number;\n timeout: ReturnType;\n };\n\n // Turns polling on or off based on this.options.pollInterval.\n private updatePolling() {\n const {\n pollingInfo,\n options: {\n pollInterval,\n },\n } = this;\n\n if (!pollInterval) {\n if (pollingInfo) {\n clearTimeout(pollingInfo.timeout);\n delete this.pollingInfo;\n }\n return;\n }\n\n if (pollingInfo &&\n pollingInfo.interval === pollInterval) {\n return;\n }\n\n invariant(\n pollInterval,\n 'Attempted to start a polling query without a polling interval.',\n );\n\n // Go no further if polling is disabled.\n if (this.shouldFetch === false) {\n return;\n }\n\n const info = pollingInfo || (\n this.pollingInfo = {} as Reobserver[\"pollingInfo\"]\n )!;\n\n info.interval = pollInterval;\n\n const maybeFetch = () => {\n if (this.pollingInfo) {\n if (this.shouldFetch && this.shouldFetch()) {\n this.reobserve({\n fetchPolicy: \"network-only\",\n nextFetchPolicy: this.options.fetchPolicy || \"cache-first\",\n }, NetworkStatus.poll).then(poll, poll);\n } else {\n poll();\n }\n };\n };\n\n const poll = () => {\n const info = this.pollingInfo;\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n\n poll();\n }\n}\n","import { invariant } from 'ts-invariant';\nimport { equal } from '@wry/equality';\n\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n cloneDeep,\n getOperationDefinition,\n Observable,\n Observer,\n ObservableSubscription,\n iterateObserversSafely,\n isNonEmptyArray,\n fixObservableSubclass,\n} from '../utilities';\nimport { ApolloError } from '../errors';\nimport { QueryManager } from './QueryManager';\nimport { ApolloQueryResult, OperationVariables } from './types';\nimport {\n WatchQueryOptions,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n} from './watchQueryOptions';\nimport { Reobserver } from './Reobserver';\nimport { QueryInfo } from './QueryInfo';\n\nexport interface FetchMoreOptions<\n TData = any,\n TVariables = OperationVariables\n> {\n updateQuery?: (\n previousQueryResult: TData,\n options: {\n fetchMoreResult?: TData;\n variables?: TVariables;\n },\n ) => TData;\n}\n\nexport interface UpdateQueryOptions {\n variables?: TVariables;\n}\n\nlet warnedAboutUpdateQuery = false;\n\nexport class ObservableQuery<\n TData = any,\n TVariables = OperationVariables\n> extends Observable> {\n public readonly options: WatchQueryOptions;\n public readonly queryId: string;\n public readonly queryName?: string;\n\n // Computed shorthand for this.options.variables, preserved for\n // backwards compatibility.\n public get variables(): TVariables | undefined {\n return this.options.variables;\n }\n\n private isTornDown: boolean;\n private queryManager: QueryManager;\n private observers = new Set>>();\n private subscriptions = new Set();\n\n private lastResult: ApolloQueryResult;\n private lastResultSnapshot: ApolloQueryResult;\n private lastError: ApolloError;\n private queryInfo: QueryInfo;\n\n constructor({\n queryManager,\n queryInfo,\n options,\n }: {\n queryManager: QueryManager;\n queryInfo: QueryInfo;\n options: WatchQueryOptions;\n }) {\n super((observer: Observer>) =>\n this.onSubscribe(observer),\n );\n\n // active state\n this.isTornDown = false;\n\n // query information\n this.options = options;\n this.queryId = queryManager.generateQueryId();\n\n const opDef = getOperationDefinition(options.query);\n this.queryName = opDef && opDef.name && opDef.name.value;\n\n // related classes\n this.queryManager = queryManager;\n\n this.queryInfo = queryInfo;\n }\n\n public result(): Promise> {\n return new Promise((resolve, reject) => {\n const observer: Observer> = {\n next: (result: ApolloQueryResult) => {\n resolve(result);\n\n // Stop the query within the QueryManager if we can before\n // this function returns.\n //\n // We do this in order to prevent observers piling up within\n // the QueryManager. Notice that we only fully unsubscribe\n // from the subscription in a setTimeout(..., 0) call. This call can\n // actually be handled by the browser at a much later time. If queries\n // are fired in the meantime, observers that should have been removed\n // from the QueryManager will continue to fire, causing an unnecessary\n // performance hit.\n this.observers.delete(observer);\n if (!this.observers.size) {\n this.queryManager.removeQuery(this.queryId);\n }\n\n setTimeout(() => {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n const subscription = this.subscribe(observer);\n });\n }\n\n public getCurrentResult(saveAsLastResult = true): ApolloQueryResult {\n const { lastResult } = this;\n\n const networkStatus =\n this.queryInfo.networkStatus ||\n (lastResult && lastResult.networkStatus) ||\n NetworkStatus.ready;\n\n const result: ApolloQueryResult = {\n ...lastResult,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n };\n\n if (this.isTornDown) {\n return result;\n }\n\n const { fetchPolicy = 'cache-first' } = this.options;\n if (fetchPolicy === 'no-cache' ||\n fetchPolicy === 'network-only') {\n // Similar to setting result.partial to false, but taking advantage\n // of the falsiness of missing fields.\n delete result.partial;\n } else if (\n !result.data ||\n // If this.options.query has @client(always: true) fields, we cannot\n // trust result.data, since it was read from the cache without\n // running local resolvers (and it's too late to run resolvers now,\n // since we must return a result synchronously). TODO In the future\n // (after Apollo Client 3.0), we should find a way to trust\n // this.lastResult in more cases, and read from the cache only in\n // cases when no result has been received yet.\n !this.queryManager.transform(this.options.query).hasForcedResolvers\n ) {\n const diff = this.queryInfo.getDiff();\n result.data = (\n diff.complete ||\n this.options.returnPartialData\n ) ? diff.result : void 0;\n if (diff.complete) {\n // If the diff is complete, and we're using a FetchPolicy that\n // terminates after a complete cache read, we can assume the next\n // result we receive will have NetworkStatus.ready and !loading.\n if (result.networkStatus === NetworkStatus.loading &&\n (fetchPolicy === 'cache-first' ||\n fetchPolicy === 'cache-only')) {\n result.networkStatus = NetworkStatus.ready;\n result.loading = false;\n }\n delete result.partial;\n } else {\n result.partial = true;\n }\n }\n\n if (saveAsLastResult) {\n this.updateLastResult(result);\n }\n\n return result;\n }\n\n // Compares newResult to the snapshot we took of this.lastResult when it was\n // first received.\n public isDifferentFromLastResult(newResult: ApolloQueryResult) {\n return !equal(this.lastResultSnapshot, newResult);\n }\n\n // Returns the last result that observer.next was called with. This is not the same as\n // getCurrentResult! If you're not sure which you need, then you probably need getCurrentResult.\n public getLastResult(): ApolloQueryResult {\n return this.lastResult;\n }\n\n public getLastError(): ApolloError {\n return this.lastError;\n }\n\n public resetLastResults(): void {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n }\n\n public resetQueryStoreErrors() {\n this.queryManager.resetErrors(this.queryId);\n }\n\n /**\n * Update the variables of this observable query, and fetch the new results.\n * This method should be preferred over `setVariables` in most use cases.\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n */\n public refetch(variables?: Partial): Promise> {\n const reobserveOptions: Partial> = {\n // Always disable polling for refetches.\n pollInterval: 0,\n };\n\n // Unless the provided fetchPolicy always consults the network\n // (no-cache, network-only, or cache-and-network), override it with\n // network-only to force the refetch for this fetchQuery call.\n const { fetchPolicy } = this.options;\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n reobserveOptions.fetchPolicy = 'network-only';\n // Go back to the original options.fetchPolicy after this refetch.\n reobserveOptions.nextFetchPolicy = fetchPolicy || \"cache-first\";\n }\n\n if (variables && !equal(this.options.variables, variables)) {\n // Update the existing options with new variables\n reobserveOptions.variables = this.options.variables = {\n ...this.options.variables,\n ...variables,\n } as TVariables;\n }\n\n return this.newReobserver(false).reobserve(\n reobserveOptions,\n NetworkStatus.refetch,\n );\n }\n\n public fetchMore(\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions,\n ): Promise> {\n const combinedOptions = {\n ...(fetchMoreOptions.query ? fetchMoreOptions : {\n ...this.options,\n ...fetchMoreOptions,\n variables: {\n ...this.options.variables,\n ...fetchMoreOptions.variables,\n },\n }),\n // The fetchMore request goes immediately to the network and does\n // not automatically write its result to the cache (hence no-cache\n // instead of network-only), because we allow the caller of\n // fetchMore to provide an updateQuery callback that determines how\n // the data gets written to the cache.\n fetchPolicy: \"no-cache\",\n } as WatchQueryOptions;\n\n const qid = this.queryManager.generateQueryId();\n\n // Simulate a loading result for the original query with\n // result.networkStatus === NetworkStatus.fetchMore.\n if (combinedOptions.notifyOnNetworkStatusChange) {\n this.queryInfo.networkStatus = NetworkStatus.fetchMore;\n this.observe();\n }\n\n return this.queryManager.fetchQuery(\n qid,\n combinedOptions,\n NetworkStatus.fetchMore,\n ).then(fetchMoreResult => {\n const data = fetchMoreResult.data as TData;\n const { updateQuery } = fetchMoreOptions;\n\n if (updateQuery) {\n if (process.env.NODE_ENV !== \"production\" &&\n !warnedAboutUpdateQuery) {\n invariant.warn(\n`The updateQuery callback for fetchMore is deprecated, and will be removed\nin the next major version of Apollo Client.\n\nPlease convert updateQuery functions to field policies with appropriate\nread and merge functions, or use/adapt a helper function (such as\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\n@apollo/client/utilities.\n\nThe field policy system handles pagination more effectively than a\nhand-written updateQuery function, and you only need to define the policy\nonce, rather than every time you call fetchMore.`);\n warnedAboutUpdateQuery = true;\n }\n this.updateQuery(previous => updateQuery(previous, {\n fetchMoreResult: data,\n variables: combinedOptions.variables as TVariables,\n }));\n } else {\n // If we're using a field policy instead of updateQuery, the only\n // thing we need to do is write the new data to the cache using\n // combinedOptions.variables (instead of this.variables, which is\n // what this.updateQuery uses, because it works by abusing the\n // original field value, keyed by the original variables).\n this.queryManager.cache.writeQuery({\n query: combinedOptions.query,\n variables: combinedOptions.variables,\n data,\n });\n }\n\n return fetchMoreResult as ApolloQueryResult;\n\n }).finally(() => {\n this.queryManager.stopQuery(qid);\n this.reobserve();\n });\n }\n\n // XXX the subscription variables are separate from the query variables.\n // if you want to update subscription variables, right now you have to do that separately,\n // and you can only do it by stopping the subscription and then subscribing again with new variables.\n public subscribeToMore<\n TSubscriptionData = TData,\n TSubscriptionVariables = TVariables\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >,\n ) {\n const subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n context: options.context,\n })\n .subscribe({\n next: (subscriptionData: { data: TSubscriptionData }) => {\n const { updateQuery } = options;\n if (updateQuery) {\n this.updateQuery(\n (previous, { variables }) =>\n updateQuery(previous, {\n subscriptionData,\n variables,\n }),\n );\n }\n },\n error: (err: any) => {\n if (options.onError) {\n options.onError(err);\n return;\n }\n invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n\n this.subscriptions.add(subscription);\n\n return () => {\n if (this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n }\n\n public setOptions(\n newOptions: Partial>,\n ): Promise> {\n return this.reobserve(newOptions);\n }\n\n /**\n * This is for *internal* use only. Most users should instead use `refetch`\n * in order to be properly notified of results even when they come from cache.\n *\n * Update the variables of this observable query, and fetch the new results\n * if they've changed. If you want to force new results, use `refetch`.\n *\n * Note: the `next` callback will *not* fire if the variables have not changed\n * or if the result is coming from cache.\n *\n * Note: the promise will return the old results immediately if the variables\n * have not changed.\n *\n * Note: the promise will return null immediately if the query is not active\n * (there are no subscribers).\n *\n * @private\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n *\n * @param tryFetch: Try and fetch new results even if the variables haven't\n * changed (we may still just hit the store, but if there's nothing in there\n * this will refetch)\n */\n public setVariables(\n variables: TVariables,\n ): Promise | void> {\n if (equal(this.variables, variables)) {\n // If we have no observers, then we don't actually want to make a network\n // request. As soon as someone observes the query, the request will kick\n // off. For now, we just store any changes. (See #1077)\n return this.observers.size\n ? this.result()\n : Promise.resolve();\n }\n\n this.options.variables = variables;\n\n // See comment above\n if (!this.observers.size) {\n return Promise.resolve();\n }\n\n let { fetchPolicy = 'cache-first' } = this.options;\n const reobserveOptions: Partial> = {\n fetchPolicy,\n variables,\n };\n\n if (fetchPolicy !== 'cache-first' &&\n fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'network-only') {\n reobserveOptions.fetchPolicy = 'cache-and-network';\n reobserveOptions.nextFetchPolicy = fetchPolicy;\n }\n\n return this.reobserve(\n reobserveOptions,\n NetworkStatus.setVariables,\n );\n }\n\n public updateQuery(\n mapFn: (\n previousQueryResult: TData,\n options: Pick, \"variables\">,\n ) => TData,\n ): void {\n const { queryManager } = this;\n const { result } = queryManager.cache.diff({\n query: this.options.query,\n variables: this.variables,\n previousResult: this.lastResult?.data,\n returnPartialData: true,\n optimistic: false,\n });\n\n const newResult = mapFn(result!, {\n variables: (this as any).variables,\n });\n\n if (newResult) {\n queryManager.cache.writeQuery({\n query: this.options.query,\n data: newResult,\n variables: this.variables,\n });\n\n queryManager.broadcastQueries();\n }\n }\n\n public startPolling(pollInterval: number) {\n this.getReobserver().updateOptions({ pollInterval });\n }\n\n public stopPolling() {\n if (this.reobserver) {\n this.reobserver.updateOptions({ pollInterval: 0 });\n }\n }\n\n private updateLastResult(newResult: ApolloQueryResult) {\n const previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n if (!isNonEmptyArray(newResult.errors)) {\n delete this.lastError;\n }\n return previousResult;\n }\n\n private onSubscribe(observer: Observer>) {\n // Subscribing using this.observer will create an infinite notificaion\n // loop, but the intent of broadcasting results to all the other\n // this.observers can be satisfied without doing anything, which is\n // why we do not bother throwing an error here.\n if (observer === this.observer) {\n return () => {};\n }\n\n // Zen Observable has its own error function, so in order to log correctly\n // we need to provide a custom error callback.\n try {\n var subObserver = (observer as any)._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n } catch {}\n\n const first = !this.observers.size;\n this.observers.add(observer);\n\n // Deliver most recent error or result.\n if (this.lastError) {\n observer.error && observer.error(this.lastError);\n } else if (this.lastResult) {\n observer.next && observer.next(this.lastResult);\n }\n\n // Initiate observation of this query if it hasn't been reported to\n // the QueryManager yet.\n if (first) {\n this.reobserve().catch(_ => {\n // Blindly catching here prevents unhandled promise rejections,\n // and is safe because the ObservableQuery handles this error with\n // this.observer.error, so we're not just swallowing the error by\n // ignoring it here.\n });\n }\n\n return () => {\n if (this.observers.delete(observer) && !this.observers.size) {\n this.tearDownQuery();\n }\n };\n }\n\n private reobserver?: Reobserver;\n\n private getReobserver(): Reobserver {\n return this.reobserver || (this.reobserver = this.newReobserver(true));\n }\n\n private newReobserver(shareOptions: boolean) {\n const { queryManager, queryId } = this;\n queryManager.setObservableQuery(this);\n return new Reobserver(\n this.observer,\n // Sharing options allows this.reobserver.options to be ===\n // this.options, so we don't have to worry about synchronizing the\n // properties of two distinct objects.\n shareOptions ? this.options : { ...this.options },\n (currentOptions, newNetworkStatus) => {\n queryManager.setObservableQuery(this);\n return queryManager.fetchQueryObservable(\n queryId,\n currentOptions,\n newNetworkStatus,\n );\n },\n // Avoid polling during SSR and when the query is already in flight.\n !queryManager.ssrMode && (\n () => !isNetworkRequestInFlight(this.queryInfo.networkStatus))\n );\n }\n\n public reobserve(\n newOptions?: Partial>,\n newNetworkStatus?: NetworkStatus,\n ): Promise> {\n this.isTornDown = false;\n return this.getReobserver().reobserve(newOptions, newNetworkStatus);\n }\n\n // Pass the current result to this.observer.next without applying any\n // fetch policies, bypassing the Reobserver.\n private observe() {\n // Passing false is important so that this.getCurrentResult doesn't\n // save the fetchMore result as this.lastResult, causing it to be\n // ignored due to the this.isDifferentFromLastResult check in\n // this.observer.next.\n this.observer.next(this.getCurrentResult(false));\n }\n\n private observer = {\n next: (result: ApolloQueryResult) => {\n if (this.lastError || this.isDifferentFromLastResult(result)) {\n this.updateLastResult(result);\n iterateObserversSafely(this.observers, 'next', result);\n }\n },\n\n error: (error: ApolloError) => {\n // Since we don't get the current result on errors, only the error, we\n // must mirror the updates that occur in QueryStore.markQueryError here\n this.updateLastResult({\n ...this.lastResult,\n error,\n errors: error.graphQLErrors,\n networkStatus: NetworkStatus.error,\n loading: false,\n });\n\n iterateObserversSafely(this.observers, 'error', this.lastError = error);\n },\n };\n\n public hasObservers() {\n return this.observers.size > 0;\n }\n\n private tearDownQuery() {\n if (this.isTornDown) return;\n\n if (this.reobserver) {\n this.reobserver.stop();\n delete this.reobserver;\n }\n\n // stop all active GraphQL subscriptions\n this.subscriptions.forEach(sub => sub.unsubscribe());\n this.subscriptions.clear();\n\n this.queryManager.stopQuery(this.queryId);\n\n this.observers.clear();\n\n this.isTornDown = true;\n }\n}\n\n// Necessary because the ObservableQuery constructor has a different\n// signature than the Observable constructor.\nfixObservableSubclass(ObservableQuery);\n\nfunction defaultSubscriptionObserverErrorCallback(error: ApolloError) {\n invariant.error('Unhandled error', error.message, error.stack);\n}\n","// A [trie](https://en.wikipedia.org/wiki/Trie) data structure that holds\n// object keys weakly, yet can also hold non-object keys, unlike the\n// native `WeakMap`.\n\n// If no makeData function is supplied, the looked-up data will be an empty,\n// null-prototype Object.\nconst defaultMakeData = () => Object.create(null);\n\n// Useful for processing arguments objects as well as arrays.\nconst { forEach, slice } = Array.prototype;\n\nexport class Trie {\n // Since a `WeakMap` cannot hold primitive values as keys, we need a\n // backup `Map` instance to hold primitive keys. Both `this._weakMap`\n // and `this._strongMap` are lazily initialized.\n private weak?: WeakMap>;\n private strong?: Map>;\n private data?: Data;\n\n constructor(\n private weakness = true,\n private makeData: (array: any[]) => Data = defaultMakeData,\n ) {}\n\n public lookup(...array: T): Data {\n return this.lookupArray(array);\n }\n\n public lookupArray(array: T): Data {\n let node: Trie = this;\n forEach.call(array, key => node = node.getChildTrie(key));\n return node.data || (node.data = this.makeData(slice.call(array)));\n }\n\n private getChildTrie(key: any) {\n const map = this.weakness && isObjRef(key)\n ? this.weak || (this.weak = new WeakMap>())\n : this.strong || (this.strong = new Map>());\n let child = map.get(key);\n if (!child) map.set(key, child = new Trie(this.weakness, this.makeData));\n return child;\n }\n}\n\nfunction isObjRef(value: any) {\n switch (typeof value) {\n case \"object\":\n if (value === null) break;\n // Fall through to return true...\n case \"function\":\n return true;\n }\n return false;\n}\n","import { Slot } from \"./slot\";\nexport { Slot }\nexport const { bind, noContext } = Slot;\n\n// Relying on the @types/node declaration of global.setTimeout can make\n// things tricky for dowstream projects (see PR #7).\ndeclare function setTimeout(\n callback: (...args: any[]) => any,\n ms?: number,\n ...args: any[]\n): any;\n\n// Like global.setTimeout, except the callback runs with captured context.\nexport { setTimeoutWithContext as setTimeout };\nfunction setTimeoutWithContext(callback: () => any, delay: number) {\n return setTimeout(bind(callback), delay);\n}\n\n// Turn any generator function into an async function (using yield instead\n// of await), with context automatically preserved across yields.\nexport function asyncFromGen(\n genFn: (...args: TArgs) => any\n) {\n return function (this: any) {\n const gen = genFn.apply(this, arguments as any);\n const boundNext = bind(gen.next);\n const boundThrow = bind(gen.throw!);\n type Method = typeof boundNext | typeof boundThrow;\n\n return new Promise((resolve, reject) => {\n function invoke(method: Method, argument: any) {\n try {\n var result: any = method.call(gen, argument);\n } catch (error) {\n return reject(error);\n }\n const next = result.done ? resolve : invokeNext;\n if (isPromiseLike(result.value)) {\n result.value.then(next, result.done ? reject : invokeThrow);\n } else {\n next(result.value);\n }\n }\n const invokeNext = (value?: any) => invoke(boundNext, value);\n const invokeThrow = (error: any) => invoke(boundThrow, error);\n invokeNext();\n });\n } as (...args: TArgs) => Promise;\n}\n\nfunction isPromiseLike(value: any): value is PromiseLike {\n return value && typeof value.then === \"function\";\n}\n\n// If you use the fibers npm package to implement coroutines in Node.js,\n// you should call this function at least once to ensure context management\n// remains coherent across any yields.\nconst wrappedFibers: Function[] = [];\nexport function wrapYieldingFiberMethods(Fiber: F): F {\n // There can be only one implementation of Fiber per process, so this array\n // should never grow longer than one element.\n if (wrappedFibers.indexOf(Fiber) < 0) {\n const wrap = (obj: any, method: string) => {\n const fn = obj[method];\n obj[method] = function () {\n return noContext(fn, arguments as any, this);\n };\n }\n // These methods can yield, according to\n // https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100\n wrap(Fiber, \"yield\");\n wrap(Fiber.prototype, \"run\");\n wrap(Fiber.prototype, \"throwInto\");\n wrappedFibers.push(Fiber);\n }\n return Fiber;\n}\n","type Context = {\n parent: Context | null;\n slots: { [slotId: string]: any };\n}\n\n// This currentContext variable will only be used if the makeSlotClass\n// function is called, which happens only if this is the first copy of the\n// @wry/context package to be imported.\nlet currentContext: Context | null = null;\n\n// This unique internal object is used to denote the absence of a value\n// for a given Slot, and is never exposed to outside code.\nconst MISSING_VALUE: any = {};\n\nlet idCounter = 1;\n\n// Although we can't do anything about the cost of duplicated code from\n// accidentally bundling multiple copies of the @wry/context package, we can\n// avoid creating the Slot class more than once using makeSlotClass.\nconst makeSlotClass = () => class Slot {\n // If you have a Slot object, you can find out its slot.id, but you cannot\n // guess the slot.id of a Slot you don't have access to, thanks to the\n // randomized suffix.\n public readonly id = [\n \"slot\",\n idCounter++,\n Date.now(),\n Math.random().toString(36).slice(2),\n ].join(\":\");\n\n public hasValue() {\n for (let context = currentContext; context; context = context.parent) {\n // We use the Slot object iself as a key to its value, which means the\n // value cannot be obtained without a reference to the Slot object.\n if (this.id in context.slots) {\n const value = context.slots[this.id];\n if (value === MISSING_VALUE) break;\n if (context !== currentContext) {\n // Cache the value in currentContext.slots so the next lookup will\n // be faster. This caching is safe because the tree of contexts and\n // the values of the slots are logically immutable.\n currentContext!.slots[this.id] = value;\n }\n return true;\n }\n }\n if (currentContext) {\n // If a value was not found for this Slot, it's never going to be found\n // no matter how many times we look it up, so we might as well cache\n // the absence of the value, too.\n currentContext.slots[this.id] = MISSING_VALUE;\n }\n return false;\n }\n\n public getValue(): TValue | undefined {\n if (this.hasValue()) {\n return currentContext!.slots[this.id] as TValue;\n }\n }\n\n public withValue(\n value: TValue,\n callback: (this: TThis, ...args: TArgs) => TResult,\n // Given the prevalence of arrow functions, specifying arguments is likely\n // to be much more common than specifying `this`, hence this ordering:\n args?: TArgs,\n thisArg?: TThis,\n ): TResult {\n const slots = {\n __proto__: null,\n [this.id]: value,\n };\n const parent = currentContext;\n currentContext = { parent, slots };\n try {\n // Function.prototype.apply allows the arguments array argument to be\n // omitted or undefined, so args! is fine here.\n return callback.apply(thisArg!, args!);\n } finally {\n currentContext = parent;\n }\n }\n\n // Capture the current context and wrap a callback function so that it\n // reestablishes the captured context when called.\n static bind(\n callback: (...args: TArgs) => TResult,\n ) {\n const context = currentContext;\n return function (this: any) {\n const saved = currentContext;\n try {\n currentContext = context;\n return callback.apply(this, arguments as any);\n } finally {\n currentContext = saved;\n }\n } as typeof callback;\n }\n\n // Immediately run a callback function without any captured context.\n static noContext(\n callback: (this: TThis, ...args: TArgs) => TResult,\n // Given the prevalence of arrow functions, specifying arguments is likely\n // to be much more common than specifying `this`, hence this ordering:\n args?: TArgs,\n thisArg?: TThis,\n ) {\n if (currentContext) {\n const saved = currentContext;\n try {\n currentContext = null;\n // Function.prototype.apply allows the arguments array argument to be\n // omitted or undefined, so args! is fine here.\n return callback.apply(thisArg!, args!);\n } finally {\n currentContext = saved;\n }\n } else {\n return callback.apply(thisArg!, args!);\n }\n }\n};\n\n// We store a single global implementation of the Slot class as a permanent\n// non-enumerable symbol property of the Array constructor. This obfuscation\n// does nothing to prevent access to the Slot class, but at least it ensures\n// the implementation (i.e. currentContext) cannot be tampered with, and all\n// copies of the @wry/context package (hopefully just one) will share the\n// same Slot implementation. Since the first copy of the @wry/context package\n// to be imported wins, this technique imposes a very high cost for any\n// future breaking changes to the Slot class.\nconst globalKey = \"@wry/context:Slot\";\nconst host = Array as any;\n\nexport const Slot: ReturnType = host[globalKey] || function () {\n const Slot = makeSlotClass();\n try {\n Object.defineProperty(host, globalKey, {\n value: host[globalKey] = Slot,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n } finally {\n return Slot;\n }\n}();\n","interface Node {\n key: K;\n value: V;\n newer: Node | null;\n older: Node | null;\n}\n\nfunction defaultDispose() {}\n\nexport class Cache {\n private map = new Map>();\n private newest: Node | null = null;\n private oldest: Node | null = null;\n\n constructor(\n private max = Infinity,\n public dispose: (value: V, key: K) => void = defaultDispose,\n ) {}\n\n public has(key: K): boolean {\n return this.map.has(key);\n }\n\n public get(key: K): V | undefined {\n const node = this.getNode(key);\n return node && node.value;\n }\n\n private getNode(key: K): Node | undefined {\n const node = this.map.get(key);\n\n if (node && node !== this.newest) {\n const { older, newer } = node;\n\n if (newer) {\n newer.older = older;\n }\n\n if (older) {\n older.newer = newer;\n }\n\n node.older = this.newest;\n node.older!.newer = node;\n\n node.newer = null;\n this.newest = node;\n\n if (node === this.oldest) {\n this.oldest = newer;\n }\n }\n\n return node;\n }\n\n public set(key: K, value: V): V {\n let node = this.getNode(key);\n if (node) {\n return node.value = value;\n }\n\n node = {\n key,\n value,\n newer: null,\n older: this.newest\n };\n\n if (this.newest) {\n this.newest.newer = node;\n }\n\n this.newest = node;\n this.oldest = this.oldest || node;\n\n this.map.set(key, node);\n\n return node.value;\n }\n\n public clean() {\n while (this.oldest && this.map.size > this.max) {\n this.delete(this.oldest.key);\n }\n }\n\n public delete(key: K): boolean {\n const node = this.map.get(key);\n if (node) {\n if (node === this.newest) {\n this.newest = node.older;\n }\n\n if (node === this.oldest) {\n this.oldest = node.newer;\n }\n\n if (node.newer) {\n node.newer.older = node.older;\n }\n\n if (node.older) {\n node.older.newer = node.newer;\n }\n\n this.map.delete(key);\n this.dispose(node.value, key);\n\n return true;\n }\n\n return false;\n }\n}\n","export type Unsubscribable = {\n unsubscribe?: void | (() => any);\n}\n\nexport function maybeUnsubscribe(entryOrDep: Unsubscribable) {\n const { unsubscribe } = entryOrDep;\n if (typeof unsubscribe === \"function\") {\n entryOrDep.unsubscribe = void 0;\n unsubscribe();\n }\n}\n","import { parentEntrySlot } from \"./context\";\nimport { OptimisticWrapOptions } from \"./index\";\nimport { Dep } from \"./dep\";\nimport { maybeUnsubscribe, Unsubscribable } from \"./helpers\";\n\nconst emptySetPool: Set[] = [];\nconst POOL_TARGET_SIZE = 100;\n\n// Since this package might be used browsers, we should avoid using the\n// Node built-in assert module.\nfunction assert(condition: any, optionalMessage?: string) {\n if (! condition) {\n throw new Error(optionalMessage || \"assertion failure\");\n }\n}\n\n// Since exceptions are cached just like normal values, we need an efficient\n// way of representing unknown, ordinary, and exceptional values.\ntype Value =\n | [] // unknown\n | [T] // known value\n | [void, any]; // known exception\n\nfunction valueIs(a: Value, b: Value) {\n const len = a.length;\n return (\n // Unknown values are not equal to each other.\n len > 0 &&\n // Both values must be ordinary (or both exceptional) to be equal.\n len === b.length &&\n // The underlying value or exception must be the same.\n a[len - 1] === b[len - 1]\n );\n}\n\nfunction valueGet(value: Value): T {\n switch (value.length) {\n case 0: throw new Error(\"unknown value\");\n case 1: return value[0];\n case 2: throw value[1];\n }\n}\n\nfunction valueCopy(value: Value): Value {\n return value.slice(0) as Value;\n}\n\nexport type AnyEntry = Entry;\n\nexport class Entry {\n public static count = 0;\n\n public subscribe: OptimisticWrapOptions[\"subscribe\"];\n public unsubscribe: Unsubscribable[\"unsubscribe\"];\n\n public readonly parents = new Set();\n public readonly childValues = new Map>();\n\n // When this Entry has children that are dirty, this property becomes\n // a Set containing other Entry objects, borrowed from emptySetPool.\n // When the set becomes empty, it gets recycled back to emptySetPool.\n public dirtyChildren: Set | null = null;\n\n public dirty = true;\n public recomputing = false;\n public readonly value: Value = [];\n\n constructor(\n public readonly fn: (...args: TArgs) => TValue,\n ) {\n ++Entry.count;\n }\n\n public peek(): TValue | undefined {\n if (this.value.length === 1 && !mightBeDirty(this)) {\n return this.value[0];\n }\n }\n\n // This is the most important method of the Entry API, because it\n // determines whether the cached this.value can be returned immediately,\n // or must be recomputed. The overall performance of the caching system\n // depends on the truth of the following observations: (1) this.dirty is\n // usually false, (2) this.dirtyChildren is usually null/empty, and thus\n // (3) valueGet(this.value) is usually returned without recomputation.\n public recompute(args: TArgs): TValue {\n assert(! this.recomputing, \"already recomputing\");\n rememberParent(this);\n return mightBeDirty(this)\n ? reallyRecompute(this, args)\n : valueGet(this.value);\n }\n\n public setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value.length = 0;\n reportDirty(this);\n forgetChildren(this);\n // We can go ahead and unsubscribe here, since any further dirty\n // notifications we receive will be redundant, and unsubscribing may\n // free up some resources, e.g. file watchers.\n maybeUnsubscribe(this);\n }\n\n public dispose() {\n forgetChildren(this);\n maybeUnsubscribe(this);\n\n // Because this entry has been kicked out of the cache (in index.js),\n // we've lost the ability to find out if/when this entry becomes dirty,\n // whether that happens through a subscription, because of a direct call\n // to entry.setDirty(), or because one of its children becomes dirty.\n // Because of this loss of future information, we have to assume the\n // worst (that this entry might have become dirty very soon), so we must\n // immediately mark this entry's parents as dirty. Normally we could\n // just call entry.setDirty() rather than calling parent.setDirty() for\n // each parent, but that would leave this entry in parent.childValues\n // and parent.dirtyChildren, which would prevent the child from being\n // truly forgotten.\n this.parents.forEach(parent => {\n parent.setDirty();\n forgetChild(parent, this);\n });\n }\n\n private deps: Set> | null = null;\n\n public dependOn(dep: Dep) {\n dep.add(this);\n if (! this.deps) {\n this.deps = emptySetPool.pop() || new Set>();\n }\n this.deps.add(dep);\n }\n\n public forgetDeps() {\n if (this.deps) {\n this.deps.forEach(dep => dep.delete(this));\n this.deps.clear();\n emptySetPool.push(this.deps);\n this.deps = null;\n }\n }\n}\n\nfunction rememberParent(child: AnyEntry) {\n const parent = parentEntrySlot.getValue();\n if (parent) {\n child.parents.add(parent);\n\n if (! parent.childValues.has(child)) {\n parent.childValues.set(child, []);\n }\n\n if (mightBeDirty(child)) {\n reportDirtyChild(parent, child);\n } else {\n reportCleanChild(parent, child);\n }\n\n return parent;\n }\n}\n\nfunction reallyRecompute(entry: AnyEntry, args: any[]) {\n forgetChildren(entry);\n\n // Set entry as the parent entry while calling recomputeNewValue(entry).\n parentEntrySlot.withValue(entry, recomputeNewValue, [entry, args]);\n\n if (maybeSubscribe(entry, args)) {\n // If we successfully recomputed entry.value and did not fail to\n // (re)subscribe, then this Entry is no longer explicitly dirty.\n setClean(entry);\n }\n\n return valueGet(entry.value);\n}\n\nfunction recomputeNewValue(entry: AnyEntry, args: any[]) {\n entry.recomputing = true;\n // Set entry.value as unknown.\n entry.value.length = 0;\n try {\n // If entry.fn succeeds, entry.value will become a normal Value.\n entry.value[0] = entry.fn.apply(null, args);\n } catch (e) {\n // If entry.fn throws, entry.value will become exceptional.\n entry.value[1] = e;\n }\n // Either way, this line is always reached.\n entry.recomputing = false;\n}\n\nfunction mightBeDirty(entry: AnyEntry) {\n return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size);\n}\n\nfunction setClean(entry: AnyEntry) {\n entry.dirty = false;\n\n if (mightBeDirty(entry)) {\n // This Entry may still have dirty children, in which case we can't\n // let our parents know we're clean just yet.\n return;\n }\n\n reportClean(entry);\n}\n\nfunction reportDirty(child: AnyEntry) {\n child.parents.forEach(parent => reportDirtyChild(parent, child));\n}\n\nfunction reportClean(child: AnyEntry) {\n child.parents.forEach(parent => reportCleanChild(parent, child));\n}\n\n// Let a parent Entry know that one of its children may be dirty.\nfunction reportDirtyChild(parent: AnyEntry, child: AnyEntry) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(parent.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! parent.dirtyChildren) {\n parent.dirtyChildren = emptySetPool.pop() || new Set;\n\n } else if (parent.dirtyChildren.has(child)) {\n // If we already know this child is dirty, then we must have already\n // informed our own parents that we are dirty, so we can terminate\n // the recursion early.\n return;\n }\n\n parent.dirtyChildren.add(child);\n reportDirty(parent);\n}\n\n// Let a parent Entry know that one of its children is no longer dirty.\nfunction reportCleanChild(parent: AnyEntry, child: AnyEntry) {\n // Must have called rememberChild(child) before calling\n // reportCleanChild(parent, child).\n assert(parent.childValues.has(child));\n assert(! mightBeDirty(child));\n\n const childValue = parent.childValues.get(child)!;\n if (childValue.length === 0) {\n parent.childValues.set(child, valueCopy(child.value));\n } else if (! valueIs(childValue, child.value)) {\n parent.setDirty();\n }\n\n removeDirtyChild(parent, child);\n\n if (mightBeDirty(parent)) {\n return;\n }\n\n reportClean(parent);\n}\n\nfunction removeDirtyChild(parent: AnyEntry, child: AnyEntry) {\n const dc = parent.dirtyChildren;\n if (dc) {\n dc.delete(child);\n if (dc.size === 0) {\n if (emptySetPool.length < POOL_TARGET_SIZE) {\n emptySetPool.push(dc);\n }\n parent.dirtyChildren = null;\n }\n }\n}\n\n// Removes all children from this entry and returns an array of the\n// removed children.\nfunction forgetChildren(parent: AnyEntry) {\n if (parent.childValues.size > 0) {\n parent.childValues.forEach((_value, child) => {\n forgetChild(parent, child);\n });\n }\n\n // Remove this parent Entry from any sets to which it was added by the\n // addToSet method.\n parent.forgetDeps();\n\n // After we forget all our children, this.dirtyChildren must be empty\n // and therefore must have been reset to null.\n assert(parent.dirtyChildren === null);\n}\n\nfunction forgetChild(parent: AnyEntry, child: AnyEntry) {\n child.parents.delete(parent);\n parent.childValues.delete(child);\n removeDirtyChild(parent, child);\n}\n\nfunction maybeSubscribe(entry: AnyEntry, args: any[]) {\n if (typeof entry.subscribe === \"function\") {\n try {\n maybeUnsubscribe(entry); // Prevent double subscriptions.\n entry.unsubscribe = entry.subscribe.apply(null, args);\n } catch (e) {\n // If this Entry has a subscribe function and it threw an exception\n // (or an unsubscribe function it previously returned now throws),\n // return false to indicate that we were not able to subscribe (or\n // unsubscribe), and this Entry should remain dirty.\n entry.setDirty();\n return false;\n }\n }\n\n // Returning true indicates either that there was no entry.subscribe\n // function or that it succeeded.\n return true;\n}\n","import { AnyEntry } from \"./entry\";\nimport { OptimisticWrapOptions } from \"./index\";\nimport { parentEntrySlot } from \"./context\";\nimport { Unsubscribable, maybeUnsubscribe } from \"./helpers\";\n\nexport type OptimisticDependencyFunction =\n ((key: TKey) => void) & {\n dirty: (key: TKey) => void;\n };\n\nexport type Dep = Set & {\n subscribe: OptimisticWrapOptions<[TKey]>[\"subscribe\"];\n} & Unsubscribable;\n\nexport function dep(options?: {\n subscribe: Dep[\"subscribe\"];\n}) {\n const depsByKey = new Map>();\n const subscribe = options && options.subscribe;\n\n function depend(key: TKey) {\n const parent = parentEntrySlot.getValue();\n if (parent) {\n let dep = depsByKey.get(key);\n if (!dep) {\n depsByKey.set(key, dep = new Set as Dep);\n }\n parent.dependOn(dep);\n if (typeof subscribe === \"function\") {\n maybeUnsubscribe(dep);\n dep.unsubscribe = subscribe(key);\n }\n }\n }\n\n depend.dirty = function dirty(key: TKey) {\n const dep = depsByKey.get(key);\n if (dep) {\n dep.forEach(entry => entry.setDirty());\n depsByKey.delete(key);\n maybeUnsubscribe(dep);\n }\n };\n\n return depend as OptimisticDependencyFunction;\n}\n","import { DocumentNode } from 'graphql';\nimport { wrap } from 'optimism';\n\nimport {\n StoreObject,\n Reference,\n getFragmentQueryDocument,\n} from '../../utilities';\nimport { DataProxy } from './types/DataProxy';\nimport { Cache } from './types/Cache';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): Reference | undefined;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract reset(): Promise;\n\n // Remove whole objects from the cache by passing just options.id, or\n // specific fields by passing options.field and/or options.args. If no\n // options.args are provided, all fields matching options.field (even\n // those with arguments) will be removed. Returns true iff any data was\n // removed from the cache.\n public abstract evict(options: Cache.EvictOptions): boolean;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // Optimistic API\n\n public abstract removeOptimistic(id: string): void;\n\n // Transactional API\n\n public abstract performTransaction(\n transaction: Transaction,\n // Although subclasses may implement recordOptimisticTransaction\n // however they choose, the default implementation simply calls\n // performTransaction with a string as the second argument, allowing\n // performTransaction to handle both optimistic and non-optimistic\n // (broadcast-batching) transactions. Passing null for optimisticId is\n // also allowed, and indicates that performTransaction should apply\n // the transaction non-optimistically (ignoring optimistic data).\n optimisticId?: string | null,\n ): void;\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n optimisticId: string,\n ) {\n this.performTransaction(transaction, optimisticId);\n }\n\n // Optional API\n\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n\n public identify(object: StoreObject | Reference): string | undefined {\n return;\n }\n\n public gc(): string[] {\n return [];\n }\n\n public modify(options: Cache.ModifyOptions): boolean {\n return false;\n }\n\n // Experimental API\n\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: Cache.ReadQueryOptions,\n optimistic = !!options.optimistic,\n ): QueryType | null {\n return this.read({\n rootId: options.id || 'ROOT_QUERY',\n query: options.query,\n variables: options.variables,\n returnPartialData: options.returnPartialData,\n optimistic,\n });\n }\n\n // Make sure we compute the same (===) fragment query document every\n // time we receive the same fragment in readFragment.\n private getFragmentDoc = wrap(getFragmentQueryDocument);\n\n public readFragment(\n options: Cache.ReadFragmentOptions,\n optimistic = !!options.optimistic,\n ): FragmentType | null {\n return this.read({\n query: this.getFragmentDoc(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n returnPartialData: options.returnPartialData,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): Reference | undefined {\n return this.write({\n dataId: options.id || 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n broadcast: options.broadcast,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): Reference | undefined {\n return this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: this.getFragmentDoc(options.fragment, options.fragmentName),\n broadcast: options.broadcast,\n });\n }\n}\n","import { DataProxy } from './DataProxy';\nimport { Modifier, Modifiers } from './common';\n\nexport namespace Cache {\n export type WatchCallback = (diff: Cache.DiffResult) => void;\n\n export interface ReadOptions\n extends DataProxy.Query {\n rootId?: string;\n previousResult?: any;\n optimistic: boolean;\n returnPartialData?: boolean;\n }\n\n export interface WriteOptions\n extends DataProxy.Query {\n dataId?: string;\n result: TResult;\n broadcast?: boolean;\n }\n\n export interface DiffOptions extends ReadOptions {\n // The DiffOptions interface is currently just an alias for\n // ReadOptions, though DiffOptions used to be responsible for\n // declaring the returnPartialData option.\n }\n\n export interface WatchOptions extends ReadOptions {\n immediate?: boolean;\n callback: WatchCallback;\n }\n\n export interface EvictOptions {\n id?: string;\n fieldName?: string;\n args?: Record;\n broadcast?: boolean;\n }\n\n export interface ModifyOptions {\n id?: string;\n fields: Modifiers | Modifier;\n optimistic?: boolean;\n broadcast?: boolean;\n }\n\n export import DiffResult = DataProxy.DiffResult;\n export import ReadQueryOptions = DataProxy.ReadQueryOptions;\n export import ReadFragmentOptions = DataProxy.ReadFragmentOptions;\n export import WriteQueryOptions = DataProxy.WriteQueryOptions;\n export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;\n export import Fragment = DataProxy.Fragment;\n}\n","import { FieldNode } from 'graphql';\n\nimport {\n Reference,\n StoreObject,\n StoreValue,\n isReference,\n} from '../../../utilities';\n\nimport { StorageType } from '../../inmemory/policies';\n\n// The Readonly type only really works for object types, since it marks\n// all of the object's properties as readonly, but there are many cases when\n// a generic type parameter like TExisting might be a string or some other\n// primitive type, in which case we need to avoid wrapping it with Readonly.\n// SafeReadonly collapses to just string, which makes string\n// assignable to SafeReadonly, whereas string is not assignable to\n// Readonly, somewhat surprisingly.\nexport type SafeReadonly = T extends object ? Readonly : T;\n\nexport class MissingFieldError {\n constructor(\n public readonly message: string,\n public readonly path: (string | number)[],\n public readonly query: import('graphql').DocumentNode,\n public readonly clientOnly: boolean,\n public readonly variables?: Record,\n ) {}\n}\n\nexport interface FieldSpecifier {\n typename?: string;\n fieldName: string;\n field?: FieldNode;\n args?: Record;\n variables?: Record;\n}\n\nexport interface ReadFieldOptions extends FieldSpecifier {\n from?: StoreObject | Reference;\n}\n\nexport interface ReadFieldFunction {\n (options: ReadFieldOptions): SafeReadonly | undefined;\n (\n fieldName: string,\n from?: StoreObject | Reference,\n ): SafeReadonly | undefined;\n}\n\nexport type ToReferenceFunction = (\n objOrIdOrRef: StoreObject | string | Reference,\n mergeIntoStore?: boolean,\n) => Reference | undefined;\n\nexport type CanReadFunction = (value: StoreValue) => boolean;\n\nexport type Modifier = (value: T, details: {\n DELETE: any;\n INVALIDATE: any;\n fieldName: string;\n storeFieldName: string;\n readField: ReadFieldFunction;\n canRead: CanReadFunction;\n isReference: typeof isReference;\n toReference: ToReferenceFunction;\n storage: StorageType;\n}) => T;\n\nexport type Modifiers = {\n [fieldName: string]: Modifier;\n};\n","import { SelectionSetNode } from 'graphql';\n\nimport { NormalizedCache } from './types';\nimport {\n Reference,\n isReference,\n StoreValue,\n StoreObject,\n isField,\n DeepMerger,\n resultKeyNameFromField,\n shouldInclude,\n} from '../../utilities';\n\nexport const hasOwn = Object.prototype.hasOwnProperty;\n\nexport function getTypenameFromStoreObject(\n store: NormalizedCache,\n objectOrReference: StoreObject | Reference,\n): string | undefined {\n return isReference(objectOrReference)\n ? store.get(objectOrReference.__ref, \"__typename\") as string\n : objectOrReference && objectOrReference.__typename;\n}\n\nexport const TypeOrFieldNameRegExp = /^[_a-z][_0-9a-z]*/i;\n\nexport function fieldNameFromStoreName(storeFieldName: string): string {\n const match = storeFieldName.match(TypeOrFieldNameRegExp);\n return match ? match[0] : storeFieldName;\n}\n\nexport function selectionSetMatchesResult(\n selectionSet: SelectionSetNode,\n result: Record,\n variables?: Record,\n): boolean {\n if (result && typeof result === \"object\") {\n return Array.isArray(result)\n ? result.every(item => selectionSetMatchesResult(selectionSet, item, variables))\n : selectionSet.selections.every(field => {\n if (isField(field) && shouldInclude(field, variables)) {\n const key = resultKeyNameFromField(field);\n return hasOwn.call(result, key) &&\n (!field.selectionSet ||\n selectionSetMatchesResult(field.selectionSet, result[key], variables));\n }\n // If the selection has been skipped with @skip(true) or\n // @include(false), it should not count against the matching. If\n // the selection is not a field, it must be a fragment (inline or\n // named). We will determine if selectionSetMatchesResult for that\n // fragment when we get to it, so for now we return true.\n return true;\n });\n }\n return false;\n}\n\nexport function storeValueIsStoreObject(\n value: StoreValue,\n): value is StoreObject {\n return value !== null &&\n typeof value === \"object\" &&\n !isReference(value) &&\n !Array.isArray(value);\n}\n\nexport function makeProcessedFieldsMerger() {\n return new DeepMerger;\n}\n","import { dep, OptimisticDependencyFunction, KeyTrie } from 'optimism';\nimport { equal } from '@wry/equality';\n\nimport {\n isReference,\n StoreValue,\n StoreObject,\n Reference,\n makeReference,\n DeepMerger,\n maybeDeepFreeze,\n canUseWeakMap,\n} from '../../utilities';\nimport { NormalizedCache, NormalizedCacheObject } from './types';\nimport { hasOwn, fieldNameFromStoreName } from './helpers';\nimport { Policies, StorageType } from './policies';\nimport { Cache } from '../core/types/Cache';\nimport {\n SafeReadonly,\n Modifier,\n Modifiers,\n ReadFieldOptions,\n ToReferenceFunction,\n CanReadFunction,\n} from '../core/types/common';\n\nconst DELETE: any = Object.create(null);\nconst delModifier: Modifier = () => DELETE;\nconst INVALIDATE: any = Object.create(null);\n\nexport abstract class EntityStore implements NormalizedCache {\n protected data: NormalizedCacheObject = Object.create(null);\n\n constructor(\n public readonly policies: Policies,\n public readonly group: CacheGroup,\n ) {}\n\n public abstract addLayer(\n layerId: string,\n replay: (layer: EntityStore) => any,\n ): Layer;\n\n public abstract removeLayer(layerId: string): EntityStore;\n\n // Although the EntityStore class is abstract, it contains concrete\n // implementations of the various NormalizedCache interface methods that\n // are inherited by the Root and Layer subclasses.\n\n public toObject(): NormalizedCacheObject {\n return { ...this.data };\n }\n\n public has(dataId: string): boolean {\n return this.lookup(dataId, true) !== void 0;\n }\n\n public get(dataId: string, fieldName: string): StoreValue {\n this.group.depend(dataId, fieldName);\n if (hasOwn.call(this.data, dataId)) {\n const storeObject = this.data[dataId];\n if (storeObject && hasOwn.call(storeObject, fieldName)) {\n return storeObject[fieldName];\n }\n }\n if (fieldName === \"__typename\" &&\n hasOwn.call(this.policies.rootTypenamesById, dataId)) {\n return this.policies.rootTypenamesById[dataId];\n }\n if (this instanceof Layer) {\n return this.parent.get(dataId, fieldName);\n }\n }\n\n protected lookup(dataId: string, dependOnExistence?: boolean): StoreObject | undefined {\n // The has method (above) calls lookup with dependOnExistence = true, so\n // that it can later be invalidated when we add or remove a StoreObject for\n // this dataId. Any consumer who cares about the contents of the StoreObject\n // should not rely on this dependency, since the contents could change\n // without the object being added or removed.\n if (dependOnExistence) this.group.depend(dataId, \"__exists\");\n\n if (hasOwn.call(this.data, dataId)) {\n return this.data[dataId];\n }\n\n if (this instanceof Layer) {\n return this.parent.lookup(dataId, dependOnExistence);\n }\n\n if (this.policies.rootTypenamesById[dataId]) {\n return Object.create(null);\n }\n }\n\n public merge(dataId: string, incoming: StoreObject): void {\n const existing = this.lookup(dataId);\n const merged: StoreObject =\n new DeepMerger(storeObjectReconciler).merge(existing, incoming);\n // Even if merged === existing, existing may have come from a lower\n // layer, so we always need to set this.data[dataId] on this level.\n this.data[dataId] = merged;\n if (merged !== existing) {\n delete this.refs[dataId];\n if (this.group.caching) {\n const fieldsToDirty: Record = Object.create(null);\n\n // If we added a new StoreObject where there was previously none, dirty\n // anything that depended on the existence of this dataId, such as the\n // EntityStore#has method.\n if (!existing) fieldsToDirty.__exists = 1;\n\n // Now invalidate dependents who called getFieldValue for any fields\n // that are changing as a result of this merge.\n Object.keys(incoming).forEach(storeFieldName => {\n if (!existing || existing[storeFieldName] !== merged[storeFieldName]) {\n // Always dirty the full storeFieldName, which may include\n // serialized arguments following the fieldName prefix.\n fieldsToDirty[storeFieldName] = 1;\n\n // Also dirty fieldNameFromStoreName(storeFieldName) if it's\n // different from storeFieldName and this field does not have\n // keyArgs configured, because that means the cache can't make\n // any assumptions about how field values with the same field\n // name but different arguments might be interrelated, so it\n // must err on the side of invalidating all field values that\n // share the same short fieldName, regardless of arguments.\n const fieldName = fieldNameFromStoreName(storeFieldName);\n if (fieldName !== storeFieldName &&\n !this.policies.hasKeyArgs(merged.__typename, fieldName)) {\n fieldsToDirty[fieldName] = 1;\n }\n\n // If merged[storeFieldName] has become undefined, and this is the\n // Root layer, actually delete the property from the merged object,\n // which is guaranteed to have been created fresh in this method.\n if (merged[storeFieldName] === void 0 && !(this instanceof Layer)) {\n delete merged[storeFieldName];\n }\n }\n });\n\n Object.keys(fieldsToDirty).forEach(\n fieldName => this.group.dirty(dataId, fieldName));\n }\n }\n }\n\n public modify(\n dataId: string,\n fields: Modifier | Modifiers,\n ): boolean {\n const storeObject = this.lookup(dataId);\n\n if (storeObject) {\n const changedFields: Record = Object.create(null);\n let needToMerge = false;\n let allDeleted = true;\n\n const sharedDetails = {\n DELETE,\n INVALIDATE,\n isReference,\n toReference: this.toReference,\n canRead: this.canRead,\n readField: (\n fieldNameOrOptions: string | ReadFieldOptions,\n from?: StoreObject | Reference,\n ) => this.policies.readField(\n typeof fieldNameOrOptions === \"string\" ? {\n fieldName: fieldNameOrOptions,\n from: from || makeReference(dataId),\n } : fieldNameOrOptions,\n { store: this },\n ),\n };\n\n Object.keys(storeObject).forEach(storeFieldName => {\n const fieldName = fieldNameFromStoreName(storeFieldName);\n let fieldValue = storeObject[storeFieldName];\n if (fieldValue === void 0) return;\n const modify: Modifier = typeof fields === \"function\"\n ? fields\n : fields[storeFieldName] || fields[fieldName];\n if (modify) {\n let newValue = modify === delModifier ? DELETE :\n modify(maybeDeepFreeze(fieldValue), {\n ...sharedDetails,\n fieldName,\n storeFieldName,\n storage: this.getStorage(dataId, storeFieldName),\n });\n if (newValue === INVALIDATE) {\n this.group.dirty(dataId, storeFieldName);\n } else {\n if (newValue === DELETE) newValue = void 0;\n if (newValue !== fieldValue) {\n changedFields[storeFieldName] = newValue;\n needToMerge = true;\n fieldValue = newValue;\n }\n }\n }\n if (fieldValue !== void 0) {\n allDeleted = false;\n }\n });\n\n if (needToMerge) {\n this.merge(dataId, changedFields);\n\n if (allDeleted) {\n if (this instanceof Layer) {\n this.data[dataId] = void 0;\n } else {\n delete this.data[dataId];\n }\n this.group.dirty(dataId, \"__exists\");\n }\n\n return true;\n }\n }\n\n return false;\n }\n\n // If called with only one argument, removes the entire entity\n // identified by dataId. If called with a fieldName as well, removes all\n // fields of that entity whose names match fieldName according to the\n // fieldNameFromStoreName helper function. If called with a fieldName\n // and variables, removes all fields of that entity whose names match fieldName\n // and whose arguments when cached exactly match the variables passed.\n public delete(\n dataId: string,\n fieldName?: string,\n args?: Record,\n ) {\n const storeObject = this.lookup(dataId);\n if (storeObject) {\n const typename = this.getFieldValue(storeObject, \"__typename\");\n const storeFieldName = fieldName && args\n ? this.policies.getStoreFieldName({ typename, fieldName, args })\n : fieldName;\n return this.modify(dataId, storeFieldName ? {\n [storeFieldName]: delModifier,\n } : delModifier);\n }\n return false;\n }\n\n public evict(options: Cache.EvictOptions): boolean {\n let evicted = false;\n if (options.id) {\n if (hasOwn.call(this.data, options.id)) {\n evicted = this.delete(options.id, options.fieldName, options.args);\n }\n if (this instanceof Layer) {\n evicted = this.parent.evict(options) || evicted;\n }\n // Always invalidate the field to trigger rereading of watched\n // queries, even if no cache data was modified by the eviction,\n // because queries may depend on computed fields with custom read\n // functions, whose values are not stored in the EntityStore.\n if (options.fieldName || evicted) {\n this.group.dirty(options.id, options.fieldName || \"__exists\");\n }\n }\n return evicted;\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public extract(): NormalizedCacheObject {\n const obj = this.toObject();\n const extraRootIds: string[] = [];\n this.getRootIdSet().forEach(id => {\n if (!hasOwn.call(this.policies.rootTypenamesById, id)) {\n extraRootIds.push(id);\n }\n });\n if (extraRootIds.length) {\n obj.__META = { extraRootIds: extraRootIds.sort() };\n }\n return obj;\n }\n\n public replace(newData: NormalizedCacheObject | null): void {\n Object.keys(this.data).forEach(dataId => {\n if (!(newData && hasOwn.call(newData, dataId))) {\n this.delete(dataId);\n }\n });\n if (newData) {\n const { __META, ...rest } = newData;\n Object.keys(rest).forEach(dataId => {\n this.merge(dataId, rest[dataId] as StoreObject);\n });\n if (__META) {\n __META.extraRootIds.forEach(this.retain, this);\n }\n }\n }\n\n public abstract getStorage(\n idOrObj: string | StoreObject,\n ...storeFieldNames: (string | number)[]\n ): StorageType;\n\n // Maps root entity IDs to the number of times they have been retained, minus\n // the number of times they have been released. Retained entities keep other\n // entities they reference (even indirectly) from being garbage collected.\n private rootIds: {\n [rootId: string]: number;\n } = Object.create(null);\n\n public retain(rootId: string): number {\n return this.rootIds[rootId] = (this.rootIds[rootId] || 0) + 1;\n }\n\n public release(rootId: string): number {\n if (this.rootIds[rootId] > 0) {\n const count = --this.rootIds[rootId];\n if (!count) delete this.rootIds[rootId];\n return count;\n }\n return 0;\n }\n\n // Return a Set of all the ID strings that have been retained by\n // this layer/root *and* any layers/roots beneath it.\n public getRootIdSet(ids = new Set()) {\n Object.keys(this.rootIds).forEach(ids.add, ids);\n if (this instanceof Layer) {\n this.parent.getRootIdSet(ids);\n } else {\n // Official singleton IDs like ROOT_QUERY and ROOT_MUTATION are\n // always considered roots for garbage collection, regardless of\n // their retainment counts in this.rootIds.\n Object.keys(this.policies.rootTypenamesById).forEach(ids.add, ids);\n }\n return ids;\n }\n\n // The goal of garbage collection is to remove IDs from the Root layer of the\n // store that are no longer reachable starting from any IDs that have been\n // explicitly retained (see retain and release, above). Returns an array of\n // dataId strings that were removed from the store.\n public gc() {\n const ids = this.getRootIdSet();\n const snapshot = this.toObject();\n ids.forEach(id => {\n if (hasOwn.call(snapshot, id)) {\n // Because we are iterating over an ECMAScript Set, the IDs we add here\n // will be visited in later iterations of the forEach loop only if they\n // were not previously contained by the Set.\n Object.keys(this.findChildRefIds(id)).forEach(ids.add, ids);\n // By removing IDs from the snapshot object here, we protect them from\n // getting removed from the root store layer below.\n delete snapshot[id];\n }\n });\n const idsToRemove = Object.keys(snapshot);\n if (idsToRemove.length) {\n let root: EntityStore = this;\n while (root instanceof Layer) root = root.parent;\n idsToRemove.forEach(id => root.delete(id));\n }\n return idsToRemove;\n }\n\n // Lazily tracks { __ref: } strings contained by this.data[dataId].\n private refs: {\n [dataId: string]: Record;\n } = Object.create(null);\n\n public findChildRefIds(dataId: string): Record {\n if (!hasOwn.call(this.refs, dataId)) {\n const found = this.refs[dataId] = Object.create(null);\n const workSet = new Set([this.data[dataId]]);\n // Within the store, only arrays and objects can contain child entity\n // references, so we can prune the traversal using this predicate:\n const canTraverse = (obj: any) => obj !== null && typeof obj === 'object';\n workSet.forEach(obj => {\n if (isReference(obj)) {\n found[obj.__ref] = true;\n } else if (canTraverse(obj)) {\n Object.values(obj!)\n // No need to add primitive values to the workSet, since they cannot\n // contain reference objects.\n .filter(canTraverse)\n .forEach(workSet.add, workSet);\n }\n });\n }\n return this.refs[dataId];\n }\n\n // Used to compute cache keys specific to this.group.\n public makeCacheKey(...args: any[]) {\n return this.group.keyMaker.lookupArray(args);\n }\n\n // Bound function that can be passed around to provide easy access to fields\n // of Reference objects as well as ordinary objects.\n public getFieldValue = (\n objectOrReference: StoreObject | Reference | undefined,\n storeFieldName: string,\n ) => maybeDeepFreeze(\n isReference(objectOrReference)\n ? this.get(objectOrReference.__ref, storeFieldName)\n : objectOrReference && objectOrReference[storeFieldName]\n ) as SafeReadonly;\n\n // Returns true for non-normalized StoreObjects and non-dangling\n // References, indicating that readField(name, objOrRef) has a chance of\n // working. Useful for filtering out dangling references from lists.\n public canRead: CanReadFunction = objOrRef => {\n return isReference(objOrRef)\n ? this.has(objOrRef.__ref)\n : typeof objOrRef === \"object\";\n };\n\n // Bound function that converts an id or an object with a __typename and\n // primary key fields to a Reference object. If called with a Reference object,\n // that same Reference object is returned. Pass true for mergeIntoStore to persist\n // an object into the store.\n public toReference: ToReferenceFunction = (\n objOrIdOrRef,\n mergeIntoStore,\n ) => {\n if (typeof objOrIdOrRef === \"string\") {\n return makeReference(objOrIdOrRef);\n }\n\n if (isReference(objOrIdOrRef)) {\n return objOrIdOrRef;\n }\n\n const [id] = this.policies.identify(objOrIdOrRef);\n\n if (id) {\n const ref = makeReference(id);\n if (mergeIntoStore) {\n this.merge(id, objOrIdOrRef);\n }\n return ref;\n }\n };\n}\n\nexport type FieldValueGetter = EntityStore[\"getFieldValue\"];\n\n// A single CacheGroup represents a set of one or more EntityStore objects,\n// typically the Root store in a CacheGroup by itself, and all active Layer\n// stores in a group together. A single EntityStore object belongs to only\n// one CacheGroup, store.group. The CacheGroup is responsible for tracking\n// dependencies, so store.group is helpful for generating unique keys for\n// cached results that need to be invalidated when/if those dependencies\n// change. If we used the EntityStore objects themselves as cache keys (that\n// is, store rather than store.group), the cache would become unnecessarily\n// fragmented by all the different Layer objects. Instead, the CacheGroup\n// approach allows all optimistic Layer objects in the same linked list to\n// belong to one CacheGroup, with the non-optimistic Root object belonging\n// to another CacheGroup, allowing resultCaching dependencies to be tracked\n// separately for optimistic and non-optimistic entity data.\nclass CacheGroup {\n private d: OptimisticDependencyFunction | null = null;\n\n constructor(public readonly caching: boolean) {\n this.d = caching ? dep() : null;\n }\n\n public depend(dataId: string, storeFieldName: string) {\n if (this.d) {\n this.d(makeDepKey(dataId, storeFieldName));\n const fieldName = fieldNameFromStoreName(storeFieldName);\n if (fieldName !== storeFieldName) {\n // Fields with arguments that contribute extra identifying\n // information to the fieldName (thus forming the storeFieldName)\n // depend not only on the full storeFieldName but also on the\n // short fieldName, so the field can be invalidated using either\n // level of specificity.\n this.d(makeDepKey(dataId, fieldName));\n }\n }\n }\n\n public dirty(dataId: string, storeFieldName: string) {\n if (this.d) {\n this.d.dirty(makeDepKey(dataId, storeFieldName));\n }\n }\n\n // Used by the EntityStore#makeCacheKey method to compute cache keys\n // specific to this CacheGroup.\n public readonly keyMaker = new KeyTrie(canUseWeakMap);\n}\n\nfunction makeDepKey(dataId: string, storeFieldName: string) {\n // Since field names cannot have '#' characters in them, this method\n // of joining the field name and the ID should be unambiguous, and much\n // cheaper than JSON.stringify([dataId, fieldName]).\n return storeFieldName + '#' + dataId;\n}\n\nexport namespace EntityStore {\n // Refer to this class as EntityStore.Root outside this namespace.\n export class Root extends EntityStore {\n // Although each Root instance gets its own unique CacheGroup object,\n // any Layer instances created by calling addLayer need to share a\n // single distinct CacheGroup object. Since this shared object must\n // outlast the Layer instances themselves, it needs to be created and\n // owned by the Root instance.\n private sharedLayerGroup: CacheGroup;\n\n constructor({\n policies,\n resultCaching = true,\n seed,\n }: {\n policies: Policies;\n resultCaching?: boolean;\n seed?: NormalizedCacheObject;\n }) {\n super(policies, new CacheGroup(resultCaching));\n this.sharedLayerGroup = new CacheGroup(resultCaching);\n if (seed) this.replace(seed);\n }\n\n public addLayer(\n layerId: string,\n replay: (layer: EntityStore) => any,\n ): Layer {\n // The replay function will be called in the Layer constructor.\n return new Layer(layerId, this, replay, this.sharedLayerGroup);\n }\n\n public removeLayer(): Root {\n // Never remove the root layer.\n return this;\n }\n\n public readonly storageTrie = new KeyTrie(canUseWeakMap);\n public getStorage(): StorageType {\n return this.storageTrie.lookupArray(arguments);\n }\n }\n}\n\n// Not exported, since all Layer instances are created by the addLayer method\n// of the EntityStore.Root class.\nclass Layer extends EntityStore {\n constructor(\n public readonly id: string,\n public readonly parent: EntityStore,\n public readonly replay: (layer: EntityStore) => any,\n public readonly group: CacheGroup,\n ) {\n super(parent.policies, group);\n replay(this);\n }\n\n public addLayer(\n layerId: string,\n replay: (layer: EntityStore) => any,\n ): Layer {\n return new Layer(layerId, this, replay, this.group);\n }\n\n public removeLayer(layerId: string): EntityStore {\n // Remove all instances of the given id, not just the first one.\n const parent = this.parent.removeLayer(layerId);\n\n if (layerId === this.id) {\n // Dirty every ID we're removing.\n if (this.group.caching) {\n Object.keys(this.data).forEach(dataId => {\n // If this.data[dataId] contains nothing different from what\n // lies beneath, we can avoid dirtying this dataId and all of\n // its fields, and simply discard this Layer. The only reason we\n // call this.delete here is to dirty the removed fields.\n if (this.data[dataId] !== (parent as Layer).lookup(dataId)) {\n this.delete(dataId);\n }\n });\n }\n return parent;\n }\n\n // No changes are necessary if the parent chain remains identical.\n if (parent === this.parent) return this;\n\n // Recreate this layer on top of the new parent.\n return parent.addLayer(this.id, this.replay);\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n public findChildRefIds(dataId: string): Record {\n const fromParent = this.parent.findChildRefIds(dataId);\n return hasOwn.call(this.data, dataId) ? {\n ...fromParent,\n ...super.findChildRefIds(dataId),\n } : fromParent;\n }\n\n public getStorage(): StorageType {\n let p: EntityStore = this.parent;\n while ((p as Layer).parent) p = (p as Layer).parent;\n return p.getStorage.apply(p, arguments);\n }\n}\n\nfunction storeObjectReconciler(\n existingObject: StoreObject,\n incomingObject: StoreObject,\n property: string,\n): StoreValue {\n const existingValue = existingObject[property];\n const incomingValue = incomingObject[property];\n // Wherever there is a key collision, prefer the incoming value, unless\n // it is deeply equal to the existing value. It's worth checking deep\n // equality here (even though blindly returning incoming would be\n // logically correct) because preserving the referential identity of\n // existing data can prevent needless rereading and rerendering.\n return equal(existingValue, incomingValue) ? existingValue : incomingValue;\n}\n\nexport function supportsResultCaching(store: any): store is EntityStore {\n // When result caching is disabled, store.depend will be null.\n return !!(store instanceof EntityStore && store.group.caching);\n}\n","import {\n DocumentNode,\n FieldNode,\n SelectionSetNode,\n} from 'graphql';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport {\n isField,\n resultKeyNameFromField,\n Reference,\n isReference,\n makeReference,\n StoreObject,\n createFragmentMap,\n FragmentMap,\n shouldInclude,\n addTypenameToDocument,\n getDefaultValues,\n getFragmentDefinitions,\n getMainDefinition,\n getQueryDefinition,\n maybeDeepFreeze,\n mergeDeepArray,\n getFragmentFromSelection,\n} from '../../utilities';\nimport { Cache } from '../core/types/Cache';\nimport {\n DiffQueryAgainstStoreOptions,\n NormalizedCache,\n ReadMergeModifyContext,\n} from './types';\nimport { supportsResultCaching } from './entityStore';\nimport { getTypenameFromStoreObject } from './helpers';\nimport { Policies } from './policies';\nimport { InMemoryCache } from './inMemoryCache';\nimport { MissingFieldError } from '../core/types/common';\n\nexport type VariableMap = { [name: string]: any };\n\ninterface ReadContext extends ReadMergeModifyContext {\n query: DocumentNode;\n policies: Policies;\n fragmentMap: FragmentMap;\n path: (string | number)[];\n clientOnly: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n missing?: MissingFieldError[];\n};\n\nfunction missingFromInvariant(\n err: InvariantError,\n context: ReadContext,\n) {\n return new MissingFieldError(\n err.message,\n context.path.slice(),\n context.query,\n context.clientOnly,\n context.variables,\n );\n}\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n objectOrReference: StoreObject | Reference;\n context: ReadContext;\n};\n\ntype ExecSubSelectedArrayOptions = {\n field: FieldNode;\n array: any[];\n context: ReadContext;\n};\n\nexport interface StoreReaderConfig {\n cache: InMemoryCache,\n addTypename?: boolean;\n}\n\nexport class StoreReader {\n constructor(private config: StoreReaderConfig) {\n this.config = { addTypename: true, ...config };\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n rootId = 'ROOT_QUERY',\n variables,\n returnPartialData = true,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n const policies = this.config.cache.policies;\n\n variables = {\n ...getDefaultValues(getQueryDefinition(query)),\n ...variables,\n };\n\n const execResult = this.executeSelectionSet({\n selectionSet: getMainDefinition(query).selectionSet,\n objectOrReference: makeReference(rootId),\n context: {\n store,\n query,\n policies,\n variables,\n varString: JSON.stringify(variables),\n fragmentMap: createFragmentMap(getFragmentDefinitions(query)),\n path: [],\n clientOnly: false,\n },\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n if (hasMissingFields && !returnPartialData) {\n throw execResult.missing![0];\n }\n\n return {\n result: execResult.result,\n missing: execResult.missing,\n complete: !hasMissingFields,\n };\n }\n\n public isFresh(\n result: Record,\n parent: StoreObject | Reference,\n selectionSet: SelectionSetNode,\n context: ReadMergeModifyContext,\n ): boolean {\n if (supportsResultCaching(context.store) &&\n this.knownResults.get(result) === selectionSet) {\n const latest = this.executeSelectionSet.peek(selectionSet, parent, context);\n if (latest && result === latest.result) {\n return true;\n }\n }\n return false;\n }\n\n // Cached version of execSelectionSetImpl.\n private executeSelectionSet: OptimisticWrapperFunction<\n [ExecSelectionSetOptions], // Actual arguments tuple type.\n ExecResult, // Actual return type.\n // Arguments type after keyArgs translation.\n [SelectionSetNode, StoreObject | Reference, ReadMergeModifyContext]\n > = wrap(options => this.execSelectionSetImpl(options), {\n keyArgs(options) {\n return [\n options.selectionSet,\n options.objectOrReference,\n options.context,\n ];\n },\n // Note that the parameters of makeCacheKey are determined by the\n // array returned by keyArgs.\n makeCacheKey(selectionSet, parent, context) {\n if (supportsResultCaching(context.store)) {\n return context.store.makeCacheKey(\n selectionSet,\n isReference(parent) ? parent.__ref : parent,\n context.varString,\n );\n }\n }\n });\n\n // Uncached version of executeSelectionSet.\n private execSelectionSetImpl({\n selectionSet,\n objectOrReference,\n context,\n }: ExecSelectionSetOptions): ExecResult {\n if (isReference(objectOrReference) &&\n !context.policies.rootTypenamesById[objectOrReference.__ref] &&\n !context.store.has(objectOrReference.__ref)) {\n return {\n result: {},\n missing: [missingFromInvariant(\n new InvariantError(\n `Dangling reference to missing ${objectOrReference.__ref} object`\n ),\n context,\n )],\n };\n }\n\n const { variables, policies, store } = context;\n const objectsToMerge: { [key: string]: any }[] = [];\n const finalResult: ExecResult = { result: null };\n const typename = store.getFieldValue(objectOrReference, \"__typename\");\n\n if (this.config.addTypename &&\n typeof typename === \"string\" &&\n !policies.rootIdsByTypename[typename]) {\n // Ensure we always include a default value for the __typename\n // field, if we have one, and this.config.addTypename is true. Note\n // that this field can be overridden by other merged objects.\n objectsToMerge.push({ __typename: typename });\n }\n\n function getMissing() {\n return finalResult.missing || (finalResult.missing = []);\n }\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) getMissing().push(...result.missing);\n return result.result;\n }\n\n const workSet = new Set(selectionSet.selections);\n\n workSet.forEach(selection => {\n // Omit fields with directives @skip(if: ) or\n // @include(if: ).\n if (!shouldInclude(selection, variables)) return;\n\n if (isField(selection)) {\n let fieldValue = policies.readField({\n fieldName: selection.name.value,\n field: selection,\n variables: context.variables,\n from: objectOrReference,\n }, context);\n\n const resultName = resultKeyNameFromField(selection);\n context.path.push(resultName);\n\n // If this field has an @client directive, then the field and\n // everything beneath it is client-only, meaning it will never be\n // sent to the server.\n const wasClientOnly = context.clientOnly;\n // Once we enter a client-only subtree of the query, we can avoid\n // repeatedly checking selection.directives.\n context.clientOnly = wasClientOnly || !!(\n // We don't use the hasDirectives helper here, because it looks\n // for directives anywhere inside the AST node, whereas we only\n // care about directives directly attached to this field.\n selection.directives &&\n selection.directives.some(d => d.name.value === \"client\")\n );\n\n if (fieldValue === void 0) {\n if (!addTypenameToDocument.added(selection)) {\n getMissing().push(\n missingFromInvariant(\n new InvariantError(`Can't find field '${\n selection.name.value\n }' on ${\n isReference(objectOrReference)\n ? objectOrReference.__ref + \" object\"\n : \"object \" + JSON.stringify(objectOrReference, null, 2)\n }`),\n context,\n ),\n );\n }\n\n } else if (Array.isArray(fieldValue)) {\n fieldValue = handleMissing(this.executeSubSelectedArray({\n field: selection,\n array: fieldValue,\n context,\n }));\n\n } else if (!selection.selectionSet) {\n // If the field does not have a selection set, then we handle it\n // as a scalar value. However, that value should not contain any\n // Reference objects, and should be frozen in development, if it\n // happens to be an object that is mutable.\n if (process.env.NODE_ENV !== 'production') {\n assertSelectionSetForIdValue(\n context.store,\n selection,\n fieldValue,\n );\n maybeDeepFreeze(fieldValue);\n }\n\n } else if (fieldValue != null) {\n // In this case, because we know the field has a selection set,\n // it must be trying to query a GraphQLObjectType, which is why\n // fieldValue must be != null.\n fieldValue = handleMissing(this.executeSelectionSet({\n selectionSet: selection.selectionSet,\n objectOrReference: fieldValue as StoreObject | Reference,\n context,\n }));\n }\n\n if (fieldValue !== void 0) {\n objectsToMerge.push({ [resultName]: fieldValue });\n }\n\n context.clientOnly = wasClientOnly;\n\n invariant(context.path.pop() === resultName);\n\n } else {\n const fragment = getFragmentFromSelection(\n selection,\n context.fragmentMap,\n );\n\n if (fragment && policies.fragmentMatches(fragment, typename)) {\n fragment.selectionSet.selections.forEach(workSet.add, workSet);\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n if (process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n\n // Store this result with its selection set so that we can quickly\n // recognize it again in the StoreReader#isFresh method.\n this.knownResults.set(finalResult.result, selectionSet);\n\n return finalResult;\n }\n\n private knownResults = new WeakMap, SelectionSetNode>();\n\n // Cached version of execSubSelectedArrayImpl.\n private executeSubSelectedArray = wrap((options: ExecSubSelectedArrayOptions) => {\n return this.execSubSelectedArrayImpl(options);\n }, {\n makeCacheKey({ field, array, context }) {\n if (supportsResultCaching(context.store)) {\n return context.store.makeCacheKey(\n field,\n array,\n context.varString,\n );\n }\n }\n });\n\n // Uncached version of executeSubSelectedArray.\n private execSubSelectedArrayImpl({\n field,\n array,\n context,\n }: ExecSubSelectedArrayOptions): ExecResult {\n let missing: MissingFieldError[] | undefined;\n\n function handleMissing(childResult: ExecResult, i: number): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n invariant(context.path.pop() === i);\n\n return childResult.result;\n }\n\n if (field.selectionSet) {\n array = array.filter(context.store.canRead);\n }\n\n array = array.map((item, i) => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n context.path.push(i);\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray({\n field,\n array: item,\n context,\n }), i);\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n objectOrReference: item,\n context,\n }), i);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assertSelectionSetForIdValue(context.store, field, item);\n }\n\n invariant(context.path.pop() === i);\n\n return item;\n });\n\n if (process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n\n return { result: array, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n store: NormalizedCache,\n field: FieldNode,\n fieldValue: any,\n) {\n if (!field.selectionSet) {\n const workSet = new Set([fieldValue]);\n workSet.forEach(value => {\n if (value && typeof value === \"object\") {\n invariant(\n !isReference(value),\n `Missing selection set for object of type ${\n getTypenameFromStoreObject(store, value)\n } returned for query field ${field.name.value}`,\n );\n Object.values(value).forEach(workSet.add, workSet);\n }\n });\n }\n}\n","import { SelectionSetNode, FieldNode, DocumentNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { equal } from '@wry/equality';\n\nimport {\n createFragmentMap,\n FragmentMap,\n getFragmentFromSelection,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n getTypenameFromResult,\n makeReference,\n isField,\n resultKeyNameFromField,\n StoreValue,\n StoreObject,\n Reference,\n isReference,\n shouldInclude,\n hasDirectives,\n cloneDeep,\n} from '../../utilities';\n\nimport { NormalizedCache, ReadMergeModifyContext, MergeTree } from './types';\nimport { makeProcessedFieldsMerger, fieldNameFromStoreName, storeValueIsStoreObject } from './helpers';\nimport { StoreReader } from './readFromStore';\nimport { InMemoryCache } from './inMemoryCache';\nimport { EntityStore } from './entityStore';\n\nexport interface WriteContext extends ReadMergeModifyContext {\n readonly written: {\n [dataId: string]: SelectionSetNode[];\n };\n readonly fragmentMap?: FragmentMap;\n // General-purpose deep-merge function for use during writes.\n merge(existing: T, incoming: T): T;\n};\n\ninterface ProcessSelectionSetOptions {\n dataId?: string,\n result: Record;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n mergeTree: MergeTree;\n}\n\nexport interface WriteToStoreOptions {\n query: DocumentNode;\n result: Object;\n dataId?: string;\n store: NormalizedCache;\n variables?: Object;\n}\n\nexport class StoreWriter {\n constructor(\n public readonly cache: InMemoryCache,\n private reader?: StoreReader,\n ) {}\n\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @return A `Reference` to the written object.\n */\n public writeToStore({\n query,\n result,\n dataId,\n store,\n variables,\n }: WriteToStoreOptions): Reference | undefined {\n const operationDefinition = getOperationDefinition(query)!;\n const merger = makeProcessedFieldsMerger();\n\n variables = {\n ...getDefaultValues(operationDefinition),\n ...variables!,\n };\n\n const ref = this.processSelectionSet({\n result: result || Object.create(null),\n dataId,\n selectionSet: operationDefinition.selectionSet,\n mergeTree: { map: new Map },\n context: {\n store,\n written: Object.create(null),\n merge(existing: T, incoming: T) {\n return merger.merge(existing, incoming) as T;\n },\n variables,\n varString: JSON.stringify(variables),\n fragmentMap: createFragmentMap(getFragmentDefinitions(query)),\n },\n });\n\n if (!isReference(ref)) {\n throw new InvariantError(`Could not identify object ${JSON.stringify(result)}`);\n }\n\n // Any IDs written explicitly to the cache will be retained as\n // reachable root IDs for garbage collection purposes. Although this\n // logic includes root IDs like ROOT_QUERY and ROOT_MUTATION, their\n // retainment counts are effectively ignored because cache.gc() always\n // includes them in its root ID set.\n store.retain(ref.__ref);\n\n return ref;\n }\n\n private processSelectionSet({\n dataId,\n result,\n selectionSet,\n context,\n // This object allows processSelectionSet to report useful information\n // to its callers without explicitly returning that information.\n mergeTree,\n }: ProcessSelectionSetOptions): StoreObject | Reference {\n const { policies } = this.cache;\n\n // Identify the result object, even if dataId was already provided,\n // since we always need keyObject below.\n const [id, keyObject] = policies.identify(\n result, selectionSet, context.fragmentMap);\n\n // If dataId was not provided, fall back to the id just generated by\n // policies.identify.\n dataId = dataId || id;\n\n if (\"string\" === typeof dataId) {\n // Avoid processing the same entity object using the same selection\n // set more than once. We use an array instead of a Set since most\n // entity IDs will be written using only one selection set, so the\n // size of this array is likely to be very small, meaning indexOf is\n // likely to be faster than Set.prototype.has.\n const sets = context.written[dataId] || (context.written[dataId] = []);\n const ref = makeReference(dataId);\n if (sets.indexOf(selectionSet) >= 0) return ref;\n sets.push(selectionSet);\n\n // If we're about to write a result object into the store, but we\n // happen to know that the exact same (===) result object would be\n // returned if we were to reread the result with the same inputs,\n // then we can skip the rest of the processSelectionSet work for\n // this object, and immediately return a Reference to it.\n if (this.reader && this.reader.isFresh(\n result,\n ref,\n selectionSet,\n context,\n )) {\n return ref;\n }\n }\n\n // This variable will be repeatedly updated using context.merge to\n // accumulate all fields that need to be written into the store.\n let incomingFields: StoreObject = Object.create(null);\n\n // Write any key fields that were used during identification, even if\n // they were not mentioned in the original query.\n if (keyObject) {\n incomingFields = context.merge(incomingFields, keyObject);\n }\n\n // If typename was not passed in, infer it. Note that typename is\n // always passed in for tricky-to-infer cases such as \"Query\" for\n // ROOT_QUERY.\n const typename: string | undefined =\n (dataId && policies.rootTypenamesById[dataId]) ||\n getTypenameFromResult(result, selectionSet, context.fragmentMap) ||\n (dataId && context.store.get(dataId, \"__typename\") as string);\n\n if (\"string\" === typeof typename) {\n incomingFields.__typename = typename;\n }\n\n const workSet = new Set(selectionSet.selections);\n\n workSet.forEach(selection => {\n if (!shouldInclude(selection, context.variables)) return;\n\n if (isField(selection)) {\n const resultFieldKey = resultKeyNameFromField(selection);\n const value = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n const storeFieldName = policies.getStoreFieldName({\n typename,\n fieldName: selection.name.value,\n field: selection,\n variables: context.variables,\n });\n\n const childTree = getChildMergeTree(mergeTree, storeFieldName);\n\n let incomingValue =\n this.processFieldValue(value, selection, context, childTree);\n\n const childTypename = selection.selectionSet\n && context.store.getFieldValue(incomingValue as StoreObject, \"__typename\")\n || void 0;\n\n const merge = policies.getMergeFunction(\n typename,\n selection.name.value,\n childTypename,\n );\n\n if (merge) {\n childTree.info = {\n // TODO Check compatibility against any existing\n // childTree.field?\n field: selection,\n typename,\n merge,\n };\n } else {\n maybeRecycleChildMergeTree(mergeTree, storeFieldName);\n }\n\n incomingFields = context.merge(incomingFields, {\n [storeFieldName]: incomingValue,\n });\n\n } else if (\n policies.usingPossibleTypes &&\n !hasDirectives([\"defer\", \"client\"], selection)\n ) {\n throw new InvariantError(\n `Missing field '${resultFieldKey}' in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n const fragment = getFragmentFromSelection(\n selection,\n context.fragmentMap,\n );\n\n if (fragment &&\n // By passing result and context.variables, we enable\n // policies.fragmentMatches to bend the rules when typename is\n // not a known subtype of the fragment type condition, but the\n // result object contains all the keys requested by the\n // fragment, which strongly suggests the fragment probably\n // matched. This fuzzy matching behavior must be enabled by\n // including a regular expression string (such as \".*\" or\n // \"Prefix.*\" or \".*Suffix\") in the possibleTypes array for\n // specific supertypes; otherwise, all matching remains exact.\n // Fuzzy matches are remembered by the Policies object and\n // later used when reading from the cache. Since there is no\n // incoming result object to check when reading, reading does\n // not involve the same fuzzy inference, so the StoreReader\n // class calls policies.fragmentMatches without passing result\n // or context.variables. The flexibility of fuzzy matching\n // allows existing clients to accommodate previously unknown\n // __typename strings produced by server/schema changes, which\n // would otherwise be breaking changes.\n policies.fragmentMatches(fragment, typename, result, context.variables)) {\n fragment.selectionSet.selections.forEach(workSet.add, workSet);\n }\n }\n });\n\n if (\"string\" === typeof dataId) {\n const entityRef = makeReference(dataId);\n\n if (mergeTree.map.size) {\n incomingFields = this.applyMerges(mergeTree, entityRef, incomingFields, context);\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n const hasSelectionSet = (storeFieldName: string) =>\n fieldsWithSelectionSets.has(fieldNameFromStoreName(storeFieldName));\n const fieldsWithSelectionSets = new Set();\n workSet.forEach(selection => {\n if (isField(selection) && selection.selectionSet) {\n fieldsWithSelectionSets.add(selection.name.value);\n }\n });\n\n const hasMergeFunction = (storeFieldName: string) => {\n const childTree = mergeTree.map.get(storeFieldName);\n return Boolean(childTree && childTree.info && childTree.info.merge);\n };\n\n Object.keys(incomingFields).forEach(storeFieldName => {\n // If a merge function was defined for this field, trust that it\n // did the right thing about (not) clobbering data. If the field\n // has no selection set, it's a scalar field, so it doesn't need\n // a merge function (even if it's an object, like JSON data).\n if (hasSelectionSet(storeFieldName) &&\n !hasMergeFunction(storeFieldName)) {\n warnAboutDataLoss(\n entityRef,\n incomingFields,\n storeFieldName,\n context.store,\n );\n }\n });\n }\n\n context.store.merge(dataId, incomingFields);\n\n return entityRef;\n }\n\n return incomingFields;\n }\n\n private processFieldValue(\n value: any,\n field: FieldNode,\n context: WriteContext,\n mergeTree: MergeTree,\n ): StoreValue {\n if (!field.selectionSet || value === null) {\n // In development, we need to clone scalar values so that they can be\n // safely frozen with maybeDeepFreeze in readFromStore.ts. In production,\n // it's cheaper to store the scalar values directly in the cache.\n return process.env.NODE_ENV === 'production' ? value : cloneDeep(value);\n }\n\n if (Array.isArray(value)) {\n return value.map((item, i) => {\n const value = this.processFieldValue(\n item, field, context, getChildMergeTree(mergeTree, i));\n maybeRecycleChildMergeTree(mergeTree, i);\n return value;\n });\n }\n\n return this.processSelectionSet({\n result: value,\n selectionSet: field.selectionSet,\n context,\n mergeTree,\n });\n }\n\n private applyMerges(\n mergeTree: MergeTree,\n existing: StoreValue,\n incoming: T,\n context: ReadMergeModifyContext,\n getStorageArgs?: Parameters,\n ): T {\n if (mergeTree.map.size && !isReference(incoming)) {\n const e: StoreObject | Reference | undefined = (\n // Items in the same position in different arrays are not\n // necessarily related to each other, so when incoming is an array\n // we process its elements as if there was no existing data.\n !Array.isArray(incoming) &&\n // Likewise, existing must be either a Reference or a StoreObject\n // in order for its fields to be safe to merge with the fields of\n // the incoming object.\n (isReference(existing) || storeValueIsStoreObject(existing))\n ) ? existing : void 0;\n\n // This narrowing is implied by mergeTree.map.size > 0 and\n // !isReference(incoming), though TypeScript understandably cannot\n // hope to infer this type.\n const i = incoming as StoreObject | StoreValue[];\n\n // The options.storage objects provided to read and merge functions\n // are derived from the identity of the parent object plus a\n // sequence of storeFieldName strings/numbers identifying the nested\n // field name path of each field value to be merged.\n if (e && !getStorageArgs) {\n getStorageArgs = [isReference(e) ? e.__ref : e];\n }\n\n // It's possible that applying merge functions to this subtree will\n // not change the incoming data, so this variable tracks the fields\n // that did change, so we can create a new incoming object when (and\n // only when) at least one incoming field has changed. We use a Map\n // to preserve the type of numeric keys.\n let changedFields: Map | undefined;\n\n const getValue = (\n from: typeof e | typeof i,\n name: string | number,\n ): StoreValue => {\n return Array.isArray(from)\n ? (typeof name === \"number\" ? from[name] : void 0)\n : context.store.getFieldValue(from, String(name))\n };\n\n mergeTree.map.forEach((childTree, storeFieldName) => {\n if (getStorageArgs) {\n getStorageArgs.push(storeFieldName);\n }\n const eVal = getValue(e, storeFieldName);\n const iVal = getValue(i, storeFieldName);\n const aVal = this.applyMerges(\n childTree,\n eVal,\n iVal,\n context,\n getStorageArgs,\n );\n if (aVal !== iVal) {\n changedFields = changedFields || new Map;\n changedFields.set(storeFieldName, aVal);\n }\n if (getStorageArgs) {\n invariant(getStorageArgs.pop() === storeFieldName);\n }\n });\n\n if (changedFields) {\n // Shallow clone i so we can add changed fields to it.\n incoming = (Array.isArray(i) ? i.slice(0) : { ...i }) as T;\n changedFields.forEach((value, name) => {\n (incoming as any)[name] = value;\n });\n }\n }\n\n if (mergeTree.info) {\n return this.cache.policies.runMergeFunction(\n existing,\n incoming,\n mergeTree.info,\n context,\n getStorageArgs && context.store.getStorage(...getStorageArgs),\n );\n }\n\n return incoming;\n }\n}\n\nconst emptyMergeTreePool: MergeTree[] = [];\n\nfunction getChildMergeTree(\n { map }: MergeTree,\n name: string | number,\n): MergeTree {\n if (!map.has(name)) {\n map.set(name, emptyMergeTreePool.pop() || { map: new Map });\n }\n return map.get(name)!;\n}\n\nfunction maybeRecycleChildMergeTree(\n { map }: MergeTree,\n name: string | number,\n) {\n const childTree = map.get(name);\n if (childTree &&\n !childTree.info &&\n !childTree.map.size) {\n emptyMergeTreePool.push(childTree);\n map.delete(name);\n }\n}\n\nconst warnings = new Set();\n\n// Note that this function is unused in production, and thus should be\n// pruned by any well-configured minifier.\nfunction warnAboutDataLoss(\n existingRef: Reference,\n incomingObj: StoreObject,\n storeFieldName: string,\n store: NormalizedCache,\n) {\n const getChild = (objOrRef: StoreObject | Reference): StoreObject | false => {\n const child = store.getFieldValue(objOrRef, storeFieldName);\n return typeof child === \"object\" && child;\n };\n\n const existing = getChild(existingRef);\n if (!existing) return;\n\n const incoming = getChild(incomingObj);\n if (!incoming) return;\n\n // It's always safe to replace a reference, since it refers to data\n // safely stored elsewhere.\n if (isReference(existing)) return;\n\n // If the values are structurally equivalent, we do not need to worry\n // about incoming replacing existing.\n if (equal(existing, incoming)) return;\n\n // If we're replacing every key of the existing object, then the\n // existing data would be overwritten even if the objects were\n // normalized, so warning would not be helpful here.\n if (Object.keys(existing).every(\n key => store.getFieldValue(incoming, key) !== void 0)) {\n return;\n }\n\n const parentType =\n store.getFieldValue(existingRef, \"__typename\") ||\n store.getFieldValue(incomingObj, \"__typename\");\n const fieldName = fieldNameFromStoreName(storeFieldName);\n const typeDotName = `${parentType}.${fieldName}`;\n // Avoid warning more than once for the same type and field name.\n if (warnings.has(typeDotName)) return;\n warnings.add(typeDotName);\n\n const childTypenames: string[] = [];\n // Arrays do not have __typename fields, and always need a custom merge\n // function, even if their elements are normalized entities.\n if (!Array.isArray(existing) &&\n !Array.isArray(incoming)) {\n [existing, incoming].forEach(child => {\n const typename = store.getFieldValue(child, \"__typename\");\n if (typeof typename === \"string\" &&\n !childTypenames.includes(typename)) {\n childTypenames.push(typename);\n }\n });\n }\n\n invariant.warn(\n`Cache data may be lost when replacing the ${fieldName} field of a ${parentType} object.\n\nTo address this problem (which is not a bug in Apollo Client), ${\n childTypenames.length\n ? \"either ensure all objects of type \" +\n childTypenames.join(\" and \") + \" have an ID or a custom merge function, or \"\n : \"\"\n}define a custom merge function for the ${\n typeDotName\n} field, so InMemoryCache can safely merge these objects:\n\n existing: ${JSON.stringify(existing).slice(0, 1000)}\n incoming: ${JSON.stringify(incoming).slice(0, 1000)}\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n`);\n}\n","import { dep, OptimisticDependencyFunction } from \"optimism\";\nimport { Slot } from \"@wry/context\";\nimport { InMemoryCache } from \"./inMemoryCache\";\nimport { ApolloCache } from '../../core';\n\nexport interface ReactiveVar {\n (newValue?: T): T;\n onNextChange(listener: ReactiveListener): () => void;\n attachCache(cache: ApolloCache): this;\n forgetCache(cache: ApolloCache): boolean;\n}\n\nexport type ReactiveListener = (value: T) => any;\n\n// Contextual Slot that acquires its value when custom read functions are\n// called in Policies#readField.\nexport const cacheSlot = new Slot>();\n\n// A listener function could in theory cause another listener to be added\n// to the set while we're iterating over it, so it's important to commit\n// to the original elements of the set before we begin iterating. See\n// iterateObserversSafely for another example of this pattern.\nfunction consumeAndIterate(set: Set, callback: (item: T) => any) {\n if (set.size) {\n const items: T[] = [];\n set.forEach(item => items.push(item));\n set.clear();\n items.forEach(callback);\n }\n}\n\nconst cacheInfoMap = new WeakMap, {\n vars: Set>;\n dep: OptimisticDependencyFunction>;\n}>();\n\nfunction getCacheInfo(cache: ApolloCache) {\n let info = cacheInfoMap.get(cache)!;\n if (!info) {\n cacheInfoMap.set(cache, info = {\n vars: new Set,\n dep: dep(),\n });\n }\n return info;\n}\n\nexport function forgetCache(cache: ApolloCache) {\n getCacheInfo(cache).vars.forEach(rv => rv.forgetCache(cache));\n}\n\n// Calling forgetCache(cache) serves to silence broadcasts and allows the\n// cache to be garbage collected. However, the varsByCache WeakMap\n// preserves the set of reactive variables that were previously associated\n// with this cache, which makes it possible to \"recall\" the cache at a\n// later time, by reattaching it to those variables. If the cache has been\n// garbage collected in the meantime, because it is no longer reachable,\n// you won't be able to call recallCache(cache), and the cache will\n// automatically disappear from the varsByCache WeakMap.\nexport function recallCache(cache: ApolloCache) {\n getCacheInfo(cache).vars.forEach(rv => rv.attachCache(cache));\n}\n\nexport function makeVar(value: T): ReactiveVar {\n const caches = new Set>();\n const listeners = new Set>();\n\n const rv: ReactiveVar = function (newValue) {\n if (arguments.length > 0) {\n if (value !== newValue) {\n value = newValue!;\n caches.forEach(cache => {\n // Invalidate any fields with custom read functions that\n // consumed this variable, so query results involving those\n // fields will be recomputed the next time we read them.\n getCacheInfo(cache).dep.dirty(rv);\n // Broadcast changes to any caches that have previously read\n // from this variable.\n broadcast(cache);\n });\n // Finally, notify any listeners added via rv.onNextChange.\n consumeAndIterate(listeners, listener => listener(value));\n }\n } else {\n // When reading from the variable, obtain the current cache from\n // context via cacheSlot. This isn't entirely foolproof, but it's\n // the same system that powers varDep.\n const cache = cacheSlot.getValue();\n if (cache) {\n attach(cache);\n getCacheInfo(cache).dep(rv);\n }\n }\n\n return value;\n };\n\n rv.onNextChange = listener => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n };\n\n const attach = rv.attachCache = cache => {\n caches.add(cache);\n getCacheInfo(cache).vars.add(rv);\n return rv;\n };\n\n rv.forgetCache = cache => caches.delete(cache);\n\n return rv;\n}\n\ntype Broadcastable = ApolloCache & {\n // This method is protected in InMemoryCache, which we are ignoring, but\n // we still want some semblance of type safety when we call it.\n broadcastWatches?: InMemoryCache[\"broadcastWatches\"];\n};\n\nfunction broadcast(cache: Broadcastable) {\n if (cache.broadcastWatches) {\n cache.broadcastWatches();\n }\n}\n","import {\n InlineFragmentNode,\n FragmentDefinitionNode,\n SelectionSetNode,\n FieldNode,\n} from 'graphql';\n\nimport { KeyTrie } from 'optimism';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport {\n FragmentMap,\n getFragmentFromSelection,\n isField,\n getTypenameFromResult,\n storeKeyNameFromField,\n StoreValue,\n StoreObject,\n argumentsObjectFromField,\n Reference,\n isReference,\n getStoreKeyName,\n canUseWeakMap,\n compact,\n} from '../../utilities';\nimport { IdGetter, ReadMergeModifyContext, MergeInfo } from \"./types\";\nimport {\n hasOwn,\n fieldNameFromStoreName,\n storeValueIsStoreObject,\n selectionSetMatchesResult,\n TypeOrFieldNameRegExp,\n} from './helpers';\nimport { cacheSlot } from './reactiveVars';\nimport { InMemoryCache } from './inMemoryCache';\nimport {\n SafeReadonly,\n FieldSpecifier,\n ToReferenceFunction,\n ReadFieldFunction,\n ReadFieldOptions,\n CanReadFunction,\n} from '../core/types/common';\nimport { FieldValueGetter } from './entityStore';\n\nexport type TypePolicies = {\n [__typename: string]: TypePolicy;\n}\n\n// TypeScript 3.7 will allow recursive type aliases, so this should work:\n// type KeySpecifier = (string | KeySpecifier)[]\ntype KeySpecifier = (string | any[])[];\n\ntype KeyFieldsContext = {\n typename?: string;\n selectionSet?: SelectionSetNode;\n fragmentMap?: FragmentMap;\n // May be set by the KeyFieldsFunction to report fields that were involved\n // in computing the ID. Never passed in by the caller.\n keyObject?: Record;\n};\n\nexport type KeyFieldsFunction = (\n object: Readonly,\n context: KeyFieldsContext,\n) => KeySpecifier | false | ReturnType;\n\ntype KeyFieldsResult = Exclude, KeySpecifier>;\n\n// TODO Should TypePolicy be a generic type, with a TObject or TEntity\n// type parameter?\nexport type TypePolicy = {\n // Allows defining the primary key fields for this type, either using an\n // array of field names or a function that returns an arbitrary string.\n keyFields?: KeySpecifier | KeyFieldsFunction | false;\n\n // Allows defining a merge function (or merge:true/false shorthand) to\n // be used for merging objects of this type wherever they appear, unless\n // the parent field also defines a merge function/boolean (that is,\n // parent field merge functions take precedence over type policy merge\n // functions). In many cases, defining merge:true for a given type\n // policy can save you from specifying merge:true for all the field\n // policies where that type might be encountered.\n merge?: FieldMergeFunction | boolean;\n\n // In the rare event that your schema happens to use a different\n // __typename for the root Query, Mutation, and/or Schema types, you can\n // express your deviant preferences by enabling one of these options.\n queryType?: true,\n mutationType?: true,\n subscriptionType?: true,\n\n fields?: {\n [fieldName: string]:\n | FieldPolicy\n | FieldReadFunction;\n }\n};\n\nexport type KeyArgsFunction = (\n args: Record | null,\n context: {\n typename: string;\n fieldName: string;\n field: FieldNode | null;\n variables?: Record;\n },\n) => KeySpecifier | false | ReturnType;\n\ntype KeyArgsResult = Exclude, KeySpecifier>;\n\nexport type FieldPolicy<\n // The internal representation used to store the field's data in the\n // cache. Must be JSON-serializable if you plan to serialize the result\n // of cache.extract() using JSON.\n TExisting = any,\n // The type of the incoming parameter passed to the merge function,\n // typically matching the GraphQL response format, but with Reference\n // objects substituted for any identifiable child objects. Often the\n // same as TExisting, but not necessarily.\n TIncoming = TExisting,\n // The type that the read function actually returns, using TExisting\n // data and options.args as input. Usually the same as TIncoming.\n TReadResult = TIncoming,\n> = {\n keyArgs?: KeySpecifier | KeyArgsFunction | false;\n read?: FieldReadFunction;\n merge?: FieldMergeFunction | boolean;\n};\n\nexport type StorageType = Record;\n\nfunction argsFromFieldSpecifier(spec: FieldSpecifier) {\n return spec.args !== void 0 ? spec.args :\n spec.field ? argumentsObjectFromField(spec.field, spec.variables) : null;\n}\n\nexport interface FieldFunctionOptions<\n TArgs = Record,\n TVars = Record,\n> {\n args: TArgs | null;\n\n // The name of the field, equal to options.field.name.value when\n // options.field is available. Useful if you reuse the same function for\n // multiple fields, and you need to know which field you're currently\n // processing. Always a string, even when options.field is null.\n fieldName: string;\n\n // The full field key used internally, including serialized key arguments.\n storeFieldName: string;\n\n // The FieldNode object used to read this field. Useful if you need to\n // know about other attributes of the field, such as its directives. This\n // option will be null when a string was passed to options.readField.\n field: FieldNode | null;\n\n variables?: TVars;\n\n // Utilities for dealing with { __ref } objects.\n isReference: typeof isReference;\n toReference: ToReferenceFunction;\n\n // A handy place to put field-specific data that you want to survive\n // across multiple read function calls. Useful for field-level caching,\n // if your read function does any expensive work.\n storage: StorageType;\n\n cache: InMemoryCache;\n\n // Helper function for reading other fields within the current object.\n // If a foreign object or reference is provided, the field will be read\n // from that object instead of the current object, so this function can\n // be used (together with isReference) to examine the cache outside the\n // current object. If a FieldNode is passed instead of a string, and\n // that FieldNode has arguments, the same options.variables will be used\n // to compute the argument values. Note that this function will invoke\n // custom read functions for other fields, if defined. Always returns\n // immutable data (enforced with Object.freeze in development).\n readField: ReadFieldFunction;\n\n // Returns true for non-normalized StoreObjects and non-dangling\n // References, indicating that readField(name, objOrRef) has a chance of\n // working. Useful for filtering out dangling references from lists.\n canRead: CanReadFunction;\n\n // Instead of just merging objects with { ...existing, ...incoming }, this\n // helper function can be used to merge objects in a way that respects any\n // custom merge functions defined for their fields.\n mergeObjects: MergeObjectsFunction;\n}\n\ntype MergeObjectsFunction = (\n existing: T,\n incoming: T,\n) => T;\n\nexport type FieldReadFunction = (\n // When reading a field, one often needs to know about any existing\n // value stored for that field. If the field is read before any value\n // has been written to the cache, this existing parameter will be\n // undefined, which makes it easy to use a default parameter expression\n // to supply the initial value. This parameter is positional (rather\n // than one of the named options) because that makes it possible for the\n // developer to annotate it with a type, without also having to provide\n // a whole new type for the options object.\n existing: SafeReadonly | undefined,\n options: FieldFunctionOptions,\n) => TReadResult | undefined;\n\nexport type FieldMergeFunction = (\n existing: SafeReadonly | undefined,\n // The incoming parameter needs to be positional as well, for the same\n // reasons discussed in FieldReadFunction above.\n incoming: SafeReadonly,\n options: FieldFunctionOptions,\n) => SafeReadonly;\n\nexport const defaultDataIdFromObject = (\n { __typename, id, _id }: Readonly,\n context?: KeyFieldsContext,\n) => {\n if (typeof __typename === \"string\") {\n if (context) {\n context.keyObject =\n id !== void 0 ? { id } :\n _id !== void 0 ? { _id } :\n void 0;\n }\n // If there is no object.id, fall back to object._id.\n if (id === void 0) id = _id;\n if (id !== void 0) {\n return `${__typename}:${(\n typeof id === \"number\" ||\n typeof id === \"string\"\n ) ? id : JSON.stringify(id)}`;\n }\n }\n};\n\nconst nullKeyFieldsFn: KeyFieldsFunction = () => void 0;\nconst simpleKeyArgsFn: KeyArgsFunction = (_args, context) => context.fieldName;\n\n// These merge functions can be selected by specifying merge:true or\n// merge:false in a field policy.\nconst mergeTrueFn: FieldMergeFunction =\n (existing, incoming, { mergeObjects }) => mergeObjects(existing, incoming);\nconst mergeFalseFn: FieldMergeFunction = (_, incoming) => incoming;\n\nexport type PossibleTypesMap = {\n [supertype: string]: string[];\n};\n\nexport class Policies {\n private typePolicies: {\n [__typename: string]: {\n keyFn?: KeyFieldsFunction;\n merge?: FieldMergeFunction;\n fields: {\n [fieldName: string]: {\n keyFn?: KeyArgsFunction;\n read?: FieldReadFunction;\n merge?: FieldMergeFunction;\n };\n };\n };\n } = Object.create(null);\n\n private toBeAdded: {\n [__typename: string]: TypePolicy[];\n } = Object.create(null);\n\n // Map from subtype names to sets of supertype names. Note that this\n // representation inverts the structure of possibleTypes (whose keys are\n // supertypes and whose values are arrays of subtypes) because it tends\n // to be much more efficient to search upwards than downwards.\n private supertypeMap = new Map>();\n\n // Any fuzzy subtypes specified by possibleTypes will be converted to\n // RegExp objects and recorded here. Every key of this map can also be\n // found in supertypeMap. In many cases this Map will be empty, which\n // means no fuzzy subtype checking will happen in fragmentMatches.\n private fuzzySubtypes = new Map();\n\n public readonly cache: InMemoryCache;\n\n public readonly rootIdsByTypename: Record = Object.create(null);\n public readonly rootTypenamesById: Record = Object.create(null);\n\n public readonly usingPossibleTypes = false;\n\n constructor(private config: {\n cache: InMemoryCache;\n dataIdFromObject?: KeyFieldsFunction;\n possibleTypes?: PossibleTypesMap;\n typePolicies?: TypePolicies;\n }) {\n this.config = {\n dataIdFromObject: defaultDataIdFromObject,\n ...config,\n };\n\n this.cache = this.config.cache;\n\n this.setRootTypename(\"Query\");\n this.setRootTypename(\"Mutation\");\n this.setRootTypename(\"Subscription\");\n\n if (config.possibleTypes) {\n this.addPossibleTypes(config.possibleTypes);\n }\n\n if (config.typePolicies) {\n this.addTypePolicies(config.typePolicies);\n }\n }\n\n public identify(\n object: StoreObject,\n selectionSet?: SelectionSetNode,\n fragmentMap?: FragmentMap,\n ): [string?, StoreObject?] {\n // TODO Use an AliasMap here?\n const typename = selectionSet && fragmentMap\n ? getTypenameFromResult(object, selectionSet, fragmentMap)\n : object.__typename;\n\n // It should be possible to write root Query fields with\n // writeFragment, using { __typename: \"Query\", ... } as the data, but\n // it does not make sense to allow the same identification behavior\n // for the Mutation and Subscription types, since application code\n // should never be writing directly to (or reading directly from)\n // those root objects.\n if (typename === this.rootTypenamesById.ROOT_QUERY) {\n return [\"ROOT_QUERY\"];\n }\n\n const context: KeyFieldsContext = {\n typename,\n selectionSet,\n fragmentMap,\n };\n\n let id: KeyFieldsResult;\n\n const policy = typename && this.getTypePolicy(typename);\n let keyFn = policy && policy.keyFn || this.config.dataIdFromObject;\n while (keyFn) {\n const specifierOrId = keyFn(object, context);\n if (Array.isArray(specifierOrId)) {\n keyFn = keyFieldsFnFromSpecifier(specifierOrId);\n } else {\n id = specifierOrId;\n break;\n }\n }\n\n id = id ? String(id) : void 0;\n return context.keyObject ? [id, context.keyObject] : [id];\n }\n\n public addTypePolicies(typePolicies: TypePolicies) {\n Object.keys(typePolicies).forEach(typename => {\n const {\n queryType,\n mutationType,\n subscriptionType,\n ...incoming\n } = typePolicies[typename];\n\n // Though {query,mutation,subscription}Type configurations are rare,\n // it's important to call setRootTypename as early as possible,\n // since these configurations should apply consistently for the\n // entire lifetime of the cache. Also, since only one __typename can\n // qualify as one of these root types, these three properties cannot\n // be inherited, unlike the rest of the incoming properties. That\n // restriction is convenient, because the purpose of this.toBeAdded\n // is to delay the processing of type/field policies until the first\n // time they're used, allowing policies to be added in any order as\n // long as all relevant policies (including policies for supertypes)\n // have been added by the time a given policy is used for the first\n // time. In other words, since inheritance doesn't matter for these\n // properties, there's also no need to delay their processing using\n // the this.toBeAdded queue.\n if (queryType) this.setRootTypename(\"Query\", typename);\n if (mutationType) this.setRootTypename(\"Mutation\", typename);\n if (subscriptionType) this.setRootTypename(\"Subscription\", typename);\n\n if (hasOwn.call(this.toBeAdded, typename)) {\n this.toBeAdded[typename].push(incoming);\n } else {\n this.toBeAdded[typename] = [incoming];\n }\n });\n }\n\n private updateTypePolicy(typename: string, incoming: TypePolicy) {\n const existing = this.getTypePolicy(typename);\n const { keyFields, fields } = incoming;\n\n function setMerge(\n existing: { merge?: FieldMergeFunction | boolean; },\n merge?: FieldMergeFunction | boolean,\n ) {\n existing.merge =\n typeof merge === \"function\" ? merge :\n // Pass merge:true as a shorthand for a merge implementation\n // that returns options.mergeObjects(existing, incoming).\n merge === true ? mergeTrueFn :\n // Pass merge:false to make incoming always replace existing\n // without any warnings about data clobbering.\n merge === false ? mergeFalseFn :\n existing.merge;\n }\n\n // Type policies can define merge functions, as an alternative to\n // using field policies to merge child objects.\n setMerge(existing, incoming.merge);\n\n existing.keyFn =\n // Pass false to disable normalization for this typename.\n keyFields === false ? nullKeyFieldsFn :\n // Pass an array of strings to use those fields to compute a\n // composite ID for objects of this typename.\n Array.isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) :\n // Pass a function to take full control over identification.\n typeof keyFields === \"function\" ? keyFields :\n // Leave existing.keyFn unchanged if above cases fail.\n existing.keyFn;\n\n if (fields) {\n Object.keys(fields).forEach(fieldName => {\n const existing = this.getFieldPolicy(typename, fieldName, true)!;\n const incoming = fields[fieldName];\n\n if (typeof incoming === \"function\") {\n existing.read = incoming;\n } else {\n const { keyArgs, read, merge } = incoming;\n\n existing.keyFn =\n // Pass false to disable argument-based differentiation of\n // field identities.\n keyArgs === false ? simpleKeyArgsFn :\n // Pass an array of strings to use named arguments to\n // compute a composite identity for the field.\n Array.isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs) :\n // Pass a function to take full control over field identity.\n typeof keyArgs === \"function\" ? keyArgs :\n // Leave existing.keyFn unchanged if above cases fail.\n existing.keyFn;\n\n if (typeof read === \"function\") {\n existing.read = read;\n }\n\n setMerge(existing, merge);\n }\n\n if (existing.read && existing.merge) {\n // If we have both a read and a merge function, assume\n // keyArgs:false, because read and merge together can take\n // responsibility for interpreting arguments in and out. This\n // default assumption can always be overridden by specifying\n // keyArgs explicitly in the FieldPolicy.\n existing.keyFn = existing.keyFn || simpleKeyArgsFn;\n }\n });\n }\n }\n\n private setRootTypename(\n which: \"Query\" | \"Mutation\" | \"Subscription\",\n typename: string = which,\n ) {\n const rootId = \"ROOT_\" + which.toUpperCase();\n const old = this.rootTypenamesById[rootId];\n if (typename !== old) {\n invariant(!old || old === which, `Cannot change root ${which} __typename more than once`);\n // First, delete any old __typename associated with this rootId from\n // rootIdsByTypename.\n if (old) delete this.rootIdsByTypename[old];\n // Now make this the only __typename that maps to this rootId.\n this.rootIdsByTypename[typename] = rootId;\n // Finally, update the __typename associated with this rootId.\n this.rootTypenamesById[rootId] = typename;\n }\n }\n\n public addPossibleTypes(possibleTypes: PossibleTypesMap) {\n (this.usingPossibleTypes as boolean) = true;\n Object.keys(possibleTypes).forEach(supertype => {\n // Make sure all types have an entry in this.supertypeMap, even if\n // their supertype set is empty, so we can return false immediately\n // from policies.fragmentMatches for unknown supertypes.\n this.getSupertypeSet(supertype, true);\n\n possibleTypes[supertype].forEach(subtype => {\n this.getSupertypeSet(subtype, true)!.add(supertype);\n const match = subtype.match(TypeOrFieldNameRegExp);\n if (!match || match[0] !== subtype) {\n // TODO Don't interpret just any invalid typename as a RegExp.\n this.fuzzySubtypes.set(subtype, new RegExp(subtype));\n }\n });\n });\n }\n\n private getTypePolicy(typename: string): Policies[\"typePolicies\"][string] {\n if (!hasOwn.call(this.typePolicies, typename)) {\n const policy: Policies[\"typePolicies\"][string] =\n this.typePolicies[typename] = Object.create(null);\n policy.fields = Object.create(null);\n\n // When the TypePolicy for typename is first accessed, instead of\n // starting with an empty policy object, inherit any properties or\n // fields from the type policies of the supertypes of typename.\n //\n // Any properties or fields defined explicitly within the TypePolicy\n // for typename will take precedence, and if there are multiple\n // supertypes, the properties of policies whose types were added\n // later via addPossibleTypes will take precedence over those of\n // earlier supertypes. TODO Perhaps we should warn about these\n // conflicts in development, and recommend defining the property\n // explicitly in the subtype policy?\n //\n // Field policy inheritance is atomic/shallow: you can't inherit a\n // field policy and then override just its read function, since read\n // and merge functions often need to cooperate, so changing only one\n // of them would be a recipe for inconsistency.\n //\n // Once the TypePolicy for typename has been accessed, its\n // properties can still be updated directly using addTypePolicies,\n // but future changes to supertype policies will not be reflected in\n // this policy, because this code runs at most once per typename.\n const supertypes = this.supertypeMap.get(typename);\n if (supertypes && supertypes.size) {\n supertypes.forEach(supertype => {\n const { fields, ...rest } = this.getTypePolicy(supertype);\n Object.assign(policy, rest);\n Object.assign(policy.fields, fields);\n });\n }\n }\n\n const inbox = this.toBeAdded[typename];\n if (inbox && inbox.length) {\n this.updateTypePolicy(typename, compact(...inbox.splice(0)));\n }\n\n return this.typePolicies[typename];\n }\n\n private getFieldPolicy(\n typename: string | undefined,\n fieldName: string,\n createIfMissing: boolean,\n ): {\n keyFn?: KeyArgsFunction;\n read?: FieldReadFunction;\n merge?: FieldMergeFunction;\n } | undefined {\n if (typename) {\n const fieldPolicies = this.getTypePolicy(typename).fields;\n return fieldPolicies[fieldName] || (\n createIfMissing && (fieldPolicies[fieldName] = Object.create(null)));\n }\n }\n\n private getSupertypeSet(\n subtype: string,\n createIfMissing: boolean,\n ): Set | undefined {\n let supertypeSet = this.supertypeMap.get(subtype);\n if (!supertypeSet && createIfMissing) {\n this.supertypeMap.set(subtype, supertypeSet = new Set());\n }\n return supertypeSet;\n }\n\n public fragmentMatches(\n fragment: InlineFragmentNode | FragmentDefinitionNode,\n typename: string | undefined,\n result?: Record,\n variables?: Record,\n ): boolean {\n if (!fragment.typeCondition) return true;\n\n // If the fragment has a type condition but the object we're matching\n // against does not have a __typename, the fragment cannot match.\n if (!typename) return false;\n\n const supertype = fragment.typeCondition.name.value;\n // Common case: fragment type condition and __typename are the same.\n if (typename === supertype) return true;\n\n if (this.usingPossibleTypes &&\n this.supertypeMap.has(supertype)) {\n const typenameSupertypeSet = this.getSupertypeSet(typename, true)!;\n const workQueue = [typenameSupertypeSet];\n const maybeEnqueue = (subtype: string) => {\n const supertypeSet = this.getSupertypeSet(subtype, false);\n if (supertypeSet &&\n supertypeSet.size &&\n workQueue.indexOf(supertypeSet) < 0) {\n workQueue.push(supertypeSet);\n }\n };\n\n // We need to check fuzzy subtypes only if we encountered fuzzy\n // subtype strings in addPossibleTypes, and only while writing to\n // the cache, since that's when selectionSetMatchesResult gives a\n // strong signal of fragment matching. The StoreReader class calls\n // policies.fragmentMatches without passing a result object, so\n // needToCheckFuzzySubtypes is always false while reading.\n let needToCheckFuzzySubtypes = !!(result && this.fuzzySubtypes.size);\n let checkingFuzzySubtypes = false;\n\n // It's important to keep evaluating workQueue.length each time through\n // the loop, because the queue can grow while we're iterating over it.\n for (let i = 0; i < workQueue.length; ++i) {\n const supertypeSet = workQueue[i];\n\n if (supertypeSet.has(supertype)) {\n if (!typenameSupertypeSet.has(supertype)) {\n if (checkingFuzzySubtypes) {\n invariant.warn(`Inferring subtype ${typename} of supertype ${supertype}`);\n }\n // Record positive results for faster future lookup.\n // Unfortunately, we cannot safely cache negative results,\n // because new possibleTypes data could always be added to the\n // Policies class.\n typenameSupertypeSet.add(supertype);\n }\n return true;\n }\n\n supertypeSet.forEach(maybeEnqueue);\n\n if (needToCheckFuzzySubtypes &&\n // Start checking fuzzy subtypes only after exhausting all\n // non-fuzzy subtypes (after the final iteration of the loop).\n i === workQueue.length - 1 &&\n // We could wait to compare fragment.selectionSet to result\n // after we verify the supertype, but this check is often less\n // expensive than that search, and we will have to do the\n // comparison anyway whenever we find a potential match.\n selectionSetMatchesResult(fragment.selectionSet, result!, variables)) {\n // We don't always need to check fuzzy subtypes (if no result\n // was provided, or !this.fuzzySubtypes.size), but, when we do,\n // we only want to check them once.\n needToCheckFuzzySubtypes = false;\n checkingFuzzySubtypes = true;\n\n // If we find any fuzzy subtypes that match typename, extend the\n // workQueue to search through the supertypes of those fuzzy\n // subtypes. Otherwise the for-loop will terminate and we'll\n // return false below.\n this.fuzzySubtypes.forEach((regExp, fuzzyString) => {\n const match = typename.match(regExp);\n if (match && match[0] === typename) {\n maybeEnqueue(fuzzyString);\n }\n });\n }\n }\n }\n\n return false;\n }\n\n public hasKeyArgs(typename: string | undefined, fieldName: string) {\n const policy = this.getFieldPolicy(typename, fieldName, false);\n return !!(policy && policy.keyFn);\n }\n\n public getStoreFieldName(fieldSpec: FieldSpecifier): string {\n const { typename, fieldName } = fieldSpec;\n const policy = this.getFieldPolicy(typename, fieldName, false);\n let storeFieldName: KeyArgsResult;\n\n let keyFn = policy && policy.keyFn;\n if (keyFn && typename) {\n const context: Parameters[1] = {\n typename,\n fieldName,\n field: fieldSpec.field || null,\n variables: fieldSpec.variables,\n };\n const args = argsFromFieldSpecifier(fieldSpec);\n while (keyFn) {\n const specifierOrString = keyFn(args, context);\n if (Array.isArray(specifierOrString)) {\n keyFn = keyArgsFnFromSpecifier(specifierOrString);\n } else {\n // If the custom keyFn returns a falsy value, fall back to\n // fieldName instead.\n storeFieldName = specifierOrString || fieldName;\n break;\n }\n }\n }\n\n if (storeFieldName === void 0) {\n storeFieldName = fieldSpec.field\n ? storeKeyNameFromField(fieldSpec.field, fieldSpec.variables)\n : getStoreKeyName(fieldName, argsFromFieldSpecifier(fieldSpec));\n }\n\n // Returning false from a keyArgs function is like configuring\n // keyArgs: false, but more dynamic.\n if (storeFieldName === false) {\n return fieldName;\n }\n\n // Make sure custom field names start with the actual field.name.value\n // of the field, so we can always figure out which properties of a\n // StoreObject correspond to which original field names.\n return fieldName === fieldNameFromStoreName(storeFieldName)\n ? storeFieldName\n : fieldName + \":\" + storeFieldName;\n }\n\n public readField(\n options: ReadFieldOptions,\n context: ReadMergeModifyContext,\n ): SafeReadonly | undefined {\n const objectOrReference = options.from;\n if (!objectOrReference) return;\n\n const nameOrField = options.field || options.fieldName;\n if (!nameOrField) return;\n\n if (options.typename === void 0) {\n const typename = context.store.getFieldValue(objectOrReference, \"__typename\");\n if (typename) options.typename = typename;\n }\n\n const storeFieldName = this.getStoreFieldName(options);\n const fieldName = fieldNameFromStoreName(storeFieldName);\n const existing = context.store.getFieldValue(objectOrReference, storeFieldName);\n const policy = this.getFieldPolicy(options.typename, fieldName, false);\n const read = policy && policy.read;\n\n if (read) {\n const readOptions = makeFieldFunctionOptions(\n this,\n objectOrReference,\n options,\n context,\n context.store.getStorage(\n isReference(objectOrReference)\n ? objectOrReference.__ref\n : objectOrReference,\n storeFieldName,\n ),\n );\n\n // Call read(existing, readOptions) with cacheSlot holding this.cache.\n return cacheSlot.withValue(\n this.cache,\n read,\n [existing, readOptions],\n ) as SafeReadonly;\n }\n\n return existing;\n }\n\n public getMergeFunction(\n parentTypename: string | undefined,\n fieldName: string,\n childTypename: string | undefined,\n ): FieldMergeFunction | undefined {\n let policy:\n | Policies[\"typePolicies\"][string]\n | Policies[\"typePolicies\"][string][\"fields\"][string]\n | undefined =\n this.getFieldPolicy(parentTypename, fieldName, false);\n let merge = policy && policy.merge;\n if (!merge && childTypename) {\n policy = this.getTypePolicy(childTypename);\n merge = policy && policy.merge;\n }\n return merge;\n }\n\n public runMergeFunction(\n existing: StoreValue,\n incoming: StoreValue,\n { field, typename, merge }: MergeInfo,\n context: ReadMergeModifyContext,\n storage?: StorageType,\n ) {\n if (merge === mergeTrueFn) {\n // Instead of going to the trouble of creating a full\n // FieldFunctionOptions object and calling mergeTrueFn, we can\n // simply call mergeObjects, as mergeTrueFn would.\n return makeMergeObjectsFunction(\n context.store.getFieldValue\n )(existing as StoreObject,\n incoming as StoreObject);\n }\n\n if (merge === mergeFalseFn) {\n // Likewise for mergeFalseFn, whose implementation is even simpler.\n return incoming;\n }\n\n return merge(existing, incoming, makeFieldFunctionOptions(\n this,\n // Unlike options.readField for read functions, we do not fall\n // back to the current object if no foreignObjOrRef is provided,\n // because it's not clear what the current object should be for\n // merge functions: the (possibly undefined) existing object, or\n // the incoming object? If you think your merge function needs\n // to read sibling fields in order to produce a new value for\n // the current field, you might want to rethink your strategy,\n // because that's a recipe for making merge behavior sensitive\n // to the order in which fields are written into the cache.\n // However, readField(name, ref) is useful for merge functions\n // that need to deduplicate child objects and references.\n void 0,\n { typename,\n fieldName: field.name.value,\n field,\n variables: context.variables },\n context,\n storage || Object.create(null),\n ));\n }\n}\n\nfunction makeFieldFunctionOptions(\n policies: Policies,\n objectOrReference: StoreObject | Reference | undefined,\n fieldSpec: FieldSpecifier,\n context: ReadMergeModifyContext,\n storage: StorageType,\n): FieldFunctionOptions {\n const storeFieldName = policies.getStoreFieldName(fieldSpec);\n const fieldName = fieldNameFromStoreName(storeFieldName);\n const variables = fieldSpec.variables || context.variables;\n const { getFieldValue, toReference, canRead } = context.store;\n\n return {\n args: argsFromFieldSpecifier(fieldSpec),\n field: fieldSpec.field || null,\n fieldName,\n storeFieldName,\n variables,\n isReference,\n toReference,\n storage,\n cache: policies.cache,\n canRead,\n\n readField(\n fieldNameOrOptions: string | ReadFieldOptions,\n from?: StoreObject | Reference,\n ) {\n const options: ReadFieldOptions =\n typeof fieldNameOrOptions === \"string\" ? {\n fieldName: fieldNameOrOptions,\n from,\n } : { ...fieldNameOrOptions };\n\n if (void 0 === options.from) {\n options.from = objectOrReference;\n }\n\n if (void 0 === options.variables) {\n options.variables = variables;\n }\n\n return policies.readField(options, context);\n },\n\n mergeObjects: makeMergeObjectsFunction(getFieldValue),\n };\n}\n\nfunction makeMergeObjectsFunction(\n getFieldValue: FieldValueGetter,\n): MergeObjectsFunction {\n return function mergeObjects(existing, incoming) {\n if (Array.isArray(existing) || Array.isArray(incoming)) {\n throw new InvariantError(\"Cannot automatically merge arrays\");\n }\n\n // These dynamic checks are necessary because the parameters of a\n // custom merge function can easily have the any type, so the type\n // system cannot always enforce the StoreObject | Reference parameter\n // types of options.mergeObjects.\n if (existing && typeof existing === \"object\" &&\n incoming && typeof incoming === \"object\") {\n const eType = getFieldValue(existing, \"__typename\");\n const iType = getFieldValue(incoming, \"__typename\");\n const typesDiffer = eType && iType && eType !== iType;\n\n if (typesDiffer ||\n !storeValueIsStoreObject(existing) ||\n !storeValueIsStoreObject(incoming)) {\n return incoming;\n }\n\n return { ...existing, ...incoming };\n }\n\n return incoming;\n };\n}\n\nfunction keyArgsFnFromSpecifier(\n specifier: KeySpecifier,\n): KeyArgsFunction {\n return (args, context) => {\n return args ? `${context.fieldName}:${\n JSON.stringify(computeKeyObject(args, specifier, false))\n }` : context.fieldName;\n };\n}\n\nfunction keyFieldsFnFromSpecifier(\n specifier: KeySpecifier,\n): KeyFieldsFunction {\n const trie = new KeyTrie<{\n aliasMap?: AliasMap;\n }>(canUseWeakMap);\n\n return (object, context) => {\n let aliasMap: AliasMap | undefined;\n if (context.selectionSet && context.fragmentMap) {\n const info = trie.lookupArray([\n context.selectionSet,\n context.fragmentMap,\n ]);\n aliasMap = info.aliasMap || (\n info.aliasMap = makeAliasMap(context.selectionSet, context.fragmentMap)\n );\n }\n\n const keyObject = context.keyObject =\n computeKeyObject(object, specifier, true, aliasMap);\n\n return `${context.typename}:${JSON.stringify(keyObject)}`;\n };\n}\n\ntype AliasMap = {\n // Map from store key to corresponding response key. Undefined when there are\n // no aliased fields in this selection set.\n aliases?: Record;\n // Map from store key to AliasMap correponding to a child selection set.\n // Undefined when there are no child selection sets.\n subsets?: Record;\n};\n\nfunction makeAliasMap(\n selectionSet: SelectionSetNode,\n fragmentMap: FragmentMap,\n): AliasMap {\n let map: AliasMap = Object.create(null);\n // TODO Cache this work, perhaps by storing selectionSet._aliasMap?\n const workQueue = new Set([selectionSet]);\n workQueue.forEach(selectionSet => {\n selectionSet.selections.forEach(selection => {\n if (isField(selection)) {\n if (selection.alias) {\n const responseKey = selection.alias.value;\n const storeKey = selection.name.value;\n if (storeKey !== responseKey) {\n const aliases = map.aliases || (map.aliases = Object.create(null));\n aliases[storeKey] = responseKey;\n }\n }\n if (selection.selectionSet) {\n const subsets = map.subsets || (map.subsets = Object.create(null));\n subsets[selection.name.value] =\n makeAliasMap(selection.selectionSet, fragmentMap);\n }\n } else {\n const fragment = getFragmentFromSelection(selection, fragmentMap);\n if (fragment) {\n workQueue.add(fragment.selectionSet);\n }\n }\n });\n });\n return map;\n}\n\nfunction computeKeyObject(\n response: Record,\n specifier: KeySpecifier,\n strict: boolean,\n aliasMap?: AliasMap,\n): Record {\n // The order of adding properties to keyObj affects its JSON serialization,\n // so we are careful to build keyObj in the order of keys given in\n // specifier.\n const keyObj = Object.create(null);\n let prevKey: string | undefined;\n specifier.forEach(s => {\n if (Array.isArray(s)) {\n if (typeof prevKey === \"string\") {\n const subsets = aliasMap && aliasMap.subsets;\n const subset = subsets && subsets[prevKey];\n keyObj[prevKey] = computeKeyObject(response[prevKey], s, strict, subset);\n }\n } else {\n const aliases = aliasMap && aliasMap.aliases;\n const responseName = aliases && aliases[s] || s;\n if (hasOwn.call(response, responseName)) {\n keyObj[prevKey = s] = response[responseName];\n } else {\n invariant(!strict, `Missing field '${responseName}' while computing key fields`);\n prevKey = void 0;\n }\n }\n });\n return keyObj;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\nimport { dep, wrap } from 'optimism';\n\nimport { ApolloCache } from '../core/cache';\nimport { Cache } from '../core/types/Cache';\nimport { MissingFieldError } from '../core/types/common';\nimport {\n addTypenameToDocument,\n StoreObject,\n Reference,\n isReference,\n} from '../../utilities';\nimport {\n ApolloReducerConfig,\n NormalizedCacheObject,\n} from './types';\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { EntityStore, supportsResultCaching } from './entityStore';\nimport { makeVar, forgetCache, recallCache } from './reactiveVars';\nimport {\n defaultDataIdFromObject,\n PossibleTypesMap,\n Policies,\n TypePolicies,\n} from './policies';\nimport { hasOwn } from './helpers';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n possibleTypes?: PossibleTypesMap;\n typePolicies?: TypePolicies;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n typePolicies: {},\n};\n\nexport class InMemoryCache extends ApolloCache {\n private data: EntityStore;\n private optimisticData: EntityStore;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n\n // Dynamically imported code can augment existing typePolicies or\n // possibleTypes by calling cache.policies.addTypePolicies or\n // cache.policies.addPossibletypes.\n public readonly policies: Policies;\n\n public readonly makeVar = makeVar;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n this.addTypename = !!this.config.addTypename;\n\n this.policies = new Policies({\n cache: this,\n dataIdFromObject: this.config.dataIdFromObject,\n possibleTypes: this.config.possibleTypes,\n typePolicies: this.config.typePolicies,\n });\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = new EntityStore.Root({\n policies: this.policies,\n resultCaching: this.config.resultCaching,\n });\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeWriter = new StoreWriter(\n this,\n this.storeReader = new StoreReader({\n cache: this,\n addTypename: this.addTypename,\n }),\n );\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).extract();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n const {\n // Since read returns data or null, without any additional metadata\n // about whether/where there might have been missing fields, the\n // default behavior cannot be returnPartialData = true (like it is\n // for the diff method), since defaulting to true would violate the\n // integrity of the T in the return type. However, partial data may\n // be useful in some cases, so returnPartialData:true may be\n // specified explicitly.\n returnPartialData = false,\n } = options;\n try {\n return this.storeReader.diffQueryAgainstStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: options.query,\n variables: options.variables,\n rootId: options.rootId,\n config: this.config,\n returnPartialData,\n }).result || null;\n } catch (e) {\n if (e instanceof MissingFieldError) {\n // Swallow MissingFieldError and return null, so callers do not\n // need to worry about catching \"normal\" exceptions resulting from\n // incomplete cache data. Unexpected errors will be re-thrown. If\n // you need more information about which fields were missing, use\n // cache.diff instead, and examine diffResult.missing.\n return null;\n }\n throw e;\n }\n }\n\n public write(options: Cache.WriteOptions): Reference | undefined {\n try {\n ++this.txCount;\n return this.storeWriter.writeToStore({\n store: this.data,\n query: options.query,\n result: options.result,\n dataId: options.dataId,\n variables: options.variables,\n });\n } finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n }\n\n public modify(options: Cache.ModifyOptions): boolean {\n if (hasOwn.call(options, \"id\") && !options.id) {\n // To my knowledge, TypeScript does not currently provide a way to\n // enforce that an optional property?:type must *not* be undefined\n // when present. That ability would be useful here, because we want\n // options.id to default to ROOT_QUERY only when no options.id was\n // provided. If the caller attempts to pass options.id with a\n // falsy/undefined value (perhaps because cache.identify failed), we\n // should not assume the goal was to modify the ROOT_QUERY object.\n // We could throw, but it seems natural to return false to indicate\n // that nothing was modified.\n return false;\n }\n const store = options.optimistic // Defaults to false.\n ? this.optimisticData\n : this.data;\n try {\n ++this.txCount;\n return store.modify(options.id || \"ROOT_QUERY\", options.fields);\n } finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n }\n\n public diff(options: Cache.DiffOptions): Cache.DiffResult {\n return this.storeReader.diffQueryAgainstStore({\n store: options.optimistic ? this.optimisticData : this.data,\n rootId: options.id || \"ROOT_QUERY\",\n query: options.query,\n variables: options.variables,\n returnPartialData: options.returnPartialData,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n if (!this.watches.size) {\n // In case we previously called forgetCache(this) because\n // this.watches became empty (see below), reattach this cache to any\n // reactive variables on which it previously depended. It might seem\n // paradoxical that we're able to recall something we supposedly\n // forgot, but the point of calling forgetCache(this) is to silence\n // useless broadcasts while this.watches is empty, and to allow the\n // cache to be garbage collected. If, however, we manage to call\n // recallCache(this) here, this cache object must not have been\n // garbage collected yet, and should resume receiving updates from\n // reactive variables, now that it has a watcher to notify.\n recallCache(this);\n }\n this.watches.add(watch);\n if (watch.immediate) {\n this.maybeBroadcastWatch(watch);\n }\n return () => {\n // Once we remove the last watch from this.watches, cache.broadcastWatches\n // no longer does anything, so we preemptively tell the reactive variable\n // system to exclude this cache from future broadcasts.\n if (this.watches.delete(watch) && !this.watches.size) {\n forgetCache(this);\n }\n this.watchDep.dirty(watch);\n // Remove this watch from the LRU cache managed by the\n // maybeBroadcastWatch OptimisticWrapperFunction, to prevent memory\n // leaks involving the closure of watch.callback.\n this.maybeBroadcastWatch.forget(watch);\n };\n }\n\n // Request garbage collection of unreachable normalized entities.\n public gc() {\n return this.optimisticData.gc();\n }\n\n // Call this method to ensure the given root ID remains in the cache after\n // garbage collection, along with its transitive child entities. Note that\n // the cache automatically retains all directly written entities. By default,\n // the retainment persists after optimistic updates are removed. Pass true\n // for the optimistic argument if you would prefer for the retainment to be\n // discarded when the top-most optimistic layer is removed. Returns the\n // resulting (non-negative) retainment count.\n public retain(rootId: string, optimistic?: boolean): number {\n return (optimistic ? this.optimisticData : this.data).retain(rootId);\n }\n\n // Call this method to undo the effect of the retain method, above. Once the\n // retainment count falls to zero, the given ID will no longer be preserved\n // during garbage collection, though it may still be preserved by other safe\n // entities that refer to it. Returns the resulting (non-negative) retainment\n // count, in case that's useful.\n public release(rootId: string, optimistic?: boolean): number {\n return (optimistic ? this.optimisticData : this.data).release(rootId);\n }\n\n // Returns the canonical ID for a given StoreObject, obeying typePolicies\n // and keyFields (and dataIdFromObject, if you still use that). At minimum,\n // the object must contain a __typename and any primary key fields required\n // to identify entities of that type. If you pass a query result object, be\n // sure that none of the primary key fields have been renamed by aliasing.\n // If you pass a Reference object, its __ref ID string will be returned.\n public identify(object: StoreObject | Reference): string | undefined {\n return isReference(object) ? object.__ref :\n this.policies.identify(object)[0];\n }\n\n public evict(options: Cache.EvictOptions): boolean {\n if (!options.id) {\n if (hasOwn.call(options, \"id\")) {\n // See comment in modify method about why we return false when\n // options.id exists but is falsy/undefined.\n return false;\n }\n options = { ...options, id: \"ROOT_QUERY\" };\n }\n try {\n // It's unlikely that the eviction will end up invoking any other\n // cache update operations while it's running, but {in,de}crementing\n // this.txCount still seems like a good idea, for uniformity with\n // the other update methods.\n ++this.txCount;\n return this.optimisticData.evict(options);\n } finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n }\n\n public reset(): Promise {\n this.data.clear();\n this.optimisticData = this.data;\n this.broadcastWatches();\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const newOptimisticData = this.optimisticData.removeLayer(idToRemove);\n if (newOptimisticData !== this.optimisticData) {\n this.optimisticData = newOptimisticData;\n this.broadcastWatches();\n }\n }\n\n private txCount = 0;\n\n public performTransaction(\n transaction: (cache: InMemoryCache) => any,\n optimisticId?: string | null,\n ) {\n const perform = (layer?: EntityStore) => {\n const { data, optimisticData } = this;\n ++this.txCount;\n if (layer) {\n this.data = this.optimisticData = layer;\n }\n try {\n transaction(this);\n } finally {\n --this.txCount;\n this.data = data;\n this.optimisticData = optimisticData;\n }\n };\n\n let fromOptimisticTransaction = false;\n\n if (typeof optimisticId === 'string') {\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n this.optimisticData = this.optimisticData.addLayer(optimisticId, perform);\n fromOptimisticTransaction = true;\n } else if (optimisticId === null) {\n // Ensure both this.data and this.optimisticData refer to the root\n // (non-optimistic) layer of the cache during the transaction. Note\n // that this.data could be a Layer if we are currently executing an\n // optimistic transaction function, but otherwise will always be an\n // EntityStore.Root instance.\n perform(this.data);\n } else {\n // Otherwise, leave this.data and this.optimisticData unchanged and\n // run the transaction with broadcast batching.\n perform();\n }\n\n // This broadcast does nothing if this.txCount > 0.\n this.broadcastWatches(fromOptimisticTransaction);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches(fromOptimisticTransaction?: boolean) {\n if (!this.txCount) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c, fromOptimisticTransaction));\n }\n }\n\n private maybeBroadcastWatch = wrap((\n c: Cache.WatchOptions,\n fromOptimisticTransaction?: boolean,\n ) => {\n return this.broadcastWatch.call(this, c, !!fromOptimisticTransaction);\n }, {\n makeCacheKey: (c: Cache.WatchOptions) => {\n // Return a cache key (thus enabling result caching) only if we're\n // currently using a data store that can track cache dependencies.\n const store = c.optimistic ? this.optimisticData : this.data;\n if (supportsResultCaching(store)) {\n const { optimistic, rootId, variables } = c;\n return store.makeCacheKey(\n c.query,\n // Different watches can have the same query, optimistic\n // status, rootId, and variables, but if their callbacks are\n // different, the (identical) result needs to be delivered to\n // each distinct callback. The easiest way to achieve that\n // separation is to include c.callback in the cache key for\n // maybeBroadcastWatch calls. See issue #5733.\n c.callback,\n JSON.stringify({ optimistic, rootId, variables }),\n );\n }\n }\n });\n\n private watchDep = dep();\n\n // This method is wrapped by maybeBroadcastWatch, which is called by\n // broadcastWatches, so that we compute and broadcast results only when\n // the data that would be broadcast might have changed. It would be\n // simpler to check for changes after recomputing a result but before\n // broadcasting it, but this wrapping approach allows us to skip both\n // the recomputation and the broadcast, in most cases.\n private broadcastWatch(\n c: Cache.WatchOptions,\n fromOptimisticTransaction: boolean,\n ) {\n // First, invalidate any other maybeBroadcastWatch wrapper functions\n // currently depending on this Cache.WatchOptions object (including\n // the one currently calling broadcastWatch), so they will be included\n // in the next broadcast, even if the result they receive is the same\n // as the previous result they received. This is important because we\n // are about to deliver a different result to c.callback, so any\n // previous results should have a chance to be redelivered.\n this.watchDep.dirty(c);\n\n // Next, re-depend on this.watchDep for just this invocation of\n // maybeBroadcastWatch (this is a no-op if broadcastWatch was not\n // called by maybeBroadcastWatch). This allows only the most recent\n // maybeBroadcastWatch invocation for this watcher to remain cached,\n // enabling re-broadcast of previous results even if they have not\n // changed since they were previously delivered.\n this.watchDep(c);\n\n const diff = this.diff({\n query: c.query,\n variables: c.variables,\n optimistic: c.optimistic,\n });\n\n if (c.optimistic && fromOptimisticTransaction) {\n diff.fromOptimisticTransaction = true;\n }\n\n c.callback(diff);\n }\n}\n","export { Transaction, ApolloCache } from './core/cache';\nexport { Cache } from './core/types/Cache';\nexport { DataProxy } from './core/types/DataProxy';\nexport { MissingFieldError } from './core/types/common';\n\nexport {\n Reference,\n isReference,\n makeReference,\n} from '../utilities';\n\nexport {\n InMemoryCache,\n InMemoryCacheConfig,\n} from './inmemory/inMemoryCache';\n\nexport {\n ReactiveVar,\n makeVar,\n cacheSlot,\n} from './inmemory/reactiveVars';\n\nexport {\n defaultDataIdFromObject,\n TypePolicies,\n TypePolicy,\n FieldPolicy,\n FieldReadFunction,\n FieldMergeFunction,\n FieldFunctionOptions,\n PossibleTypesMap,\n} from './inmemory/policies';\n\nexport * from './inmemory/types';\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n SelectionNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n FieldNode,\n ASTNode,\n visit,\n BREAK,\n} from 'graphql';\nimport { invariant } from 'ts-invariant';\n\nimport { ApolloCache } from '../cache';\nimport {\n FragmentMap,\n StoreObject,\n argumentsObjectFromField,\n buildQueryFromSelectionSet,\n createFragmentMap,\n getFragmentDefinitions,\n getMainDefinition,\n hasDirectives,\n isField,\n isInlineFragment,\n mergeDeep,\n mergeDeepArray,\n removeClientSetsFromDocument,\n resultKeyNameFromField,\n shouldInclude,\n} from '../utilities';\nimport { ApolloClient } from './ApolloClient';\nimport { Resolvers, OperationVariables } from './types';\nimport { FetchResult } from '../link/core';\nimport { cacheSlot } from '../cache';\n\nexport type Resolver = (\n rootValue?: any,\n args?: any,\n context?: any,\n info?: {\n field: FieldNode;\n fragmentMap: FragmentMap;\n },\n) => any;\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: any,\n) => boolean;\n\nexport type ExecContext = {\n fragmentMap: FragmentMap;\n context: any;\n variables: VariableMap;\n fragmentMatcher: FragmentMatcher;\n defaultOperationType: string;\n exportedVariables: Record;\n onlyRunForcedResolvers: boolean;\n};\n\nexport type LocalStateOptions = {\n cache: ApolloCache;\n client?: ApolloClient;\n resolvers?: Resolvers | Resolvers[];\n fragmentMatcher?: FragmentMatcher;\n};\n\nexport class LocalState {\n private cache: ApolloCache;\n private client: ApolloClient;\n private resolvers?: Resolvers;\n private fragmentMatcher: FragmentMatcher;\n\n constructor({\n cache,\n client,\n resolvers,\n fragmentMatcher,\n }: LocalStateOptions) {\n this.cache = cache;\n\n if (client) {\n this.client = client;\n }\n\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(resolverGroup => {\n this.resolvers = mergeDeep(this.resolvers, resolverGroup);\n });\n } else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n }\n\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n }\n\n public getResolvers() {\n return this.resolvers || {};\n }\n\n // Run local client resolvers against the incoming query and remote data.\n // Locally resolved field values are merged with the incoming remote data,\n // and returned. Note that locally resolved fields will overwrite\n // remote data using the same field name.\n public async runResolvers({\n document,\n remoteResult,\n context,\n variables,\n onlyRunForcedResolvers = false,\n }: {\n document: DocumentNode | null;\n remoteResult: FetchResult;\n context?: Record;\n variables?: Record;\n onlyRunForcedResolvers?: boolean;\n }): Promise> {\n if (document) {\n return this.resolveDocument(\n document,\n remoteResult.data,\n context,\n variables,\n this.fragmentMatcher,\n onlyRunForcedResolvers,\n ).then(localResult => ({\n ...remoteResult,\n data: localResult.result,\n }));\n }\n\n return remoteResult;\n }\n\n public setFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n }\n\n public getFragmentMatcher(): FragmentMatcher {\n return this.fragmentMatcher;\n }\n\n // Client queries contain everything in the incoming document (if a @client\n // directive is found).\n public clientQuery(document: DocumentNode) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n }\n return null;\n }\n\n // Server queries are stripped of all @client based selection sets.\n public serverQuery(document: DocumentNode) {\n return removeClientSetsFromDocument(document);\n }\n\n public prepareContext(context?: Record) {\n const { cache } = this;\n return {\n ...context,\n cache,\n // Getting an entry's cache key is useful for local state resolvers.\n getCacheKey(obj: StoreObject) {\n return cache.identify(obj);\n },\n };\n }\n\n // To support `@client @export(as: \"someVar\")` syntax, we'll first resolve\n // @client @export fields locally, then pass the resolved values back to be\n // used alongside the original operation variables.\n public async addExportedVariables(\n document: DocumentNode,\n variables: OperationVariables = {},\n context = {},\n ) {\n if (document) {\n return this.resolveDocument(\n document,\n this.buildRootValueFromCache(document, variables) || {},\n this.prepareContext(context),\n variables,\n ).then(data => ({\n ...variables,\n ...data.exportedVariables,\n }));\n }\n\n return {\n ...variables,\n };\n }\n\n public shouldForceResolvers(document: ASTNode) {\n let forceResolvers = false;\n visit(document, {\n Directive: {\n enter(node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(\n arg =>\n arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true,\n );\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n }\n\n // Query the cache and return matching data.\n private buildRootValueFromCache(\n document: DocumentNode,\n variables?: Record,\n ) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n }\n\n private async resolveDocument(\n document: DocumentNode,\n rootValue: TData,\n context: any = {},\n variables: VariableMap = {},\n fragmentMatcher: FragmentMatcher = () => true,\n onlyRunForcedResolvers: boolean = false,\n ) {\n const mainDefinition = getMainDefinition(document);\n const fragments = getFragmentDefinitions(document);\n const fragmentMap = createFragmentMap(fragments);\n\n const definitionOperation = (mainDefinition as OperationDefinitionNode)\n .operation;\n\n const defaultOperationType = definitionOperation\n ? definitionOperation.charAt(0).toUpperCase() +\n definitionOperation.slice(1)\n : 'Query';\n\n const { cache, client } = this;\n const execContext: ExecContext = {\n fragmentMap,\n context: {\n ...context,\n cache,\n client,\n },\n variables,\n fragmentMatcher,\n defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers,\n };\n\n return this.resolveSelectionSet(\n mainDefinition.selectionSet,\n rootValue,\n execContext,\n ).then(result => ({\n result,\n exportedVariables: execContext.exportedVariables,\n }));\n }\n\n private async resolveSelectionSet(\n selectionSet: SelectionSetNode,\n rootValue: TData,\n execContext: ExecContext,\n ) {\n const { fragmentMap, context, variables } = execContext;\n const resultsToMerge: TData[] = [rootValue];\n\n const execute = async (selection: SelectionNode): Promise => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely.\n return;\n }\n\n if (isField(selection)) {\n return this.resolveField(selection, rootValue, execContext).then(\n fieldResult => {\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n } as TData);\n }\n },\n );\n }\n\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment.\n fragment = fragmentMap[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}`);\n }\n\n if (fragment && fragment.typeCondition) {\n const typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return this.resolveSelectionSet(\n fragment.selectionSet,\n rootValue,\n execContext,\n ).then(fragmentResult => {\n resultsToMerge.push(fragmentResult);\n });\n }\n }\n };\n\n return Promise.all(selectionSet.selections.map(execute)).then(function() {\n return mergeDeepArray(resultsToMerge);\n });\n }\n\n private async resolveField(\n field: FieldNode,\n rootValue: any,\n execContext: ExecContext,\n ): Promise {\n const { variables } = execContext;\n const fieldName = field.name.value;\n const aliasedFieldName = resultKeyNameFromField(field);\n const aliasUsed = fieldName !== aliasedFieldName;\n const defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n let resultPromise = Promise.resolve(defaultResult);\n\n // Usually all local resolvers are run when passing through here, but\n // if we've specifically identified that we only want to run forced\n // resolvers (that is, resolvers for fields marked with\n // `@client(always: true)`), then we'll skip running non-forced resolvers.\n if (\n !execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)\n ) {\n const resolverType =\n rootValue.__typename || execContext.defaultOperationType;\n const resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n const resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(\n // In case the resolve function accesses reactive variables,\n // set cacheSlot to the current cache instance.\n cacheSlot.withValue(this.cache, resolve, [\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field, fragmentMap: execContext.fragmentMap },\n ])\n );\n }\n }\n }\n\n return resultPromise.then((result = defaultResult) => {\n // If an @export directive is associated with the current field, store\n // the `as` export variable name and current result for later use.\n if (field.directives) {\n field.directives.forEach(directive => {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(arg => {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n\n // Handle all scalar types here.\n if (!field.selectionSet) {\n return result;\n }\n\n // From here down, the field has a selection set, which means it's trying\n // to query a GraphQLObjectType.\n if (result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return result;\n }\n\n if (Array.isArray(result)) {\n return this.resolveSubSelectedArray(field, result, execContext);\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n if (field.selectionSet) {\n return this.resolveSelectionSet(\n field.selectionSet,\n result,\n execContext,\n );\n }\n });\n }\n\n private resolveSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): any {\n return Promise.all(\n result.map(item => {\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse.\n if (Array.isArray(item)) {\n return this.resolveSubSelectedArray(field, item, execContext);\n }\n\n // This is an object, run the selection set on it.\n if (field.selectionSet) {\n return this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }),\n );\n }\n}\n","import { DocumentNode, GraphQLError } from 'graphql';\nimport { equal } from \"@wry/equality\";\n\nimport { Cache, ApolloCache } from '../cache';\nimport { WatchQueryOptions, ErrorPolicy } from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { QueryListener } from './types';\nimport { FetchResult } from '../link/core';\nimport {\n ObservableSubscription,\n isNonEmptyArray,\n graphQLResultHasError,\n canUseWeakMap,\n} from '../utilities';\nimport {\n NetworkStatus,\n isNetworkRequestInFlight,\n} from './networkStatus';\nimport { ApolloError } from '../errors';\n\nexport type QueryStoreValue = Pick;\n\nconst destructiveMethodCounts = new (\n canUseWeakMap ? WeakMap : Map\n), number>();\n\nfunction wrapDestructiveCacheMethod(\n cache: ApolloCache,\n methodName: keyof ApolloCache,\n) {\n const original = cache[methodName];\n if (typeof original === \"function\") {\n cache[methodName] = function () {\n destructiveMethodCounts.set(\n cache,\n // The %1e15 allows the count to wrap around to 0 safely every\n // quadrillion evictions, so there's no risk of overflow. To be\n // clear, this is more of a pedantic principle than something\n // that matters in any conceivable practical scenario.\n (destructiveMethodCounts.get(cache)! + 1) % 1e15,\n );\n return original.apply(this, arguments);\n };\n }\n}\n\nfunction cancelNotifyTimeout(info: QueryInfo) {\n if (info[\"notifyTimeout\"]) {\n clearTimeout(info[\"notifyTimeout\"]);\n info[\"notifyTimeout\"] = void 0;\n }\n}\n\n// A QueryInfo object represents a single query managed by the\n// QueryManager, which tracks all QueryInfo objects by queryId in its\n// this.queries Map. QueryInfo objects store the latest results and errors\n// for the given query, and are responsible for reporting those results to\n// the corresponding ObservableQuery, via the QueryInfo.notify method.\n// Results are reported asynchronously whenever setDiff marks the\n// QueryInfo object as dirty, though a call to the QueryManager's\n// broadcastQueries method may trigger the notification before it happens\n// automatically. This class used to be a simple interface type without\n// any field privacy or meaningful methods, which is why it still has so\n// many public fields. The effort to lock down and simplify the QueryInfo\n// interface is ongoing, and further improvements are welcome.\nexport class QueryInfo {\n listeners = new Set();\n document: DocumentNode | null = null;\n lastRequestId = 1;\n subscriptions = new Set();\n variables?: Record;\n networkStatus?: NetworkStatus;\n networkError?: Error | null;\n graphQLErrors?: ReadonlyArray;\n stopped = false;\n\n constructor(private cache: ApolloCache) {\n // Track how often cache.evict is called, since we want eviction to\n // override the feud-stopping logic in the markResult method, by\n // causing shouldWrite to return true. Wrapping the cache.evict method\n // is a bit of a hack, but it saves us from having to make eviction\n // counting an official part of the ApolloCache API.\n if (!destructiveMethodCounts.has(cache)) {\n destructiveMethodCounts.set(cache, 0);\n wrapDestructiveCacheMethod(cache, \"evict\");\n wrapDestructiveCacheMethod(cache, \"modify\");\n wrapDestructiveCacheMethod(cache, \"reset\");\n }\n }\n\n public init(query: {\n document: DocumentNode;\n variables: Record | undefined,\n // The initial networkStatus for this fetch, most often\n // NetworkStatus.loading, but also possibly fetchMore, poll, refetch,\n // or setVariables.\n networkStatus?: NetworkStatus,\n observableQuery?: ObservableQuery;\n lastRequestId?: number;\n }): this {\n let networkStatus = query.networkStatus || NetworkStatus.loading;\n if (this.variables &&\n this.networkStatus !== NetworkStatus.loading &&\n !equal(this.variables, query.variables)) {\n networkStatus = NetworkStatus.setVariables;\n }\n\n if (!equal(query.variables, this.variables)) {\n this.diff = null;\n }\n\n Object.assign(this, {\n document: query.document,\n variables: query.variables,\n networkError: null,\n graphQLErrors: this.graphQLErrors || [],\n networkStatus,\n });\n\n if (query.observableQuery) {\n this.setObservableQuery(query.observableQuery);\n }\n\n if (query.lastRequestId) {\n this.lastRequestId = query.lastRequestId;\n }\n\n return this;\n }\n\n private dirty: boolean = false;\n\n private notifyTimeout?: ReturnType;\n\n private diff: Cache.DiffResult | null = null;\n\n reset() {\n cancelNotifyTimeout(this);\n this.diff = null;\n this.dirty = false;\n }\n\n getDiff(variables = this.variables): Cache.DiffResult {\n if (this.diff && equal(variables, this.variables)) {\n return this.diff;\n }\n\n this.updateWatch(this.variables = variables);\n\n return this.diff = this.cache.diff({\n query: this.document!,\n variables,\n returnPartialData: true,\n optimistic: true,\n });\n }\n\n setDiff(diff: Cache.DiffResult | null) {\n const oldDiff = this.diff;\n this.diff = diff;\n if (!this.dirty &&\n (diff && diff.result) !== (oldDiff && oldDiff.result)) {\n this.dirty = true;\n if (!this.notifyTimeout) {\n this.notifyTimeout = setTimeout(() => this.notify(), 0);\n }\n }\n }\n\n public readonly observableQuery: ObservableQuery | null = null;\n private oqListener?: QueryListener;\n\n setObservableQuery(oq: ObservableQuery | null) {\n if (oq === this.observableQuery) return;\n\n if (this.oqListener) {\n this.listeners.delete(this.oqListener);\n }\n\n (this as any).observableQuery = oq;\n\n if (oq) {\n oq[\"queryInfo\"] = this;\n this.listeners.add(this.oqListener = () => {\n // If this.diff came from an optimistic transaction, deliver the\n // current cache data to the ObservableQuery, but don't perform a\n // full reobservation, since oq.reobserve might make a network\n // request, and we don't want to trigger network requests for\n // optimistic updates.\n if (this.getDiff().fromOptimisticTransaction) {\n oq[\"observe\"]();\n } else {\n oq.reobserve();\n }\n });\n } else {\n delete this.oqListener;\n }\n }\n\n notify() {\n cancelNotifyTimeout(this);\n\n if (this.shouldNotify()) {\n this.listeners.forEach(listener => listener(this));\n }\n\n this.dirty = false;\n }\n\n private shouldNotify() {\n if (!this.dirty || !this.listeners.size) {\n return false;\n }\n\n if (isNetworkRequestInFlight(this.networkStatus) &&\n this.observableQuery) {\n const { fetchPolicy } = this.observableQuery.options;\n if (fetchPolicy !== \"cache-only\" &&\n fetchPolicy !== \"cache-and-network\") {\n return false;\n }\n }\n\n return true;\n }\n\n public stop() {\n if (!this.stopped) {\n this.stopped = true;\n\n // Cancel the pending notify timeout\n this.reset();\n \n this.cancel();\n // Revert back to the no-op version of cancel inherited from\n // QueryInfo.prototype.\n delete this.cancel;\n\n this.subscriptions.forEach(sub => sub.unsubscribe());\n\n const oq = this.observableQuery;\n if (oq) oq.stopPolling();\n }\n }\n\n // This method is a no-op by default, until/unless overridden by the\n // updateWatch method.\n private cancel() {}\n\n private lastWatch?: Cache.WatchOptions;\n\n private updateWatch(variables = this.variables) {\n const oq = this.observableQuery;\n if (oq && oq.options.fetchPolicy === \"no-cache\") {\n return;\n }\n if (!this.lastWatch ||\n this.lastWatch.query !== this.document ||\n !equal(variables, this.lastWatch.variables)) {\n this.cancel();\n this.cancel = this.cache.watch(this.lastWatch = {\n query: this.document!,\n variables,\n optimistic: true,\n callback: diff => this.setDiff(diff),\n });\n }\n }\n\n private lastWrite?: {\n result: FetchResult;\n variables: WatchQueryOptions[\"variables\"];\n dmCount: number | undefined;\n };\n\n private shouldWrite(\n result: FetchResult,\n variables: WatchQueryOptions[\"variables\"],\n ) {\n const { lastWrite } = this;\n return !(\n lastWrite &&\n // If cache.evict has been called since the last time we wrote this\n // data into the cache, there's a chance writing this result into\n // the cache will repair what was evicted.\n lastWrite.dmCount === destructiveMethodCounts.get(this.cache) &&\n equal(variables, lastWrite.variables) &&\n equal(result.data, lastWrite.result.data)\n );\n }\n\n public markResult(\n result: FetchResult,\n options: Pick,\n allowCacheWrite: boolean,\n ) {\n this.graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n\n // Cancel the pending notify timeout (if it exists) to prevent extraneous network\n // requests. To allow future notify timeouts, diff and dirty are reset as well.\n this.reset();\n\n if (options.fetchPolicy === 'no-cache') {\n this.diff = { result: result.data, complete: true };\n\n } else if (!this.stopped && allowCacheWrite) {\n if (shouldWriteResult(result, options.errorPolicy)) {\n // Using a transaction here so we have a chance to read the result\n // back from the cache before the watch callback fires as a result\n // of writeQuery, so we can store the new diff quietly and ignore\n // it when we receive it redundantly from the watch callback.\n this.cache.performTransaction(cache => {\n if (this.shouldWrite(result, options.variables)) {\n cache.writeQuery({\n query: this.document!,\n data: result.data as T,\n variables: options.variables,\n });\n\n this.lastWrite = {\n result,\n variables: options.variables,\n dmCount: destructiveMethodCounts.get(this.cache),\n };\n } else {\n // If result is the same as the last result we received from\n // the network (and the variables match too), avoid writing\n // result into the cache again. The wisdom of skipping this\n // cache write is far from obvious, since any cache write\n // could be the one that puts the cache back into a desired\n // state, fixing corruption or missing data. However, if we\n // always write every network result into the cache, we enable\n // feuds between queries competing to update the same data in\n // incompatible ways, which can lead to an endless cycle of\n // cache broadcasts and useless network requests. As with any\n // feud, eventually one side must step back from the brink,\n // letting the other side(s) have the last word(s). There may\n // be other points where we could break this cycle, such as\n // silencing the broadcast for cache.writeQuery (not a good\n // idea, since it just delays the feud a bit) or somehow\n // avoiding the network request that just happened (also bad,\n // because the server could return useful new data). All\n // options considered, skipping this cache write seems to be\n // the least damaging place to break the cycle, because it\n // reflects the intuition that we recently wrote this exact\n // result into the cache, so the cache *should* already/still\n // contain this data. If some other query has clobbered that\n // data in the meantime, that's too bad, but there will be no\n // winners if every query blindly reverts to its own version\n // of the data. This approach also gives the network a chance\n // to return new data, which will be written into the cache as\n // usual, notifying only those queries that are directly\n // affected by the cache updates, as usual. In the future, an\n // even more sophisticated cache could perhaps prevent or\n // mitigate the clobbering somehow, but that would make this\n // particular cache write even less important, and thus\n // skipping it would be even safer than it is today.\n if (this.diff && this.diff.complete) {\n // Reuse data from the last good (complete) diff that we\n // received, when possible.\n result.data = this.diff.result;\n return;\n }\n // If the previous this.diff was incomplete, fall through to\n // re-reading the latest data with cache.diff, below.\n }\n\n const diff = cache.diff({\n query: this.document!,\n variables: options.variables,\n returnPartialData: true,\n optimistic: true,\n });\n\n // In case the QueryManager stops this QueryInfo before its\n // results are delivered, it's important to avoid restarting the\n // cache watch when markResult is called.\n if (!this.stopped) {\n // Any time we're about to update this.diff, we need to make\n // sure we've started watching the cache.\n this.updateWatch(options.variables);\n }\n\n // If we're allowed to write to the cache, and we can read a\n // complete result from the cache, update result.data to be the\n // result from the cache, rather than the raw network result.\n // Set without setDiff to avoid triggering a notify call, since\n // we have other ways of notifying for this result.\n this.diff = diff;\n if (diff.complete) {\n result.data = diff.result;\n }\n });\n\n } else {\n this.lastWrite = void 0;\n }\n }\n }\n\n public markReady() {\n this.networkError = null;\n return this.networkStatus = NetworkStatus.ready;\n }\n\n public markError(error: ApolloError) {\n this.networkStatus = NetworkStatus.error;\n this.lastWrite = void 0;\n\n this.reset();\n\n if (error.graphQLErrors) {\n this.graphQLErrors = error.graphQLErrors;\n }\n\n if (error.networkError) {\n this.networkError = error.networkError;\n }\n\n return error;\n }\n}\n\nexport function shouldWriteResult(\n result: FetchResult,\n errorPolicy: ErrorPolicy = \"none\",\n) {\n const ignoreErrors =\n errorPolicy === \"ignore\" ||\n errorPolicy === \"all\";\n let writeWithErrors = !graphQLResultHasError(result);\n if (!writeWithErrors && ignoreErrors && result.data) {\n writeWithErrors = true;\n }\n return writeWithErrors;\n}\n","import { DocumentNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { equal } from '@wry/equality';\n\nimport { ApolloLink, execute, FetchResult } from '../link/core';\nimport { Cache, ApolloCache } from '../cache';\n\nimport {\n getDefaultValues,\n getOperationDefinition,\n getOperationName,\n hasClientExports,\n graphQLResultHasError,\n removeConnectionDirectiveFromDocument,\n canUseWeakMap,\n ObservableSubscription,\n Observable,\n asyncMap,\n isNonEmptyArray,\n Concast,\n ConcastSourcesIterable,\n} from '../utilities';\nimport { ApolloError, isApolloError } from '../errors';\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n WatchQueryFetchPolicy,\n ErrorPolicy,\n} from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n ApolloQueryResult,\n OperationVariables,\n} from './types';\nimport { LocalState } from './LocalState';\n\nimport { QueryInfo, QueryStoreValue, shouldWriteResult } from './QueryInfo';\n\nconst { hasOwnProperty } = Object.prototype;\n\ninterface MutationStoreValue {\n mutation: DocumentNode;\n variables: Record;\n loading: boolean;\n error: Error | null;\n}\n\nexport class QueryManager {\n public cache: ApolloCache;\n public link: ApolloLink;\n public readonly assumeImmutableResults: boolean;\n public readonly ssrMode: boolean;\n\n private queryDeduplication: boolean;\n private clientAwareness: Record = {};\n private localState: LocalState;\n\n private onBroadcast?: () => void;\n public mutationStore?: {\n [mutationId: string]: MutationStoreValue;\n };\n\n // All the queries that the QueryManager is currently managing (not\n // including mutations and subscriptions).\n private queries = new Map();\n\n // Maps from queryId strings to Promise rejection functions for\n // currently active queries and fetches.\n private fetchCancelFns = new Map any>();\n\n constructor({\n cache,\n link,\n queryDeduplication = false,\n onBroadcast,\n ssrMode = false,\n clientAwareness = {},\n localState,\n assumeImmutableResults,\n }: {\n cache: ApolloCache;\n link: ApolloLink;\n queryDeduplication?: boolean;\n onBroadcast?: () => void;\n ssrMode?: boolean;\n clientAwareness?: Record;\n localState?: LocalState;\n assumeImmutableResults?: boolean;\n }) {\n this.cache = cache;\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n if ((this.onBroadcast = onBroadcast)) {\n this.mutationStore = Object.create(null);\n }\n }\n\n /**\n * Call this method to terminate any active query processes, making it safe\n * to dispose of this QueryManager instance.\n */\n public stop() {\n this.queries.forEach((_info, queryId) => {\n this.stopQueryNoBroadcast(queryId);\n });\n\n this.cancelPendingFetches(\n new InvariantError('QueryManager stopped while query was in flight'),\n );\n }\n\n private cancelPendingFetches(error: Error) {\n this.fetchCancelFns.forEach(cancel => cancel(error));\n this.fetchCancelFns.clear();\n }\n\n public async mutate({\n mutation,\n variables,\n optimisticResponse,\n updateQueries,\n refetchQueries = [],\n awaitRefetchQueries = false,\n update: updateWithProxyFn,\n errorPolicy = 'none',\n fetchPolicy,\n context = {},\n }: MutationOptions): Promise> {\n invariant(\n mutation,\n 'mutation option is required. You must specify your GraphQL document in the mutation option.',\n );\n\n invariant(\n !fetchPolicy || fetchPolicy === 'no-cache',\n \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\"\n );\n\n const mutationId = this.generateMutationId();\n mutation = this.transform(mutation).document;\n\n variables = this.getVariables(mutation, variables);\n\n if (this.transform(mutation).hasClientExports) {\n variables = await this.localState.addExportedVariables(mutation, variables, context);\n }\n\n const mutationStoreValue =\n this.mutationStore &&\n (this.mutationStore[mutationId] = {\n mutation,\n variables,\n loading: true,\n error: null,\n } as MutationStoreValue);\n\n if (optimisticResponse) {\n this.markMutationOptimistic(optimisticResponse, {\n mutationId,\n document: mutation,\n variables,\n errorPolicy,\n updateQueries,\n update: updateWithProxyFn,\n });\n }\n\n this.broadcastQueries();\n\n const self = this;\n\n return new Promise((resolve, reject) => {\n let storeResult: FetchResult | null;\n let error: ApolloError;\n\n self.getObservableFromLink(\n mutation,\n {\n ...context,\n optimisticResponse,\n },\n variables,\n false,\n ).subscribe({\n next(result: FetchResult) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n\n if (mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = null;\n }\n\n if (fetchPolicy !== 'no-cache') {\n try {\n self.markMutationResult({\n mutationId,\n result,\n document: mutation,\n variables,\n errorPolicy,\n updateQueries,\n update: updateWithProxyFn,\n });\n } catch (e) {\n error = new ApolloError({\n networkError: e,\n });\n return;\n }\n }\n\n storeResult = result;\n },\n\n error(err: Error) {\n if (mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = err;\n }\n if (optimisticResponse) {\n self.cache.removeOptimistic(mutationId);\n }\n self.broadcastQueries();\n reject(\n new ApolloError({\n networkError: err,\n }),\n );\n },\n\n complete() {\n if (error && mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = error;\n }\n\n if (optimisticResponse) {\n self.cache.removeOptimistic(mutationId);\n }\n\n self.broadcastQueries();\n\n if (error) {\n reject(error);\n return;\n }\n\n // allow for conditional refetches\n // XXX do we want to make this the only API one day?\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult!);\n }\n\n const refetchQueryPromises: Promise<\n ApolloQueryResult[] | ApolloQueryResult<{}>\n >[] = [];\n\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(refetchQuery => {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(({ observableQuery }) => {\n if (observableQuery &&\n observableQuery.hasObservers() &&\n observableQuery.queryName === refetchQuery) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n } else {\n const queryOptions: QueryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n\n Promise.all(\n awaitRefetchQueries ? refetchQueryPromises : [],\n ).then(() => {\n if (\n errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)\n ) {\n delete storeResult.errors;\n }\n\n resolve(storeResult!);\n }, reject);\n },\n });\n });\n }\n\n public markMutationResult(\n mutation: {\n mutationId: string;\n result: FetchResult;\n document: DocumentNode;\n variables?: OperationVariables;\n errorPolicy: ErrorPolicy;\n updateQueries: MutationOptions[\"updateQueries\"],\n update?: (\n cache: ApolloCache,\n result: FetchResult,\n ) => void;\n },\n cache = this.cache,\n ) {\n if (shouldWriteResult(mutation.result, mutation.errorPolicy)) {\n const cacheWrites: Cache.WriteOptions[] = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n\n const { updateQueries } = mutation;\n if (updateQueries) {\n this.queries.forEach(({ observableQuery }, queryId) => {\n const queryName = observableQuery && observableQuery.queryName;\n if (!queryName || !hasOwnProperty.call(updateQueries, queryName)) {\n return;\n }\n const updater = updateQueries[queryName];\n const { document, variables } = this.queries.get(queryId)!;\n\n // Read the current query result from the store.\n const { result: currentQueryResult, complete } = cache.diff({\n query: document!,\n variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n if (complete && currentQueryResult) {\n // Run our reducer using the current query result and the mutation result.\n const nextQueryResult = updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: document && getOperationName(document) || void 0,\n queryVariables: variables!,\n });\n\n // Write the modified result back into the store if we got a new result.\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: document!,\n variables,\n });\n }\n }\n });\n }\n\n cache.performTransaction(c => {\n cacheWrites.forEach(write => c.write(write));\n\n // If the mutation has some writes associated with it then we need to\n // apply those writes to the store by running this reducer again with a\n // write action.\n const { update } = mutation;\n if (update) {\n update(c, mutation.result);\n }\n }, /* non-optimistic transaction: */ null);\n }\n }\n\n public markMutationOptimistic(\n optimisticResponse: any,\n mutation: {\n mutationId: string;\n document: DocumentNode;\n variables?: OperationVariables;\n errorPolicy: ErrorPolicy;\n updateQueries: MutationOptions[\"updateQueries\"],\n update?: (\n cache: ApolloCache,\n result: FetchResult,\n ) => void;\n },\n ) {\n const data = typeof optimisticResponse === \"function\"\n ? optimisticResponse(mutation.variables)\n : optimisticResponse;\n\n return this.cache.recordOptimisticTransaction(cache => {\n try {\n this.markMutationResult({\n ...mutation,\n result: { data },\n }, cache);\n } catch (error) {\n invariant.error(error);\n }\n }, mutation.mutationId);\n }\n\n public fetchQuery(\n queryId: string,\n options: WatchQueryOptions,\n networkStatus?: NetworkStatus,\n ): Promise> {\n return this.fetchQueryObservable(\n queryId,\n options,\n networkStatus,\n ).promise;\n }\n\n public getQueryStore() {\n const store: Record = Object.create(null);\n this.queries.forEach((info, queryId) => {\n store[queryId] = {\n variables: info.variables,\n networkStatus: info.networkStatus,\n networkError: info.networkError,\n graphQLErrors: info.graphQLErrors,\n };\n });\n return store;\n }\n\n public resetErrors(queryId: string) {\n const queryInfo = this.queries.get(queryId);\n if (queryInfo) {\n queryInfo.networkError = undefined;\n queryInfo.graphQLErrors = [];\n }\n }\n\n private transformCache = new (canUseWeakMap ? WeakMap : Map)<\n DocumentNode,\n Readonly<{\n document: Readonly;\n hasClientExports: boolean;\n hasForcedResolvers: boolean;\n clientQuery: Readonly | null;\n serverQuery: Readonly | null;\n defaultVars: Readonly;\n }>\n >();\n\n public transform(document: DocumentNode) {\n const { transformCache } = this;\n\n if (!transformCache.has(document)) {\n const transformed = this.cache.transformDocument(document);\n const forLink = removeConnectionDirectiveFromDocument(\n this.cache.transformForLink(transformed));\n\n const clientQuery = this.localState.clientQuery(transformed);\n const serverQuery = forLink && this.localState.serverQuery(forLink);\n\n const cacheEntry = {\n document: transformed,\n // TODO These two calls (hasClientExports and shouldForceResolvers)\n // could probably be merged into a single traversal.\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery,\n serverQuery,\n defaultVars: getDefaultValues(\n getOperationDefinition(transformed)\n ) as OperationVariables,\n };\n\n const add = (doc: DocumentNode | null) => {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry);\n }\n }\n // Add cacheEntry to the transformCache using several different keys,\n // since any one of these documents could end up getting passed to the\n // transform method again in the future.\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n\n return transformCache.get(document)!;\n }\n\n private getVariables(\n document: DocumentNode,\n variables?: OperationVariables,\n ): OperationVariables {\n return {\n ...this.transform(document).defaultVars,\n ...variables,\n };\n }\n\n public watchQuery(\n options: WatchQueryOptions,\n ): ObservableQuery {\n // assign variable default values if supplied\n options = {\n ...options,\n variables: this.getVariables(\n options.query,\n options.variables,\n ) as TVariables,\n };\n\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n\n const queryInfo = new QueryInfo(this.cache);\n const observable = new ObservableQuery({\n queryManager: this,\n queryInfo,\n options,\n });\n\n this.queries.set(observable.queryId, queryInfo);\n\n queryInfo.init({\n document: options.query,\n observableQuery: observable,\n variables: options.variables,\n });\n\n return observable;\n }\n\n public query(\n options: QueryOptions,\n ): Promise> {\n invariant(\n options.query,\n 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.',\n );\n\n invariant(\n options.query.kind === 'Document',\n 'You must wrap the query string in a \"gql\" tag.',\n );\n\n invariant(\n !(options as any).returnPartialData,\n 'returnPartialData option only supported on watchQuery.',\n );\n\n invariant(\n !(options as any).pollInterval,\n 'pollInterval option only supported on watchQuery.',\n );\n\n const queryId = this.generateQueryId();\n return this.fetchQuery(\n queryId,\n options,\n ).finally(() => this.stopQuery(queryId));\n }\n\n private queryIdCounter = 1;\n public generateQueryId() {\n return String(this.queryIdCounter++);\n }\n\n private requestIdCounter = 1;\n public generateRequestId() {\n return this.requestIdCounter++;\n }\n\n private mutationIdCounter = 1;\n public generateMutationId() {\n return String(this.mutationIdCounter++);\n }\n\n public stopQueryInStore(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryInStoreNoBroadcast(queryId: string) {\n const queryInfo = this.queries.get(queryId);\n if (queryInfo) queryInfo.stop();\n }\n\n public clearStore(): Promise {\n // Before we have sent the reset action to the store, we can no longer\n // rely on the results returned by in-flight requests since these may\n // depend on values that previously existed in the data portion of the\n // store. So, we cancel the promises and observers that we have issued\n // so far and not yet resolved (in the case of queries).\n this.cancelPendingFetches(new InvariantError(\n 'Store reset while query was in flight (not completed in link chain)',\n ));\n\n this.queries.forEach(queryInfo => {\n if (queryInfo.observableQuery) {\n // Set loading to true so listeners don't trigger unless they want\n // results with partial data.\n queryInfo.networkStatus = NetworkStatus.loading;\n } else {\n queryInfo.stop();\n }\n });\n\n if (this.mutationStore) {\n this.mutationStore = Object.create(null);\n }\n\n // begin removing data from the store\n return this.cache.reset();\n }\n\n public resetStore(): Promise[]> {\n // Similarly, we have to have to refetch each of the queries currently being\n // observed. We refetch instead of error'ing on these since the assumption is that\n // resetting the store doesn't eliminate the need for the queries currently being\n // watched. If there is an existing query in flight when the store is reset,\n // the promise for it will be rejected and its results will not be written to the\n // store.\n return this.clearStore().then(() => {\n return this.reFetchObservableQueries();\n });\n }\n\n public reFetchObservableQueries(\n includeStandby: boolean = false,\n ): Promise[]> {\n const observableQueryPromises: Promise>[] = [];\n\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery && observableQuery.hasObservers()) {\n const fetchPolicy = observableQuery.options.fetchPolicy;\n\n observableQuery.resetLastResults();\n if (\n fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')\n ) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n\n this.getQuery(queryId).setDiff(null);\n }\n });\n\n this.broadcastQueries();\n\n return Promise.all(observableQueryPromises);\n }\n\n public setObservableQuery(observableQuery: ObservableQuery) {\n this.getQuery(observableQuery.queryId).setObservableQuery(observableQuery);\n }\n\n public startGraphQLSubscription({\n query,\n fetchPolicy,\n errorPolicy,\n variables,\n context = {},\n }: SubscriptionOptions): Observable> {\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n\n const makeObservable = (variables: OperationVariables) =>\n this.getObservableFromLink(\n query,\n context,\n variables,\n false,\n ).map(result => {\n if (fetchPolicy !== 'no-cache') {\n // the subscription interface should handle not sending us results we no longer subscribe to.\n // XXX I don't think we ever send in an object with errors, but we might in the future...\n if (shouldWriteResult(result, errorPolicy)) {\n this.cache.write({\n query,\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n variables: variables,\n });\n }\n\n this.broadcastQueries();\n }\n\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n\n return result;\n });\n\n if (this.transform(query).hasClientExports) {\n const observablePromise = this.localState.addExportedVariables(\n query,\n variables,\n context,\n ).then(makeObservable);\n\n return new Observable>(observer => {\n let sub: ObservableSubscription | null = null;\n observablePromise.then(\n observable => sub = observable.subscribe(observer),\n observer.error,\n );\n return () => sub && sub.unsubscribe();\n });\n }\n\n return makeObservable(variables);\n }\n\n public stopQuery(queryId: string) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryNoBroadcast(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n }\n\n public removeQuery(queryId: string) {\n // teardown all links\n // Both `QueryManager.fetchRequest` and `QueryManager.query` create separate promises\n // that each add their reject functions to fetchCancelFns.\n // A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.\n // The same queryId could have two rejection fns for two promises\n this.fetchCancelFns.delete(queryId);\n this.getQuery(queryId).stop();\n this.queries.delete(queryId);\n }\n\n public broadcastQueries() {\n if (this.onBroadcast) this.onBroadcast();\n this.queries.forEach(info => info.notify());\n }\n\n public getLocalState(): LocalState {\n return this.localState;\n }\n\n private inFlightLinkObservables = new Map<\n DocumentNode,\n Map>\n >();\n\n private getObservableFromLink(\n query: DocumentNode,\n context: any,\n variables?: OperationVariables,\n deduplication: boolean =\n // Prefer context.queryDeduplication if specified.\n context?.queryDeduplication ??\n this.queryDeduplication,\n ): Observable> {\n let observable: Observable>;\n\n const { serverQuery } = this.transform(query);\n if (serverQuery) {\n const { inFlightLinkObservables, link } = this;\n\n const operation = {\n query: serverQuery,\n variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext({\n ...context,\n forceFetch: !deduplication\n }),\n };\n\n context = operation.context;\n\n if (deduplication) {\n const byVariables = inFlightLinkObservables.get(serverQuery) || new Map();\n inFlightLinkObservables.set(serverQuery, byVariables);\n\n const varJson = JSON.stringify(variables);\n observable = byVariables.get(varJson);\n\n if (!observable) {\n const concast = new Concast([\n execute(link, operation) as Observable>\n ]);\n\n byVariables.set(varJson, observable = concast);\n\n concast.cleanup(() => {\n if (byVariables.delete(varJson) &&\n byVariables.size < 1) {\n inFlightLinkObservables.delete(serverQuery);\n }\n });\n }\n\n } else {\n observable = new Concast([\n execute(link, operation) as Observable>\n ]);\n }\n } else {\n observable = new Concast([\n Observable.of({ data: {} } as FetchResult)\n ]);\n context = this.prepareContext(context);\n }\n\n const { clientQuery } = this.transform(query);\n if (clientQuery) {\n observable = asyncMap(observable, result => {\n return this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context,\n variables,\n });\n });\n }\n\n return observable;\n }\n\n private getResultsFromLink(\n queryInfo: QueryInfo,\n allowCacheWrite: boolean,\n options: Pick,\n | \"variables\"\n | \"context\"\n | \"fetchPolicy\"\n | \"errorPolicy\">,\n ): Observable> {\n const requestId = queryInfo.lastRequestId = this.generateRequestId();\n\n return asyncMap(\n this.getObservableFromLink(\n queryInfo.document!,\n options.context,\n options.variables,\n ),\n\n result => {\n const hasErrors = isNonEmptyArray(result.errors);\n\n // If we interrupted this request by calling getResultsFromLink again\n // with the same QueryInfo object, we ignore the old results.\n if (requestId >= queryInfo.lastRequestId) {\n if (hasErrors && options.errorPolicy === \"none\") {\n // Throwing here effectively calls observer.error.\n throw queryInfo.markError(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n queryInfo.markResult(result, options, allowCacheWrite);\n queryInfo.markReady();\n }\n\n const aqr: ApolloQueryResult = {\n data: result.data,\n loading: false,\n networkStatus: queryInfo.networkStatus || NetworkStatus.ready,\n };\n\n if (hasErrors && options.errorPolicy !== \"ignore\") {\n aqr.errors = result.errors;\n }\n\n return aqr;\n },\n\n networkError => {\n const error = isApolloError(networkError)\n ? networkError\n : new ApolloError({ networkError });\n\n // Avoid storing errors from older interrupted queries.\n if (requestId >= queryInfo.lastRequestId) {\n queryInfo.markError(error);\n }\n\n throw error;\n },\n );\n }\n\n public fetchQueryObservable(\n queryId: string,\n options: WatchQueryOptions,\n // The initial networkStatus for this fetch, most often\n // NetworkStatus.loading, but also possibly fetchMore, poll, refetch,\n // or setVariables.\n networkStatus = NetworkStatus.loading,\n ): Concast> {\n const query = this.transform(options.query).document;\n const variables = this.getVariables(query, options.variables) as TVars;\n const queryInfo = this.getQuery(queryId);\n const oldNetworkStatus = queryInfo.networkStatus;\n\n let {\n fetchPolicy = \"cache-first\" as WatchQueryFetchPolicy,\n errorPolicy = \"none\" as ErrorPolicy,\n returnPartialData = false,\n notifyOnNetworkStatusChange = false,\n context = {},\n } = options;\n\n const mightUseNetwork =\n fetchPolicy === \"cache-first\" ||\n fetchPolicy === \"cache-and-network\" ||\n fetchPolicy === \"network-only\" ||\n fetchPolicy === \"no-cache\";\n\n if (mightUseNetwork &&\n notifyOnNetworkStatusChange &&\n typeof oldNetworkStatus === \"number\" &&\n oldNetworkStatus !== networkStatus &&\n isNetworkRequestInFlight(networkStatus)) {\n // In order to force delivery of an incomplete cache result with\n // loading:true, we tweak the fetchPolicy to include the cache, and\n // pretend that returnPartialData was enabled.\n if (fetchPolicy !== \"cache-first\") {\n fetchPolicy = \"cache-and-network\";\n }\n returnPartialData = true;\n }\n\n const normalized = Object.assign({}, options, {\n query,\n variables,\n fetchPolicy,\n errorPolicy,\n returnPartialData,\n notifyOnNetworkStatusChange,\n context,\n });\n\n const fromVariables = (variables: TVars) => {\n // Since normalized is always a fresh copy of options, it's safe to\n // modify its properties here, rather than creating yet another new\n // WatchQueryOptions object.\n normalized.variables = variables;\n return this.fetchQueryByPolicy(\n queryInfo,\n normalized,\n networkStatus,\n );\n };\n\n // This cancel function needs to be set before the concast is created,\n // in case concast creation synchronously cancels the request.\n this.fetchCancelFns.set(queryId, reason => {\n // Delaying the cancellation using a Promise ensures that the\n // concast variable has been initialized.\n Promise.resolve().then(() => concast.cancel(reason));\n });\n\n // A Concast can be created either from an Iterable>\n // or from a PromiseLike>>, where T in this\n // case is ApolloQueryResult.\n const concast = new Concast(\n // If the query has @export(as: ...) directives, then we need to\n // process those directives asynchronously. When there are no\n // @export directives (the common case), we deliberately avoid\n // wrapping the result of this.fetchQueryByPolicy in a Promise,\n // since the timing of result delivery is (unfortunately) important\n // for backwards compatibility. TODO This code could be simpler if\n // we deprecated and removed LocalState.\n this.transform(normalized.query).hasClientExports\n ? this.localState.addExportedVariables(\n normalized.query,\n normalized.variables,\n normalized.context,\n ).then(fromVariables)\n : fromVariables(normalized.variables!)\n );\n\n concast.cleanup(() => {\n this.fetchCancelFns.delete(queryId);\n\n const { nextFetchPolicy } = options;\n if (nextFetchPolicy) {\n // The options.nextFetchPolicy transition should happen only once,\n // but it should be possible for a nextFetchPolicy function to set\n // this.nextFetchPolicy to perform an additional transition.\n options.nextFetchPolicy = void 0;\n\n // When someone chooses cache-and-network or network-only as their\n // initial FetchPolicy, they often do not want future cache updates to\n // trigger unconditional network requests, which is what repeatedly\n // applying the cache-and-network or network-only policies would seem\n // to imply. Instead, when the cache reports an update after the\n // initial network request, it may be desirable for subsequent network\n // requests to be triggered only if the cache result is incomplete.\n // The options.nextFetchPolicy option provides an easy way to update\n // options.fetchPolicy after the intial network request, without\n // having to call observableQuery.setOptions.\n options.fetchPolicy = typeof nextFetchPolicy === \"function\"\n ? nextFetchPolicy.call(options, options.fetchPolicy || \"cache-first\")\n : nextFetchPolicy;\n }\n });\n\n return concast;\n }\n\n private fetchQueryByPolicy(\n queryInfo: QueryInfo,\n options: WatchQueryOptions,\n // The initial networkStatus for this fetch, most often\n // NetworkStatus.loading, but also possibly fetchMore, poll, refetch,\n // or setVariables.\n networkStatus: NetworkStatus,\n ): ConcastSourcesIterable> {\n const {\n query,\n variables,\n fetchPolicy,\n errorPolicy,\n returnPartialData,\n context,\n } = options;\n\n queryInfo.init({\n document: query,\n variables,\n networkStatus,\n });\n\n const readCache = () => queryInfo.getDiff(variables);\n\n const resultsFromCache = (\n diff: Cache.DiffResult,\n networkStatus = queryInfo.networkStatus || NetworkStatus.loading,\n ) => {\n const data = diff.result as TData;\n\n if (process.env.NODE_ENV !== 'production' &&\n isNonEmptyArray(diff.missing) &&\n !equal(data, {}) &&\n !returnPartialData) {\n invariant.warn(`Missing cache result fields: ${\n diff.missing.map(m => m.path.join('.')).join(', ')\n }`, diff.missing);\n }\n\n const fromData = (data: TData) => Observable.of({\n data,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n ...(diff.complete ? null : { partial: true }),\n } as ApolloQueryResult);\n\n if (this.transform(query).hasForcedResolvers) {\n return this.localState.runResolvers({\n document: query,\n remoteResult: { data },\n context,\n variables,\n onlyRunForcedResolvers: true,\n }).then(resolved => fromData(resolved.data!));\n }\n\n return fromData(data);\n };\n\n const resultsFromLink = (allowCacheWrite: boolean) =>\n this.getResultsFromLink(queryInfo, allowCacheWrite, {\n variables,\n context,\n fetchPolicy,\n errorPolicy,\n });\n\n switch (fetchPolicy) {\n default: case \"cache-first\": {\n const diff = readCache();\n\n if (diff.complete) {\n return [\n resultsFromCache(diff, queryInfo.markReady()),\n ];\n }\n\n if (returnPartialData) {\n return [\n resultsFromCache(diff),\n resultsFromLink(true),\n ];\n }\n\n return [\n resultsFromLink(true),\n ];\n }\n\n case \"cache-and-network\": {\n const diff = readCache();\n\n if (diff.complete || returnPartialData) {\n return [\n resultsFromCache(diff),\n resultsFromLink(true),\n ];\n }\n\n return [\n resultsFromLink(true),\n ];\n }\n\n case \"cache-only\":\n return [\n resultsFromCache(readCache(), queryInfo.markReady()),\n ];\n\n case \"network-only\":\n return [resultsFromLink(true)];\n\n case \"no-cache\":\n return [resultsFromLink(false)];\n\n case \"standby\":\n return [];\n }\n }\n\n private getQuery(queryId: string): QueryInfo {\n if (queryId && !this.queries.has(queryId)) {\n this.queries.set(queryId, new QueryInfo(this.cache));\n }\n return this.queries.get(queryId)!;\n }\n\n private prepareContext(context = {}) {\n const newContext = this.localState.prepareContext(context);\n return {\n ...newContext,\n clientAwareness: this.clientAwareness,\n };\n }\n}\n","import { ExecutionResult, DocumentNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { ApolloLink, FetchResult, GraphQLRequest, execute } from '../link/core';\nimport { ApolloCache, DataProxy } from '../cache';\nimport { Observable, compact } from '../utilities';\nimport { version } from '../version';\nimport { HttpLink, UriFunction } from '../link/http';\n\nimport { QueryManager } from './QueryManager';\nimport { ObservableQuery } from './ObservableQuery';\n\nimport {\n ApolloQueryResult,\n OperationVariables,\n Resolvers,\n} from './types';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n MutationOptions,\n SubscriptionOptions,\n WatchQueryFetchPolicy,\n} from './watchQueryOptions';\n\nimport {\n LocalState,\n FragmentMatcher,\n} from './LocalState';\n\nexport interface DefaultOptions {\n watchQuery?: Partial>;\n query?: Partial>;\n mutate?: Partial>;\n}\n\nlet hasSuggestedDevtools = false;\n\nexport type ApolloClientOptions = {\n uri?: string | UriFunction;\n credentials?: string;\n headers?: Record;\n link?: ApolloLink;\n cache: ApolloCache;\n ssrForceFetchDelay?: number;\n ssrMode?: boolean;\n connectToDevTools?: boolean;\n queryDeduplication?: boolean;\n defaultOptions?: DefaultOptions;\n assumeImmutableResults?: boolean;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: FragmentMatcher;\n name?: string;\n version?: string;\n};\n\ntype OptionsUnion =\n | WatchQueryOptions\n | QueryOptions\n | MutationOptions;\n\nexport function mergeOptions<\n TOptions extends OptionsUnion\n>(\n defaults: Partial,\n options: TOptions,\n): TOptions {\n return compact(defaults, options, options.variables && {\n variables: {\n ...defaults.variables,\n ...options.variables,\n },\n });\n}\n\n/**\n * This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries\n * and mutations) to a GraphQL spec-compliant server over a {@link NetworkInterface} instance,\n * receive results from the server and cache the results in a store. It also delivers updates\n * to GraphQL queries through {@link Observable} instances.\n */\nexport class ApolloClient implements DataProxy {\n public link: ApolloLink;\n public cache: ApolloCache;\n public disableNetworkFetches: boolean;\n public version: string;\n public queryDeduplication: boolean;\n public defaultOptions: DefaultOptions = {};\n public readonly typeDefs: ApolloClientOptions['typeDefs'];\n\n private queryManager: QueryManager;\n private devToolsHookCb: Function;\n private resetStoreCallbacks: Array<() => Promise> = [];\n private clearStoreCallbacks: Array<() => Promise> = [];\n private localState: LocalState;\n\n /**\n * Constructs an instance of {@link ApolloClient}.\n *\n * @param uri The GraphQL endpoint that Apollo Client will connect to. If\n * `link` is configured, this option is ignored.\n * @param link The {@link ApolloLink} over which GraphQL documents will be resolved into a response.\n *\n * @param cache The initial cache to use in the data store.\n *\n * @param ssrMode Determines whether this is being run in Server Side Rendering (SSR) mode.\n *\n * @param ssrForceFetchDelay Determines the time interval before we force fetch queries for a\n * server side render.\n *\n * @param queryDeduplication If set to false, a query will still be sent to the server even if a query\n * with identical parameters (query, variables, operationName) is already in flight.\n *\n * @param defaultOptions Used to set application wide defaults for the\n * options supplied to `watchQuery`, `query`, or\n * `mutate`.\n *\n * @param assumeImmutableResults When this option is true, the client will assume results\n * read from the cache are never mutated by application code,\n * which enables substantial performance optimizations. Passing\n * `{ freezeResults: true }` to the `InMemoryCache` constructor\n * can help enforce this immutability.\n *\n * @param name A custom name that can be used to identify this client, when\n * using Apollo client awareness features. E.g. \"iOS\".\n *\n * @param version A custom version that can be used to identify this client,\n * when using Apollo client awareness features. This is the\n * version of your client, which you may want to increment on\n * new builds. This is NOT the version of Apollo Client that\n * you are using.\n */\n constructor(options: ApolloClientOptions) {\n const {\n uri,\n credentials,\n headers,\n cache,\n ssrMode = false,\n ssrForceFetchDelay = 0,\n connectToDevTools =\n // Expose the client instance as window.__APOLLO_CLIENT__ and call\n // onBroadcast in queryManager.broadcastQueries to enable browser\n // devtools, but disable them by default in production.\n typeof window === 'object' &&\n !(window as any).__APOLLO_CLIENT__ &&\n process.env.NODE_ENV !== 'production',\n queryDeduplication = true,\n defaultOptions,\n assumeImmutableResults = false,\n resolvers,\n typeDefs,\n fragmentMatcher,\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n } = options;\n\n let { link } = options;\n\n if (!link) {\n link = uri\n ? new HttpLink({ uri, credentials, headers })\n : ApolloLink.empty();\n }\n\n if (!cache) {\n throw new InvariantError(\n \"To initialize Apollo Client, you must specify a 'cache' property \" +\n \"in the options object. \\n\" +\n \"For more information, please visit: https://go.apollo.dev/c/docs\"\n );\n }\n\n this.link = link;\n this.cache = cache;\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n\n if (ssrForceFetchDelay) {\n setTimeout(\n () => (this.disableNetworkFetches = false),\n ssrForceFetchDelay,\n );\n }\n\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n\n if (connectToDevTools && typeof window === 'object') {\n (window as any).__APOLLO_CLIENT__ = this;\n }\n\n /**\n * Suggest installing the devtools for developers who don't have them\n */\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (\n typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self &&\n !(window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__\n ) {\n const nav = window.navigator;\n const ua = nav && nav.userAgent;\n let url: string | undefined;\n if (typeof ua === \"string\") {\n if (ua.indexOf(\"Chrome/\") > -1) {\n url = \"https://chrome.google.com/webstore/detail/\" +\n \"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm\";\n } else if (ua.indexOf(\"Firefox/\") > -1) {\n url = \"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/\";\n }\n }\n if (url) {\n invariant.log(\n \"Download the Apollo DevTools for a better development \" +\n \"experience: \" + url\n );\n }\n }\n }\n\n this.version = version;\n\n this.localState = new LocalState({\n cache,\n client: this,\n resolvers,\n fragmentMatcher,\n });\n\n this.queryManager = new QueryManager({\n cache: this.cache,\n link: this.link,\n queryDeduplication,\n ssrMode,\n clientAwareness: {\n name: clientAwarenessName!,\n version: clientAwarenessVersion!,\n },\n localState: this.localState,\n assumeImmutableResults,\n onBroadcast: connectToDevTools ? () => {\n if (this.devToolsHookCb) {\n this.devToolsHookCb({\n action: {},\n state: {\n queries: this.queryManager.getQueryStore(),\n mutations: this.queryManager.mutationStore || {},\n },\n dataWithOptimisticResults: this.cache.extract(true),\n });\n }\n } : void 0,\n });\n }\n\n /**\n * Call this method to terminate any active client processes, making it safe\n * to dispose of this `ApolloClient` instance.\n */\n public stop() {\n this.queryManager.stop();\n }\n\n /**\n * This watches the cache store of the query according to the options specified and\n * returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and\n * receive updated results through a GraphQL observer when the cache store changes.\n *

\n * Note that this method is not an implementation of GraphQL subscriptions. Rather,\n * it uses Apollo's store in order to reactively deliver updates to your query results.\n *

\n * For example, suppose you call watchQuery on a GraphQL query that fetches a person's\n * first and last name and this person has a particular object identifer, provided by\n * dataIdFromObject. Later, a different query fetches that same person's\n * first and last name and the first name has now changed. Then, any observers associated\n * with the results of the first query will be updated with a new result object.\n *

\n * Note that if the cache does not change, the subscriber will *not* be notified.\n *

\n * See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for\n * a description of store reactivity.\n */\n public watchQuery(\n options: WatchQueryOptions,\n ): ObservableQuery {\n if (this.defaultOptions.watchQuery) {\n options = mergeOptions(this.defaultOptions.watchQuery, options);\n }\n\n // XXX Overwriting options is probably not the best way to do this long term...\n if (\n this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.watchQuery(options);\n }\n\n /**\n * This resolves a single query according to the options specified and\n * returns a {@link Promise} which is either resolved with the resulting data\n * or rejected with an error.\n *\n * @param options An object of type {@link QueryOptions} that allows us to\n * describe how this query should be treated e.g. whether it should hit the\n * server at all or just resolve from the cache, etc.\n */\n public query(\n options: QueryOptions,\n ): Promise> {\n if (this.defaultOptions.query) {\n options = mergeOptions(this.defaultOptions.query, options);\n }\n\n invariant(\n (options.fetchPolicy as WatchQueryFetchPolicy) !== 'cache-and-network',\n 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.'\n );\n\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.query(options);\n }\n\n /**\n * This resolves a single mutation according to the options specified and returns a\n * {@link Promise} which is either resolved with the resulting data or rejected with an\n * error.\n *\n * It takes options as an object with the following keys and values:\n */\n public mutate(\n options: MutationOptions,\n ): Promise> {\n if (this.defaultOptions.mutate) {\n options = mergeOptions(this.defaultOptions.mutate, options);\n }\n return this.queryManager.mutate(options);\n }\n\n /**\n * This subscribes to a graphql subscription according to the options specified and returns an\n * {@link Observable} which either emits received data or an error.\n */\n public subscribe(\n options: SubscriptionOptions,\n ): Observable> {\n return this.queryManager.startGraphQLSubscription(options);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL query without making a network request. This method will start at\n * the root query. To start at a specific id returned by `dataIdFromObject`\n * use `readFragment`.\n *\n * @param optimistic Set to `true` to allow `readQuery` to return\n * optimistic results. Is `false` by default.\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readQuery(options, optimistic);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL fragment without making a network request. This method will read a\n * GraphQL fragment from any arbitrary id that is currently cached, unlike\n * `readQuery` which will only read from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are reading. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n *\n * @param optimistic Set to `true` to allow `readFragment` to return\n * optimistic results. Is `false` by default.\n */\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readFragment(options, optimistic);\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL query directly to\n * the store. This method will start at the root query. To start at a\n * specific id returned by `dataIdFromObject` then use `writeFragment`.\n */\n public writeQuery(\n options: DataProxy.WriteQueryOptions,\n ): void {\n this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL fragment directly to\n * the store. This method will write to a GraphQL fragment from any arbitrary\n * id that is currently cached, unlike `writeQuery` which will only write\n * from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are writing. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n */\n public writeFragment(\n options: DataProxy.WriteFragmentOptions,\n ): void {\n this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n }\n\n public __actionHookForDevTools(cb: () => any) {\n this.devToolsHookCb = cb;\n }\n\n public __requestRaw(payload: GraphQLRequest): Observable {\n return execute(this.link, payload);\n }\n\n /**\n * Resets your entire store by clearing out your cache and then re-executing\n * all of your active queries. This makes it so that you may guarantee that\n * there is no data left in your store from a time before you called this\n * method.\n *\n * `resetStore()` is useful when your user just logged out. You’ve removed the\n * user session, and you now want to make sure that any references to data you\n * might have fetched while the user session was active is gone.\n *\n * It is important to remember that `resetStore()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n */\n public resetStore(): Promise[] | null> {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.resetStoreCallbacks.map(fn => fn())))\n .then(() => this.reFetchObservableQueries());\n }\n\n /**\n * Remove all data from the store. Unlike `resetStore`, `clearStore` will\n * not refetch any active queries.\n */\n public clearStore(): Promise {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.clearStoreCallbacks.map(fn => fn())));\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * reset. `onResetStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onResetStore(cb: () => Promise): () => void {\n this.resetStoreCallbacks.push(cb);\n return () => {\n this.resetStoreCallbacks = this.resetStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * cleared. `onClearStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onClearStore(cb: () => Promise): () => void {\n this.clearStoreCallbacks.push(cb);\n return () => {\n this.clearStoreCallbacks = this.clearStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Refetches all of your active queries.\n *\n * `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage\n *\n * It is important to remember that `reFetchObservableQueries()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n * Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.\n */\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise[]> {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n }\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public extract(optimistic?: boolean): TCacheShape {\n return this.cache.extract(optimistic);\n }\n\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public restore(serializedState: TCacheShape): ApolloCache {\n return this.cache.restore(serializedState);\n }\n\n /**\n * Add additional local resolvers.\n */\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.addResolvers(resolvers);\n }\n\n /**\n * Set (override existing) local resolvers.\n */\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.setResolvers(resolvers);\n }\n\n /**\n * Get all registered local resolvers.\n */\n public getResolvers() {\n return this.localState.getResolvers();\n }\n\n /**\n * Set a custom local state fragment matcher.\n */\n public setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n }\n\n /**\n * Define a new ApolloLink (or link chain) that Apollo Client will use.\n */\n public setLink(newLink: ApolloLink) {\n this.link = this.queryManager.link = newLink;\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/* Core */\n\nexport {\n ApolloClient,\n ApolloClientOptions,\n DefaultOptions,\n mergeOptions,\n} from './ApolloClient';\nexport {\n ObservableQuery,\n FetchMoreOptions,\n UpdateQueryOptions,\n} from './ObservableQuery';\nexport {\n QueryOptions,\n WatchQueryOptions,\n MutationOptions,\n SubscriptionOptions,\n FetchPolicy,\n WatchQueryFetchPolicy,\n ErrorPolicy,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n MutationUpdaterFn,\n} from './watchQueryOptions';\nexport { NetworkStatus } from './networkStatus';\nexport * from './types';\nexport {\n Resolver,\n FragmentMatcher,\n} from './LocalState';\nexport { isApolloError, ApolloError } from '../errors';\n\n/* Cache */\n\nexport {\n // All the exports (types and values) from ../cache, minus cacheSlot,\n // which we want to keep semi-private.\n Cache,\n ApolloCache,\n Transaction,\n DataProxy,\n InMemoryCache,\n InMemoryCacheConfig,\n MissingFieldError,\n defaultDataIdFromObject,\n ReactiveVar,\n makeVar,\n TypePolicies,\n TypePolicy,\n FieldPolicy,\n FieldReadFunction,\n FieldMergeFunction,\n FieldFunctionOptions,\n PossibleTypesMap,\n} from '../cache';\n\nexport * from '../cache/inmemory/types';\n\n/* Link */\n\nexport * from '../link/core';\nexport * from '../link/http';\nexport {\n fromError,\n toPromise,\n fromPromise,\n ServerError,\n throwServerError,\n} from '../link/utils';\n\n/* Utilities */\n\nexport {\n Observable,\n Observer,\n ObservableSubscription,\n Reference,\n isReference,\n makeReference,\n StoreObject,\n} from '../utilities';\n\n/* Supporting */\n\n// The verbosity of invariant.{log,warn,error} can be controlled globally\n// (for anyone using the same ts-invariant package) by passing \"log\",\n// \"warn\", \"error\", or \"silent\" to setVerbosity (\"log\" is the default).\n// Note that all invariant.* logging is hidden in production.\nimport { setVerbosity } from \"ts-invariant\";\nexport { setVerbosity as setLogVerbosity }\nsetVerbosity(\"log\");\n\n// Note that importing `gql` by itself, then destructuring\n// additional properties separately before exporting, is intentional.\n// Due to the way the `graphql-tag` library is setup, certain bundlers\n// can't find the properties added to the exported `gql` function without\n// additional guidance (e.g. Rollup - see\n// https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module).\n// Instead of having people that are using bundlers with `@apollo/client` add\n// extra bundler config to help `graphql-tag` exports be found (which would be\n// awkward since they aren't importing `graphql-tag` themselves), this\n// workaround of pulling the extra properties off the `gql` function,\n// then re-exporting them separately, helps keeps bundlers happy without any\n// additional config changes.\nimport gql from 'graphql-tag';\nexport const {\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables\n} = gql;\nexport { gql };\n","import React from 'react';\nimport { ApolloClient } from '../../core';\nimport { canUseWeakMap } from '../../utilities';\n\nexport interface ApolloContextValue {\n client?: ApolloClient;\n renderPromises?: Record;\n}\n\n// To make sure Apollo Client doesn't create more than one React context\n// (which can lead to problems like having an Apollo Client instance added\n// in one context, then attempting to retrieve it from another different\n// context), a single Apollo context is created and tracked in global state.\n// We use React.createContext as the key instead of just React to avoid\n// ambiguities between default and namespace React imports.\n\nconst cache = new (canUseWeakMap ? WeakMap : Map)<\n typeof React.createContext,\n React.Context\n>();\n\nexport function getApolloContext() {\n let context = cache.get(React.createContext)!;\n if (!context) {\n context = React.createContext({});\n context.displayName = 'ApolloContext';\n cache.set(React.createContext, context);\n }\n return context;\n}\n\nexport { getApolloContext as resetApolloContext }\n","import React from 'react';\nimport { invariant } from 'ts-invariant';\n\nimport { ApolloClient } from '../../core';\nimport { getApolloContext } from './ApolloContext';\n\nexport interface ApolloConsumerProps {\n children: (client: ApolloClient) => React.ReactChild | null;\n}\n\nexport const ApolloConsumer: React.FC = props => {\n const ApolloContext = getApolloContext();\n return (\n \n {(context: any) => {\n invariant(\n context && context.client,\n 'Could not find \"client\" in the context of ApolloConsumer. ' +\n 'Wrap the root component in an .'\n );\n return props.children(context.client);\n }}\n \n );\n};\n","import React from 'react';\nimport { invariant } from 'ts-invariant';\n\nimport { ApolloClient } from '../../core';\nimport { getApolloContext } from './ApolloContext';\n\nexport interface ApolloProviderProps {\n client: ApolloClient;\n children: React.ReactNode | React.ReactNode[] | null;\n}\n\nexport const ApolloProvider: React.FC> = ({\n client,\n children\n}) => {\n const ApolloContext = getApolloContext();\n return (\n \n {(context: any = {}) => {\n if (client && context.client !== client) {\n context = Object.assign({}, context, { client });\n }\n\n invariant(\n context.client,\n 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.'\n );\n\n return (\n \n {children}\n \n );\n }}\n \n );\n};\n","export * from './ApolloConsumer';\nexport * from './ApolloContext';\nexport * from './ApolloProvider';\n","import React from 'react';\nimport { invariant } from 'ts-invariant';\n\nimport { ApolloClient } from '../../core';\nimport { getApolloContext } from '../context';\n\nexport function useApolloClient(): ApolloClient {\n const { client } = React.useContext(getApolloContext());\n invariant(\n client,\n 'No Apollo Client instance can be found. Please ensure that you ' +\n 'have called `ApolloProvider` higher up in your tree.'\n );\n return client!;\n}\n","import {\n DocumentNode,\n DefinitionNode,\n VariableDefinitionNode,\n OperationDefinitionNode\n} from 'graphql';\nimport { invariant } from 'ts-invariant';\n\nexport enum DocumentType {\n Query,\n Mutation,\n Subscription\n}\n\nexport interface IDocumentDefinition {\n type: DocumentType;\n name: string;\n variables: ReadonlyArray;\n}\n\nconst cache = new Map();\n\nexport function operationName(type: DocumentType) {\n let name;\n switch (type) {\n case DocumentType.Query:\n name = 'Query';\n break;\n case DocumentType.Mutation:\n name = 'Mutation';\n break;\n case DocumentType.Subscription:\n name = 'Subscription';\n break;\n }\n return name;\n}\n\n// This parser is mostly used to saftey check incoming documents.\nexport function parser(document: DocumentNode): IDocumentDefinition {\n const cached = cache.get(document);\n if (cached) return cached;\n\n let variables, type, name;\n\n invariant(\n !!document && !!document.kind,\n `Argument of ${document} passed to parser was not a valid GraphQL ` +\n `DocumentNode. You may need to use 'graphql-tag' or another method ` +\n `to convert your operation into a document`\n );\n\n const fragments = document.definitions.filter(\n (x: DefinitionNode) => x.kind === 'FragmentDefinition'\n );\n\n const queries = document.definitions.filter(\n (x: DefinitionNode) =>\n x.kind === 'OperationDefinition' && x.operation === 'query'\n );\n\n const mutations = document.definitions.filter(\n (x: DefinitionNode) =>\n x.kind === 'OperationDefinition' && x.operation === 'mutation'\n );\n\n const subscriptions = document.definitions.filter(\n (x: DefinitionNode) =>\n x.kind === 'OperationDefinition' && x.operation === 'subscription'\n );\n\n invariant(\n !fragments.length ||\n (queries.length || mutations.length || subscriptions.length),\n `Passing only a fragment to 'graphql' is not yet supported. ` +\n `You must include a query, subscription or mutation as well`\n );\n\n invariant(\n queries.length + mutations.length + subscriptions.length <= 1,\n `react-apollo only supports a query, subscription, or a mutation per HOC. ` +\n `${document} had ${queries.length} queries, ${subscriptions.length} ` +\n `subscriptions and ${mutations.length} mutations. ` +\n `You can use 'compose' to join multiple operation types to a component`\n );\n\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length) type = DocumentType.Subscription;\n\n const definitions = queries.length\n ? queries\n : mutations.length\n ? mutations\n : subscriptions;\n\n invariant(\n definitions.length === 1,\n `react-apollo only supports one definition per HOC. ${document} had ` +\n `${definitions.length} definitions. ` +\n `You can use 'compose' to join multiple operation types to a component`\n );\n\n const definition = definitions[0] as OperationDefinitionNode;\n variables = definition.variableDefinitions || [];\n\n if (definition.name && definition.name.kind === 'Name') {\n name = definition.name.value;\n } else {\n name = 'data'; // fallback to using data if no name\n }\n\n const payload = { name, type, variables };\n cache.set(document, payload);\n return payload;\n}\n","import { DocumentNode } from 'graphql';\nimport { equal } from '@wry/equality';\nimport { invariant } from 'ts-invariant';\n\nimport { ApolloClient } from '../../core';\nimport { DocumentType, parser, operationName } from '../parser';\nimport { CommonOptions } from '../types/types';\n\nexport abstract class OperationData {\n public isMounted: boolean = false;\n public previousOptions: CommonOptions = {} as CommonOptions<\n TOptions\n >;\n public context: any = {};\n public client: ApolloClient;\n\n private options: CommonOptions = {} as CommonOptions;\n\n constructor(options?: CommonOptions, context?: any) {\n this.options = options || ({} as CommonOptions);\n this.context = context || {};\n }\n\n public getOptions(): CommonOptions {\n return this.options;\n }\n\n public setOptions(\n newOptions: CommonOptions,\n storePrevious: boolean = false\n ) {\n if (storePrevious && !equal(this.options, newOptions)) {\n this.previousOptions = this.options;\n }\n this.options = newOptions;\n }\n\n public abstract execute(...args: any): any;\n public abstract afterExecute(...args: any): void | (() => void);\n public abstract cleanup(): void;\n\n protected unmount() {\n this.isMounted = false;\n }\n\n protected refreshClient() {\n const client =\n (this.options && this.options.client) ||\n (this.context && this.context.client);\n\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as an option. ' +\n 'Wrap the root component in an , or pass an ' +\n 'ApolloClient instance in via options.'\n );\n\n let isNew = false;\n if (client !== this.client) {\n isNew = true;\n this.client = client;\n this.cleanup();\n }\n return {\n client: this.client as ApolloClient,\n isNew\n };\n }\n\n protected verifyDocumentType(document: DocumentNode, type: DocumentType) {\n const operation = parser(document);\n const requiredOperationName = operationName(type);\n const usedOperationName = operationName(operation.type);\n invariant(\n operation.type === type,\n `Running a ${requiredOperationName} requires a graphql ` +\n `${requiredOperationName}, but a ${usedOperationName} was used instead.`\n );\n }\n}\n","import { equal } from '@wry/equality';\n\nimport { OperationData } from './OperationData';\nimport {\n SubscriptionCurrentObservable,\n SubscriptionDataOptions,\n SubscriptionResult\n} from '../types/types';\n\nexport class SubscriptionData<\n TData = any,\n TVariables = any\n> extends OperationData> {\n private setResult: any;\n private currentObservable: SubscriptionCurrentObservable = {};\n\n constructor({\n options,\n context,\n setResult\n }: {\n options: SubscriptionDataOptions;\n context: any;\n setResult: any;\n }) {\n super(options, context);\n this.setResult = setResult;\n this.initialize(options);\n }\n\n public execute(result: SubscriptionResult) {\n if (this.getOptions().skip === true) {\n this.cleanup();\n return {\n loading: false,\n error: undefined,\n data: undefined,\n variables: this.getOptions().variables\n };\n }\n\n let currentResult = result;\n if (this.refreshClient().isNew) {\n currentResult = this.getLoadingResult();\n }\n\n let { shouldResubscribe } = this.getOptions();\n if (typeof shouldResubscribe === 'function') {\n shouldResubscribe = !!shouldResubscribe(this.getOptions());\n }\n\n if (\n shouldResubscribe !== false &&\n this.previousOptions &&\n Object.keys(this.previousOptions).length > 0 &&\n (this.previousOptions.subscription !== this.getOptions().subscription ||\n !equal(this.previousOptions.variables, this.getOptions().variables) ||\n this.previousOptions.skip !== this.getOptions().skip)\n ) {\n this.cleanup();\n currentResult = this.getLoadingResult();\n }\n\n this.initialize(this.getOptions());\n this.startSubscription();\n\n this.previousOptions = this.getOptions();\n return { ...currentResult, variables: this.getOptions().variables };\n }\n\n public afterExecute() {\n this.isMounted = true;\n }\n\n public cleanup() {\n this.endSubscription();\n delete this.currentObservable.query;\n }\n\n private initialize(options: SubscriptionDataOptions) {\n if (this.currentObservable.query || this.getOptions().skip === true) return;\n this.currentObservable.query = this.refreshClient().client.subscribe({\n query: options.subscription,\n variables: options.variables,\n fetchPolicy: options.fetchPolicy,\n context: options.context,\n });\n }\n\n private startSubscription() {\n if (this.currentObservable.subscription) return;\n this.currentObservable.subscription = this.currentObservable.query!.subscribe(\n {\n next: this.updateCurrentData.bind(this),\n error: this.updateError.bind(this),\n complete: this.completeSubscription.bind(this)\n }\n );\n }\n\n private getLoadingResult() {\n return {\n loading: true,\n error: undefined,\n data: undefined\n } as SubscriptionResult;\n }\n\n private updateResult(result: SubscriptionResult) {\n if (this.isMounted) {\n this.setResult(result);\n }\n }\n\n private updateCurrentData(result: SubscriptionResult) {\n const { onSubscriptionData } = this.getOptions();\n\n this.updateResult({\n data: result.data,\n loading: false,\n error: undefined\n });\n\n if (onSubscriptionData) {\n onSubscriptionData({\n client: this.refreshClient().client,\n subscriptionData: result\n });\n }\n }\n\n private updateError(error: any) {\n this.updateResult({\n error,\n loading: false\n });\n }\n\n private completeSubscription() {\n // We have to defer this endSubscription call, because otherwise multiple\n // subscriptions for the same component will cause infinite rendering.\n // See https://github.com/apollographql/apollo-client/pull/7917\n Promise.resolve().then(() => {\n const { onSubscriptionComplete } = this.getOptions();\n if (onSubscriptionComplete) onSubscriptionComplete();\n this.endSubscription();\n });\n }\n\n private endSubscription() {\n if (this.currentObservable.subscription) {\n this.currentObservable.subscription.unsubscribe();\n delete this.currentObservable.subscription;\n }\n }\n}\n","import { equal } from '@wry/equality';\n\nimport { DocumentType } from '../parser';\nimport { ApolloError } from '../../errors';\nimport {\n MutationDataOptions,\n MutationTuple,\n MutationFunctionOptions,\n MutationResult,\n} from '../types/types';\nimport { OperationData } from './OperationData';\nimport { OperationVariables, MutationOptions, mergeOptions } from '../../core';\nimport { FetchResult } from '../../link/core';\n\ntype MutationResultWithoutClient = Omit, 'client'>;\n\nexport class MutationData<\n TData = any,\n TVariables = OperationVariables\n> extends OperationData> {\n private mostRecentMutationId: number;\n private result: MutationResultWithoutClient;\n private previousResult?: MutationResultWithoutClient;\n private setResult: (result: MutationResultWithoutClient) => any;\n\n constructor({\n options,\n context,\n result,\n setResult\n }: {\n options: MutationDataOptions;\n context: any;\n result: MutationResultWithoutClient;\n setResult: (result: MutationResultWithoutClient) => any;\n }) {\n super(options, context);\n this.verifyDocumentType(options.mutation, DocumentType.Mutation);\n this.result = result;\n this.setResult = setResult;\n this.mostRecentMutationId = 0;\n }\n\n public execute(result: MutationResultWithoutClient): MutationTuple {\n this.isMounted = true;\n this.verifyDocumentType(this.getOptions().mutation, DocumentType.Mutation);\n return [\n this.runMutation,\n { ...result, client: this.refreshClient().client }\n ] as MutationTuple;\n }\n\n public afterExecute() {\n this.isMounted = true;\n return this.unmount.bind(this);\n }\n\n public cleanup() {\n // No cleanup required.\n }\n\n private runMutation = (\n mutationFunctionOptions: MutationFunctionOptions<\n TData,\n TVariables\n > = {} as MutationFunctionOptions\n ) => {\n this.onMutationStart();\n const mutationId = this.generateNewMutationId();\n\n return this.mutate(mutationFunctionOptions)\n .then((response: FetchResult) => {\n this.onMutationCompleted(response, mutationId);\n return response;\n })\n .catch((error: ApolloError) => {\n this.onMutationError(error, mutationId);\n if (!this.getOptions().onError) throw error;\n });\n };\n\n private mutate(\n options: MutationFunctionOptions\n ) {\n return this.refreshClient().client.mutate(\n mergeOptions(\n this.getOptions(),\n options as MutationOptions,\n ),\n );\n }\n\n private onMutationStart() {\n if (!this.result.loading && !this.getOptions().ignoreResults) {\n this.updateResult({\n loading: true,\n error: undefined,\n data: undefined,\n called: true\n });\n }\n }\n\n private onMutationCompleted(\n response: FetchResult,\n mutationId: number\n ) {\n const { onCompleted, ignoreResults } = this.getOptions();\n\n const { data, errors } = response;\n const error =\n errors && errors.length > 0\n ? new ApolloError({ graphQLErrors: errors })\n : undefined;\n\n const callOncomplete = () =>\n onCompleted ? onCompleted(data as TData) : null;\n\n if (this.isMostRecentMutation(mutationId) && !ignoreResults) {\n this.updateResult({\n called: true,\n loading: false,\n data,\n error\n });\n }\n callOncomplete();\n }\n\n private onMutationError(error: ApolloError, mutationId: number) {\n const { onError } = this.getOptions();\n\n if (this.isMostRecentMutation(mutationId)) {\n this.updateResult({\n loading: false,\n error,\n data: undefined,\n called: true\n });\n }\n\n if (onError) {\n onError(error);\n }\n }\n\n private generateNewMutationId(): number {\n return ++this.mostRecentMutationId;\n }\n\n private isMostRecentMutation(mutationId: number) {\n return this.mostRecentMutationId === mutationId;\n }\n\n private updateResult(result: MutationResultWithoutClient) {\n if (\n this.isMounted &&\n (!this.previousResult || !equal(this.previousResult, result))\n ) {\n this.setResult(result);\n this.previousResult = result;\n }\n }\n}\n","import { equal } from '@wry/equality';\n\nimport { ApolloError } from '../../errors';\n\nimport {\n ApolloClient,\n NetworkStatus,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n ObservableQuery,\n FetchMoreOptions,\n UpdateQueryOptions,\n DocumentNode,\n TypedDocumentNode\n} from '../../core';\n\nimport {\n ObservableSubscription\n} from '../../utilities';\n\nimport { DocumentType } from '../parser';\nimport {\n QueryResult,\n QueryDataOptions,\n QueryTuple,\n QueryLazyOptions,\n ObservableQueryFields,\n} from '../types/types';\nimport { OperationData } from './OperationData';\n\nexport class QueryData extends OperationData<\n QueryDataOptions\n> {\n public onNewData: () => void;\n private currentObservable?: ObservableQuery;\n private currentSubscription?: ObservableSubscription;\n private runLazy: boolean = false;\n private lazyOptions?: QueryLazyOptions;\n private previous: {\n client?: ApolloClient;\n query?: DocumentNode | TypedDocumentNode;\n observableQueryOptions?: {};\n result?: QueryResult;\n loading?: boolean;\n options?: QueryDataOptions;\n error?: ApolloError;\n } = Object.create(null);\n\n constructor({\n options,\n context,\n onNewData\n }: {\n options: QueryDataOptions;\n context: any;\n onNewData: () => void;\n }) {\n super(options, context);\n this.onNewData = onNewData;\n }\n\n public execute(): QueryResult {\n this.refreshClient();\n\n const { skip, query } = this.getOptions();\n if (skip || query !== this.previous.query) {\n this.removeQuerySubscription();\n this.removeObservable(!skip);\n this.previous.query = query;\n }\n\n this.updateObservableQuery();\n\n if (this.isMounted) this.startQuerySubscription();\n\n return this.getExecuteSsrResult() || this.getExecuteResult();\n }\n\n public executeLazy(): QueryTuple {\n return !this.runLazy\n ? [\n this.runLazyQuery,\n {\n loading: false,\n networkStatus: NetworkStatus.ready,\n called: false,\n data: undefined\n }\n ]\n : [this.runLazyQuery, this.execute()];\n }\n\n // For server-side rendering\n public fetchData(): Promise | boolean {\n const options = this.getOptions();\n if (options.skip || options.ssr === false) return false;\n return new Promise(resolve => this.startQuerySubscription(resolve));\n }\n\n public afterExecute({ lazy = false }: { lazy?: boolean } = {}) {\n this.isMounted = true;\n\n if (!lazy || this.runLazy) {\n this.handleErrorOrCompleted();\n }\n\n this.previousOptions = this.getOptions();\n return this.unmount.bind(this);\n }\n\n public cleanup() {\n this.removeQuerySubscription();\n this.removeObservable(true);\n delete this.previous.result;\n }\n\n public getOptions() {\n const options = super.getOptions();\n\n if (this.lazyOptions) {\n options.variables = {\n ...options.variables,\n ...this.lazyOptions.variables\n } as TVariables;\n options.context = {\n ...options.context,\n ...this.lazyOptions.context\n };\n }\n\n // skip is not supported when using lazy query execution.\n if (this.runLazy) {\n delete options.skip;\n }\n\n return options;\n }\n\n public ssrInitiated() {\n return this.context && this.context.renderPromises;\n }\n\n private runLazyQuery = (options?: QueryLazyOptions) => {\n this.cleanup();\n this.runLazy = true;\n this.lazyOptions = options;\n this.onNewData();\n };\n\n private getExecuteResult(): QueryResult {\n const result = this.getQueryResult();\n this.startQuerySubscription();\n return result;\n };\n\n private getExecuteSsrResult() {\n const { ssr, skip } = this.getOptions();\n const ssrDisabled = ssr === false;\n const fetchDisabled = this.refreshClient().client.disableNetworkFetches;\n\n const ssrLoading = {\n loading: true,\n networkStatus: NetworkStatus.loading,\n called: true,\n data: undefined,\n stale: false,\n client: this.client,\n ...this.observableQueryFields(),\n } as QueryResult;\n\n // If SSR has been explicitly disabled, and this function has been called\n // on the server side, return the default loading state.\n if (ssrDisabled && (this.ssrInitiated() || fetchDisabled)) {\n this.previous.result = ssrLoading;\n return ssrLoading;\n }\n\n if (this.ssrInitiated()) {\n const result = this.getQueryResult() || ssrLoading;\n if (result.loading && !skip) {\n this.context.renderPromises!.addQueryPromise(this, () => null);\n }\n return result;\n }\n }\n\n private prepareObservableQueryOptions() {\n const options = this.getOptions();\n this.verifyDocumentType(options.query, DocumentType.Query);\n const displayName = options.displayName || 'Query';\n\n // Set the fetchPolicy to cache-first for network-only and cache-and-network\n // fetches for server side renders.\n if (\n this.ssrInitiated() &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options.fetchPolicy = 'cache-first';\n }\n\n return {\n ...options,\n displayName,\n context: options.context,\n };\n }\n\n private initializeObservableQuery() {\n // See if there is an existing observable that was used to fetch the same\n // data and if so, use it instead since it will contain the proper queryId\n // to fetch the result set. This is used during SSR.\n if (this.ssrInitiated()) {\n this.currentObservable = this.context!.renderPromises!.getSSRObservable(\n this.getOptions()\n );\n }\n\n if (!this.currentObservable) {\n const observableQueryOptions = this.prepareObservableQueryOptions();\n\n this.previous.observableQueryOptions = {\n ...observableQueryOptions,\n children: null\n };\n this.currentObservable = this.refreshClient().client.watchQuery({\n ...observableQueryOptions\n });\n\n if (this.ssrInitiated()) {\n this.context!.renderPromises!.registerSSRObservable(\n this.currentObservable,\n observableQueryOptions\n );\n }\n }\n }\n\n private updateObservableQuery() {\n // If we skipped initially, we may not have yet created the observable\n if (!this.currentObservable) {\n this.initializeObservableQuery();\n return;\n }\n\n if (this.getOptions().skip) return;\n\n const newObservableQueryOptions = {\n ...this.prepareObservableQueryOptions(),\n children: null\n };\n\n if (\n !equal(\n newObservableQueryOptions,\n this.previous.observableQueryOptions\n )\n ) {\n this.previous.observableQueryOptions = newObservableQueryOptions;\n this.currentObservable\n .setOptions(newObservableQueryOptions)\n // The error will be passed to the child container, so we don't\n // need to log it here. We could conceivably log something if\n // an option was set. OTOH we don't log errors w/ the original\n // query. See https://github.com/apollostack/react-apollo/issues/404\n .catch(() => {});\n }\n }\n\n // Setup a subscription to watch for Apollo Client `ObservableQuery` changes.\n // When new data is received, and it doesn't match the data that was used\n // during the last `QueryData.execute` call (and ultimately the last query\n // component render), trigger the `onNewData` callback. If not specified,\n // `onNewData` will fallback to the default `QueryData.onNewData` function\n // (which usually leads to a query component re-render).\n private startQuerySubscription(onNewData: () => void = this.onNewData) {\n if (this.currentSubscription || this.getOptions().skip) return;\n\n this.currentSubscription = this.currentObservable!.subscribe({\n next: ({ loading, networkStatus, data }) => {\n const previousResult = this.previous.result;\n\n // Make sure we're not attempting to re-render similar results\n if (\n previousResult &&\n previousResult.loading === loading &&\n previousResult.networkStatus === networkStatus &&\n equal(previousResult.data, data)\n ) {\n return;\n }\n\n onNewData();\n },\n error: error => {\n this.resubscribeToQuery();\n if (!error.hasOwnProperty('graphQLErrors')) throw error;\n\n const previousResult = this.previous.result;\n if (\n (previousResult && previousResult.loading) ||\n !equal(error, this.previous.error)\n ) {\n this.previous.error = error;\n onNewData();\n }\n }\n });\n }\n\n private resubscribeToQuery() {\n this.removeQuerySubscription();\n\n // Unfortunately, if `lastError` is set in the current\n // `observableQuery` when the subscription is re-created,\n // the subscription will immediately receive the error, which will\n // cause it to terminate again. To avoid this, we first clear\n // the last error/result from the `observableQuery` before re-starting\n // the subscription, and restore it afterwards (so the subscription\n // has a chance to stay open).\n const { currentObservable } = this;\n if (currentObservable) {\n const lastError = currentObservable.getLastError();\n const lastResult = currentObservable.getLastResult();\n currentObservable.resetLastResults();\n this.startQuerySubscription();\n Object.assign(currentObservable, {\n lastError,\n lastResult\n });\n }\n }\n\n private getQueryResult = (): QueryResult => {\n let result = this.observableQueryFields() as QueryResult;\n const options = this.getOptions();\n\n // When skipping a query (ie. we're not querying for data but still want\n // to render children), make sure the `data` is cleared out and\n // `loading` is set to `false` (since we aren't loading anything).\n //\n // NOTE: We no longer think this is the correct behavior. Skipping should\n // not automatically set `data` to `undefined`, but instead leave the\n // previous data in place. In other words, skipping should not mandate\n // that previously received data is all of a sudden removed. Unfortunately,\n // changing this is breaking, so we'll have to wait until Apollo Client\n // 4.0 to address this.\n if (options.skip) {\n result = {\n ...result,\n data: undefined,\n error: undefined,\n loading: false,\n networkStatus: NetworkStatus.ready,\n called: true,\n };\n } else if (this.currentObservable) {\n // Fetch the current result (if any) from the store.\n const currentResult = this.currentObservable.getCurrentResult();\n const { data, loading, partial, networkStatus, errors } = currentResult;\n let { error } = currentResult;\n\n // Until a set naming convention for networkError and graphQLErrors is\n // decided upon, we map errors (graphQLErrors) to the error options.\n if (errors && errors.length > 0) {\n error = new ApolloError({ graphQLErrors: errors });\n }\n\n result = {\n ...result,\n data,\n loading,\n networkStatus,\n error,\n called: true\n };\n\n if (loading) {\n // Fall through without modifying result...\n } else if (error) {\n Object.assign(result, {\n data: (this.currentObservable.getLastResult() || ({} as any))\n .data\n });\n } else {\n const { fetchPolicy } = this.currentObservable.options;\n const { partialRefetch } = options;\n if (\n partialRefetch &&\n partial &&\n (!data || Object.keys(data).length === 0) &&\n fetchPolicy !== 'cache-only'\n ) {\n // When a `Query` component is mounted, and a mutation is executed\n // that returns the same ID as the mounted `Query`, but has less\n // fields in its result, Apollo Client's `QueryManager` returns the\n // data as `undefined` since a hit can't be found in the cache.\n // This can lead to application errors when the UI elements rendered by\n // the original `Query` component are expecting certain data values to\n // exist, and they're all of a sudden stripped away. To help avoid\n // this we'll attempt to refetch the `Query` data.\n Object.assign(result, {\n loading: true,\n networkStatus: NetworkStatus.loading\n });\n result.refetch();\n return result;\n }\n }\n }\n\n result.client = this.client;\n // Store options as this.previousOptions.\n this.setOptions(options, true);\n\n const previousResult = this.previous.result;\n\n this.previous.loading =\n previousResult && previousResult.loading || false;\n\n // Ensure the returned result contains previousData as a separate\n // property, to give developers the flexibility of leveraging outdated\n // data while new data is loading from the network. Falling back to\n // previousResult.previousData when previousResult.data is falsy here\n // allows result.previousData to persist across multiple results.\n result.previousData = previousResult &&\n (previousResult.data || previousResult.previousData);\n\n this.previous.result = result;\n\n // Any query errors that exist are now available in `result`, so we'll\n // remove the original errors from the `ObservableQuery` query store to\n // make sure they aren't re-displayed on subsequent (potentially error\n // free) requests/responses.\n this.currentObservable && this.currentObservable.resetQueryStoreErrors();\n\n return result;\n }\n\n private handleErrorOrCompleted() {\n if (!this.currentObservable || !this.previous.result) return;\n\n const { data, loading, error } = this.previous.result;\n\n if (!loading) {\n const {\n query,\n variables,\n onCompleted,\n onError,\n skip\n } = this.getOptions();\n\n // No changes, so we won't call onError/onCompleted.\n if (\n this.previousOptions &&\n !this.previous.loading &&\n equal(this.previousOptions.query, query) &&\n equal(this.previousOptions.variables, variables)\n ) {\n return;\n }\n\n if (onCompleted && !error && !skip) {\n onCompleted(data as TData);\n } else if (onError && error) {\n onError(error);\n }\n }\n }\n\n private removeQuerySubscription() {\n if (this.currentSubscription) {\n this.currentSubscription.unsubscribe();\n delete this.currentSubscription;\n }\n }\n\n private removeObservable(andDelete: boolean) {\n if (this.currentObservable) {\n this.currentObservable[\"tearDownQuery\"]();\n if (andDelete) {\n delete this.currentObservable;\n }\n }\n }\n\n private obsRefetch = (variables?: Partial) =>\n this.currentObservable?.refetch(variables);\n\n private obsFetchMore = (\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions\n ) => this.currentObservable!.fetchMore(fetchMoreOptions);\n\n private obsUpdateQuery = (\n mapFn: (\n previousQueryResult: TData,\n options: UpdateQueryOptions\n ) => TData\n ) => this.currentObservable!.updateQuery(mapFn);\n\n private obsStartPolling = (pollInterval: number) => {\n this.currentObservable?.startPolling(pollInterval);\n };\n\n private obsStopPolling = () => {\n this.currentObservable?.stopPolling();\n };\n\n private obsSubscribeToMore = <\n TSubscriptionData = TData,\n TSubscriptionVariables = TVariables\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >\n ) => this.currentObservable!.subscribeToMore(options);\n\n private observableQueryFields() {\n return {\n variables: this.currentObservable?.variables,\n refetch: this.obsRefetch,\n fetchMore: this.obsFetchMore,\n updateQuery: this.obsUpdateQuery,\n startPolling: this.obsStartPolling,\n stopPolling: this.obsStopPolling,\n subscribeToMore: this.obsSubscribeToMore\n } as ObservableQueryFields;\n }\n}\n","export { SubscriptionData } from './SubscriptionData';\nexport { OperationData } from './OperationData';\nexport { MutationData } from './MutationData';\nexport { QueryData } from './QueryData';\n","import { useRef } from 'react';\nimport { equal } from '@wry/equality';\n\n/**\n * Memoize a result using deep equality. This hook has two advantages over\n * React.useMemo: it uses deep equality to compare memo keys, and it guarantees\n * that the memo function will only be called if the keys are unequal.\n * React.useMemo cannot be relied on to do this, since it is only a performance\n * optimization (see https://reactjs.org/docs/hooks-reference.html#usememo).\n */\nexport function useDeepMemo(\n memoFn: () => TValue,\n key: TKey\n): TValue {\n const ref = useRef<{ key: TKey; value: TValue }>();\n\n if (!ref.current || !equal(key, ref.current.key)) {\n ref.current = { key, value: memoFn() };\n }\n\n return ref.current.value;\n}\n","import { useContext, useEffect, useReducer, useRef } from 'react';\nimport { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport {\n QueryHookOptions,\n QueryDataOptions,\n QueryTuple,\n QueryResult,\n} from '../../types/types';\nimport { QueryData } from '../../data';\nimport { useDeepMemo } from './useDeepMemo';\nimport { OperationVariables } from '../../../core';\nimport { getApolloContext } from '../../context';\n\nexport function useBaseQuery(\n query: DocumentNode | TypedDocumentNode,\n options?: QueryHookOptions,\n lazy = false\n) {\n const context = useContext(getApolloContext());\n const [tick, forceUpdate] = useReducer(x => x + 1, 0);\n const updatedOptions = options ? { ...options, query } : { query };\n\n const queryDataRef = useRef>();\n const queryData = queryDataRef.current || (\n queryDataRef.current = new QueryData({\n options: updatedOptions as QueryDataOptions,\n context,\n onNewData() {\n if (!queryData.ssrInitiated()) {\n // When new data is received from the `QueryData` object, we want to\n // force a re-render to make sure the new data is displayed. We can't\n // force that re-render if we're already rendering however so to be\n // safe we'll trigger the re-render in a microtask. In case the\n // component gets unmounted before this callback fires, we re-check\n // queryDataRef.current before calling forceUpdate().\n Promise.resolve().then(() => queryDataRef.current && forceUpdate());\n } else {\n // If we're rendering on the server side we can force an update at\n // any point.\n forceUpdate();\n }\n }\n })\n );\n\n queryData.setOptions(updatedOptions);\n queryData.context = context;\n\n // `onError` and `onCompleted` callback functions will not always have a\n // stable identity, so we'll exclude them from the memoization key to\n // prevent `afterExecute` from being triggered un-necessarily.\n const memo = {\n options: {\n ...updatedOptions,\n onError: undefined,\n onCompleted: undefined\n } as QueryHookOptions,\n context,\n tick\n };\n\n const result = useDeepMemo(\n () => (lazy ? queryData.executeLazy() : queryData.execute()),\n memo\n );\n\n const queryResult = lazy\n ? (result as QueryTuple)[1]\n : (result as QueryResult);\n\n useEffect(() => {\n return () => queryData.cleanup();\n }, []);\n\n useEffect(() => queryData.afterExecute({ lazy }), [\n queryResult.loading,\n queryResult.networkStatus,\n queryResult.error,\n queryResult.data,\n ]);\n\n return result;\n}\n","import { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { LazyQueryHookOptions, QueryTuple } from '../types/types';\nimport { useBaseQuery } from './utils/useBaseQuery';\nimport { OperationVariables } from '../../core';\n\nexport function useLazyQuery(\n query: DocumentNode | TypedDocumentNode,\n options?: LazyQueryHookOptions\n) {\n return useBaseQuery(query, options, true) as QueryTuple<\n TData,\n TVariables\n >;\n}\n","import { useContext, useState, useRef, useEffect } from 'react';\nimport { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { MutationHookOptions, MutationTuple } from '../types/types';\nimport { MutationData } from '../data';\nimport { OperationVariables } from '../../core';\nimport { getApolloContext } from '../context';\n\nexport function useMutation(\n mutation: DocumentNode | TypedDocumentNode,\n options?: MutationHookOptions\n): MutationTuple {\n const context = useContext(getApolloContext());\n const [result, setResult] = useState({ called: false, loading: false });\n const updatedOptions = options ? { ...options, mutation } : { mutation };\n\n const mutationDataRef = useRef>();\n function getMutationDataRef() {\n if (!mutationDataRef.current) {\n mutationDataRef.current = new MutationData({\n options: updatedOptions,\n context,\n result,\n setResult\n });\n }\n return mutationDataRef.current;\n }\n\n const mutationData = getMutationDataRef();\n mutationData.setOptions(updatedOptions);\n mutationData.context = context;\n\n useEffect(() => mutationData.afterExecute());\n\n return mutationData.execute(result);\n}\n","import { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { QueryHookOptions, QueryResult } from '../types/types';\nimport { useBaseQuery } from './utils/useBaseQuery';\nimport { OperationVariables } from '../../core';\n\nexport function useQuery(\n query: DocumentNode | TypedDocumentNode,\n options?: QueryHookOptions\n) {\n return useBaseQuery(query, options, false) as QueryResult<\n TData,\n TVariables\n >;\n}\n","import { useContext, useState, useRef, useEffect } from 'react';\nimport { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { SubscriptionHookOptions } from '../types/types';\nimport { SubscriptionData } from '../data';\nimport { OperationVariables } from '../../core';\nimport { getApolloContext } from '../context';\n\nexport function useSubscription(\n subscription: DocumentNode | TypedDocumentNode,\n options?: SubscriptionHookOptions\n) {\n const context = useContext(getApolloContext());\n const updatedOptions = options\n ? { ...options, subscription }\n : { subscription };\n const [result, setResult] = useState({\n loading: !updatedOptions.skip,\n error: undefined,\n data: undefined\n });\n\n const subscriptionDataRef = useRef>();\n function getSubscriptionDataRef() {\n if (!subscriptionDataRef.current) {\n subscriptionDataRef.current = new SubscriptionData({\n options: updatedOptions,\n context,\n setResult\n });\n }\n return subscriptionDataRef.current;\n }\n\n const subscriptionData = getSubscriptionDataRef();\n subscriptionData.setOptions(updatedOptions, true);\n subscriptionData.context = context;\n\n useEffect(() => subscriptionData.afterExecute());\n useEffect(() => subscriptionData.cleanup.bind(subscriptionData), []);\n\n return subscriptionData.execute(result);\n}\n","import { useState, useEffect } from 'react';\nimport { ReactiveVar } from '../../core';\n\nexport function useReactiveVar(rv: ReactiveVar): T {\n const value = rv();\n // We don't actually care what useState thinks the value of the variable\n // is, so we take only the update function from the returned array.\n const [, setValue] = useState(value);\n // We subscribe to variable updates on initial mount and when the value has\n // changed. This avoids a subtle bug in React.StrictMode where multiple listeners\n // are added, leading to inconsistent updates.\n useEffect(() => rv.onNextChange(setValue), [value]);\n // Once the component is unmounted, ignore future updates. Note that the\n // above useEffect function returns a mute function without calling it,\n // allowing it to be called when the component unmounts. This is\n // equivalent to the following, but shorter:\n // useEffect(() => {\n // const mute = rv.onNextChange(setValue);\n // return () => mute();\n // }, [value])\n\n // We check the variable's value in this useEffect and schedule an update if\n // the value has changed. This check occurs once, on the initial render, to avoid\n // a useEffect higher in the component tree changing a variable's value\n // before the above useEffect can set the onNextChange handler. Note that React\n // will not schedule an update if setState is called with the same value as before.\n useEffect(() => {\n setValue(rv())\n }, []);\n\n return value;\n}\n","export * from './useApolloClient';\nexport * from './useLazyQuery';\nexport * from './useMutation';\nexport * from './useQuery';\nexport * from './useSubscription';\nexport * from './useReactiveVar';\n","export {\n ApolloProvider,\n ApolloConsumer,\n getApolloContext,\n resetApolloContext,\n ApolloContextValue\n} from './context';\n\nexport * from './hooks';\n\nexport {\n DocumentType,\n IDocumentDefinition,\n operationName,\n parser\n} from './parser';\n\nexport * from './types/types';\n","\"use strict\";function _interopDefault(e){return e&&\"object\"==typeof e&&\"default\"in e?e.default:e}Object.defineProperty(exports,\"__esModule\",{value:!0});var React=_interopDefault(require(\"react\"));function AppContainer(e){return AppContainer.warnAboutHMRDisabled&&(AppContainer.warnAboutHMRDisabled=!0,console.error(\"React-Hot-Loader: misconfiguration detected, using production version in non-production environment.\"),console.error(\"React-Hot-Loader: Hot Module Replacement is not enabled.\")),React.Children.only(e.children)}AppContainer.warnAboutHMRDisabled=!1;var hot=function e(){return e.shouldWrapWithAppContainer?function(e){return function(n){return React.createElement(AppContainer,null,React.createElement(e,n))}}:function(e){return e}};hot.shouldWrapWithAppContainer=!1;var areComponentsEqual=function(e,n){return e===n},setConfig=function(){},cold=function(e){return e},configureComponent=function(){};exports.AppContainer=AppContainer,exports.hot=hot,exports.areComponentsEqual=areComponentsEqual,exports.setConfig=setConfig,exports.cold=cold,exports.configureComponent=configureComponent;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./dist/react-hot-loader.production.min.js');\n} else if (process.env.NODE_ENV === 'test') {\n module.exports = require('./dist/react-hot-loader.production.min.js');\n} else if (typeof window === 'undefined') {\n // this is just server environment\n module.exports = require('./dist/react-hot-loader.production.min.js');\n} else if (!module.hot) {\n module.exports = require('./dist/react-hot-loader.production.min.js');\n module.exports.AppContainer.warnAboutHMRDisabled = true;\n module.exports.hot.shouldWrapWithAppContainer = true;\n} else {\n var evalAllowed = false;\n var evalError = null;\n try {\n eval('evalAllowed = true');\n } catch (e) {\n // eval not allowed due to CSP\n evalError = e && e.message ? e.message : 'unknown reason';\n }\n\n // TODO: dont use eval to update methods. see #1273\n // RHL needs setPrototypeOf to operate Component inheritance, and eval to patch methods\n var jsFeaturesPresent = !!Object.setPrototypeOf;\n\n if (!jsFeaturesPresent || !evalAllowed) {\n // we are not in prod mode, but RHL could not be activated\n console.warn(\n 'React-Hot-Loader is not supported in this environment:',\n [\n !jsFeaturesPresent && \"some JS features are missing\",\n !evalAllowed && \"`eval` is not allowed(\" + evalError + \")\"\n ].join(','),\n '.'\n );\n module.exports = require('./dist/react-hot-loader.production.min.js');\n } else {\n module.exports = window.reactHotLoaderGlobal = require('./dist/react-hot-loader.development.js');\n }\n}\n","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","'use strict';\n\nmodule.exports = function ReactNativeFile(_ref) {\n var uri = _ref.uri,\n name = _ref.name,\n type = _ref.type;\n this.uri = uri;\n this.name = name;\n this.type = type;\n};\n","'use strict';\n\nvar ReactNativeFile = require('./ReactNativeFile');\n\nmodule.exports = function isExtractableFile(value) {\n return (\n (typeof File !== 'undefined' && value instanceof File) ||\n (typeof Blob !== 'undefined' && value instanceof Blob) ||\n value instanceof ReactNativeFile\n );\n};\n","'use strict';\n\nvar defaultIsExtractableFile = require('./isExtractableFile');\n\nmodule.exports = function extractFiles(value, path, isExtractableFile) {\n if (path === void 0) {\n path = '';\n }\n\n if (isExtractableFile === void 0) {\n isExtractableFile = defaultIsExtractableFile;\n }\n\n var clone;\n var files = new Map();\n\n function addFile(paths, file) {\n var storedPaths = files.get(file);\n if (storedPaths) storedPaths.push.apply(storedPaths, paths);\n else files.set(file, paths);\n }\n\n if (isExtractableFile(value)) {\n clone = null;\n addFile([path], value);\n } else {\n var prefix = path ? path + '.' : '';\n if (typeof FileList !== 'undefined' && value instanceof FileList)\n clone = Array.prototype.map.call(value, function (file, i) {\n addFile(['' + prefix + i], file);\n return null;\n });\n else if (Array.isArray(value))\n clone = value.map(function (child, i) {\n var result = extractFiles(child, '' + prefix + i, isExtractableFile);\n result.files.forEach(addFile);\n return result.clone;\n });\n else if (value && value.constructor === Object) {\n clone = {};\n\n for (var i in value) {\n var result = extractFiles(value[i], '' + prefix + i, isExtractableFile);\n result.files.forEach(addFile);\n clone[i] = result.clone;\n }\n } else clone = value;\n }\n\n return {\n clone: clone,\n files: files,\n };\n};\n","'use strict';\n\nmodule.exports = function formDataAppendFile(formData, fieldName, file) {\n formData.append(fieldName, file, file.name);\n};\n","'use strict';\n\nmodule.exports = require('extract-files/public/isExtractableFile');\n","'use strict';\n\nvar _extends = require('@babel/runtime/helpers/extends');\n\nvar _require = require('@apollo/client/core'),\n ApolloLink = _require.ApolloLink,\n Observable = _require.Observable;\n\nvar _require2 = require('@apollo/client/link/http'),\n createSignalIfSupported = _require2.createSignalIfSupported,\n fallbackHttpConfig = _require2.fallbackHttpConfig,\n parseAndCheckHttpResponse = _require2.parseAndCheckHttpResponse,\n rewriteURIForGET = _require2.rewriteURIForGET,\n selectHttpOptionsAndBody = _require2.selectHttpOptionsAndBody,\n selectURI = _require2.selectURI,\n serializeFetchParameter = _require2.serializeFetchParameter;\n\nvar extractFiles = require('extract-files/public/extractFiles');\n\nvar formDataAppendFile = require('./formDataAppendFile');\n\nvar isExtractableFile = require('./isExtractableFile');\n\nmodule.exports = function createUploadLink(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$uri = _ref.uri,\n fetchUri = _ref$uri === void 0 ? '/graphql' : _ref$uri,\n useGETForQueries = _ref.useGETForQueries,\n _ref$isExtractableFil = _ref.isExtractableFile,\n customIsExtractableFile =\n _ref$isExtractableFil === void 0\n ? isExtractableFile\n : _ref$isExtractableFil,\n CustomFormData = _ref.FormData,\n _ref$formDataAppendFi = _ref.formDataAppendFile,\n customFormDataAppendFile =\n _ref$formDataAppendFi === void 0\n ? formDataAppendFile\n : _ref$formDataAppendFi,\n customFetch = _ref.fetch,\n fetchOptions = _ref.fetchOptions,\n credentials = _ref.credentials,\n headers = _ref.headers,\n includeExtensions = _ref.includeExtensions;\n\n var linkConfig = {\n http: {\n includeExtensions: includeExtensions,\n },\n options: fetchOptions,\n credentials: credentials,\n headers: headers,\n };\n return new ApolloLink(function (operation) {\n var context = operation.getContext();\n var _context$clientAwaren = context.clientAwareness;\n _context$clientAwaren =\n _context$clientAwaren === void 0 ? {} : _context$clientAwaren;\n var name = _context$clientAwaren.name,\n version = _context$clientAwaren.version,\n headers = context.headers;\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: _extends(\n {},\n name && {\n 'apollographql-client-name': name,\n },\n version && {\n 'apollographql-client-version': version,\n },\n headers\n ),\n };\n\n var _selectHttpOptionsAnd = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig\n ),\n options = _selectHttpOptionsAnd.options,\n body = _selectHttpOptionsAnd.body;\n\n var _extractFiles = extractFiles(body, '', customIsExtractableFile),\n clone = _extractFiles.clone,\n files = _extractFiles.files;\n\n var uri = selectURI(operation, fetchUri);\n\n if (files.size) {\n delete options.headers['content-type'];\n var RuntimeFormData = CustomFormData || FormData;\n var form = new RuntimeFormData();\n form.append('operations', serializeFetchParameter(clone, 'Payload'));\n var map = {};\n var i = 0;\n files.forEach(function (paths) {\n map[++i] = paths;\n });\n form.append('map', JSON.stringify(map));\n i = 0;\n files.forEach(function (paths, file) {\n customFormDataAppendFile(form, ++i, file);\n });\n options.body = form;\n } else {\n if (\n useGETForQueries &&\n !operation.query.definitions.some(function (definition) {\n return (\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation'\n );\n })\n )\n options.method = 'GET';\n\n if (options.method === 'GET') {\n var _rewriteURIForGET = rewriteURIForGET(uri, body),\n newURI = _rewriteURIForGET.newURI,\n parseError = _rewriteURIForGET.parseError;\n\n if (parseError)\n return new Observable(function (observer) {\n observer.error(parseError);\n });\n uri = newURI;\n } else options.body = serializeFetchParameter(clone, 'Payload');\n }\n\n var _createSignalIfSuppor = createSignalIfSupported(),\n controller = _createSignalIfSuppor.controller;\n\n if (controller) {\n if (options.signal)\n options.signal.addEventListener('abort', function () {\n controller.abort();\n });\n options.signal = controller.signal;\n }\n\n var runtimeFetch = customFetch || fetch;\n return new Observable(function (observer) {\n var cleaningUp;\n runtimeFetch(uri, options)\n .then(function (response) {\n operation.setContext({\n response: response,\n });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n })\n .catch(function (error) {\n if (!cleaningUp) {\n if (error.result && error.result.errors && error.result.data)\n observer.next(error.result);\n observer.error(error);\n }\n });\n return function () {\n cleaningUp = true;\n if (controller) controller.abort();\n };\n });\n });\n};\n","'use strict';\n\nmodule.exports = require('extract-files/public/ReactNativeFile');\n","'use strict';\n\nexports.createUploadLink = require('./createUploadLink');\nexports.formDataAppendFile = require('./formDataAppendFile');\nexports.isExtractableFile = require('./isExtractableFile');\nexports.ReactNativeFile = require('./ReactNativeFile');\n","import * as React from 'react';\nimport { createContext, useContext } from 'react';\n\nexport interface Notify {\n notice: (title: string) => void;\n ok: (title: string) => void;\n error: (title: string, message?: string) => void;\n warning: (title: string, message?: string) => void;\n info: (title: string) => void;\n}\n\ninterface ProviderProps {\n notificationApi: Notify;\n children: React.ReactElement;\n}\n\nexport const NotifyContext = createContext(null);\nexport const useNotify = (): Notify => useContext(NotifyContext);\n\nexport function NotifyProvider({ children, notificationApi }: ProviderProps) {\n const error = (title: string, message = '') => notificationApi['error'](title, message);\n const warning = (title: string, message = '') => notificationApi['warning'](title, message);\n const ok = (title: string) => notificationApi['ok'](title);\n const info = (title: string) => notificationApi['info'](title);\n const notice = (title: string) => notificationApi['notice'](title);\n\n return {children};\n}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","import escapeStringRegexp from 'escape-string-regexp';\n\nconst regexpCache = new Map();\n\nconst sanitizeArray = (input, inputName) => {\n\tif (!Array.isArray(input)) {\n\t\tswitch (typeof input) {\n\t\t\tcase 'string':\n\t\t\t\tinput = [input];\n\t\t\t\tbreak;\n\t\t\tcase 'undefined':\n\t\t\t\tinput = [];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new TypeError(`Expected '${inputName}' to be a string or an array, but got a type of '${typeof input}'`);\n\t\t}\n\t}\n\n\treturn input.filter(string => {\n\t\tif (typeof string !== 'string') {\n\t\t\tif (typeof string === 'undefined') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthrow new TypeError(`Expected '${inputName}' to be an array of strings, but found a type of '${typeof string}' in the array`);\n\t\t}\n\n\t\treturn true;\n\t});\n};\n\nconst makeRegexp = (pattern, options) => {\n\toptions = {\n\t\tcaseSensitive: false,\n\t\t...options,\n\t};\n\n\tconst cacheKey = pattern + JSON.stringify(options);\n\n\tif (regexpCache.has(cacheKey)) {\n\t\treturn regexpCache.get(cacheKey);\n\t}\n\n\tconst negated = pattern[0] === '!';\n\n\tif (negated) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tpattern = escapeStringRegexp(pattern).replace(/\\\\\\*/g, '[\\\\s\\\\S]*');\n\n\tconst regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i');\n\tregexp.negated = negated;\n\tregexpCache.set(cacheKey, regexp);\n\n\treturn regexp;\n};\n\nconst baseMatcher = (inputs, patterns, options, firstMatchOnly) => {\n\tinputs = sanitizeArray(inputs, 'inputs');\n\tpatterns = sanitizeArray(patterns, 'patterns');\n\n\tif (patterns.length === 0) {\n\t\treturn [];\n\t}\n\n\tpatterns = patterns.map(pattern => makeRegexp(pattern, options));\n\n\tconst {allPatterns} = options || {};\n\tconst result = [];\n\n\tfor (const input of inputs) {\n\t\t// String is included only if it matches at least one non-negated pattern supplied.\n\t\t// Note: the `allPatterns` option requires every non-negated pattern to be matched once.\n\t\t// Matching a negated pattern excludes the string.\n\t\tlet matches;\n\t\tconst didFit = [...patterns].fill(false);\n\n\t\tfor (const [index, pattern] of patterns.entries()) {\n\t\t\tif (pattern.test(input)) {\n\t\t\t\tdidFit[index] = true;\n\t\t\t\tmatches = !pattern.negated;\n\n\t\t\t\tif (!matches) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!(\n\t\t\t\tmatches === false\n\t\t\t\t|| (matches === undefined && patterns.some(pattern => !pattern.negated))\n\t\t\t\t|| (allPatterns && didFit.some((yes, index) => !yes && !patterns[index].negated))\n\t\t\t)\n\t\t) {\n\t\t\tresult.push(input);\n\n\t\t\tif (firstMatchOnly) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n};\n\nexport function matcher(inputs, patterns, options) {\n\treturn baseMatcher(inputs, patterns, options, false);\n}\n\nexport function isMatch(inputs, patterns, options) {\n\treturn baseMatcher(inputs, patterns, options, true).length > 0;\n}\n","import { gql } from '@apollo/client';\n\nexport const ASSET_SOURCE_FRAGMENT = gql`\n fragment AssetSourceProps on AssetSource {\n label\n id\n description\n iconUri\n readOnly\n supportsTagging\n supportsCollections\n }\n`;\n","import { gql } from '@apollo/client';\n\nexport const IPTC_PROPERTY_FRAGMENT = gql`\n fragment IptcPropertyProps on IptcProperty {\n propertyName\n value\n }\n`;\n","import { gql } from '@apollo/client';\n\nexport const FILE_FRAGMENT = gql`\n fragment FileProps on File {\n extension\n mediaType\n typeIcon {\n url\n alt\n }\n size\n url\n }\n`;\n","import { gql } from '@apollo/client';\n\nexport const TAG_FRAGMENT = gql`\n fragment TagProps on Tag {\n id\n label\n }\n`;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_SOURCE_FRAGMENT } from './assetSource';\nimport { IPTC_PROPERTY_FRAGMENT } from './iptcProperty';\nimport { FILE_FRAGMENT } from './file';\nimport { TAG_FRAGMENT } from './tag';\n\n// TODO: Somehow extend `isInClipboard` from clipboard feature package\n\nexport const ASSET_FRAGMENT = gql`\n fragment AssetProps on Asset {\n id\n localId\n assetSource {\n ...AssetSourceProps\n }\n imported\n label\n caption\n filename\n tags {\n ...TagProps\n }\n collections {\n id\n title\n }\n copyrightNotice\n lastModified\n iptcProperties {\n ...IptcPropertyProps\n }\n width\n height\n file {\n ...FileProps\n }\n thumbnailUrl\n previewUrl\n isInClipboard @client\n isInUse @include(if: $includeUsage)\n }\n ${ASSET_SOURCE_FRAGMENT}\n ${IPTC_PROPERTY_FRAGMENT}\n ${FILE_FRAGMENT}\n ${TAG_FRAGMENT}\n`;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\nconst ASSET = gql`\n query ASSET($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: \"includeUsage\")\n asset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ${ASSET_FRAGMENT}\n`;\n\nexport default ASSET;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\nconst ASSETS = gql`\n query ASSETS(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n $limit: Int\n $offset: Int\n $sortBy: SortBy\n $sortDirection: SortDirection\n $includeUsage: Boolean = false\n ) {\n selectedAssetSourceId @client(always: true) @export(as: \"assetSourceId\")\n includeUsage @client(always: true) @export(as: \"includeUsage\")\n assets(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n limit: $limit\n offset: $offset\n sortBy: $sortBy\n sortDirection: $sortDirection\n ) {\n ...AssetProps\n }\n }\n ${ASSET_FRAGMENT}\n`;\n\nexport default ASSETS;\n","import { gql } from '@apollo/client';\nimport { TAG_FRAGMENT } from './tag';\n\nexport const ASSET_COLLECTION_FRAGMENT = gql`\n fragment AssetCollectionProps on AssetCollection {\n id\n title\n tags {\n ...TagProps\n }\n }\n ${TAG_FRAGMENT}\n`;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_COLLECTION_FRAGMENT } from '../fragments/assetCollection';\n\nconst ASSET_COLLECTION = gql`\n query ASSET_COLLECTION($id: AssetCollectionId!) {\n assetCollection(id: $id) {\n ...AssetCollectionProps\n }\n }\n ${ASSET_COLLECTION_FRAGMENT}\n`;\n\nexport default ASSET_COLLECTION;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_COLLECTION_FRAGMENT } from '../fragments/assetCollection';\n\nconst ASSET_COLLECTIONS = gql`\n query ASSET_COLLECTIONS {\n assetCollections {\n ...AssetCollectionProps\n }\n }\n ${ASSET_COLLECTION_FRAGMENT}\n`;\n\nexport default ASSET_COLLECTIONS;\n","import { gql } from '@apollo/client';\n\nconst ASSET_COUNT = gql`\n query ASSET_COUNT(\n $searchTerm: String\n $assetSourceId: AssetSourceId\n $assetCollectionId: AssetCollectionId\n $mediaType: MediaType\n $tagId: TagId\n ) {\n selectedAssetSourceId @client(always: true) @export(as: \"assetSourceId\")\n assetCount(\n searchTerm: $searchTerm\n assetSourceId: $assetSourceId\n assetCollectionId: $assetCollectionId\n mediaType: $mediaType\n tagId: $tagId\n )\n }\n`;\n\nexport default ASSET_COUNT;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_SOURCE_FRAGMENT } from '../fragments/assetSource';\n\nconst ASSET_SOURCES = gql`\n query ASSET_SOURCES {\n assetSources {\n ...AssetSourceProps\n }\n }\n ${ASSET_SOURCE_FRAGMENT}\n`;\n\nexport default ASSET_SOURCES;\n","import { gql } from '@apollo/client';\n\nconst CONFIG = gql`\n query CONFIG {\n config {\n uploadMaxFileSize\n uploadMaxFileUploadLimit\n currentServerTime\n }\n }\n`;\n\nexport default CONFIG;\n","import { gql } from '@apollo/client';\n\nimport { TAG_FRAGMENT } from '../fragments/tag';\n\nconst TAG = gql`\n query TAG($id: TagId!) {\n tag(id: $id) {\n ...TagProps\n }\n }\n ${TAG_FRAGMENT}\n`;\n\nexport default TAG;\n","import { gql } from '@apollo/client';\n\nimport { TAG_FRAGMENT } from '../fragments/tag';\n\nconst TAGS = gql`\n query TAGS {\n tags {\n ...TagProps\n }\n }\n ${TAG_FRAGMENT}\n`;\n\nexport default TAGS;\n","import { gql } from '@apollo/client';\n\nexport const SELECTED_ASSET_SOURCE_ID = gql`\n query SelectedAssetSourceId {\n selectedAssetSourceId @client(always: true)\n }\n`;\n\nexport const SET_SELECTED_ASSET_SOURCE_ID = gql`\n mutation SetSelectedAssetSourceId($selectedAssetSourceId: String) {\n setSelectedAssetSourceId(selectedAssetSourceId: $selectedAssetSourceId) @client\n }\n`;\n","import ASSET from './asset';\nimport ASSETS from './assets';\nimport ASSET_COLLECTION from './assetCollection';\nimport ASSET_COLLECTIONS from './assetCollections';\nimport ASSET_COUNT from './assetCount';\nimport ASSET_SOURCES from './assetSources';\nimport CONFIG from './config';\nimport TAG from './tag';\nimport TAGS from './tags';\nimport { SELECTED_ASSET_SOURCE_ID, SET_SELECTED_ASSET_SOURCE_ID } from './selectedAssetSource';\n\nexport {\n ASSET,\n ASSETS,\n ASSET_COLLECTION,\n ASSET_COLLECTIONS,\n ASSET_COUNT,\n ASSET_SOURCES,\n CONFIG,\n SELECTED_ASSET_SOURCE_ID,\n SET_SELECTED_ASSET_SOURCE_ID,\n TAG,\n TAGS,\n};\n","import { useQuery } from '@apollo/client';\n\nimport { AssetCollection } from '../interfaces';\nimport { ASSET_COLLECTIONS } from '../queries';\n\ninterface AssetCollectionsQueryResult {\n assetCollections: AssetCollection[];\n}\n\nexport default function useAssetCollectionsQuery() {\n const { data, loading } = useQuery(ASSET_COLLECTIONS);\n return { assetCollections: data?.assetCollections || [], loading };\n}\n","import { atom } from 'recoil';\n\nconst currentPageState = atom({\n key: 'currentPageState',\n default: 1,\n});\n\nexport default currentPageState;\n","import { atom } from 'recoil';\n\nconst initialLoadCompleteState = atom({\n key: 'initialLoadComplete',\n default: false,\n});\n\nexport default initialLoadCompleteState;\n","import { atom } from 'recoil';\n\nconst loadingState = atom({\n key: 'loadingState',\n default: false,\n});\n\nexport default loadingState;\n","import { atom } from 'recoil';\n\nconst searchTermState = atom({\n key: 'searchTermState',\n default: '',\n});\n\nexport default searchTermState;\n","import { atom } from 'recoil';\n\nconst selectedAssetCollectionIdState = atom({\n key: 'selectedAssetCollectionIdState',\n default: null,\n});\n\nexport default selectedAssetCollectionIdState;\n","import { atom } from 'recoil';\n\nimport AssetIdentity from '../interfaces/AssetIdentity';\n\nconst selectedAssetIdState = atom({\n key: 'selectedAssetIdState',\n default: null,\n});\n\nexport default selectedAssetIdState;\n","import { atom } from 'recoil';\n\nconst selectedInspectorViewState = atom({\n key: 'selectedInspectorViewState',\n default: null,\n});\n\nexport default selectedInspectorViewState;\n","import { atom } from 'recoil';\n\nexport type AssetMediaType = 'image' | 'video' | 'audio' | 'document' | 'all';\n\nconst selectedMediaTypeState = atom({\n key: 'selectedMediaTypeState',\n default: 'all',\n});\n\nexport default selectedMediaTypeState;\n","import { atom } from 'recoil';\n\nexport enum SORT_BY {\n Name = 'name',\n LastModified = 'lastModified',\n}\nexport enum SORT_DIRECTION {\n Asc = 'ASC',\n Desc = 'DESC',\n}\n\nexport interface SortOrder {\n sortBy: SORT_BY;\n sortDirection: SORT_DIRECTION;\n}\nconst selectedSortOrderState = atom({\n key: 'selectedSortOrderState',\n default: {\n sortBy: SORT_BY.LastModified,\n sortDirection: SORT_DIRECTION.Desc,\n },\n});\n\nexport default selectedSortOrderState;\n","import { atom } from 'recoil';\n\nconst selectedTagIdState = atom({\n key: 'selectedTagIdState',\n default: null,\n});\n\nexport default selectedTagIdState;\n","import currentPageState from './currentPageState';\nimport initialLoadCompleteState from './initialLoadComplete';\nimport loadingState from './loadingState';\nimport searchTermState from './searchTermState';\nimport selectedAssetCollectionIdState from './selectedAssetCollectionIdState';\nimport selectedAssetIdState from './selectedAssetIdState';\nimport selectedInspectorViewState from './selectedInspectorViewState';\nimport selectedMediaTypeState from './selectedMediaTypeState';\nimport selectedSortOrderState from './selectedSortOrderState';\nimport selectedTagIdState from './selectedTagIdState';\n\nexport {\n currentPageState,\n initialLoadCompleteState,\n loadingState,\n searchTermState,\n selectedAssetCollectionIdState,\n selectedAssetIdState,\n selectedInspectorViewState,\n selectedMediaTypeState,\n selectedSortOrderState,\n selectedTagIdState,\n};\n","import { useRecoilValue } from 'recoil';\nimport { useQuery } from '@apollo/client';\n\nimport { Tag } from '../interfaces';\nimport { selectedTagIdState } from '../state';\nimport { TAG } from '../queries';\n\ninterface TagQueryResult {\n tag: Tag;\n}\n\nconst useSelectedTag = (): Tag => {\n const selectedTagId = useRecoilValue(selectedTagIdState);\n\n const { data } = useQuery(TAG, {\n variables: { id: selectedTagId },\n skip: !selectedTagId,\n });\n\n return data?.tag || null;\n};\n\nexport default useSelectedTag;\n","import { useRecoilValue } from 'recoil';\nimport { useQuery } from '@apollo/client';\n\nimport { AssetCollection } from '../interfaces';\nimport { selectedAssetCollectionIdState } from '../state';\nimport { ASSET_COLLECTION } from '../queries';\n\ninterface AssetCollectionQueryResult {\n assetCollection: AssetCollection;\n}\n\nconst useSelectedAssetCollection = (): AssetCollection => {\n const selectedAssetCollectionId = useRecoilValue(selectedAssetCollectionIdState);\n\n const { data } = useQuery(ASSET_COLLECTION, {\n variables: { id: selectedAssetCollectionId },\n skip: !selectedAssetCollectionId,\n });\n\n return data?.assetCollection || null;\n};\n\nexport default useSelectedAssetCollection;\n","import { useQuery } from '@apollo/client';\nimport { useRecoilValue } from 'recoil';\n\nimport { ASSET_COUNT } from '../queries';\nimport useSelectedTag from './useSelectedTag';\nimport useSelectedAssetCollection from './useSelectedAssetCollection';\nimport { searchTermState } from '../state';\n\ninterface AssetCountQueryResult {\n assetCount: number;\n}\n\ninterface AssetCountVariables {\n assetCollectionId?: string;\n tagId?: string;\n mediaType?: string;\n searchTerm?: string;\n}\n\nexport default function useAssetCountQuery() {\n const searchTerm = useRecoilValue(searchTermState);\n const selectedTag = useSelectedTag();\n const selectedAssetCollection = useSelectedAssetCollection();\n const { data, loading } = useQuery(ASSET_COUNT, {\n variables: {\n assetCollectionId: selectedAssetCollection?.id,\n tagId: selectedTag?.id,\n searchTerm: searchTerm,\n },\n });\n return { assetCount: data?.assetCount || 0, loading };\n}\n","import { useQuery } from '@apollo/client';\n\nimport { Asset, AssetIdentity } from '../interfaces';\nimport { ASSET } from '../queries';\n\ninterface AssetQueryResult {\n asset: Asset;\n}\n\nexport default function useAssetQuery(assetIdentity?: AssetIdentity) {\n const { data, loading, refetch } = useQuery(ASSET, {\n variables: { id: assetIdentity?.assetId, assetSourceId: assetIdentity?.assetSourceId },\n skip: !assetIdentity,\n });\n return { asset: data?.asset || null, loading, refetch };\n}\n","import { useMemo } from 'react';\nimport { useQuery } from '@apollo/client';\n\nimport { ASSET_SOURCES } from '../queries';\nimport { AssetSource } from '../interfaces';\nimport { useMediaUi } from '../provider';\n\ninterface AssetSourcesQueryResult {\n assetSources: AssetSource[];\n}\n\nexport default function useAssetSourcesQuery() {\n const { constraints } = useMediaUi();\n const { data, loading } = useQuery(ASSET_SOURCES);\n\n // Filter out sources that don't match the constraints\n const assetSources = useMemo(() => {\n const assetSources = data?.assetSources || [];\n return constraints.assetSources\n ? assetSources.filter((source) => {\n return constraints.assetSources.includes(source.id);\n })\n : assetSources;\n }, [data?.assetSources, constraints.assetSources]);\n\n // TODO: Handle error if no asset sources are available\n\n return { assetSources, loading };\n}\n","// TODO: Make configurable via Settings\nexport const ASSETS_PER_PAGE = 20;\nexport const PAGINATION_MAXIMUM_LINKS = 5;\n","import { useEffect, useState } from 'react';\nimport { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';\nimport { useLazyQuery } from '@apollo/client';\n\nimport useSelectedAssetCollection from './useSelectedAssetCollection';\nimport useSelectedTag from './useSelectedTag';\nimport { ASSETS_PER_PAGE } from '../constants/pagination';\nimport { Asset, AssetCollection, AssetSource, Tag } from '../interfaces';\nimport {\n searchTermState,\n selectedMediaTypeState,\n loadingState,\n currentPageState,\n initialLoadCompleteState,\n selectedSortOrderState,\n} from '../state';\nimport { ASSETS } from '../queries';\nimport { SORT_BY, SORT_DIRECTION } from '../state/selectedSortOrderState';\ninterface AssetsQueryResult {\n assets: Asset[];\n assetCollections: AssetCollection[];\n assetSources: AssetSource[];\n assetCount: number;\n tags: Tag[];\n}\n\ninterface AssetsQueryVariables {\n searchTerm: string;\n assetCollectionId: string;\n mediaType: string;\n tagId: string;\n limit: number;\n offset: number;\n sortBy: SORT_BY;\n sortDirection: SORT_DIRECTION;\n}\n\nconst useAssetsQuery = () => {\n const searchTerm = useRecoilValue(searchTermState);\n const selectedAssetCollection = useSelectedAssetCollection();\n const selectedTag = useSelectedTag();\n const mediaTypeFilter = useRecoilValue(selectedMediaTypeState);\n const sortOrderState = useRecoilValue(selectedSortOrderState);\n const currentPage = useRecoilValue(currentPageState);\n const [isLoading, setIsLoading] = useRecoilState(loadingState);\n const setInitialLoadComplete = useSetRecoilState(initialLoadCompleteState);\n const [assets, setAssets] = useState([]);\n\n const limit = ASSETS_PER_PAGE;\n const offset = (currentPage - 1) * ASSETS_PER_PAGE;\n\n const [query, { loading, error, data, refetch }] = useLazyQuery(ASSETS, {\n notifyOnNetworkStatusChange: false,\n variables: {\n searchTerm,\n assetCollectionId: selectedAssetCollection?.id,\n mediaType: mediaTypeFilter,\n tagId: selectedTag?.id,\n limit,\n offset,\n sortBy: sortOrderState.sortBy,\n sortDirection: sortOrderState.sortDirection,\n },\n });\n\n useEffect(() => {\n if (!loading && !isLoading) {\n query({\n variables: {\n searchTerm,\n assetCollectionId: selectedAssetCollection?.id,\n mediaType: mediaTypeFilter,\n tagId: selectedTag?.id,\n limit,\n offset,\n sortBy: sortOrderState.sortBy,\n sortDirection: sortOrderState.sortDirection,\n },\n });\n setIsLoading(true);\n } else if (data && !loading && isLoading) {\n setIsLoading(false);\n setInitialLoadComplete(true);\n setAssets(data.assets);\n // TODO: Update currentPage if asset count changes and current page exceeds limit\n }\n // Don't include `isLoading` to prevent constant reloads\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n query,\n data,\n loading,\n offset,\n limit,\n searchTerm,\n selectedAssetCollection?.title,\n mediaTypeFilter,\n selectedTag?.id,\n sortOrderState,\n ]);\n\n return { error, assets, refetch };\n};\n\nexport default useAssetsQuery;\n","import { useQuery } from '@apollo/client';\nimport { CONFIG } from '../queries';\n\ninterface ConfigQueryResult {\n config: {\n uploadMaxFileSize: number;\n uploadMaxFileUploadLimit: number;\n currentServerTime: Date;\n };\n}\n\nconst useConfigQuery = () => {\n const { data, loading } = useQuery(CONFIG);\n return { config: data?.config, loading };\n};\n\nexport default useConfigQuery;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_COLLECTION_FRAGMENT } from '../fragments/assetCollection';\n\nconst CREATE_ASSET_COLLECTION = gql`\n mutation CreateAssetCollection($title: String!) {\n createAssetCollection(title: $title) {\n ...AssetCollectionProps\n }\n }\n ${ASSET_COLLECTION_FRAGMENT}\n`;\n\nexport default CREATE_ASSET_COLLECTION;\n","import { gql } from '@apollo/client';\n\nimport { TAG_FRAGMENT } from '../fragments/tag';\n\nconst CREATE_TAG = gql`\n mutation CreateTag($label: TagLabel!, $assetCollectionId: AssetCollectionId) {\n createTag(label: $label, assetCollectionId: $assetCollectionId) {\n ...TagProps\n }\n }\n ${TAG_FRAGMENT}\n`;\n\nexport default CREATE_TAG;\n","import { gql } from '@apollo/client';\n\nconst DELETE_ASSET = gql`\n mutation DeleteAsset($id: AssetId!, $assetSourceId: AssetSourceId!) {\n deleteAsset(id: $id, assetSourceId: $assetSourceId)\n }\n`;\n\nexport default DELETE_ASSET;\n","import { gql } from '@apollo/client';\n\nconst DELETE_ASSET_COLLECTION = gql`\n mutation DeleteAssetCollection($id: AssetCollectionId!) {\n deleteAssetCollection(id: $id) {\n success\n }\n }\n`;\n\nexport default DELETE_ASSET_COLLECTION;\n","import { gql } from '@apollo/client';\n\nconst DELETE_TAG = gql`\n mutation DeleteTag($id: TagId!) {\n deleteTag(id: $id)\n }\n`;\n\nexport default DELETE_TAG;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\nconst IMPORT_ASSET = gql`\n mutation ImportAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: \"includeUsage\")\n importAsset(id: $id, assetSourceId: $assetSourceId) {\n ...AssetProps\n }\n }\n ${ASSET_FRAGMENT}\n`;\n\nexport default IMPORT_ASSET;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\nconst SET_ASSET_COLLECTIONS = gql`\n mutation SetAssetCollections(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $assetCollectionIds: [AssetCollectionId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: \"includeUsage\")\n setAssetCollections(id: $id, assetSourceId: $assetSourceId, assetCollectionIds: $assetCollectionIds) {\n ...AssetProps\n }\n }\n ${ASSET_FRAGMENT}\n`;\n\nexport default SET_ASSET_COLLECTIONS;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\nconst SET_ASSET_TAGS = gql`\n mutation SetAssetTags(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $tagIds: [TagId!]!\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: \"includeUsage\")\n setAssetTags(id: $id, assetSourceId: $assetSourceId, tagIds: $tagIds) {\n ...AssetProps\n }\n }\n ${ASSET_FRAGMENT}\n`;\n\nexport default SET_ASSET_TAGS;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\nconst TAG_ASSET = gql`\n mutation TagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: \"includeUsage\")\n tagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ${ASSET_FRAGMENT}\n`;\n\nexport default TAG_ASSET;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\nconst UNTAG_ASSET = gql`\n mutation UntagAsset($id: AssetId!, $assetSourceId: AssetSourceId!, $tagId: TagId!, $includeUsage: Boolean = false) {\n includeUsage @client(always: true) @export(as: \"includeUsage\")\n untagAsset(id: $id, assetSourceId: $assetSourceId, tagId: $tagId) {\n ...AssetProps\n }\n }\n ${ASSET_FRAGMENT}\n`;\n\nexport default UNTAG_ASSET;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\nconst UPDATE_ASSET = gql`\n mutation UpdateAsset(\n $id: AssetId!\n $assetSourceId: AssetSourceId!\n $label: String\n $caption: String\n $copyrightNotice: String\n $includeUsage: Boolean = false\n ) {\n includeUsage @client(always: true) @export(as: \"includeUsage\")\n updateAsset(\n id: $id\n assetSourceId: $assetSourceId\n label: $label\n caption: $caption\n copyrightNotice: $copyrightNotice\n ) {\n ...AssetProps\n }\n }\n ${ASSET_FRAGMENT}\n`;\n\nexport default UPDATE_ASSET;\n","import { gql } from '@apollo/client';\n\nimport { ASSET_COLLECTION_FRAGMENT } from '../fragments/assetCollection';\n\nconst UPDATE_ASSET_COLLECTION = gql`\n mutation UpdateAssetCollection($id: AssetCollectionId!, $title: String, $tagIds: [TagId]) {\n updateAssetCollection(id: $id, title: $title, tagIds: $tagIds) {\n ...AssetCollectionProps\n }\n }\n ${ASSET_COLLECTION_FRAGMENT}\n`;\n\nexport default UPDATE_ASSET_COLLECTION;\n","import { gql } from '@apollo/client';\n\nimport { TAG_FRAGMENT } from '../fragments/tag';\n\nconst UPDATE_TAG = gql`\n mutation UpdateTag($id: TagId!, $label: String) {\n updateTag(id: $id, label: $label) {\n ...TagProps\n }\n }\n ${TAG_FRAGMENT}\n`;\n\nexport default UPDATE_TAG;\n","import CREATE_ASSET_COLLECTION from './createAssetCollection';\nimport CREATE_TAG from './createTag';\nimport DELETE_ASSET from './deleteAsset';\nimport DELETE_ASSET_COLLECTION from './deleteAssetCollection';\nimport DELETE_TAG from './deleteTag';\nimport IMPORT_ASSET from './importAsset';\nimport SET_ASSET_COLLECTIONS from './setAssetCollections';\nimport SET_ASSET_TAGS from './setAssetTags';\nimport TAG_ASSET from './tagAsset';\nimport UNTAG_ASSET from './untagAsset';\nimport UPDATE_ASSET from './updateAsset';\nimport UPDATE_ASSET_COLLECTION from './updateAssetCollection';\nimport UPDATE_TAG from './updateTag';\n\nexport {\n CREATE_ASSET_COLLECTION,\n CREATE_TAG,\n DELETE_ASSET,\n DELETE_ASSET_COLLECTION,\n DELETE_TAG,\n IMPORT_ASSET,\n SET_ASSET_COLLECTIONS,\n SET_ASSET_TAGS,\n TAG_ASSET,\n UNTAG_ASSET,\n UPDATE_ASSET,\n UPDATE_ASSET_COLLECTION,\n UPDATE_TAG,\n};\n","import { useMutation } from '@apollo/client';\n\nimport { ASSET_COLLECTIONS } from '../queries';\nimport { AssetCollection } from '../interfaces';\nimport { CREATE_ASSET_COLLECTION } from '../mutations';\n\ninterface CreateAssetCollectionVariables {\n title: string;\n}\n\nexport default function useCreateAssetCollection() {\n const [action, { error, data, loading }] = useMutation<\n { createAssetCollection: AssetCollection },\n CreateAssetCollectionVariables\n >(CREATE_ASSET_COLLECTION);\n\n const createAssetCollection = (title: string) =>\n action({\n variables: {\n title,\n },\n update(cache, { data }) {\n const { assetCollections } = cache.readQuery({ query: ASSET_COLLECTIONS });\n cache.writeQuery({\n query: ASSET_COLLECTIONS,\n data: { assetCollections: assetCollections.concat([data?.createAssetCollection]) },\n });\n },\n });\n\n return { createAssetCollection, data, error, loading };\n}\n","import { useMutation } from '@apollo/client';\n\nimport { Tag } from '../interfaces';\nimport { ASSET_COLLECTIONS, TAGS } from '../queries';\nimport { CREATE_TAG } from '../mutations';\n\ninterface CreateTagVariables {\n label: string;\n assetCollectionId?: string;\n}\n\nexport default function useCreateTag() {\n const [action, { error, data }] = useMutation<{ __typename: string; createTag: Tag }, CreateTagVariables>(\n CREATE_TAG\n );\n\n const createTag = (label: string, assetCollectionId?: string) =>\n action({\n variables: { label, assetCollectionId },\n // FIXME: Optimistic response has to be adjusted as we don't know the id of the created tag\n // optimisticResponse: {\n // __typename: 'Mutation',\n // createTag: {\n // __typename: 'Tag',\n // label: label,\n // }\n // },\n update: (proxy, { data: { createTag: newTag } }) => {\n const { assetCollections } = proxy.readQuery({ query: ASSET_COLLECTIONS });\n const updatedAssetCollections = assetCollections.map((assetCollection) => {\n if (assetCollection.id === assetCollectionId) {\n return { ...assetCollection, tags: [...assetCollection.tags, newTag] };\n }\n return assetCollection;\n });\n proxy.writeQuery({\n query: ASSET_COLLECTIONS,\n data: { assetCollections: updatedAssetCollections },\n });\n\n const { tags } = proxy.readQuery({ query: TAGS });\n if (!tags.find((tag) => tag?.label === newTag?.label)) {\n proxy.writeQuery({\n query: TAGS,\n data: {\n tags: [...tags, newTag],\n },\n });\n }\n },\n });\n\n return { createTag, data, error };\n}\n","/**\n * Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk\n * License: MIT - http://mrgnrdrck.mit-license.org\n *\n * https://github.com/mroderick/PubSubJS\n */\n\n(function (root, factory){\n 'use strict';\n\n var PubSub = {};\n root.PubSub = PubSub;\n factory(PubSub);\n // CommonJS and Node.js module support\n if (typeof exports === 'object'){\n if (module !== undefined && module.exports) {\n exports = module.exports = PubSub; // Node.js specific `module.exports`\n }\n exports.PubSub = PubSub; // CommonJS module 1.1.1 spec\n module.exports = exports = PubSub; // CommonJS\n }\n // AMD support\n /* eslint-disable no-undef */\n else if (typeof define === 'function' && define.amd){\n define(function() { return PubSub; });\n /* eslint-enable no-undef */\n }\n\n}(( typeof window === 'object' && window ) || this, function (PubSub){\n 'use strict';\n\n var messages = {},\n lastUid = -1,\n ALL_SUBSCRIBING_MSG = '*';\n\n function hasKeys(obj){\n var key;\n\n for (key in obj){\n if ( Object.prototype.hasOwnProperty.call(obj, key) ){\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns a function that throws the passed exception, for use as argument for setTimeout\n * @alias throwException\n * @function\n * @param { Object } ex An Error object\n */\n function throwException( ex ){\n return function reThrowException(){\n throw ex;\n };\n }\n\n function callSubscriberWithDelayedExceptions( subscriber, message, data ){\n try {\n subscriber( message, data );\n } catch( ex ){\n setTimeout( throwException( ex ), 0);\n }\n }\n\n function callSubscriberWithImmediateExceptions( subscriber, message, data ){\n subscriber( message, data );\n }\n\n function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){\n var subscribers = messages[matchedMessage],\n callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions,\n s;\n\n if ( !Object.prototype.hasOwnProperty.call( messages, matchedMessage ) ) {\n return;\n }\n\n for (s in subscribers){\n if ( Object.prototype.hasOwnProperty.call(subscribers, s)){\n callSubscriber( subscribers[s], originalMessage, data );\n }\n }\n }\n\n function createDeliveryFunction( message, data, immediateExceptions ){\n return function deliverNamespaced(){\n var topic = String( message ),\n position = topic.lastIndexOf( '.' );\n\n // deliver the message as it is now\n deliverMessage(message, message, data, immediateExceptions);\n\n // trim the hierarchy and deliver message to each level\n while( position !== -1 ){\n topic = topic.substr( 0, position );\n position = topic.lastIndexOf('.');\n deliverMessage( message, topic, data, immediateExceptions );\n }\n\n deliverMessage(message, ALL_SUBSCRIBING_MSG, data, immediateExceptions);\n };\n }\n\n function hasDirectSubscribersFor( message ) {\n var topic = String( message ),\n found = Boolean(Object.prototype.hasOwnProperty.call( messages, topic ) && hasKeys(messages[topic]));\n\n return found;\n }\n\n function messageHasSubscribers( message ){\n var topic = String( message ),\n found = hasDirectSubscribersFor(topic) || hasDirectSubscribersFor(ALL_SUBSCRIBING_MSG),\n position = topic.lastIndexOf( '.' );\n\n while ( !found && position !== -1 ){\n topic = topic.substr( 0, position );\n position = topic.lastIndexOf( '.' );\n found = hasDirectSubscribersFor(topic);\n }\n\n return found;\n }\n\n function publish( message, data, sync, immediateExceptions ){\n message = (typeof message === 'symbol') ? message.toString() : message;\n\n var deliver = createDeliveryFunction( message, data, immediateExceptions ),\n hasSubscribers = messageHasSubscribers( message );\n\n if ( !hasSubscribers ){\n return false;\n }\n\n if ( sync === true ){\n deliver();\n } else {\n setTimeout( deliver, 0 );\n }\n return true;\n }\n\n /**\n * Publishes the message, passing the data to it's subscribers\n * @function\n * @alias publish\n * @param { String } message The message to publish\n * @param {} data The data to pass to subscribers\n * @return { Boolean }\n */\n PubSub.publish = function( message, data ){\n return publish( message, data, false, PubSub.immediateExceptions );\n };\n\n /**\n * Publishes the message synchronously, passing the data to it's subscribers\n * @function\n * @alias publishSync\n * @param { String } message The message to publish\n * @param {} data The data to pass to subscribers\n * @return { Boolean }\n */\n PubSub.publishSync = function( message, data ){\n return publish( message, data, true, PubSub.immediateExceptions );\n };\n\n /**\n * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if you need to unsubscribe\n * @function\n * @alias subscribe\n * @param { String } message The message to subscribe to\n * @param { Function } func The function to call when a new message is published\n * @return { String }\n */\n PubSub.subscribe = function( message, func ){\n if ( typeof func !== 'function'){\n return false;\n }\n\n message = (typeof message === 'symbol') ? message.toString() : message;\n\n // message is not registered yet\n if ( !Object.prototype.hasOwnProperty.call( messages, message ) ){\n messages[message] = {};\n }\n\n // forcing token as String, to allow for future expansions without breaking usage\n // and allow for easy use as key names for the 'messages' object\n var token = 'uid_' + String(++lastUid);\n messages[message][token] = func;\n\n // return token for unsubscribing\n return token;\n };\n\n PubSub.subscribeAll = function( func ){\n return PubSub.subscribe(ALL_SUBSCRIBING_MSG, func);\n };\n\n /**\n * Subscribes the passed function to the passed message once\n * @function\n * @alias subscribeOnce\n * @param { String } message The message to subscribe to\n * @param { Function } func The function to call when a new message is published\n * @return { PubSub }\n */\n PubSub.subscribeOnce = function( message, func ){\n var token = PubSub.subscribe( message, function(){\n // before func apply, unsubscribe message\n PubSub.unsubscribe( token );\n func.apply( this, arguments );\n });\n return PubSub;\n };\n\n /**\n * Clears all subscriptions\n * @function\n * @public\n * @alias clearAllSubscriptions\n */\n PubSub.clearAllSubscriptions = function clearAllSubscriptions(){\n messages = {};\n };\n\n /**\n * Clear subscriptions by the topic\n * @function\n * @public\n * @alias clearAllSubscriptions\n * @return { int }\n */\n PubSub.clearSubscriptions = function clearSubscriptions(topic){\n var m;\n for (m in messages){\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){\n delete messages[m];\n }\n }\n };\n\n /**\n Count subscriptions by the topic\n * @function\n * @public\n * @alias countSubscriptions\n * @return { Array }\n */\n PubSub.countSubscriptions = function countSubscriptions(topic){\n var m;\n // eslint-disable-next-line no-unused-vars\n var token;\n var count = 0;\n for (m in messages) {\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0) {\n for (token in messages[m]) {\n count++;\n }\n break;\n }\n }\n return count;\n };\n\n\n /**\n Gets subscriptions by the topic\n * @function\n * @public\n * @alias getSubscriptions\n */\n PubSub.getSubscriptions = function getSubscriptions(topic){\n var m;\n var list = [];\n for (m in messages){\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){\n list.push(m);\n }\n }\n return list;\n };\n\n /**\n * Removes subscriptions\n *\n * - When passed a token, removes a specific subscription.\n *\n\t * - When passed a function, removes all subscriptions for that function\n *\n\t * - When passed a topic, removes all subscriptions for that topic (hierarchy)\n * @function\n * @public\n * @alias subscribeOnce\n * @param { String | Function } value A token, function or topic to unsubscribe from\n * @example // Unsubscribing with a token\n * var token = PubSub.subscribe('mytopic', myFunc);\n * PubSub.unsubscribe(token);\n * @example // Unsubscribing with a function\n * PubSub.unsubscribe(myFunc);\n * @example // Unsubscribing from a topic\n * PubSub.unsubscribe('mytopic');\n */\n PubSub.unsubscribe = function(value){\n var descendantTopicExists = function(topic) {\n var m;\n for ( m in messages ){\n if ( Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0 ){\n // a descendant of the topic exists:\n return true;\n }\n }\n\n return false;\n },\n isTopic = typeof value === 'string' && ( Object.prototype.hasOwnProperty.call(messages, value) || descendantTopicExists(value) ),\n isToken = !isTopic && typeof value === 'string',\n isFunction = typeof value === 'function',\n result = false,\n m, message, t;\n\n if (isTopic){\n PubSub.clearSubscriptions(value);\n return;\n }\n\n for ( m in messages ){\n if ( Object.prototype.hasOwnProperty.call( messages, m ) ){\n message = messages[m];\n\n if ( isToken && message[value] ){\n delete message[value];\n result = value;\n // tokens are unique, so we can just stop here\n break;\n }\n\n if (isFunction) {\n for ( t in message ){\n if (Object.prototype.hasOwnProperty.call(message, t) && message[t] === value){\n delete message[t];\n result = true;\n }\n }\n }\n }\n }\n\n return result;\n };\n}));\n","import PubSub from 'pubsub-js';\n\ntype Topic = string;\ntype Token = string;\ntype Subscriber = (topic: Topic, payload: A) => void;\n\nexport interface MediaEvent {\n (payload: E): E;\n subscribe(subscriber: Subscriber): Token;\n unsubscribe(subscriber: Subscriber | Token): void;\n publish(payload: E): boolean;\n}\n\n/**\n * Wraps the used pubsub library and exposes the methods we need\n */\nexport function createEvent(topic: Topic): MediaEvent {\n const event: any = (payload: Payload) => {\n event.publish(payload);\n };\n /**\n * Subscribe to the event\n * @returns a token which can be used to unsubscribe\n */\n event.subscribe = (subscriber: Subscriber): Token => {\n return PubSub.subscribe(topic, subscriber);\n };\n /**\n * Unsubscribe from the event\n * @param subscriber a function which was previously subscribed or a token which was returned by `subscribe`\n */\n event.unsubscribe = (subscriber: Subscriber | Token) => {\n PubSub.unsubscribe(subscriber);\n };\n /**\n * Publish event and call all subscribers with payload\n * @returns true if the event has been published to at least one subscriber\n */\n event.publish = (payload: Payload): boolean => {\n return PubSub.publish(topic, payload);\n };\n return event;\n}\n","import { createEvent } from './createEvent';\nimport { AssetIdentity } from '../interfaces';\n\nconst assetCreatedEvent = createEvent('ASSET_CREATED');\nconst assetRemovedEvent = createEvent('ASSET_REMOVED');\nconst assetUpdatedEvent = createEvent('ASSET_UPDATED');\n\nexport { assetCreatedEvent, assetRemovedEvent, assetUpdatedEvent };\n","import { assetCreatedEvent, assetUpdatedEvent, assetRemovedEvent } from './asset';\nimport { createEvent, MediaEvent } from './createEvent';\n\nexport { createEvent, MediaEvent, assetCreatedEvent, assetRemovedEvent, assetUpdatedEvent };\n","import { useMutation } from '@apollo/client';\nimport { useRecoilState } from 'recoil';\n\nimport { DELETE_ASSET } from '../mutations';\nimport { AssetIdentity } from '../interfaces';\nimport { selectedAssetIdState } from '../state';\nimport { ASSET } from '../queries';\nimport { useEvent } from './index';\nimport { assetRemovedEvent } from '../events';\n\ninterface DeleteAssetVariables {\n id: string;\n assetSourceId: string;\n}\n\nexport default function useDeleteAsset() {\n const [action, { error, data }] = useMutation<{ deleteAsset: boolean }, DeleteAssetVariables>(DELETE_ASSET);\n const [selectedAssetId, setSelectedAsset] = useRecoilState(selectedAssetIdState);\n const assetRemoved = useEvent(assetRemovedEvent);\n\n // TODO: Check whether an optimisticResponse can be used here\n // Without a fast asset usage count retrieval a lot of negative responses are possible\n const deleteAsset = ({ assetId, assetSourceId }: AssetIdentity) =>\n action({\n variables: { id: assetId, assetSourceId: assetSourceId },\n refetchQueries: [\n {\n query: ASSET,\n variables: { id: assetId, assetSourceId: assetSourceId },\n },\n ],\n update: (cache, { data: { deleteAsset: success } }) => {\n if (!success) return;\n\n // Remove deleted asset from cache\n cache.evict({ id: cache.identify({ __typename: 'Asset', id: assetId }) });\n cache.gc();\n },\n }).then(({ data: { deleteAsset: success } }) => {\n if (!success) {\n throw new Error('Could not delete asset');\n }\n\n assetRemoved({ assetId, assetSourceId });\n\n // Unselect currently selected asset if it was just deleted\n if (assetId === selectedAssetId?.assetId) {\n setSelectedAsset(null);\n }\n });\n\n return { deleteAsset, data, error };\n}\n","import { useMutation } from '@apollo/client';\n\nimport { ASSET_COLLECTIONS } from '../queries';\nimport { AssetCollection, DeleteAssetCollectionResult } from '../interfaces';\nimport { DELETE_ASSET_COLLECTION } from '../mutations';\n\ninterface DeleteAssetCollectionVariables {\n id: string;\n}\n\nexport default function useDeleteAssetCollection() {\n const [action, { error, data, loading }] = useMutation<\n { deleteAssetCollection: DeleteAssetCollectionResult },\n DeleteAssetCollectionVariables\n >(DELETE_ASSET_COLLECTION);\n\n const deleteAssetCollection = (id: string) =>\n action({\n variables: {\n id,\n },\n optimisticResponse: {\n deleteAssetCollection: {\n success: true,\n __typename: 'DeleteAssetCollectionResult',\n },\n },\n update(cache) {\n const { assetCollections } = cache.readQuery({ query: ASSET_COLLECTIONS });\n cache.writeQuery({\n query: ASSET_COLLECTIONS,\n data: { assetCollections: assetCollections.filter((c: AssetCollection) => c.id !== id) },\n });\n },\n });\n\n return { deleteAssetCollection, data, error, loading };\n}\n","import { useMutation } from '@apollo/client';\nimport { useRecoilState } from 'recoil';\n\nimport { selectedTagIdState } from '../state';\nimport { Tag } from '../interfaces';\nimport { ASSET_COLLECTIONS, TAGS } from '../queries';\nimport { DELETE_TAG } from '../mutations';\n\ninterface DeleteTagVariables {\n id: string;\n}\n\nexport default function useDeleteTag() {\n const [action, { error, data }] = useMutation<{ __typename: string; deleteTag: boolean }, DeleteTagVariables>(\n DELETE_TAG\n );\n const [selectedTagId, setSelectedTagId] = useRecoilState(selectedTagIdState);\n\n const deleteTag = (id: string) =>\n action({\n variables: { id },\n optimisticResponse: {\n __typename: 'Mutation',\n deleteTag: true,\n },\n update: (proxy, { data: { deleteTag: success } }) => {\n if (!success) return;\n const { assetCollections } = proxy.readQuery({ query: ASSET_COLLECTIONS });\n const updatedAssetCollections = assetCollections.map((assetCollection) => {\n return { ...assetCollection, tags: assetCollection.tags.filter((tag) => tag?.id !== id) };\n });\n proxy.writeQuery({\n query: ASSET_COLLECTIONS,\n data: { assetCollections: updatedAssetCollections },\n });\n\n const { tags }: { tags: Tag[] } = proxy.readQuery({ query: TAGS });\n proxy.writeQuery({\n query: TAGS,\n data: {\n tags: tags.filter((tag) => tag.id !== id),\n },\n });\n },\n }).then((success) => {\n // Unselect currently selected tag if it was just deleted\n if (success && id === selectedTagId) {\n setSelectedTagId(null);\n }\n });\n\n return { deleteTag, data, error };\n}\n","import { MediaEvent } from '../events';\n\nexport default function useEvent(event: MediaEvent): MediaEvent {\n return event;\n}\n","import { useMutation } from '@apollo/client';\n\nimport { IMPORT_ASSET } from '../mutations';\nimport { Asset, AssetIdentity } from '../interfaces';\n\ninterface ImportAssetVariables {\n id: string;\n assetSourceId: string;\n}\n\nexport default function useImportAsset() {\n const [action, { error, data, loading }] = useMutation<\n { __typename: string; importAsset: Asset },\n ImportAssetVariables\n >(IMPORT_ASSET);\n\n const importAsset = (assetIdentity: AssetIdentity) =>\n action({\n variables: {\n id: assetIdentity.assetId,\n assetSourceId: assetIdentity.assetSourceId,\n },\n });\n\n return { importAsset, data, error, loading };\n}\n","import { useCallback } from 'react';\nimport { useSetRecoilState } from 'recoil';\n\nimport { useMediaUi } from '../provider';\nimport { AssetIdentity } from '../interfaces';\nimport { selectedAssetIdState } from '../state';\nimport selectedInspectorViewState from '../state/selectedInspectorViewState';\n\nconst useSelectAsset = () => {\n const setSelectedAssetId = useSetRecoilState(selectedAssetIdState);\n const setSelectedInspectorView = useSetRecoilState(selectedInspectorViewState);\n const { handleSelectAsset } = useMediaUi();\n return useCallback(\n (assetIdentity: AssetIdentity) => {\n if (!assetIdentity) return;\n setSelectedAssetId(assetIdentity);\n handleSelectAsset(assetIdentity);\n setSelectedInspectorView('asset');\n },\n [setSelectedAssetId, handleSelectAsset, setSelectedInspectorView]\n );\n};\nexport default useSelectAsset;\n","import { useCallback } from 'react';\nimport { useSetRecoilState } from 'recoil';\nimport { AssetCollection } from '../interfaces';\nimport {\n selectedInspectorViewState,\n selectedAssetCollectionIdState,\n selectedAssetIdState,\n selectedTagIdState,\n currentPageState,\n} from '../state';\n\nconst useSelectAssetCollection = () => {\n const setSelectedAssetCollectionId = useSetRecoilState(selectedAssetCollectionIdState);\n const setSelectedTagId = useSetRecoilState(selectedTagIdState);\n const setSelectedAssetId = useSetRecoilState(selectedAssetIdState);\n const setSelectedInspectorView = useSetRecoilState(selectedInspectorViewState);\n const setCurrentPage = useSetRecoilState(currentPageState);\n\n return useCallback(\n (assetCollection: AssetCollection | null) => {\n setSelectedInspectorView('assetCollection');\n setSelectedTagId(null);\n setSelectedAssetId(null);\n setCurrentPage(1);\n setSelectedAssetCollectionId(assetCollection?.id);\n },\n [setSelectedInspectorView, setSelectedTagId, setSelectedAssetId, setCurrentPage, setSelectedAssetCollectionId]\n );\n};\nexport default useSelectAssetCollection;\n","import { useCallback, useMemo } from 'react';\nimport { useMutation, useQuery } from '@apollo/client';\nimport { ExecutionResult } from 'graphql';\nimport { useSetRecoilState } from 'recoil';\n\nimport { SELECTED_ASSET_SOURCE_ID, SET_SELECTED_ASSET_SOURCE_ID } from '../queries';\nimport { AssetSource } from '../interfaces';\nimport { useAssetSourcesQuery } from './index';\nimport { currentPageState } from '../state';\n\nconst useSelectAssetSource = (): [AssetSource, (assetSource: AssetSource) => Promise>] => {\n const selectedAssetSourceQuery = useQuery(SELECTED_ASSET_SOURCE_ID);\n const { selectedAssetSourceId } = selectedAssetSourceQuery.data;\n const { assetSources } = useAssetSourcesQuery();\n const setCurrentPage = useSetRecoilState(currentPageState);\n const selectedAssetSource = useMemo(\n () => assetSources.find((assetSource) => assetSource.id === selectedAssetSourceId),\n [assetSources, selectedAssetSourceId]\n );\n\n const [mutateSelectedAssetSourceId] = useMutation(SET_SELECTED_ASSET_SOURCE_ID);\n const setSelectedAssetSource = useCallback(\n (assetSource: AssetSource) => {\n setCurrentPage(1);\n return mutateSelectedAssetSourceId({\n variables: { selectedAssetSourceId: assetSource.id },\n });\n },\n [mutateSelectedAssetSourceId, setCurrentPage]\n );\n\n return [selectedAssetSource, setSelectedAssetSource];\n};\n\nexport default useSelectAssetSource;\n","import { useCallback } from 'react';\nimport { useSetRecoilState } from 'recoil';\n\nimport { AssetCollection, Tag } from '../interfaces';\nimport { currentPageState, selectedAssetCollectionIdState, selectedAssetIdState, selectedTagIdState } from '../state';\nimport selectedInspectorViewState from '../state/selectedInspectorViewState';\n\nconst useSelectTag = () => {\n const setSelectedAssetCollectionId = useSetRecoilState(selectedAssetCollectionIdState);\n const setSelectedTagId = useSetRecoilState(selectedTagIdState);\n const setSelectedAssetId = useSetRecoilState(selectedAssetIdState);\n const setSelectedInspectorView = useSetRecoilState(selectedInspectorViewState);\n const setCurrentPage = useSetRecoilState(currentPageState);\n\n return useCallback(\n (tag: Tag, assetCollection: AssetCollection = null) => {\n setSelectedInspectorView('tag');\n setSelectedAssetCollectionId(assetCollection?.id);\n setSelectedTagId(tag?.id);\n setCurrentPage(1);\n setSelectedAssetId(null);\n },\n [setCurrentPage, setSelectedAssetCollectionId, setSelectedAssetId, setSelectedInspectorView, setSelectedTagId]\n );\n};\nexport default useSelectTag;\n","import { useRecoilValue } from 'recoil';\n\nimport { Asset } from '../interfaces';\nimport selectedAssetIdState from '../state/selectedAssetIdState';\nimport useAssetQuery from './useAssetQuery';\n\nconst useSelectedAsset = (): Asset => {\n const selectedAssetId = useRecoilValue(selectedAssetIdState);\n const { asset } = useAssetQuery(selectedAssetId);\n return asset;\n};\n\nexport default useSelectedAsset;\n","import { useMutation } from '@apollo/client';\n\nimport { Asset, AssetCollection } from '../interfaces';\nimport { SET_ASSET_COLLECTIONS } from '../mutations';\n\ninterface SetAssetCollectionsProps {\n asset: Asset;\n assetCollections: AssetCollection[];\n}\n\ninterface SetAssetCollectionsVariables {\n id: string;\n assetSourceId: string;\n assetCollectionIds: string[];\n}\n\nexport default function useSetAssetCollections() {\n const [action, { error, data, loading }] = useMutation<\n { __typename: string; setAssetCollections: Asset },\n SetAssetCollectionsVariables\n >(SET_ASSET_COLLECTIONS);\n\n const setAssetCollections = ({ asset, assetCollections }: SetAssetCollectionsProps) =>\n action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n assetCollectionIds: assetCollections.map((c) => c.id),\n },\n optimisticResponse: {\n __typename: 'Mutation',\n setAssetCollections: {\n ...asset,\n collections: assetCollections,\n },\n },\n });\n\n return { setAssetCollections: setAssetCollections, data, error, loading };\n}\n","import { useMutation } from '@apollo/client';\n\nimport { Asset, Tag } from '../interfaces';\nimport { SET_ASSET_TAGS } from '../mutations';\n\ninterface SetAssetTagsProps {\n asset: Asset;\n tags: Tag[];\n}\n\ninterface SetAssetTagsVariables {\n id: string;\n assetSourceId: string;\n tagIds: string[];\n}\n\nexport default function useSetAssetTags() {\n const [action, { error, data, loading }] = useMutation<\n { __typename: string; setAssetTags: Asset },\n SetAssetTagsVariables\n >(SET_ASSET_TAGS);\n\n const setAssetTags = ({ asset, tags }: SetAssetTagsProps) =>\n action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n tagIds: tags.map((tag) => tag.id),\n },\n optimisticResponse: {\n __typename: 'Mutation',\n setAssetTags: {\n ...asset,\n tags,\n },\n },\n });\n\n return { setAssetTags, data, error, loading };\n}\n","import { useQuery } from '@apollo/client';\n\nimport { TAGS } from '../queries';\nimport { Tag } from '../interfaces';\n\ninterface TagsQueryResult {\n tags: Tag[];\n}\n\nexport default function useAssetTagsQuery() {\n const { data, loading } = useQuery(TAGS);\n return { tags: data?.tags || [], loading };\n}\n","import { useMutation } from '@apollo/client';\n\nimport { Asset } from '../interfaces';\nimport { UNTAG_ASSET } from '../mutations';\n\ninterface UntagAssetProps {\n asset: Asset;\n tagName: string;\n}\n\ninterface UntagAssetVariables {\n id: string;\n assetSourceId: string;\n tag: string;\n}\n\nexport default function useUntagAsset() {\n const [action, { error, data, loading }] = useMutation<\n { __typename: string; untagAsset: Asset },\n UntagAssetVariables\n >(UNTAG_ASSET);\n\n const untagAsset = ({ asset, tagName }: UntagAssetProps) =>\n action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n tag: tagName,\n },\n optimisticResponse: {\n __typename: 'Mutation',\n untagAsset: {\n ...asset,\n tags: [...asset.tags.filter((tag) => tag.label !== tagName)],\n },\n },\n });\n\n return { untagAsset, data, error, loading };\n}\n","import { useMutation } from '@apollo/client';\n\nimport { UPDATE_ASSET } from '../mutations';\nimport { Asset } from '../interfaces';\n\ninterface UpdateAssetProps {\n asset: Asset;\n label?: string;\n caption?: string;\n copyrightNotice?: string;\n}\n\ninterface UpdateAssetVariables {\n id: string;\n assetSourceId: string;\n label?: string;\n caption?: string;\n copyrightNotice?: string;\n}\n\nexport default function useUpdateAsset() {\n const [action, { error, data, loading }] = useMutation<\n { __typename: string; updateAsset: Asset },\n UpdateAssetVariables\n >(UPDATE_ASSET);\n\n const updateAsset = ({ asset, label, caption, copyrightNotice }: UpdateAssetProps) =>\n action({\n variables: {\n id: asset.id,\n assetSourceId: asset.assetSource.id,\n label,\n caption,\n copyrightNotice,\n },\n optimisticResponse: {\n __typename: 'Mutation',\n updateAsset: {\n ...asset,\n label,\n caption,\n copyrightNotice,\n },\n },\n });\n\n return { updateAsset, data, error, loading };\n}\n","import { useMutation } from '@apollo/client';\n\nimport { UPDATE_ASSET_COLLECTION } from '../mutations';\nimport { AssetCollection, Tag } from '../interfaces';\n\ninterface UpdateAssetCollectionProps {\n assetCollection: AssetCollection;\n title?: string;\n tags?: Tag[];\n}\n\ninterface UpdateAssetCollectionVariables {\n id: string;\n title?: string;\n tagIds?: string[];\n}\n\nexport default function useUpdateAssetCollection() {\n const [action, { error, data, loading }] = useMutation<\n { updateAssetCollection: AssetCollection },\n UpdateAssetCollectionVariables\n >(UPDATE_ASSET_COLLECTION);\n\n const updateAssetCollection = ({ assetCollection, title, tags }: UpdateAssetCollectionProps) =>\n action({\n variables: {\n id: assetCollection.id,\n title,\n tagIds: tags?.map((tag) => tag.id),\n },\n optimisticResponse: {\n updateAssetCollection: {\n ...assetCollection,\n title,\n ...(title\n ? {\n title,\n }\n : {}),\n ...(tags\n ? {\n tags,\n }\n : {}),\n },\n },\n });\n\n return { updateAssetCollection, data, error, loading };\n}\n","import { useMutation } from '@apollo/client';\n\nimport { UPDATE_TAG } from '../mutations';\nimport { Tag } from '../interfaces';\n\ninterface UpdateTagProps {\n tag: Tag;\n label?: string;\n}\n\ninterface UpdateTagVariables {\n id: string;\n label?: string;\n}\n\nexport default function useUpdateTag() {\n const [action, { error, data, loading }] = useMutation<{ updateTag: Tag }, UpdateTagVariables>(UPDATE_TAG);\n\n const updateTag = ({ tag, label }: UpdateTagProps) =>\n action({\n variables: {\n id: tag.id,\n label,\n },\n optimisticResponse: {\n updateTag: {\n ...tag,\n label,\n ...(label\n ? {\n label,\n }\n : {}),\n },\n },\n });\n\n return { updateTag, data, error, loading };\n}\n","import useAssetCollectionsQuery from './useAssetCollectionsQuery';\nimport useAssetCountQuery from './useAssetCountQuery';\nimport useAssetQuery from './useAssetQuery';\nimport useAssetSourcesQuery from './useAssetSourcesQuery';\nimport useAssetsQuery from './useAssetsQuery';\nimport useConfigQuery from './useConfigQuery';\nimport useCreateAssetCollection from './useCreateAssetCollection';\nimport useCreateTag from './useCreateTag';\nimport useDeleteAsset from './useDeleteAsset';\nimport useDeleteAssetCollection from './useDeleteAssetCollection';\nimport useDeleteTag from './useDeleteTag';\nimport useEvent from './useEvent';\nimport useImportAsset from './useImportAsset';\nimport useSelectAsset from './useSelectAsset';\nimport useSelectAssetCollection from './useSelectAssetCollection';\nimport useSelectAssetSource from './useSelectAssetSource';\nimport useSelectTag from './useSelectTag';\nimport useSelectedAsset from './useSelectedAsset';\nimport useSelectedAssetCollection from './useSelectedAssetCollection';\nimport useSelectedTag from './useSelectedTag';\nimport useSetAssetCollections from './useSetAssetCollections';\nimport useSetAssetTags from './useSetAssetTags';\nimport useTagsQuery from './useTagsQuery';\nimport useUntagAsset from './useUntagAsset';\nimport useUpdateAsset from './useUpdateAsset';\nimport useUpdateAssetCollection from './useUpdateAssetCollection';\nimport useUpdateTag from './useUpdateTag';\n\nexport {\n useAssetCollectionsQuery,\n useAssetCountQuery,\n useAssetQuery,\n useAssetSourcesQuery,\n useAssetsQuery,\n useConfigQuery,\n useCreateAssetCollection,\n useCreateTag,\n useDeleteAsset,\n useDeleteAssetCollection,\n useDeleteTag,\n useEvent,\n useImportAsset,\n useSelectAsset,\n useSelectAssetCollection,\n useSelectAssetSource,\n useSelectTag,\n useSelectedAsset,\n useSelectedAssetCollection,\n useSelectedTag,\n useSetAssetCollections,\n useSetAssetTags,\n useTagsQuery,\n useUntagAsset,\n useUpdateAsset,\n useUpdateAssetCollection,\n useUpdateTag,\n};\n","import * as React from 'react';\nimport { createContext, useCallback, useContext, useEffect } from 'react';\nimport { useApolloClient, gql } from '@apollo/client';\nimport { useRecoilState } from 'recoil';\nimport { isMatch } from 'matcher';\n\nimport { useIntl } from '@media-ui/core/src';\n\nimport { Asset, AssetIdentity, FeatureFlags, SelectionConstraints } from '../interfaces';\nimport { useAssetsQuery, useDeleteAsset, useImportAsset } from '../hooks';\nimport { useNotify } from './Notify';\nimport { selectedMediaTypeState } from '../state';\nimport { AssetMediaType } from '../state/selectedMediaTypeState';\nimport { ASSET_FRAGMENT } from '../fragments/asset';\n\ninterface MediaUiProviderProps {\n children: React.ReactElement;\n dummyImage: string;\n selectionMode?: boolean;\n isInNodeCreationDialog?: boolean;\n containerRef: React.RefObject;\n onAssetSelection?: (localAssetIdentifier: string) => void;\n featureFlags: FeatureFlags;\n constraints?: SelectionConstraints;\n assetType?: AssetMediaType;\n}\n\ninterface MediaUiProviderValues {\n containerRef: React.RefObject;\n dummyImage: string;\n handleDeleteAsset: (asset: Asset) => Promise;\n handleSelectAsset: (assetIdentity: AssetIdentity) => void;\n selectionMode: boolean;\n isInNodeCreationDialog: boolean;\n assets: Asset[];\n refetchAssets: () => void;\n featureFlags: FeatureFlags;\n constraints: SelectionConstraints;\n assetType: AssetMediaType;\n isAssetSelectable: (asset: Asset) => boolean;\n}\n\nexport const MediaUiContext = createContext({} as MediaUiProviderValues);\nexport const useMediaUi = (): MediaUiProviderValues => useContext(MediaUiContext);\n\nexport function MediaUiProvider({\n children,\n dummyImage,\n selectionMode = false,\n isInNodeCreationDialog = false,\n onAssetSelection = null,\n containerRef,\n featureFlags,\n constraints = {},\n assetType = 'all',\n}: MediaUiProviderProps) {\n const { translate } = useIntl();\n const Notify = useNotify();\n const client = useApolloClient();\n const { deleteAsset } = useDeleteAsset();\n const { importAsset } = useImportAsset();\n const { assets, refetch: refetchAssets } = useAssetsQuery();\n const [selectedMediaType, setSelectedMediaType] = useRecoilState(selectedMediaTypeState);\n\n // Set initial media type state\n useEffect(() => {\n if (assetType) {\n setSelectedMediaType(assetType);\n }\n }, [assetType, setSelectedMediaType]);\n\n const handleDeleteAsset = useCallback(\n (asset: Asset): Promise => {\n // TODO: Use custom modal\n const confirm = window.confirm(\n translate('action.deleteAsset.confirm', 'Do you really want to delete the asset ' + asset.label, [\n asset.label,\n ])\n );\n if (!confirm) return new Promise(() => false);\n\n return deleteAsset({ assetId: asset.id, assetSourceId: asset.assetSource.id })\n .then(() => {\n Notify.ok(translate('action.deleteAsset.success', 'The asset has been deleted'));\n return true;\n })\n .catch(({ message }) => {\n // TODO: translate possible error message or generate one on server\n Notify.error(\n translate('action.deleteAsset.error', 'Error while trying to delete the asset'),\n message\n );\n return false;\n });\n },\n [Notify, translate, deleteAsset]\n );\n\n const isAssetSelectable = useCallback(\n (asset: Asset) => {\n if (constraints.mediaTypes?.length > 0) {\n if (!isMatch(asset.file.mediaType, constraints.mediaTypes)) {\n return false;\n }\n }\n if (constraints.assetSources?.length > 0) {\n if (!isMatch(asset.assetSource.id, constraints.assetSources)) {\n return false;\n }\n }\n return true;\n },\n [constraints]\n );\n\n // Handle selection mode for the secondary Neos UI inspector\n const handleSelectAsset = useCallback(\n (assetIdentity: AssetIdentity) => {\n if (!onAssetSelection || !assetIdentity) {\n return;\n }\n\n // Read local asset data from cache as the asset editor and the constraint check require it\n const asset = client.readFragment({\n fragment: gql`\n fragment LocalAssetData on Asset {\n ...AssetProps\n }\n ${ASSET_FRAGMENT}\n `,\n fragmentName: 'LocalAssetData',\n variables: {\n includeUsage: false,\n },\n id: client.cache.identify({ __typename: 'Asset', id: assetIdentity.assetId }),\n });\n\n if (!isAssetSelectable(asset)) {\n Notify.notice(\n translate(\n 'action.selectAsset.invalidType.message',\n 'You can only select any of the following types: {types}',\n {\n types: constraints.mediaTypes.join(', '),\n }\n )\n );\n return;\n }\n\n if (asset.localId) {\n onAssetSelection(asset.localId);\n } else {\n // If no local id is present, we first need to import the asset from its remote source\n importAsset(assetIdentity).then(({ data }) => {\n onAssetSelection(data.importAsset.localId);\n });\n }\n },\n [client, importAsset, onAssetSelection, isAssetSelectable, translate, Notify, constraints.mediaTypes]\n );\n\n return (\n \n {children}\n \n );\n}\n","import * as React from 'react';\nimport { createContext, useContext } from 'react';\n\n// TODO: This is a copy of the interface in Neos.Ui and should preferably be made available to plugins\nexport interface I18nRegistry {\n translate: (\n id?: string,\n fallback?: string,\n params?: Record | string[],\n packageKey?: string,\n sourceName?: string\n ) => string;\n}\n\ninterface ProviderProps extends I18nRegistry {\n children: React.ReactElement;\n translate: (\n id?: string,\n fallback?: string,\n params?: Record | string[],\n packageKey?: string,\n sourceName?: string\n ) => string;\n}\n\ninterface ProviderValues extends I18nRegistry {\n translate: (\n id?: string,\n fallback?: string,\n params?: Record | string[],\n packageKey?: string,\n sourceName?: string\n ) => string;\n}\n\nexport const IntlContext = createContext(null);\nexport const useIntl = (): ProviderValues => useContext(IntlContext);\n\nexport function IntlProvider({ children, translate }: ProviderProps) {\n return {children};\n}\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","var isProduction = process.env.NODE_ENV === 'production';\nfunction warning(condition, message) {\n if (!isProduction) {\n if (condition) {\n return;\n }\n\n var text = \"Warning: \" + message;\n\n if (typeof console !== 'undefined') {\n console.warn(text);\n }\n\n try {\n throw Error(text);\n } catch (x) {}\n }\n}\n\nexport default warning;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getDisplayName;\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');\n}","import React, { createContext } from 'react';\nimport warning from 'tiny-warning';\nimport PropTypes from 'prop-types';\nimport hoist from 'hoist-non-react-statics';\nimport getDisplayName from 'react-display-name';\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object' && !Array.isArray(obj);\n}\n\nfunction createThemeProvider(context) {\n var ThemeProvider =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(ThemeProvider, _React$Component);\n\n function ThemeProvider() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"cachedTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"lastOuterTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"lastTheme\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"renderProvider\", function (outerTheme) {\n var children = _this.props.children;\n return React.createElement(context.Provider, {\n value: _this.getTheme(outerTheme)\n }, children);\n });\n\n return _this;\n }\n\n var _proto = ThemeProvider.prototype;\n\n // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation\n _proto.getTheme = function getTheme(outerTheme) {\n if (this.props.theme !== this.lastTheme || outerTheme !== this.lastOuterTheme || !this.cachedTheme) {\n this.lastOuterTheme = outerTheme;\n this.lastTheme = this.props.theme;\n\n if (typeof this.lastTheme === 'function') {\n var theme = this.props.theme;\n this.cachedTheme = theme(outerTheme);\n process.env.NODE_ENV !== \"production\" ? warning(isObject(this.cachedTheme), '[ThemeProvider] Please return an object from your theme function') : void 0;\n } else {\n var _theme = this.props.theme;\n process.env.NODE_ENV !== \"production\" ? warning(isObject(_theme), '[ThemeProvider] Please make your theme prop a plain object') : void 0;\n this.cachedTheme = outerTheme ? _extends({}, outerTheme, _theme) : _theme;\n }\n }\n\n return this.cachedTheme;\n };\n\n _proto.render = function render() {\n var children = this.props.children;\n\n if (!children) {\n return null;\n }\n\n return React.createElement(context.Consumer, null, this.renderProvider);\n };\n\n return ThemeProvider;\n }(React.Component);\n\n if (process.env.NODE_ENV !== 'production') {\n ThemeProvider.propTypes = {\n // eslint-disable-next-line react/require-default-props\n children: PropTypes.node,\n theme: PropTypes.oneOfType([PropTypes.shape({}), PropTypes.func]).isRequired\n };\n }\n\n return ThemeProvider;\n}\n\nfunction createWithTheme(context) {\n return function hoc(Component) {\n var withTheme = React.forwardRef(function (props, ref) {\n return React.createElement(context.Consumer, null, function (theme) {\n process.env.NODE_ENV !== \"production\" ? warning(isObject(theme), '[theming] Please use withTheme only with the ThemeProvider') : void 0;\n return React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n });\n });\n\n if (process.env.NODE_ENV !== 'production') {\n withTheme.displayName = \"WithTheme(\" + getDisplayName(Component) + \")\";\n }\n\n hoist(withTheme, Component);\n return withTheme;\n };\n}\n\nfunction createUseTheme(context) {\n var useTheme = function useTheme() {\n var theme = React.useContext(context);\n process.env.NODE_ENV !== \"production\" ? warning(isObject(theme), '[theming] Please use useTheme only with the ThemeProvider') : void 0;\n return theme;\n };\n\n return useTheme;\n}\n\nfunction createTheming(context) {\n return {\n context: context,\n withTheme: createWithTheme(context),\n useTheme: createUseTheme(context),\n ThemeProvider: createThemeProvider(context)\n };\n}\n\nvar ThemeContext = createContext();\n\nvar _createTheming = createTheming(ThemeContext),\n withTheme = _createTheming.withTheme,\n ThemeProvider = _createTheming.ThemeProvider,\n useTheme = _createTheming.useTheme;\n\nexport { useTheme, ThemeContext, withTheme, createTheming, ThemeProvider };\n","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexport var isBrowser = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\" && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === 'object' && document.nodeType === 9;\n\nexport default isBrowser;\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _extends from '@babel/runtime/helpers/esm/extends';\nimport isInBrowser from 'is-in-browser';\nimport warning from 'tiny-warning';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\n\nvar plainObjectConstrurctor = {}.constructor;\nfunction cloneStyle(style) {\n if (style == null || typeof style !== 'object') return style;\n if (Array.isArray(style)) return style.map(cloneStyle);\n if (style.constructor !== plainObjectConstrurctor) return style;\n var newStyle = {};\n\n for (var name in style) {\n newStyle[name] = cloneStyle(style[name]);\n }\n\n return newStyle;\n}\n\n/**\n * Create a rule instance.\n */\n\nfunction createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}\n\nvar join = function join(value, by) {\n var result = '';\n\n for (var i = 0; i < value.length; i++) {\n // Remove !important from the value, it will be readded later.\n if (value[i] === '!important') break;\n if (result) result += by;\n result += value[i];\n }\n\n return result;\n};\n\n/**\n * Converts array values to string.\n *\n * `margin: [['5px', '10px']]` > `margin: 5px 10px;`\n * `border: ['1px', '2px']` > `border: 1px, 2px;`\n * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`\n * `color: ['red', !important]` > `color: red !important;`\n */\nvar toCssValue = function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n};\n\n/**\n * Indent a string.\n * http://jsperf.com/array-join-vs-for\n */\nfunction indentStr(str, indent) {\n var result = '';\n\n for (var index = 0; index < indent; index++) {\n result += ' ';\n }\n\n return result + str;\n}\n/**\n * Converts a Rule to CSS string.\n */\n\n\nfunction toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}\n\nvar escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\nvar nativeEscape = typeof CSS !== 'undefined' && CSS.escape;\nvar escape = (function (str) {\n return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\\\$1');\n});\n\nvar BaseStyleRule =\n/*#__PURE__*/\nfunction () {\n function BaseStyleRule(key, style, options) {\n this.type = 'style';\n this.key = void 0;\n this.isProcessed = false;\n this.style = void 0;\n this.renderer = void 0;\n this.renderable = void 0;\n this.options = void 0;\n var sheet = options.sheet,\n Renderer = options.Renderer;\n this.key = key;\n this.options = options;\n this.style = style;\n if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer();\n }\n /**\n * Get or set a style property.\n */\n\n\n var _proto = BaseStyleRule.prototype;\n\n _proto.prop = function prop(name, value, options) {\n // It's a getter.\n if (value === undefined) return this.style[name]; // Don't do anything if the value has not changed.\n\n var force = options ? options.force : false;\n if (!force && this.style[name] === value) return this;\n var newValue = value;\n\n if (!options || options.process !== false) {\n newValue = this.options.jss.plugins.onChangeValue(value, name, this);\n }\n\n var isEmpty = newValue == null || newValue === false;\n var isDefined = name in this.style; // Value is empty and wasn't defined before.\n\n if (isEmpty && !isDefined && !force) return this; // We are going to remove this value.\n\n var remove = isEmpty && isDefined;\n if (remove) delete this.style[name];else this.style[name] = newValue; // Renderable is defined if StyleSheet option `link` is true.\n\n if (this.renderable && this.renderer) {\n if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, newValue);\n return this;\n }\n\n var sheet = this.options.sheet;\n\n if (sheet && sheet.attached) {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Rule is not linked. Missing sheet option \"link: true\".') : void 0;\n }\n\n return this;\n };\n\n return BaseStyleRule;\n}();\nvar StyleRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(StyleRule, _BaseStyleRule);\n\n function StyleRule(key, style, options) {\n var _this;\n\n _this = _BaseStyleRule.call(this, key, style, options) || this;\n _this.selectorText = void 0;\n _this.id = void 0;\n _this.renderable = void 0;\n var selector = options.selector,\n scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n\n if (selector) {\n _this.selectorText = selector;\n } else if (scoped !== false) {\n _this.id = generateId(_assertThisInitialized(_assertThisInitialized(_this)), sheet);\n _this.selectorText = \".\" + escape(_this.id);\n }\n\n return _this;\n }\n /**\n * Set selector string.\n * Attention: use this with caution. Most browsers didn't implement\n * selectorText setter, so this may result in rerendering of entire Style Sheet.\n */\n\n\n var _proto2 = StyleRule.prototype;\n\n /**\n * Apply rule to an element inline.\n */\n _proto2.applyTo = function applyTo(renderable) {\n var renderer = this.renderer;\n\n if (renderer) {\n var json = this.toJSON();\n\n for (var prop in json) {\n renderer.setProperty(renderable, prop, json[prop]);\n }\n }\n\n return this;\n }\n /**\n * Returns JSON representation of the rule.\n * Fallbacks are not supported.\n * Useful for inline styles.\n */\n ;\n\n _proto2.toJSON = function toJSON() {\n var json = {};\n\n for (var prop in this.style) {\n var value = this.style[prop];\n if (typeof value !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = toCssValue(value);\n }\n\n return json;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto2.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.selectorText, this.style, opts);\n };\n\n _createClass(StyleRule, [{\n key: \"selector\",\n set: function set(selector) {\n if (selector === this.selectorText) return;\n this.selectorText = selector;\n var renderer = this.renderer,\n renderable = this.renderable;\n if (!renderable || !renderer) return;\n var hasChanged = renderer.setSelector(renderable, selector); // If selector setter is not implemented, rerender the rule.\n\n if (!hasChanged) {\n renderer.replaceRule(renderable, this);\n }\n }\n /**\n * Get selector string.\n */\n ,\n get: function get() {\n return this.selectorText;\n }\n }]);\n\n return StyleRule;\n}(BaseStyleRule);\nvar pluginStyleRule = {\n onCreateRule: function onCreateRule(name, style, options) {\n if (name[0] === '@' || options.parent && options.parent.type === 'keyframes') {\n return null;\n }\n\n return new StyleRule(name, style, options);\n }\n};\n\nvar defaultToStringOptions = {\n indent: 1,\n children: true\n};\nvar atRegExp = /@([\\w-]+)/;\n/**\n * Conditional rule for @media, @supports\n */\n\nvar ConditionalRule =\n/*#__PURE__*/\nfunction () {\n function ConditionalRule(key, styles, options) {\n this.type = 'conditional';\n this.at = void 0;\n this.key = void 0;\n this.query = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n var atMatch = key.match(atRegExp);\n this.at = atMatch ? atMatch[1] : 'unknown'; // Key might contain a unique suffix in case the `name` passed by user was duplicate.\n\n this.query = options.name || \"@\" + this.at;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = ConditionalRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions.indent;\n if (options.children == null) options.children = defaultToStringOptions.children;\n\n if (options.children === false) {\n return this.query + \" {}\";\n }\n\n var children = this.rules.toString(options);\n return children ? this.query + \" {\\n\" + children + \"\\n}\" : '';\n };\n\n return ConditionalRule;\n}();\nvar keyRegExp = /@media|@supports\\s+/;\nvar pluginConditionalRule = {\n onCreateRule: function onCreateRule(key, styles, options) {\n return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;\n }\n};\n\nvar defaultToStringOptions$1 = {\n indent: 1,\n children: true\n};\nvar nameRegExp = /@keyframes\\s+([\\w-]+)/;\n/**\n * Rule for @keyframes\n */\n\nvar KeyframesRule =\n/*#__PURE__*/\nfunction () {\n function KeyframesRule(key, frames, options) {\n this.type = 'keyframes';\n this.at = '@keyframes';\n this.key = void 0;\n this.name = void 0;\n this.id = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n var nameMatch = key.match(nameRegExp);\n\n if (nameMatch && nameMatch[1]) {\n this.name = nameMatch[1];\n } else {\n this.name = 'noname';\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Bad keyframes name \" + key) : void 0;\n }\n\n this.key = this.type + \"-\" + this.name;\n this.options = options;\n var scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n this.id = scoped === false ? this.name : escape(generateId(this, sheet));\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in frames) {\n this.rules.add(name, frames[name], _extends({}, options, {\n parent: this\n }));\n }\n\n this.rules.process();\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = KeyframesRule.prototype;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions$1;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions$1.indent;\n if (options.children == null) options.children = defaultToStringOptions$1.children;\n\n if (options.children === false) {\n return this.at + \" \" + this.id + \" {}\";\n }\n\n var children = this.rules.toString(options);\n if (children) children = \"\\n\" + children + \"\\n\";\n return this.at + \" \" + this.id + \" {\" + children + \"}\";\n };\n\n return KeyframesRule;\n}();\nvar keyRegExp$1 = /@keyframes\\s+/;\nvar refRegExp = /\\$([\\w-]+)/g;\n\nvar findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {\n if (typeof val === 'string') {\n return val.replace(refRegExp, function (match, name) {\n if (name in keyframes) {\n return keyframes[name];\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced keyframes rule \\\"\" + name + \"\\\" is not defined.\") : void 0;\n return match;\n });\n }\n\n return val;\n};\n/**\n * Replace the reference for a animation name.\n */\n\n\nvar replaceRef = function replaceRef(style, prop, keyframes) {\n var value = style[prop];\n var refKeyframe = findReferencedKeyframe(value, keyframes);\n\n if (refKeyframe !== value) {\n style[prop] = refKeyframe;\n }\n};\n\nvar plugin = {\n onCreateRule: function onCreateRule(key, frames, options) {\n return typeof key === 'string' && keyRegExp$1.test(key) ? new KeyframesRule(key, frames, options) : null;\n },\n // Animation name ref replacer.\n onProcessStyle: function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style' || !sheet) return style;\n if ('animation-name' in style) replaceRef(style, 'animation-name', sheet.keyframes);\n if ('animation' in style) replaceRef(style, 'animation', sheet.keyframes);\n return style;\n },\n onChangeValue: function onChangeValue(val, prop, rule) {\n var sheet = rule.options.sheet;\n\n if (!sheet) {\n return val;\n }\n\n switch (prop) {\n case 'animation':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n case 'animation-name':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n default:\n return val;\n }\n }\n};\n\nvar KeyframeRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(KeyframeRule, _BaseStyleRule);\n\n function KeyframeRule() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _BaseStyleRule.call.apply(_BaseStyleRule, [this].concat(args)) || this;\n _this.renderable = void 0;\n return _this;\n }\n\n var _proto = KeyframeRule.prototype;\n\n /**\n * Generates a CSS string.\n */\n _proto.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.key, this.style, opts);\n };\n\n return KeyframeRule;\n}(BaseStyleRule);\nvar pluginKeyframeRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n if (options.parent && options.parent.type === 'keyframes') {\n return new KeyframeRule(key, style, options);\n }\n\n return null;\n }\n};\n\nvar FontFaceRule =\n/*#__PURE__*/\nfunction () {\n function FontFaceRule(key, style, options) {\n this.type = 'font-face';\n this.at = '@font-face';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = FontFaceRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.style)) {\n var str = '';\n\n for (var index = 0; index < this.style.length; index++) {\n str += toCss(this.at, this.style[index]);\n if (this.style[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return toCss(this.at, this.style, options);\n };\n\n return FontFaceRule;\n}();\nvar keyRegExp$2 = /@font-face/;\nvar pluginFontFaceRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return keyRegExp$2.test(key) ? new FontFaceRule(key, style, options) : null;\n }\n};\n\nvar ViewportRule =\n/*#__PURE__*/\nfunction () {\n function ViewportRule(key, style, options) {\n this.type = 'viewport';\n this.at = '@viewport';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = ViewportRule.prototype;\n\n _proto.toString = function toString(options) {\n return toCss(this.key, this.style, options);\n };\n\n return ViewportRule;\n}();\nvar pluginViewportRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return key === '@viewport' || key === '@-ms-viewport' ? new ViewportRule(key, style, options) : null;\n }\n};\n\nvar SimpleRule =\n/*#__PURE__*/\nfunction () {\n function SimpleRule(key, value, options) {\n this.type = 'simple';\n this.key = void 0;\n this.value = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.value = value;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n // eslint-disable-next-line no-unused-vars\n\n\n var _proto = SimpleRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.value)) {\n var str = '';\n\n for (var index = 0; index < this.value.length; index++) {\n str += this.key + \" \" + this.value[index] + \";\";\n if (this.value[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return this.key + \" \" + this.value + \";\";\n };\n\n return SimpleRule;\n}();\nvar keysMap = {\n '@charset': true,\n '@import': true,\n '@namespace': true\n};\nvar pluginSimpleRule = {\n onCreateRule: function onCreateRule(key, value, options) {\n return key in keysMap ? new SimpleRule(key, value, options) : null;\n }\n};\n\nvar plugins = [pluginStyleRule, pluginConditionalRule, plugin, pluginKeyframeRule, pluginFontFaceRule, pluginViewportRule, pluginSimpleRule];\n\nvar defaultUpdateOptions = {\n process: true\n};\nvar forceUpdateOptions = {\n force: true,\n process: true\n /**\n * Contains rules objects and allows adding/removing etc.\n * Is used for e.g. by `StyleSheet` or `ConditionalRule`.\n */\n\n};\n\nvar RuleList =\n/*#__PURE__*/\nfunction () {\n // Rules registry for access by .get() method.\n // It contains the same rule registered by name and by selector.\n // Original styles object.\n // Used to ensure correct rules order.\n function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }\n /**\n * Create and register rule.\n *\n * Will not render after Style Sheet was rendered the first time.\n */\n\n\n var _proto = RuleList.prototype;\n\n _proto.add = function add(name, decl, ruleOptions) {\n var _this$options = this.options,\n parent = _this$options.parent,\n sheet = _this$options.sheet,\n jss = _this$options.jss,\n Renderer = _this$options.Renderer,\n generateId = _this$options.generateId,\n scoped = _this$options.scoped;\n\n var options = _extends({\n classes: this.classes,\n parent: parent,\n sheet: sheet,\n jss: jss,\n Renderer: Renderer,\n generateId: generateId,\n scoped: scoped,\n name: name,\n keyframes: this.keyframes,\n selector: undefined\n }, ruleOptions); // When user uses .createStyleSheet(), duplicate names are not possible, but\n // `sheet.addRule()` opens the door for any duplicate rule name. When this happens\n // we need to make the key unique within this RuleList instance scope.\n\n\n var key = name;\n\n if (name in this.raw) {\n key = name + \"-d\" + this.counter++;\n } // We need to save the original decl before creating the rule\n // because cache plugin needs to use it as a key to return a cached rule.\n\n\n this.raw[key] = decl;\n\n if (key in this.classes) {\n // E.g. rules inside of @media container\n options.selector = \".\" + escape(this.classes[key]);\n }\n\n var rule = createRule(key, decl, options);\n if (!rule) return null;\n this.register(rule);\n var index = options.index === undefined ? this.index.length : options.index;\n this.index.splice(index, 0, rule);\n return rule;\n }\n /**\n * Get a rule.\n */\n ;\n\n _proto.get = function get(name) {\n return this.map[name];\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.remove = function remove(rule) {\n this.unregister(rule);\n delete this.raw[rule.key];\n this.index.splice(this.index.indexOf(rule), 1);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.index.indexOf(rule);\n }\n /**\n * Run `onProcessRule()` plugins on every rule.\n */\n ;\n\n _proto.process = function process() {\n var plugins = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop\n // we end up with very hard-to-track-down side effects.\n\n this.index.slice(0).forEach(plugins.onProcessRule, plugins);\n }\n /**\n * Register a rule in `.map`, `.classes` and `.keyframes` maps.\n */\n ;\n\n _proto.register = function register(rule) {\n this.map[rule.key] = rule;\n\n if (rule instanceof StyleRule) {\n this.map[rule.selector] = rule;\n if (rule.id) this.classes[rule.key] = rule.id;\n } else if (rule instanceof KeyframesRule && this.keyframes) {\n this.keyframes[rule.name] = rule.id;\n }\n }\n /**\n * Unregister a rule.\n */\n ;\n\n _proto.unregister = function unregister(rule) {\n delete this.map[rule.key];\n\n if (rule instanceof StyleRule) {\n delete this.map[rule.selector];\n delete this.classes[rule.key];\n } else if (rule instanceof KeyframesRule) {\n delete this.keyframes[rule.name];\n }\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var name;\n var data;\n var options;\n\n if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {\n name = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe[invalid-tuple-index]\n\n data = arguments.length <= 1 ? undefined : arguments[1]; // $FlowFixMe[invalid-tuple-index]\n\n options = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n data = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe[invalid-tuple-index]\n\n options = arguments.length <= 1 ? undefined : arguments[1];\n name = null;\n }\n\n if (name) {\n this.updateOne(this.map[name], data, options);\n } else {\n for (var index = 0; index < this.index.length; index++) {\n this.updateOne(this.index[index], data, options);\n }\n }\n }\n /**\n * Execute plugins, update rule props.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n if (options === void 0) {\n options = defaultUpdateOptions;\n }\n\n var _this$options2 = this.options,\n plugins = _this$options2.jss.plugins,\n sheet = _this$options2.sheet; // It is a rules container like for e.g. ConditionalRule.\n\n if (rule.rules instanceof RuleList) {\n rule.rules.update(data, options);\n return;\n }\n\n var styleRule = rule;\n var style = styleRule.style;\n plugins.onUpdate(data, rule, sheet, options); // We rely on a new `style` ref in case it was mutated during onUpdate hook.\n\n if (options.process && style && style !== styleRule.style) {\n // We need to run the plugins in case new `style` relies on syntax plugins.\n plugins.onProcessStyle(styleRule.style, styleRule, sheet); // Update and add props.\n\n for (var prop in styleRule.style) {\n var nextValue = styleRule.style[prop];\n var prevValue = style[prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (nextValue !== prevValue) {\n styleRule.prop(prop, nextValue, forceUpdateOptions);\n }\n } // Remove props.\n\n\n for (var _prop in style) {\n var _nextValue = styleRule.style[_prop];\n var _prevValue = style[_prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (_nextValue == null && _nextValue !== _prevValue) {\n styleRule.prop(_prop, null, forceUpdateOptions);\n }\n }\n }\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n var str = '';\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n\n for (var index = 0; index < this.index.length; index++) {\n var rule = this.index[index];\n var css = rule.toString(options); // No need to render an empty rule.\n\n if (!css && !link) continue;\n if (str) str += '\\n';\n str += css;\n }\n\n return str;\n };\n\n return RuleList;\n}();\n\nvar StyleSheet =\n/*#__PURE__*/\nfunction () {\n function StyleSheet(styles, options) {\n this.options = void 0;\n this.deployed = void 0;\n this.attached = void 0;\n this.rules = void 0;\n this.renderer = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.queue = void 0;\n this.attached = false;\n this.deployed = false;\n this.classes = {};\n this.keyframes = {};\n this.options = _extends({}, options, {\n sheet: this,\n parent: this,\n classes: this.classes,\n keyframes: this.keyframes\n });\n\n if (options.Renderer) {\n this.renderer = new options.Renderer(this);\n }\n\n this.rules = new RuleList(this.options);\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Attach renderable to the render tree.\n */\n\n\n var _proto = StyleSheet.prototype;\n\n _proto.attach = function attach() {\n if (this.attached) return this;\n if (this.renderer) this.renderer.attach();\n this.attached = true; // Order is important, because we can't use insertRule API if style element is not attached.\n\n if (!this.deployed) this.deploy();\n return this;\n }\n /**\n * Remove renderable from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.attached) return this;\n if (this.renderer) this.renderer.detach();\n this.attached = false;\n return this;\n }\n /**\n * Add a rule to the current stylesheet.\n * Will insert a rule also after the stylesheet has been rendered first time.\n */\n ;\n\n _proto.addRule = function addRule(name, decl, options) {\n var queue = this.queue; // Plugins can create rules.\n // In order to preserve the right order, we need to queue all `.addRule` calls,\n // which happen after the first `rules.add()` call.\n\n if (this.attached && !queue) this.queue = [];\n var rule = this.rules.add(name, decl, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n\n if (this.attached) {\n if (!this.deployed) return rule; // Don't insert rule directly if there is no stringified version yet.\n // It will be inserted all together when .attach is called.\n\n if (queue) queue.push(rule);else {\n this.insertRule(rule);\n\n if (this.queue) {\n this.queue.forEach(this.insertRule, this);\n this.queue = undefined;\n }\n }\n return rule;\n } // We can't add rules to a detached style node.\n // We will redeploy the sheet once user will attach it.\n\n\n this.deployed = false;\n return rule;\n }\n /**\n * Insert rule into the StyleSheet\n */\n ;\n\n _proto.insertRule = function insertRule(rule) {\n if (this.renderer) {\n this.renderer.insertRule(rule);\n }\n }\n /**\n * Create and add rules.\n * Will render also after Style Sheet was rendered the first time.\n */\n ;\n\n _proto.addRules = function addRules(styles, options) {\n var added = [];\n\n for (var name in styles) {\n var rule = this.addRule(name, styles[name], options);\n if (rule) added.push(rule);\n }\n\n return added;\n }\n /**\n * Get a rule by name.\n */\n ;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Delete a rule by name.\n * Returns `true`: if rule has been deleted from the DOM.\n */\n ;\n\n _proto.deleteRule = function deleteRule(name) {\n var rule = typeof name === 'object' ? name : this.rules.get(name);\n\n if (!rule || // Style sheet was created without link: true and attached, in this case we\n // won't be able to remove the CSS rule from the DOM.\n this.attached && !rule.renderable) {\n return false;\n }\n\n this.rules.remove(rule);\n\n if (this.attached && rule.renderable && this.renderer) {\n return this.renderer.deleteRule(rule.renderable);\n }\n\n return true;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Deploy pure CSS string to a renderable.\n */\n ;\n\n _proto.deploy = function deploy() {\n if (this.renderer) this.renderer.deploy();\n this.deployed = true;\n return this;\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var _this$rules;\n\n (_this$rules = this.rules).update.apply(_this$rules, arguments);\n\n return this;\n }\n /**\n * Updates a single rule.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n this.rules.updateOne(rule, data, options);\n return this;\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n return this.rules.toString(options);\n };\n\n return StyleSheet;\n}();\n\nvar PluginsRegistry =\n/*#__PURE__*/\nfunction () {\n function PluginsRegistry() {\n this.plugins = {\n internal: [],\n external: []\n };\n this.registry = void 0;\n }\n\n var _proto = PluginsRegistry.prototype;\n\n /**\n * Call `onCreateRule` hooks and return an object if returned by a hook.\n */\n _proto.onCreateRule = function onCreateRule(name, decl, options) {\n for (var i = 0; i < this.registry.onCreateRule.length; i++) {\n var rule = this.registry.onCreateRule[i](name, decl, options);\n if (rule) return rule;\n }\n\n return null;\n }\n /**\n * Call `onProcessRule` hooks.\n */\n ;\n\n _proto.onProcessRule = function onProcessRule(rule) {\n if (rule.isProcessed) return;\n var sheet = rule.options.sheet;\n\n for (var i = 0; i < this.registry.onProcessRule.length; i++) {\n this.registry.onProcessRule[i](rule, sheet);\n }\n\n if (rule.style) this.onProcessStyle(rule.style, rule, sheet);\n rule.isProcessed = true;\n }\n /**\n * Call `onProcessStyle` hooks.\n */\n ;\n\n _proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {\n for (var i = 0; i < this.registry.onProcessStyle.length; i++) {\n // $FlowFixMe[prop-missing]\n rule.style = this.registry.onProcessStyle[i](rule.style, rule, sheet);\n }\n }\n /**\n * Call `onProcessSheet` hooks.\n */\n ;\n\n _proto.onProcessSheet = function onProcessSheet(sheet) {\n for (var i = 0; i < this.registry.onProcessSheet.length; i++) {\n this.registry.onProcessSheet[i](sheet);\n }\n }\n /**\n * Call `onUpdate` hooks.\n */\n ;\n\n _proto.onUpdate = function onUpdate(data, rule, sheet, options) {\n for (var i = 0; i < this.registry.onUpdate.length; i++) {\n this.registry.onUpdate[i](data, rule, sheet, options);\n }\n }\n /**\n * Call `onChangeValue` hooks.\n */\n ;\n\n _proto.onChangeValue = function onChangeValue(value, prop, rule) {\n var processedValue = value;\n\n for (var i = 0; i < this.registry.onChangeValue.length; i++) {\n processedValue = this.registry.onChangeValue[i](processedValue, prop, rule);\n }\n\n return processedValue;\n }\n /**\n * Register a plugin.\n */\n ;\n\n _proto.use = function use(newPlugin, options) {\n if (options === void 0) {\n options = {\n queue: 'external'\n };\n }\n\n var plugins = this.plugins[options.queue]; // Avoids applying same plugin twice, at least based on ref.\n\n if (plugins.indexOf(newPlugin) !== -1) {\n return;\n }\n\n plugins.push(newPlugin);\n this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {\n for (var name in plugin) {\n if (name in registry) {\n registry[name].push(plugin[name]);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown hook \\\"\" + name + \"\\\".\") : void 0;\n }\n }\n\n return registry;\n }, {\n onCreateRule: [],\n onProcessRule: [],\n onProcessStyle: [],\n onProcessSheet: [],\n onChangeValue: [],\n onUpdate: []\n });\n };\n\n return PluginsRegistry;\n}();\n\n/**\n * Sheets registry to access them all at one place.\n */\nvar SheetsRegistry =\n/*#__PURE__*/\nfunction () {\n function SheetsRegistry() {\n this.registry = [];\n }\n\n var _proto = SheetsRegistry.prototype;\n\n /**\n * Register a Style Sheet.\n */\n _proto.add = function add(sheet) {\n var registry = this.registry;\n var index = sheet.options.index;\n if (registry.indexOf(sheet) !== -1) return;\n\n if (registry.length === 0 || index >= this.index) {\n registry.push(sheet);\n return;\n } // Find a position.\n\n\n for (var i = 0; i < registry.length; i++) {\n if (registry[i].options.index > index) {\n registry.splice(i, 0, sheet);\n return;\n }\n }\n }\n /**\n * Reset the registry.\n */\n ;\n\n _proto.reset = function reset() {\n this.registry = [];\n }\n /**\n * Remove a Style Sheet.\n */\n ;\n\n _proto.remove = function remove(sheet) {\n var index = this.registry.indexOf(sheet);\n this.registry.splice(index, 1);\n }\n /**\n * Convert all attached sheets to a CSS string.\n */\n ;\n\n _proto.toString = function toString(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n attached = _ref.attached,\n options = _objectWithoutPropertiesLoose(_ref, [\"attached\"]);\n\n var css = '';\n\n for (var i = 0; i < this.registry.length; i++) {\n var sheet = this.registry[i];\n\n if (attached != null && sheet.attached !== attached) {\n continue;\n }\n\n if (css) css += '\\n';\n css += sheet.toString(options);\n }\n\n return css;\n };\n\n _createClass(SheetsRegistry, [{\n key: \"index\",\n\n /**\n * Current highest index number.\n */\n get: function get() {\n return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index;\n }\n }]);\n\n return SheetsRegistry;\n}();\n\n/**\n * This is a global sheets registry. Only DomRenderer will add sheets to it.\n * On the server one should use an own SheetsRegistry instance and add the\n * sheets to it, because you need to make sure to create a new registry for\n * each request in order to not leak sheets across requests.\n */\n\nvar registry = new SheetsRegistry();\n\n/* eslint-disable */\n\n/**\n * Now that `globalThis` is available on most platforms\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility)\n * we check for `globalThis` first. `globalThis` is necessary for jss\n * to run in Agoric's secure version of JavaScript (SES). Under SES,\n * `globalThis` exists, but `window`, `self`, and `Function('return\n * this')()` are all undefined for security reasons.\n *\n * https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n */\nvar globalThis$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' && window.Math === Math ? window : typeof self !== 'undefined' && self.Math === Math ? self : Function('return this')();\n\nvar ns = '2f1acc6c3a606b082e5eef5e54414ffb';\nif (globalThis$1[ns] == null) globalThis$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify\n// the current version with just one short number and use it for classes generation\n// we use a counter. Also it is more accurate, because user can manually reevaluate\n// the module.\n\nvar moduleId = globalThis$1[ns]++;\n\nvar maxRules = 1e10;\n\n/**\n * Returns a function which generates unique class names based on counters.\n * When new generator function is created, rule counter is reseted.\n * We need to reset the rule counter for SSR for each request.\n */\nvar createGenerateId = function createGenerateId(options) {\n if (options === void 0) {\n options = {};\n }\n\n var ruleCounter = 0;\n return function (rule, sheet) {\n ruleCounter += 1;\n\n if (ruleCounter > maxRules) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] You might have a memory leak. Rule counter is at \" + ruleCounter + \".\") : void 0;\n }\n\n var jssId = '';\n var prefix = '';\n\n if (sheet) {\n if (sheet.options.classNamePrefix) {\n prefix = sheet.options.classNamePrefix;\n }\n\n if (sheet.options.jss.id != null) {\n jssId = String(sheet.options.jss.id);\n }\n }\n\n if (options.minify) {\n // Using \"c\" because a number can't be the first char in a class name.\n return \"\" + (prefix || 'c') + moduleId + jssId + ruleCounter;\n }\n\n return prefix + rule.key + \"-\" + moduleId + (jssId ? \"-\" + jssId : '') + \"-\" + ruleCounter;\n };\n};\n\n/**\n * Cache the value from the first time a function is called.\n */\nvar memoize = function memoize(fn) {\n var value;\n return function () {\n if (!value) value = fn();\n return value;\n };\n};\n\n/**\n * Get a style property value.\n */\nvar getPropertyValue = function getPropertyValue(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n return cssRule.attributeStyleMap.get(prop);\n }\n\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n};\n\n/**\n * Set a style property.\n */\nvar setProperty = function setProperty(cssRule, prop, value) {\n try {\n var cssValue = value;\n\n if (Array.isArray(value)) {\n cssValue = toCssValue(value, true);\n\n if (value[value.length - 1] === '!important') {\n cssRule.style.setProperty(prop, cssValue, 'important');\n return true;\n }\n } // Support CSSTOM.\n\n\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.set(prop, cssValue);\n } else {\n cssRule.style.setProperty(prop, cssValue);\n }\n } catch (err) {\n // IE may throw if property is unknown.\n return false;\n }\n\n return true;\n};\n\n/**\n * Remove a style property.\n */\nvar removeProperty = function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") : void 0;\n }\n};\n\n/**\n * Set the selector.\n */\nvar setSelector = function setSelector(cssRule, selectorText) {\n cssRule.selectorText = selectorText; // Return false if setter was not successful.\n // Currently works in chrome only.\n\n return cssRule.selectorText === selectorText;\n};\n/**\n * Gets the `head` element upon the first call and caches it.\n * We assume it can't be null.\n */\n\n\nvar getHead = memoize(function () {\n return document.querySelector('head');\n});\n/**\n * Find attached sheet with an index higher than the passed one.\n */\n\nfunction findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find attached sheet with the highest index.\n */\n\n\nfunction findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find a comment with \"jss\" inside.\n */\n\n\nfunction findCommentNode(text) {\n var head = getHead();\n\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n\n return null;\n}\n\n/**\n * Find a node before which we can insert the sheet.\n */\nfunction findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}\n/**\n * Insert style element into the DOM.\n */\n\n\nfunction insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}\n/**\n * Read jss nonce setting from the page if the user has set it.\n */\n\n\nvar getNonce = memoize(function () {\n var node = document.querySelector('meta[property=\"csp-nonce\"]');\n return node ? node.getAttribute('content') : null;\n});\n\nvar _insertRule = function insertRule(container, rule, index) {\n try {\n if ('insertRule' in container) {\n var c = container;\n c.insertRule(rule, index);\n } // Keyframes rule.\n else if ('appendRule' in container) {\n var _c = container;\n\n _c.appendRule(rule);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] \" + err.message) : void 0;\n return false;\n }\n\n return container.cssRules[index];\n};\n\nvar getValidRuleInsertionIndex = function getValidRuleInsertionIndex(container, index) {\n var maxIndex = container.cssRules.length; // In case previous insertion fails, passed index might be wrong\n\n if (index === undefined || index > maxIndex) {\n // eslint-disable-next-line no-param-reassign\n return maxIndex;\n }\n\n return index;\n};\n\nvar createStyle = function createStyle() {\n var el = document.createElement('style'); // Without it, IE will have a broken source order specificity if we\n // insert rules after we insert the style tag.\n // It seems to kick-off the source order specificity algorithm.\n\n el.textContent = '\\n';\n return el;\n};\n\nvar DomRenderer =\n/*#__PURE__*/\nfunction () {\n // HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696\n // Will be empty if link: true option is not set, because\n // it is only for use together with insertRule API.\n function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = [];\n // There is no sheet when the renderer is used from a standalone StyleRule.\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }\n /**\n * Insert style element into render tree.\n */\n\n\n var _proto = DomRenderer.prototype;\n\n _proto.attach = function attach() {\n // In the case the element node is external and it is already in the DOM.\n if (this.element.parentNode || !this.sheet) return;\n insertStyle(this.element, this.sheet.options); // When rules are inserted using `insertRule` API, after `sheet.detach().attach()`\n // most browsers create a new CSSStyleSheet, except of all IEs.\n\n var deployed = Boolean(this.sheet && this.sheet.deployed);\n\n if (this.hasInsertedRules && deployed) {\n this.hasInsertedRules = false;\n this.deploy();\n }\n }\n /**\n * Remove style element from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.sheet) return;\n var parentNode = this.element.parentNode;\n if (parentNode) parentNode.removeChild(this.element); // In the most browsers, rules inserted using insertRule() API will be lost when style element is removed.\n // Though IE will keep them and we need a consistent behavior.\n\n if (this.sheet.options.link) {\n this.cssRules = [];\n this.element.textContent = '\\n';\n }\n }\n /**\n * Inject CSS string into element.\n */\n ;\n\n _proto.deploy = function deploy() {\n var sheet = this.sheet;\n if (!sheet) return;\n\n if (sheet.options.link) {\n this.insertRules(sheet.rules);\n return;\n }\n\n this.element.textContent = \"\\n\" + sheet.toString() + \"\\n\";\n }\n /**\n * Insert RuleList into an element.\n */\n ;\n\n _proto.insertRules = function insertRules(rules, nativeParent) {\n for (var i = 0; i < rules.index.length; i++) {\n this.insertRule(rules.index[i], i, nativeParent);\n }\n }\n /**\n * Insert a rule into element.\n */\n ;\n\n _proto.insertRule = function insertRule(rule, index, nativeParent) {\n if (nativeParent === void 0) {\n nativeParent = this.element.sheet;\n }\n\n if (rule.rules) {\n var parent = rule;\n var latestNativeParent = nativeParent;\n\n if (rule.type === 'conditional' || rule.type === 'keyframes') {\n var _insertionIndex = getValidRuleInsertionIndex(nativeParent, index); // We need to render the container without children first.\n\n\n latestNativeParent = _insertRule(nativeParent, parent.toString({\n children: false\n }), _insertionIndex);\n\n if (latestNativeParent === false) {\n return false;\n }\n\n this.refCssRule(rule, _insertionIndex, latestNativeParent);\n }\n\n this.insertRules(parent.rules, latestNativeParent);\n return latestNativeParent;\n }\n\n var ruleStr = rule.toString();\n if (!ruleStr) return false;\n var insertionIndex = getValidRuleInsertionIndex(nativeParent, index);\n\n var nativeRule = _insertRule(nativeParent, ruleStr, insertionIndex);\n\n if (nativeRule === false) {\n return false;\n }\n\n this.hasInsertedRules = true;\n this.refCssRule(rule, insertionIndex, nativeRule);\n return nativeRule;\n };\n\n _proto.refCssRule = function refCssRule(rule, index, cssRule) {\n rule.renderable = cssRule; // We only want to reference the top level rules, deleteRule API doesn't support removing nested rules\n // like rules inside media queries or keyframes\n\n if (rule.options.parent instanceof StyleSheet) {\n this.cssRules[index] = cssRule;\n }\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.deleteRule = function deleteRule(cssRule) {\n var sheet = this.element.sheet;\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return true;\n }\n /**\n * Get index of a CSS Rule.\n */\n ;\n\n _proto.indexOf = function indexOf(cssRule) {\n return this.cssRules.indexOf(cssRule);\n }\n /**\n * Generate a new CSS rule and replace the existing one.\n *\n * Only used for some old browsers because they can't set a selector.\n */\n ;\n\n _proto.replaceRule = function replaceRule(cssRule, rule) {\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n this.element.sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return this.insertRule(rule, index);\n }\n /**\n * Get all rules elements.\n */\n ;\n\n _proto.getRules = function getRules() {\n return this.element.sheet.cssRules;\n };\n\n return DomRenderer;\n}();\n\nvar instanceCounter = 0;\n\nvar Jss =\n/*#__PURE__*/\nfunction () {\n function Jss(options) {\n this.id = instanceCounter++;\n this.version = \"10.6.0\";\n this.plugins = new PluginsRegistry();\n this.options = {\n id: {\n minify: false\n },\n createGenerateId: createGenerateId,\n Renderer: isInBrowser ? DomRenderer : null,\n plugins: []\n };\n this.generateId = createGenerateId({\n minify: false\n });\n\n for (var i = 0; i < plugins.length; i++) {\n this.plugins.use(plugins[i], {\n queue: 'internal'\n });\n }\n\n this.setup(options);\n }\n /**\n * Prepares various options, applies plugins.\n * Should not be used twice on the same instance, because there is no plugins\n * deduplication logic.\n */\n\n\n var _proto = Jss.prototype;\n\n _proto.setup = function setup(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.createGenerateId) {\n this.options.createGenerateId = options.createGenerateId;\n }\n\n if (options.id) {\n this.options.id = _extends({}, this.options.id, options.id);\n }\n\n if (options.createGenerateId || options.id) {\n this.generateId = this.options.createGenerateId(this.options.id);\n }\n\n if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint;\n\n if ('Renderer' in options) {\n this.options.Renderer = options.Renderer;\n } // eslint-disable-next-line prefer-spread\n\n\n if (options.plugins) this.use.apply(this, options.plugins);\n return this;\n }\n /**\n * Create a Style Sheet.\n */\n ;\n\n _proto.createStyleSheet = function createStyleSheet(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n index = _options.index;\n\n if (typeof index !== 'number') {\n index = registry.index === 0 ? 0 : registry.index + 1;\n }\n\n var sheet = new StyleSheet(styles, _extends({}, options, {\n jss: this,\n generateId: options.generateId || this.generateId,\n insertionPoint: this.options.insertionPoint,\n Renderer: this.options.Renderer,\n index: index\n }));\n this.plugins.onProcessSheet(sheet);\n return sheet;\n }\n /**\n * Detach the Style Sheet and remove it from the registry.\n */\n ;\n\n _proto.removeStyleSheet = function removeStyleSheet(sheet) {\n sheet.detach();\n registry.remove(sheet);\n return this;\n }\n /**\n * Create a rule without a Style Sheet.\n * [Deprecated] will be removed in the next major version.\n */\n ;\n\n _proto.createRule = function createRule$1(name, style, options) {\n if (style === void 0) {\n style = {};\n }\n\n if (options === void 0) {\n options = {};\n }\n\n // Enable rule without name for inline styles.\n if (typeof name === 'object') {\n // $FlowFixMe[incompatible-call]\n return this.createRule(undefined, name, style);\n } // $FlowFixMe[incompatible-type]\n\n\n var ruleOptions = _extends({}, options, {\n name: name,\n jss: this,\n Renderer: this.options.Renderer\n });\n\n if (!ruleOptions.generateId) ruleOptions.generateId = this.generateId;\n if (!ruleOptions.classes) ruleOptions.classes = {};\n if (!ruleOptions.keyframes) ruleOptions.keyframes = {};\n\n var rule = createRule(name, style, ruleOptions);\n\n if (rule) this.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Register plugin. Passed function will be invoked with a rule instance.\n */\n ;\n\n _proto.use = function use() {\n var _this = this;\n\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n plugins.forEach(function (plugin) {\n _this.plugins.use(plugin);\n });\n return this;\n };\n\n return Jss;\n}();\n\n/**\n * Extracts a styles object with only props that contain function values.\n */\nfunction getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}\n\n/**\n * SheetsManager is like a WeakMap which is designed to count StyleSheet\n * instances and attach/detach automatically.\n */\nvar SheetsManager =\n/*#__PURE__*/\nfunction () {\n function SheetsManager() {\n this.length = 0;\n this.sheets = new WeakMap();\n }\n\n var _proto = SheetsManager.prototype;\n\n _proto.get = function get(key) {\n var entry = this.sheets.get(key);\n return entry && entry.sheet;\n };\n\n _proto.add = function add(key, sheet) {\n if (this.sheets.has(key)) return;\n this.length++;\n this.sheets.set(key, {\n sheet: sheet,\n refs: 0\n });\n };\n\n _proto.manage = function manage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs === 0) {\n entry.sheet.attach();\n }\n\n entry.refs++;\n return entry.sheet;\n }\n\n warning(false, \"[JSS] SheetsManager: can't find sheet to manage\");\n return undefined;\n };\n\n _proto.unmanage = function unmanage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs > 0) {\n entry.refs--;\n if (entry.refs === 0) entry.sheet.detach();\n }\n } else {\n warning(false, \"SheetsManager: can't find sheet to unmanage\");\n }\n };\n\n _createClass(SheetsManager, [{\n key: \"size\",\n get: function get() {\n return this.length;\n }\n }]);\n\n return SheetsManager;\n}();\n\n/**\n * A better abstraction over CSS.\n *\n * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present\n * @website https://github.com/cssinjs/jss\n * @license MIT\n */\n\n/**\n * Export a constant indicating if this browser has CSSTOM support.\n * https://developers.google.com/web/updates/2018/03/cssom\n */\nvar hasCSSTOMSupport = typeof CSS === 'object' && CSS != null && 'number' in CSS;\n/**\n * Creates a new instance of Jss.\n */\n\nvar create = function create(options) {\n return new Jss(options);\n};\n/**\n * A global Jss instance.\n */\n\nvar jss = create();\n\nexport default jss;\nexport { RuleList, SheetsManager, SheetsRegistry, create, createGenerateId, createRule, getDynamicStyles, hasCSSTOMSupport, registry as sheets, toCssValue };\n","import warning from 'tiny-warning';\nimport { createRule } from 'jss';\n\nvar now = Date.now();\nvar fnValuesNs = \"fnValues\" + now;\nvar fnRuleNs = \"fnStyle\" + ++now;\n\nvar functionPlugin = function functionPlugin() {\n return {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (typeof decl !== 'function') return null;\n var rule = createRule(name, {}, options);\n rule[fnRuleNs] = decl;\n return rule;\n },\n onProcessStyle: function onProcessStyle(style, rule) {\n // We need to extract function values from the declaration, so that we can keep core unaware of them.\n // We need to do that only once.\n // We don't need to extract functions on each style update, since this can happen only once.\n // We don't support function values inside of function rules.\n if (fnValuesNs in rule || fnRuleNs in rule) return style;\n var fnValues = {};\n\n for (var prop in style) {\n var value = style[prop];\n if (typeof value !== 'function') continue;\n delete style[prop];\n fnValues[prop] = value;\n } // $FlowFixMe[prop-missing]\n\n\n rule[fnValuesNs] = fnValues;\n return style;\n },\n onUpdate: function onUpdate(data, rule, sheet, options) {\n var styleRule = rule; // $FlowFixMe[prop-missing]\n\n var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object\n // will be returned from that function.\n\n if (fnRule) {\n // Empty object will remove all currently defined props\n // in case function rule returns a falsy value.\n styleRule.style = fnRule(data) || {};\n\n if (process.env.NODE_ENV === 'development') {\n for (var prop in styleRule.style) {\n if (typeof styleRule.style[prop] === 'function') {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;\n break;\n }\n }\n }\n } // $FlowFixMe[prop-missing]\n\n\n var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.\n\n if (fnValues) {\n for (var _prop in fnValues) {\n styleRule.prop(_prop, fnValues[_prop](data), options);\n }\n }\n }\n };\n};\n\nexport default functionPlugin;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","import $$observable from 'symbol-observable';\nimport { createRule } from 'jss';\n\nvar isObservable = function isObservable(value) {\n return value && value[$$observable] && value === value[$$observable]();\n};\n\nvar observablePlugin = function observablePlugin(updateOptions) {\n return {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (!isObservable(decl)) return null; // Cast `decl` to `Observable`, since it passed the type guard.\n\n var style$ = decl;\n var rule = createRule(name, {}, options); // TODO\n // Call `stream.subscribe()` returns a subscription, which should be explicitly\n // unsubscribed from when we know this sheet is no longer needed.\n\n style$.subscribe(function (style) {\n for (var prop in style) {\n rule.prop(prop, style[prop], updateOptions);\n }\n });\n return rule;\n },\n onProcessRule: function onProcessRule(rule) {\n if (rule && rule.type !== 'style') return;\n var styleRule = rule;\n var style = styleRule.style;\n\n var _loop = function _loop(prop) {\n var value = style[prop];\n if (!isObservable(value)) return \"continue\";\n delete style[prop];\n value.subscribe({\n next: function next(nextValue) {\n styleRule.prop(prop, nextValue, updateOptions);\n }\n });\n };\n\n for (var prop in style) {\n var _ret = _loop(prop);\n\n if (_ret === \"continue\") continue;\n }\n }\n };\n};\n\nexport default observablePlugin;\n","import warning from 'tiny-warning';\n\nvar semiWithNl = /;\\n/;\n\n/**\n * Naive CSS parser.\n * - Supports only rule body (no selectors)\n * - Requires semicolon and new line after the value (except of last line)\n * - No nested rules support\n */\nvar parse = function parse(cssText) {\n var style = {};\n var split = cssText.split(semiWithNl);\n\n for (var i = 0; i < split.length; i++) {\n var decl = (split[i] || '').trim();\n if (!decl) continue;\n var colonIndex = decl.indexOf(':');\n\n if (colonIndex === -1) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Malformed CSS string \\\"\" + decl + \"\\\"\") : void 0;\n continue;\n }\n\n var prop = decl.substr(0, colonIndex).trim();\n var value = decl.substr(colonIndex + 1).trim();\n style[prop] = value;\n }\n\n return style;\n};\n\nvar onProcessRule = function onProcessRule(rule) {\n if (typeof rule.style === 'string') {\n // $FlowFixMe[prop-missing] We can safely assume that rule has the style property\n rule.style = parse(rule.style);\n }\n};\n\nfunction templatePlugin() {\n return {\n onProcessRule: onProcessRule\n };\n}\n\nexport default templatePlugin;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport { RuleList } from 'jss';\n\nvar at = '@global';\nvar atPrefix = '@global ';\n\nvar GlobalContainerRule =\n/*#__PURE__*/\nfunction () {\n function GlobalContainerRule(key, styles, options) {\n this.type = 'global';\n this.at = at;\n this.rules = void 0;\n this.options = void 0;\n this.key = void 0;\n this.isProcessed = false;\n this.key = key;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var selector in styles) {\n this.rules.add(selector, styles[selector]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = GlobalContainerRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (rule) this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString() {\n return this.rules.toString();\n };\n\n return GlobalContainerRule;\n}();\n\nvar GlobalPrefixedRule =\n/*#__PURE__*/\nfunction () {\n function GlobalPrefixedRule(key, style, options) {\n this.type = 'global';\n this.at = at;\n this.options = void 0;\n this.rule = void 0;\n this.isProcessed = false;\n this.key = void 0;\n this.key = key;\n this.options = options;\n var selector = key.substr(atPrefix.length);\n this.rule = options.jss.createRule(selector, style, _extends({}, options, {\n parent: this\n }));\n }\n\n var _proto2 = GlobalPrefixedRule.prototype;\n\n _proto2.toString = function toString(options) {\n return this.rule ? this.rule.toString(options) : '';\n };\n\n return GlobalPrefixedRule;\n}();\n\nvar separatorRegExp = /\\s*,\\s*/g;\n\nfunction addScope(selector, scope) {\n var parts = selector.split(separatorRegExp);\n var scoped = '';\n\n for (var i = 0; i < parts.length; i++) {\n scoped += scope + \" \" + parts[i].trim();\n if (parts[i + 1]) scoped += ', ';\n }\n\n return scoped;\n}\n\nfunction handleNestedGlobalContainerRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n var rules = style ? style[at] : null;\n if (!rules) return;\n\n for (var name in rules) {\n sheet.addRule(name, rules[name], _extends({}, options, {\n selector: addScope(name, rule.selector)\n }));\n }\n\n delete style[at];\n}\n\nfunction handlePrefixedGlobalRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n\n for (var prop in style) {\n if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;\n var selector = addScope(prop.substr(at.length), rule.selector);\n sheet.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n delete style[prop];\n }\n}\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssGlobal() {\n function onCreateRule(name, styles, options) {\n if (!name) return null;\n\n if (name === at) {\n return new GlobalContainerRule(name, styles, options);\n }\n\n if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {\n return new GlobalPrefixedRule(name, styles, options);\n }\n\n var parent = options.parent;\n\n if (parent) {\n if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {\n options.scoped = false;\n }\n }\n\n if (options.scoped === false) {\n options.selector = name;\n }\n\n return null;\n }\n\n function onProcessRule(rule, sheet) {\n if (rule.type !== 'style' || !sheet) return;\n handleNestedGlobalContainerRule(rule, sheet);\n handlePrefixedGlobalRule(rule, sheet);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}\n\nexport default jssGlobal;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport warning from 'tiny-warning';\n\nvar isObject = function isObject(obj) {\n return obj && typeof obj === 'object' && !Array.isArray(obj);\n};\n\nvar valueNs = \"extendCurrValue\" + Date.now();\n\nfunction mergeExtend(style, rule, sheet, newStyle) {\n var extendType = typeof style.extend; // Extend using a rule name.\n\n if (extendType === 'string') {\n if (!sheet) return;\n var refRule = sheet.getRule(style.extend);\n if (!refRule) return;\n\n if (refRule === rule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] A rule tries to extend itself \\n\" + rule.toString()) : void 0;\n return;\n }\n\n var parent = refRule.options.parent;\n\n if (parent) {\n var originalStyle = parent.rules.raw[style.extend];\n extend(originalStyle, rule, sheet, newStyle);\n }\n\n return;\n } // Extend using an array.\n\n\n if (Array.isArray(style.extend)) {\n for (var index = 0; index < style.extend.length; index++) {\n var singleExtend = style.extend[index];\n var singleStyle = typeof singleExtend === 'string' ? _extends({}, style, {\n extend: singleExtend\n }) : style.extend[index];\n extend(singleStyle, rule, sheet, newStyle);\n }\n\n return;\n } // Extend is a style object.\n\n\n for (var prop in style.extend) {\n if (prop === 'extend') {\n extend(style.extend.extend, rule, sheet, newStyle);\n continue;\n }\n\n if (isObject(style.extend[prop])) {\n if (!(prop in newStyle)) newStyle[prop] = {};\n extend(style.extend[prop], rule, sheet, newStyle[prop]);\n continue;\n }\n\n newStyle[prop] = style.extend[prop];\n }\n}\n\nfunction mergeRest(style, rule, sheet, newStyle) {\n // Copy base style.\n for (var prop in style) {\n if (prop === 'extend') continue;\n\n if (isObject(newStyle[prop]) && isObject(style[prop])) {\n extend(style[prop], rule, sheet, newStyle[prop]);\n continue;\n }\n\n if (isObject(style[prop])) {\n newStyle[prop] = extend(style[prop], rule, sheet);\n continue;\n }\n\n newStyle[prop] = style[prop];\n }\n}\n/**\n * Recursively extend styles.\n */\n\n\nfunction extend(style, rule, sheet, newStyle) {\n if (newStyle === void 0) {\n newStyle = {};\n }\n\n mergeExtend(style, rule, sheet, newStyle);\n mergeRest(style, rule, sheet, newStyle);\n return newStyle;\n}\n/**\n * Handle `extend` property.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssExtend() {\n function onProcessStyle(style, rule, sheet) {\n if ('extend' in style) return extend(style, rule, sheet);\n return style;\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop !== 'extend') return value; // Value is empty, remove properties set previously.\n\n if (value == null || value === false) {\n // $FlowFixMe[prop-missing]\n for (var key in rule[valueNs]) {\n rule.prop(key, null);\n } // $FlowFixMe[prop-missing] Flow complains because there is no indexer property in StyleRule\n\n\n rule[valueNs] = null;\n return null;\n }\n\n if (typeof value === 'object') {\n // $FlowFixMe[invalid-in-rhs] This will be an object\n for (var _key in value) {\n // $FlowFixMe[incompatible-use] This will be an object\n rule.prop(_key, value[_key]);\n } // $FlowFixMe[prop-missing] Flow complains because there is no indexer property in StyleRule\n\n\n rule[valueNs] = value;\n } // Make sure we don't set the value in the core.\n\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default jssExtend;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport warning from 'tiny-warning';\n\nvar separatorRegExp = /\\s*,\\s*/g;\nvar parentRegExp = /&/g;\nvar refRegExp = /\\$([\\w-]+)/g;\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\nfunction jssNested() {\n // Get a function to be used for $ref replacement.\n function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : void 0;\n return key;\n };\n }\n\n function replaceParentRefs(nestedProp, parentProp) {\n var parentSelectors = parentProp.split(separatorRegExp);\n var nestedSelectors = nestedProp.split(separatorRegExp);\n var result = '';\n\n for (var i = 0; i < parentSelectors.length; i++) {\n var parent = parentSelectors[i];\n\n for (var j = 0; j < nestedSelectors.length; j++) {\n var nested = nestedSelectors[j];\n if (result) result += ', '; // Replace all & by the parent or prefix & with the parent.\n\n result += nested.indexOf('&') !== -1 ? nested.replace(parentRegExp, parent) : parent + \" \" + nested;\n }\n }\n\n return result;\n }\n\n function getOptions(rule, container, prevOptions) {\n // Options has been already created, now we only increase index.\n if (prevOptions) return _extends({}, prevOptions, {\n index: prevOptions.index + 1 // $FlowFixMe[prop-missing]\n\n });\n var nestingLevel = rule.options.nestingLevel;\n nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;\n\n var options = _extends({}, rule.options, {\n nestingLevel: nestingLevel,\n index: container.indexOf(rule) + 1 // We don't need the parent name to be set options for chlid.\n\n });\n\n delete options.name;\n return options;\n }\n\n function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style') return style;\n var styleRule = rule;\n var container = styleRule.options.parent;\n var options;\n var replaceRef;\n\n for (var prop in style) {\n var isNested = prop.indexOf('&') !== -1;\n var isNestedConditional = prop[0] === '@';\n if (!isNested && !isNestedConditional) continue;\n options = getOptions(styleRule, container, options);\n\n if (isNested) {\n var selector = replaceParentRefs(prop, styleRule.selector); // Lazily create the ref replacer function just once for\n // all nested rules within the sheet.\n\n if (!replaceRef) replaceRef = getReplaceRef(container, sheet); // Replace all $refs.\n\n selector = selector.replace(refRegExp, replaceRef);\n container.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n } else if (isNestedConditional) {\n // Place conditional right after the parent rule to ensure right ordering.\n container.addRule(prop, {}, options) // Flow expects more options but they aren't required\n // And flow doesn't know this will always be a StyleRule which has the addRule method\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n .addRule(styleRule.key, style[prop], {\n selector: styleRule.selector\n });\n }\n\n delete style[prop];\n }\n\n return style;\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssNested;\n","import warning from 'tiny-warning';\n\n/**\n * Set selector.\n *\n * @param {Object} original rule\n * @param {String} className class string\n * @return {Boolean} flag, indicating function was successfull or not\n */\nfunction registerClass(rule, className) {\n // Skip falsy values\n if (!className) return true; // Support array of class names `{composes: ['foo', 'bar']}`\n\n if (Array.isArray(className)) {\n for (var index = 0; index < className.length; index++) {\n var isSetted = registerClass(rule, className[index]);\n if (!isSetted) return false;\n }\n\n return true;\n } // Support space separated class names `{composes: 'foo bar'}`\n\n\n if (className.indexOf(' ') > -1) {\n return registerClass(rule, className.split(' '));\n }\n\n var _ref = rule.options,\n parent = _ref.parent; // It is a ref to a local rule.\n\n if (className[0] === '$') {\n var refRule = parent.getRule(className.substr(1));\n\n if (!refRule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced rule is not defined. \\n\" + rule.toString()) : void 0;\n return false;\n }\n\n if (refRule === rule) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Cyclic composition detected. \\n\" + rule.toString()) : void 0;\n return false;\n }\n\n parent.classes[rule.key] += \" \" + parent.classes[refRule.key];\n return true;\n }\n\n parent.classes[rule.key] += \" \" + className;\n return true;\n}\n/**\n * Convert compose property to additional class, remove property from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssCompose() {\n function onProcessStyle(style, rule) {\n if (!('composes' in style)) return style;\n registerClass(rule, style.composes); // Remove composes property to prevent infinite loop.\n\n delete style.composes;\n return style;\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssCompose;\n","/* eslint-disable no-var, prefer-template */\nvar uppercasePattern = /[A-Z]/g\nvar msPattern = /^ms-/\nvar cache = {}\n\nfunction toHyphenLower(match) {\n return '-' + match.toLowerCase()\n}\n\nfunction hyphenateStyleName(name) {\n if (cache.hasOwnProperty(name)) {\n return cache[name]\n }\n\n var hName = name.replace(uppercasePattern, toHyphenLower)\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)\n}\n\nexport default hyphenateStyleName\n","import hyphenate from 'hyphenate-style-name';\n\n/**\n * Convert camel cased property names to dash separated.\n *\n * @param {Object} style\n * @return {Object}\n */\n\nfunction convertCase(style) {\n var converted = {};\n\n for (var prop in style) {\n var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop);\n converted[key] = style[prop];\n }\n\n if (style.fallbacks) {\n if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);\n }\n\n return converted;\n}\n/**\n * Allow camel cased property names by converting them back to dasherized.\n *\n * @param {Rule} rule\n */\n\n\nfunction camelCase() {\n function onProcessStyle(style) {\n if (Array.isArray(style)) {\n // Handle rules like @font-face, which can have multiple styles in an array\n for (var index = 0; index < style.length; index++) {\n style[index] = convertCase(style[index]);\n }\n\n return style;\n }\n\n return convertCase(style);\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop.indexOf('--') === 0) {\n return value;\n }\n\n var hyphenatedProp = hyphenate(prop); // There was no camel case in place\n\n if (prop === hyphenatedProp) return value;\n rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default camelCase;\n","import { hasCSSTOMSupport } from 'jss';\n\nvar px = hasCSSTOMSupport && CSS ? CSS.px : 'px';\nvar ms = hasCSSTOMSupport && CSS ? CSS.ms : 'ms';\nvar percent = hasCSSTOMSupport && CSS ? CSS.percent : '%';\n/**\n * Generated jss-plugin-default-unit CSS property units\n *\n * @type object\n */\n\nvar defaultUnits = {\n // Animation properties\n 'animation-delay': ms,\n 'animation-duration': ms,\n // Background properties\n 'background-position': px,\n 'background-position-x': px,\n 'background-position-y': px,\n 'background-size': px,\n // Border Properties\n border: px,\n 'border-bottom': px,\n 'border-bottom-left-radius': px,\n 'border-bottom-right-radius': px,\n 'border-bottom-width': px,\n 'border-left': px,\n 'border-left-width': px,\n 'border-radius': px,\n 'border-right': px,\n 'border-right-width': px,\n 'border-top': px,\n 'border-top-left-radius': px,\n 'border-top-right-radius': px,\n 'border-top-width': px,\n 'border-width': px,\n 'border-block': px,\n 'border-block-end': px,\n 'border-block-end-width': px,\n 'border-block-start': px,\n 'border-block-start-width': px,\n 'border-block-width': px,\n 'border-inline': px,\n 'border-inline-end': px,\n 'border-inline-end-width': px,\n 'border-inline-start': px,\n 'border-inline-start-width': px,\n 'border-inline-width': px,\n 'border-start-start-radius': px,\n 'border-start-end-radius': px,\n 'border-end-start-radius': px,\n 'border-end-end-radius': px,\n // Margin properties\n margin: px,\n 'margin-bottom': px,\n 'margin-left': px,\n 'margin-right': px,\n 'margin-top': px,\n 'margin-block': px,\n 'margin-block-end': px,\n 'margin-block-start': px,\n 'margin-inline': px,\n 'margin-inline-end': px,\n 'margin-inline-start': px,\n // Padding properties\n padding: px,\n 'padding-bottom': px,\n 'padding-left': px,\n 'padding-right': px,\n 'padding-top': px,\n 'padding-block': px,\n 'padding-block-end': px,\n 'padding-block-start': px,\n 'padding-inline': px,\n 'padding-inline-end': px,\n 'padding-inline-start': px,\n // Mask properties\n 'mask-position-x': px,\n 'mask-position-y': px,\n 'mask-size': px,\n // Width and height properties\n height: px,\n width: px,\n 'min-height': px,\n 'max-height': px,\n 'min-width': px,\n 'max-width': px,\n // Position properties\n bottom: px,\n left: px,\n top: px,\n right: px,\n inset: px,\n 'inset-block': px,\n 'inset-block-end': px,\n 'inset-block-start': px,\n 'inset-inline': px,\n 'inset-inline-end': px,\n 'inset-inline-start': px,\n // Shadow properties\n 'box-shadow': px,\n 'text-shadow': px,\n // Column properties\n 'column-gap': px,\n 'column-rule': px,\n 'column-rule-width': px,\n 'column-width': px,\n // Font and text properties\n 'font-size': px,\n 'font-size-delta': px,\n 'letter-spacing': px,\n 'text-decoration-thickness': px,\n 'text-indent': px,\n 'text-stroke': px,\n 'text-stroke-width': px,\n 'word-spacing': px,\n // Motion properties\n motion: px,\n 'motion-offset': px,\n // Outline properties\n outline: px,\n 'outline-offset': px,\n 'outline-width': px,\n // Perspective properties\n perspective: px,\n 'perspective-origin-x': percent,\n 'perspective-origin-y': percent,\n // Transform properties\n 'transform-origin': percent,\n 'transform-origin-x': percent,\n 'transform-origin-y': percent,\n 'transform-origin-z': percent,\n // Transition properties\n 'transition-delay': ms,\n 'transition-duration': ms,\n // Alignment properties\n 'vertical-align': px,\n 'flex-basis': px,\n // Some random properties\n 'shape-margin': px,\n size: px,\n gap: px,\n // Grid properties\n grid: px,\n 'grid-gap': px,\n 'row-gap': px,\n 'grid-row-gap': px,\n 'grid-column-gap': px,\n 'grid-template-rows': px,\n 'grid-template-columns': px,\n 'grid-auto-rows': px,\n 'grid-auto-columns': px,\n // Not existing properties.\n // Used to avoid issues with jss-plugin-expand integration.\n 'box-shadow-x': px,\n 'box-shadow-y': px,\n 'box-shadow-blur': px,\n 'box-shadow-spread': px,\n 'font-line-height': px,\n 'text-shadow-x': px,\n 'text-shadow-y': px,\n 'text-shadow-blur': px\n};\n\n/**\n * Clones the object and adds a camel cased property version.\n */\nfunction addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n\n var newObj = {};\n\n for (var _key in obj) {\n newObj[_key] = obj[_key];\n newObj[_key.replace(regExp, replace)] = obj[_key];\n }\n\n return newObj;\n}\n\nvar units = addCamelCasedVersion(defaultUnits);\n/**\n * Recursive deep style passing function\n */\n\nfunction iterate(prop, value, options) {\n if (value == null) return value;\n\n if (Array.isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n value[i] = iterate(prop, value[i], options);\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n for (var innerProp in value) {\n value[innerProp] = iterate(innerProp, value[innerProp], options);\n }\n } else {\n for (var _innerProp in value) {\n value[_innerProp] = iterate(prop + \"-\" + _innerProp, value[_innerProp], options);\n }\n } // eslint-disable-next-line no-restricted-globals\n\n } else if (typeof value === 'number' && isNaN(value) === false) {\n var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.\n\n if (unit && !(value === 0 && unit === px)) {\n return typeof unit === 'function' ? unit(value).toString() : \"\" + value + unit;\n }\n\n return value.toString();\n }\n\n return value;\n}\n/**\n * Add unit to numeric values.\n */\n\n\nfunction defaultUnit(options) {\n if (options === void 0) {\n options = {};\n }\n\n var camelCasedOptions = addCamelCasedVersion(options);\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n for (var prop in style) {\n style[prop] = iterate(prop, style[prop], camelCasedOptions);\n }\n\n return style;\n }\n\n function onChangeValue(value, prop) {\n return iterate(prop, value, camelCasedOptions);\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default defaultUnit;\n","/**\n * A scheme for converting properties from array to regular style.\n * All properties listed below will be transformed to a string separated by space.\n */\nvar propArray = {\n 'background-size': true,\n 'background-position': true,\n border: true,\n 'border-bottom': true,\n 'border-left': true,\n 'border-top': true,\n 'border-right': true,\n 'border-radius': true,\n 'border-image': true,\n 'border-width': true,\n 'border-style': true,\n 'border-color': true,\n 'box-shadow': true,\n flex: true,\n margin: true,\n padding: true,\n outline: true,\n 'transform-origin': true,\n transform: true,\n transition: true\n /**\n * A scheme for converting arrays to regular styles inside of objects.\n * For e.g.: \"{position: [0, 0]}\" => \"background-position: 0 0;\".\n */\n\n};\nvar propArrayInObj = {\n position: true,\n // background-position\n size: true // background-size\n\n /**\n * A scheme for parsing and building correct styles from passed objects.\n */\n\n};\nvar propObj = {\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n background: {\n attachment: null,\n color: null,\n image: null,\n position: null,\n repeat: null\n },\n border: {\n width: null,\n style: null,\n color: null\n },\n 'border-top': {\n width: null,\n style: null,\n color: null\n },\n 'border-right': {\n width: null,\n style: null,\n color: null\n },\n 'border-bottom': {\n width: null,\n style: null,\n color: null\n },\n 'border-left': {\n width: null,\n style: null,\n color: null\n },\n outline: {\n width: null,\n style: null,\n color: null\n },\n 'list-style': {\n type: null,\n position: null,\n image: null\n },\n transition: {\n property: null,\n duration: null,\n 'timing-function': null,\n timingFunction: null,\n // Needed for avoiding comilation issues with jss-plugin-camel-case\n delay: null\n },\n animation: {\n name: null,\n duration: null,\n 'timing-function': null,\n timingFunction: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n delay: null,\n 'iteration-count': null,\n iterationCount: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n direction: null,\n 'fill-mode': null,\n fillMode: null,\n // Needed to avoid compilation issues with jss-plugin-camel-case\n 'play-state': null,\n playState: null // Needed to avoid compilation issues with jss-plugin-camel-case\n\n },\n 'box-shadow': {\n x: 0,\n y: 0,\n blur: 0,\n spread: 0,\n color: null,\n inset: null\n },\n 'text-shadow': {\n x: 0,\n y: 0,\n blur: null,\n color: null\n }\n /**\n * A scheme for converting non-standart properties inside object.\n * For e.g.: include 'border-radius' property inside 'border' object.\n */\n\n};\nvar customPropObj = {\n border: {\n radius: 'border-radius',\n image: 'border-image',\n width: 'border-width',\n style: 'border-style',\n color: 'border-color'\n },\n 'border-bottom': {\n width: 'border-bottom-width',\n style: 'border-bottom-style',\n color: 'border-bottom-color'\n },\n 'border-top': {\n width: 'border-top-width',\n style: 'border-top-style',\n color: 'border-top-color'\n },\n 'border-left': {\n width: 'border-left-width',\n style: 'border-left-style',\n color: 'border-left-color'\n },\n 'border-right': {\n width: 'border-right-width',\n style: 'border-right-style',\n color: 'border-right-color'\n },\n background: {\n size: 'background-size',\n image: 'background-image'\n },\n font: {\n style: 'font-style',\n variant: 'font-variant',\n weight: 'font-weight',\n stretch: 'font-stretch',\n size: 'font-size',\n family: 'font-family',\n lineHeight: 'line-height',\n // Needed to avoid compilation issues with jss-plugin-camel-case\n 'line-height': 'line-height'\n },\n flex: {\n grow: 'flex-grow',\n basis: 'flex-basis',\n direction: 'flex-direction',\n wrap: 'flex-wrap',\n flow: 'flex-flow',\n shrink: 'flex-shrink'\n },\n align: {\n self: 'align-self',\n items: 'align-items',\n content: 'align-content'\n },\n grid: {\n 'template-columns': 'grid-template-columns',\n templateColumns: 'grid-template-columns',\n 'template-rows': 'grid-template-rows',\n templateRows: 'grid-template-rows',\n 'template-areas': 'grid-template-areas',\n templateAreas: 'grid-template-areas',\n template: 'grid-template',\n 'auto-columns': 'grid-auto-columns',\n autoColumns: 'grid-auto-columns',\n 'auto-rows': 'grid-auto-rows',\n autoRows: 'grid-auto-rows',\n 'auto-flow': 'grid-auto-flow',\n autoFlow: 'grid-auto-flow',\n row: 'grid-row',\n column: 'grid-column',\n 'row-start': 'grid-row-start',\n rowStart: 'grid-row-start',\n 'row-end': 'grid-row-end',\n rowEnd: 'grid-row-end',\n 'column-start': 'grid-column-start',\n columnStart: 'grid-column-start',\n 'column-end': 'grid-column-end',\n columnEnd: 'grid-column-end',\n area: 'grid-area',\n gap: 'grid-gap',\n 'row-gap': 'grid-row-gap',\n rowGap: 'grid-row-gap',\n 'column-gap': 'grid-column-gap',\n columnGap: 'grid-column-gap'\n }\n};\n\n/* eslint-disable no-use-before-define */\n\n/**\n * Map values by given prop.\n *\n * @param {Array} array of values\n * @param {String} original property\n * @param {String} original rule\n * @return {String} mapped values\n */\nfunction mapValuesByProp(value, prop, rule) {\n return value.map(function (item) {\n return objectToArray(item, prop, rule, false, true);\n });\n}\n/**\n * Convert array to nested array, if needed\n */\n\n\nfunction processArray(value, prop, scheme, rule) {\n if (scheme[prop] == null) return value;\n if (value.length === 0) return [];\n if (Array.isArray(value[0])) return processArray(value[0], prop, scheme, rule);\n\n if (typeof value[0] === 'object') {\n return mapValuesByProp(value, prop, rule);\n }\n\n return [value];\n}\n/**\n * Convert object to array.\n */\n\n\nfunction objectToArray(value, prop, rule, isFallback, isInArray) {\n if (!(propObj[prop] || customPropObj[prop])) return [];\n var result = []; // Check if exists any non-standard property\n\n if (customPropObj[prop]) {\n // eslint-disable-next-line no-param-reassign\n value = customPropsToStyle(value, rule, customPropObj[prop], isFallback);\n } // Pass throught all standart props\n\n\n if (Object.keys(value).length) {\n for (var baseProp in propObj[prop]) {\n if (value[baseProp]) {\n if (Array.isArray(value[baseProp])) {\n result.push(propArrayInObj[baseProp] === null ? value[baseProp] : value[baseProp].join(' '));\n } else result.push(value[baseProp]);\n\n continue;\n } // Add default value from props config.\n\n\n if (propObj[prop][baseProp] != null) {\n result.push(propObj[prop][baseProp]);\n }\n }\n }\n\n if (!result.length || isInArray) return result;\n return [result];\n}\n/**\n * Convert custom properties values to styles adding them to rule directly\n */\n\n\nfunction customPropsToStyle(value, rule, customProps, isFallback) {\n for (var prop in customProps) {\n var propName = customProps[prop]; // If current property doesn't exist already in rule - add new one\n\n if (typeof value[prop] !== 'undefined' && (isFallback || !rule.prop(propName))) {\n var _styleDetector;\n\n var appendedValue = styleDetector((_styleDetector = {}, _styleDetector[propName] = value[prop], _styleDetector), rule)[propName]; // Add style directly in rule\n\n if (isFallback) rule.style.fallbacks[propName] = appendedValue;else rule.style[propName] = appendedValue;\n } // Delete converted property to avoid double converting\n\n\n delete value[prop];\n }\n\n return value;\n}\n/**\n * Detect if a style needs to be converted.\n */\n\n\nfunction styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}\n/**\n * Adds possibility to write expanded styles.\n */\n\n\nfunction jssExpand() {\n function onProcessStyle(style, rule) {\n if (!style || rule.type !== 'style') return style;\n\n if (Array.isArray(style)) {\n // Pass rules one by one and reformat them\n for (var index = 0; index < style.length; index++) {\n style[index] = styleDetector(style[index], rule);\n }\n\n return style;\n }\n\n return styleDetector(style, rule);\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssExpand;\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import isInBrowser from 'is-in-browser';\nimport _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';\n\n// Export javascript style and css style vendor prefixes.\nvar js = '';\nvar css = '';\nvar vendor = '';\nvar browser = '';\nvar isTouch = isInBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.\n\nif (isInBrowser) {\n // Order matters. We need to check Webkit the last one because\n // other vendors use to add Webkit prefixes to some properties\n var jsCssMap = {\n Moz: '-moz-',\n ms: '-ms-',\n O: '-o-',\n Webkit: '-webkit-'\n };\n\n var _document$createEleme = document.createElement('p'),\n style = _document$createEleme.style;\n\n var testProp = 'Transform';\n\n for (var key in jsCssMap) {\n if (key + testProp in style) {\n js = key;\n css = jsCssMap[key];\n break;\n }\n } // Correctly detect the Edge browser.\n\n\n if (js === 'Webkit' && 'msHyphens' in style) {\n js = 'ms';\n css = jsCssMap.ms;\n browser = 'edge';\n } // Correctly detect the Safari browser.\n\n\n if (js === 'Webkit' && '-apple-trailing-word' in style) {\n vendor = 'apple';\n }\n}\n/**\n * Vendor prefix string for the current browser.\n *\n * @type {{js: String, css: String, vendor: String, browser: String}}\n * @api public\n */\n\n\nvar prefix = {\n js: js,\n css: css,\n vendor: vendor,\n browser: browser,\n isTouch: isTouch\n};\n\n/**\n * Test if a keyframe at-rule should be prefixed or not\n *\n * @param {String} vendor prefix string for the current browser.\n * @return {String}\n * @api public\n */\n\nfunction supportedKeyframes(key) {\n // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'\n if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.\n // https://caniuse.com/#search=keyframes\n\n if (prefix.js === 'ms') return key;\n return \"@\" + prefix.css + \"keyframes\" + key.substr(10);\n}\n\n// https://caniuse.com/#search=appearance\n\nvar appearence = {\n noPrefill: ['appearance'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'appearance') return false;\n if (prefix.js === 'ms') return \"-webkit-\" + prop;\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=color-adjust\n\nvar colorAdjust = {\n noPrefill: ['color-adjust'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'color-adjust') return false;\n if (prefix.js === 'Webkit') return prefix.css + \"print-\" + prop;\n return prop;\n }\n};\n\nvar regExp = /[-\\s]+(.)?/g;\n/**\n * Replaces the letter with the capital letter\n *\n * @param {String} match\n * @param {String} c\n * @return {String}\n * @api private\n */\n\nfunction toUpper(match, c) {\n return c ? c.toUpperCase() : '';\n}\n/**\n * Convert dash separated strings to camel-cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\n\nfunction camelize(str) {\n return str.replace(regExp, toUpper);\n}\n\n/**\n * Convert dash separated strings to pascal cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction pascalize(str) {\n return camelize(\"-\" + str);\n}\n\n// but we can use a longhand property instead.\n// https://caniuse.com/#search=mask\n\nvar mask = {\n noPrefill: ['mask'],\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^mask/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var longhand = 'mask-image';\n\n if (camelize(longhand) in style) {\n return prop;\n }\n\n if (prefix.js + pascalize(longhand) in style) {\n return prefix.css + prop;\n }\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=text-orientation\n\nvar textOrientation = {\n noPrefill: ['text-orientation'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'text-orientation') return false;\n\n if (prefix.vendor === 'apple' && !prefix.isTouch) {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=transform\n\nvar transform = {\n noPrefill: ['transform'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transform') return false;\n\n if (options.transform) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=transition\n\nvar transition = {\n noPrefill: ['transition'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transition') return false;\n\n if (options.transition) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=writing-mode\n\nvar writingMode = {\n noPrefill: ['writing-mode'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'writing-mode') return false;\n\n if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=user-select\n\nvar userSelect = {\n noPrefill: ['user-select'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'user-select') return false;\n\n if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=multicolumn\n// https://github.com/postcss/autoprefixer/issues/491\n// https://github.com/postcss/autoprefixer/issues/177\n\nvar breakPropsOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^break-/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var jsProp = \"WebkitColumn\" + pascalize(prop);\n return jsProp in style ? prefix.css + \"column-\" + prop : false;\n }\n\n if (prefix.js === 'Moz') {\n var _jsProp = \"page\" + pascalize(prop);\n\n return _jsProp in style ? \"page-\" + prop : false;\n }\n\n return false;\n }\n};\n\n// See https://github.com/postcss/autoprefixer/issues/324.\n\nvar inlineLogicalOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^(border|margin|padding)-inline/.test(prop)) return false;\n if (prefix.js === 'Moz') return prop;\n var newProp = prop.replace('-inline', '');\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\n// Camelization is required because we can't test using.\n// CSS syntax for e.g. in FF.\n\nvar unprefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n return camelize(prop) in style ? prop : false;\n }\n};\n\nvar prefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.\n\n if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.\n\n if (prop[0] === '-' && prop[1] === '-') return prop;\n if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback.\n\n if (prefix.js !== 'Webkit' && \"Webkit\" + pascalized in style) return \"-webkit-\" + prop;\n return false;\n }\n};\n\n// https://caniuse.com/#search=scroll-snap\n\nvar scrollSnap = {\n supportedProperty: function supportedProperty(prop) {\n if (prop.substring(0, 11) !== 'scroll-snap') return false;\n\n if (prefix.js === 'ms') {\n return \"\" + prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=overscroll-behavior\n\nvar overscrollBehavior = {\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'overscroll-behavior') return false;\n\n if (prefix.js === 'ms') {\n return prefix.css + \"scroll-chaining\";\n }\n\n return prop;\n }\n};\n\nvar propMap = {\n 'flex-grow': 'flex-positive',\n 'flex-shrink': 'flex-negative',\n 'flex-basis': 'flex-preferred-size',\n 'justify-content': 'flex-pack',\n order: 'flex-order',\n 'align-items': 'flex-align',\n 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.\n\n}; // Support old flex spec from 2012.\n\nvar flex2012 = {\n supportedProperty: function supportedProperty(prop, style) {\n var newProp = propMap[prop];\n if (!newProp) return false;\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\nvar propMap$1 = {\n flex: 'box-flex',\n 'flex-grow': 'box-flex',\n 'flex-direction': ['box-orient', 'box-direction'],\n order: 'box-ordinal-group',\n 'align-items': 'box-align',\n 'flex-flow': ['box-orient', 'box-direction'],\n 'justify-content': 'box-pack'\n};\nvar propKeys = Object.keys(propMap$1);\n\nvar prefixCss = function prefixCss(p) {\n return prefix.css + p;\n}; // Support old flex spec from 2009.\n\n\nvar flex2009 = {\n supportedProperty: function supportedProperty(prop, style, _ref) {\n var multiple = _ref.multiple;\n\n if (propKeys.indexOf(prop) > -1) {\n var newProp = propMap$1[prop];\n\n if (!Array.isArray(newProp)) {\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n\n if (!multiple) return false;\n\n for (var i = 0; i < newProp.length; i++) {\n if (!(prefix.js + pascalize(newProp[0]) in style)) {\n return false;\n }\n }\n\n return newProp.map(prefixCss);\n }\n\n return false;\n }\n};\n\n// plugins = [\n// ...plugins,\n// breakPropsOld,\n// inlineLogicalOld,\n// unprefixed,\n// prefixed,\n// scrollSnap,\n// flex2012,\n// flex2009\n// ]\n// Plugins without 'noPrefill' value, going last.\n// 'flex-*' plugins should be at the bottom.\n// 'flex2009' going after 'flex2012'.\n// 'prefixed' going after 'unprefixed'\n\nvar plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];\nvar propertyDetectors = plugins.filter(function (p) {\n return p.supportedProperty;\n}).map(function (p) {\n return p.supportedProperty;\n});\nvar noPrefill = plugins.filter(function (p) {\n return p.noPrefill;\n}).reduce(function (a, p) {\n a.push.apply(a, _toConsumableArray(p.noPrefill));\n return a;\n}, []);\n\nvar el;\nvar cache = {};\n\nif (isInBrowser) {\n el = document.createElement('p'); // We test every property on vendor prefix requirement.\n // Once tested, result is cached. It gives us up to 70% perf boost.\n // http://jsperf.com/element-style-object-access-vs-plain-object\n //\n // Prefill cache with known css properties to reduce amount of\n // properties we need to feature test at runtime.\n // http://davidwalsh.name/vendor-prefix\n\n var computed = window.getComputedStyle(document.documentElement, '');\n\n for (var key$1 in computed) {\n // eslint-disable-next-line no-restricted-globals\n if (!isNaN(key$1)) cache[computed[key$1]] = computed[key$1];\n } // Properties that cannot be correctly detected using the\n // cache prefill method.\n\n\n noPrefill.forEach(function (x) {\n return delete cache[x];\n });\n}\n/**\n * Test if a property is supported, returns supported property with vendor\n * prefix if required. Returns `false` if not supported.\n *\n * @param {String} prop dash separated\n * @param {Object} [options]\n * @return {String|Boolean}\n * @api public\n */\n\n\nfunction supportedProperty(prop, options) {\n if (options === void 0) {\n options = {};\n }\n\n // For server-side rendering.\n if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache[prop] != null) {\n return cache[prop];\n } // Check if 'transition' or 'transform' natively supported in browser.\n\n\n if (prop === 'transition' || prop === 'transform') {\n options[prop] = prop in el.style;\n } // Find a plugin for current prefix property.\n\n\n for (var i = 0; i < propertyDetectors.length; i++) {\n cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.\n\n if (cache[prop]) break;\n } // Reset styles for current property.\n // Firefox can even throw an error for invalid properties, e.g., \"0\".\n\n\n try {\n el.style[prop] = '';\n } catch (err) {\n return false;\n }\n\n return cache[prop];\n}\n\nvar cache$1 = {};\nvar transitionProperties = {\n transition: 1,\n 'transition-property': 1,\n '-webkit-transition': 1,\n '-webkit-transition-property': 1\n};\nvar transPropsRegExp = /(^\\s*[\\w-]+)|, (\\s*[\\w-]+)(?![^()]*\\))/g;\nvar el$1;\n/**\n * Returns prefixed value transition/transform if needed.\n *\n * @param {String} match\n * @param {String} p1\n * @param {String} p2\n * @return {String}\n * @api private\n */\n\nfunction prefixTransitionCallback(match, p1, p2) {\n if (p1 === 'var') return 'var';\n if (p1 === 'all') return 'all';\n if (p2 === 'all') return ', all';\n var prefixedValue = p1 ? supportedProperty(p1) : \", \" + supportedProperty(p2);\n if (!prefixedValue) return p1 || p2;\n return prefixedValue;\n}\n\nif (isInBrowser) el$1 = document.createElement('p');\n/**\n * Returns prefixed value if needed. Returns `false` if value is not supported.\n *\n * @param {String} property\n * @param {String} value\n * @return {String|Boolean}\n * @api public\n */\n\nfunction supportedValue(property, value) {\n // For server-side rendering.\n var prefixedValue = value;\n if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.\n // We want only prefixable values here.\n // eslint-disable-next-line no-restricted-globals\n\n if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {\n return prefixedValue;\n } // Create cache key for current value.\n\n\n var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache$1[cacheKey] != null) {\n return cache$1[cacheKey];\n } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.\n\n\n try {\n // Test value as it is.\n el$1.style[property] = prefixedValue;\n } catch (err) {\n // Return false if value not supported.\n cache$1[cacheKey] = false;\n return false;\n } // If 'transition' or 'transition-property' property.\n\n\n if (transitionProperties[property]) {\n prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);\n } else if (el$1.style[property] === '') {\n // Value with a vendor prefix.\n prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert \"flex\" to \"-ms-flexbox\" for IE10.\n\n if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.\n\n el$1.style[property] = prefixedValue; // Return false if value not supported.\n\n if (el$1.style[property] === '') {\n cache$1[cacheKey] = false;\n return false;\n }\n } // Reset styles for current property.\n\n\n el$1.style[property] = ''; // Write current value to cache.\n\n cache$1[cacheKey] = prefixedValue;\n return cache$1[cacheKey];\n}\n\nexport { prefix, supportedKeyframes, supportedProperty, supportedValue };\n","import { supportedKeyframes, supportedValue, supportedProperty } from 'css-vendor';\nimport { toCssValue } from 'jss';\n\n/**\n * Add vendor prefix to a property name when needed.\n *\n * @api public\n */\n\nfunction jssVendorPrefixer() {\n function onProcessRule(rule) {\n if (rule.type === 'keyframes') {\n var atRule = rule;\n atRule.at = supportedKeyframes(atRule.at);\n }\n }\n\n function prefixStyle(style) {\n for (var prop in style) {\n var value = style[prop];\n\n if (prop === 'fallbacks' && Array.isArray(value)) {\n style[prop] = value.map(prefixStyle);\n continue;\n }\n\n var changeProp = false;\n var supportedProp = supportedProperty(prop);\n if (supportedProp && supportedProp !== prop) changeProp = true;\n var changeValue = false;\n var supportedValue$1 = supportedValue(supportedProp, toCssValue(value));\n if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;\n\n if (changeProp || changeValue) {\n if (changeProp) delete style[prop];\n style[supportedProp || prop] = supportedValue$1 || value;\n }\n }\n\n return style;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n return prefixStyle(style);\n }\n\n function onChangeValue(value, prop) {\n return supportedValue(prop, toCssValue(value)) || value;\n }\n\n return {\n onProcessRule: onProcessRule,\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default jssVendorPrefixer;\n","/**\n * Sort props by length.\n */\nfunction jssPropsSort() {\n var sort = function sort(prop0, prop1) {\n if (prop0.length === prop1.length) {\n return prop0 > prop1 ? 1 : -1;\n }\n\n return prop0.length - prop1.length;\n };\n\n return {\n onProcessStyle: function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n\n for (var i = 0; i < props.length; i++) {\n newStyle[props[i]] = style[props[i]];\n }\n\n return newStyle;\n }\n };\n}\n\nexport default jssPropsSort;\n","import functions from 'jss-plugin-rule-value-function';\nimport observable from 'jss-plugin-rule-value-observable';\nimport template from 'jss-plugin-template';\nimport global from 'jss-plugin-global';\nimport extend from 'jss-plugin-extend';\nimport nested from 'jss-plugin-nested';\nimport compose from 'jss-plugin-compose';\nimport camelCase from 'jss-plugin-camel-case';\nimport defaultUnit from 'jss-plugin-default-unit';\nimport expand from 'jss-plugin-expand';\nimport vendorPrefixer from 'jss-plugin-vendor-prefixer';\nimport propsSort from 'jss-plugin-props-sort';\n\nvar create = function create(options) {\n if (options === void 0) {\n options = {};\n }\n\n return {\n plugins: [functions(), observable(options.observable), template(), global(), extend(), nested(), compose(), camelCase(), defaultUnit(options.defaultUnit), expand(), vendorPrefixer(), propsSort()]\n };\n};\n\nexport default create;\n","function shallowEqualObjects(objA, objB) {\n if (objA === objB) {\n return true;\n }\n\n if (!objA || !objB) {\n return false;\n }\n\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n var len = aKeys.length;\n\n if (bKeys.length !== len) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n var key = aKeys[i];\n\n if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction shallowEqualArrays(arrA, arrB) {\n if (arrA === arrB) {\n return true;\n }\n\n if (!arrA || !arrB) {\n return false;\n }\n\n var len = arrA.length;\n\n if (arrB.length !== len) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n if (arrA[i] !== arrB[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport { shallowEqualArrays, shallowEqualObjects };\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import { create } from 'jss';\nimport preset from 'jss-preset-default';\n\n// I have been trying to benchmark and I have seen a slow down after about 10k rules.\n// Since we are in a single sheet mode, user shouldn't care about this.\nvar MAX_RULES_PER_SHEET = 10000;\nvar defaultJss = create(preset());\n\nvar createCss = function createCss(jss) {\n if (jss === void 0) {\n jss = defaultJss;\n }\n\n var cache = new Map();\n var ruleIndex = 0;\n var sheet;\n\n var getSheet = function getSheet() {\n if (!sheet || sheet.rules.index.length > MAX_RULES_PER_SHEET) {\n sheet = jss.createStyleSheet().attach();\n }\n\n return sheet;\n };\n\n function css() {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments; // We can avoid the need for stringification with a babel plugin,\n // which could generate a hash at build time and add it to the object.\n\n var argsStr = JSON.stringify(args);\n var cached = cache.get(argsStr);\n if (cached) return cached.className;\n var flatArgs = []; // Flatten arguments which can be\n // - style objects\n // - array of style objects\n // - arrays of style objects\n\n for (var argIndex in args) {\n var arg = args[argIndex];\n\n if (!Array.isArray(arg)) {\n flatArgs.push(arg);\n continue;\n }\n\n for (var innerArgIndex = 0; innerArgIndex < arg.length; innerArgIndex++) {\n flatArgs.push(arg[innerArgIndex]);\n }\n }\n\n var mergedStyle = {};\n var labels = [];\n\n for (var i = 0; i < flatArgs.length; i++) {\n var style = flatArgs[i];\n if (!style) continue;\n var styleObject = style; // It can be a class name that css() has previously generated.\n\n if (typeof style === 'string') {\n // eslint-disable-next-line no-shadow\n var _cached = cache.get(style);\n\n if (_cached) {\n // eslint-disable-next-line prefer-spread\n if (_cached.labels.length) labels.push.apply(labels, _cached.labels);\n styleObject = _cached.style;\n }\n }\n\n if (styleObject.label && labels.indexOf(styleObject.label) === -1) labels.push(styleObject.label);\n Object.assign(mergedStyle, styleObject);\n }\n\n delete mergedStyle.label;\n var label = labels.length === 0 ? 'css' : labels.join('-');\n var key = label + \"-\" + ruleIndex++;\n getSheet().addRule(key, mergedStyle);\n var className = getSheet().classes[key];\n var cacheValue = {\n style: mergedStyle,\n labels: labels,\n className: className\n };\n cache.set(argsStr, cacheValue);\n cache.set(className, cacheValue);\n return className;\n } // For testing only.\n\n\n css.getSheet = getSheet;\n return css;\n};\n\nvar css = createCss();\n\nexport default css;\nexport { createCss as create };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport { createContext, forwardRef, createElement as createElement$1, Component, useRef, useContext, useMemo, useDebugValue, useEffect, useLayoutEffect } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { ThemeContext } from 'theming';\nexport { ThemeProvider, createTheming, useTheme, withTheme } from 'theming';\nimport warning from 'tiny-warning';\nimport defaultJss, { SheetsManager, create as create$1, getDynamicStyles, createGenerateId, SheetsRegistry } from 'jss';\nexport { SheetsRegistry, createGenerateId } from 'jss';\nimport preset from 'jss-preset-default';\nimport isInBrowser from 'is-in-browser';\nimport PropTypes from 'prop-types';\nimport { shallowEqualObjects } from 'shallow-equal';\nimport isPropValid from '@emotion/is-prop-valid';\nimport defaultCss from 'css-jss';\n\n// eslint-disable-next-line no-unused-vars\nvar getDisplayName = function getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component';\n};\n\nvar memoize = function memoize(fn) {\n var lastArgs;\n var lastResult;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (Array.isArray(lastArgs) && args.length === lastArgs.length) {\n var isSame = true;\n\n for (var i = 0; i < args.length; i++) {\n if (args[i] !== lastArgs[i]) {\n isSame = false;\n }\n }\n\n if (isSame) {\n return lastResult;\n }\n }\n\n lastArgs = args;\n lastResult = fn.apply(void 0, args);\n return lastResult;\n };\n};\n\nvar mergeClasses = function mergeClasses(baseClasses, additionalClasses) {\n var combinedClasses = _extends({}, baseClasses);\n\n for (var name in additionalClasses) {\n combinedClasses[name] = name in combinedClasses ? combinedClasses[name] + \" \" + additionalClasses[name] : additionalClasses[name];\n }\n\n return combinedClasses;\n};\n\nvar JssContext = createContext({\n classNamePrefix: '',\n disableStylesGeneration: false\n});\n\n/**\n * Global index counter to preserve source order.\n * As we create the style sheet during componentWillMount lifecycle,\n * children are handled after the parents, so the order of style elements would\n * be parent->child. It is a problem though when a parent passes a className\n * which needs to override any childs styles. StyleSheet of the child has a higher\n * specificity, because of the source order.\n * So our solution is to render sheets them in the reverse order child->sheet, so\n * that parent has a higher specificity.\n *\n * We start at [Number.MIN_SAFE_INTEGER] to always insert sheets from react-jss first before any\n * sheet which might be inserted manually by the user.\n */\nvar index = Number.MIN_SAFE_INTEGER || -1e9;\n\nvar getSheetIndex = function getSheetIndex() {\n return index++;\n};\n\nvar defaultManagers = new Map();\nvar getManager = function getManager(context, managerId) {\n // If `managers` map is present in the context, we use it in order to\n // let JssProvider reset them when new response has to render server-side.\n if (context.managers) {\n if (!context.managers[managerId]) {\n context.managers[managerId] = new SheetsManager();\n }\n\n return context.managers[managerId];\n }\n\n var manager = defaultManagers.get(managerId);\n\n if (!manager) {\n manager = new SheetsManager();\n defaultManagers.set(managerId, manager);\n }\n\n return manager;\n};\nvar manageSheet = function manageSheet(options) {\n var sheet = options.sheet,\n context = options.context,\n index = options.index,\n theme = options.theme;\n\n if (!sheet) {\n return;\n }\n\n var manager = getManager(context, index);\n manager.manage(theme);\n\n if (context.registry) {\n context.registry.add(sheet);\n }\n};\nvar unmanageSheet = function unmanageSheet(options) {\n if (!options.sheet) {\n return;\n }\n\n var manager = getManager(options.context, options.index);\n manager.unmanage(options.theme);\n};\n\nvar jss = create$1(preset());\n\nvar sheetsMeta = new WeakMap();\nvar getMeta = function getMeta(sheet) {\n return sheetsMeta.get(sheet);\n};\nvar addMeta = function addMeta(sheet, meta) {\n sheetsMeta.set(sheet, meta);\n};\n\n// eslint-disable-next-line no-unused-vars\nvar getStyles = function getStyles(options) {\n var styles = options.styles;\n\n if (typeof styles !== 'function') {\n return styles;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(styles.length !== 0, \"[JSS] <\" + (options.name || 'Hook') + \" />'s styles function doesn't rely on the \\\"theme\\\" argument. We recommend declaring styles as an object instead.\") : void 0;\n return styles(options.theme);\n};\n\nfunction getSheetOptions(options, link) {\n var minify;\n\n if (options.context.id && options.context.id.minify != null) {\n minify = options.context.id.minify;\n }\n\n var classNamePrefix = options.context.classNamePrefix || '';\n\n if (options.name && !minify) {\n classNamePrefix += options.name.replace(/\\s/g, '-') + \"-\";\n }\n\n var meta = '';\n if (options.name) meta = options.name + \", \";\n meta += typeof options.styles === 'function' ? 'Themed' : 'Unthemed';\n return _extends({}, options.sheetOptions, {\n index: options.index,\n meta: meta,\n classNamePrefix: classNamePrefix,\n link: link,\n generateId: options.sheetOptions.generateId || options.context.generateId\n });\n}\n\n// eslint-disable-next-line no-unused-vars\nvar createStyleSheet = function createStyleSheet(options) {\n if (options.context.disableStylesGeneration) {\n return undefined;\n }\n\n var manager = getManager(options.context, options.index);\n var existingSheet = manager.get(options.theme);\n\n if (existingSheet) {\n return existingSheet;\n }\n\n var jss$1 = options.context.jss || jss;\n var styles = getStyles(options);\n var dynamicStyles = getDynamicStyles(styles);\n var sheet = jss$1.createStyleSheet(styles, getSheetOptions(options, dynamicStyles !== null));\n addMeta(sheet, {\n dynamicStyles: dynamicStyles,\n styles: styles\n });\n manager.add(options.theme, sheet);\n return sheet;\n};\nvar removeDynamicRules = function removeDynamicRules(sheet, rules) {\n // Loop over each dynamic rule and remove the dynamic rule\n // We can't just remove the whole sheet as this has all of the rules for every component instance\n for (var key in rules) {\n sheet.deleteRule(rules[key]);\n }\n};\nvar updateDynamicRules = function updateDynamicRules(data, sheet, rules) {\n // Loop over each dynamic rule and update it\n // We can't just update the whole sheet as this has all of the rules for every component instance\n for (var key in rules) {\n sheet.updateOne(rules[key], data);\n }\n};\nvar addDynamicRules = function addDynamicRules(sheet, data) {\n var meta = getMeta(sheet);\n\n if (!meta) {\n return undefined;\n }\n\n var rules = {}; // Loop over each dynamic rule and add it to the stylesheet\n\n for (var key in meta.dynamicStyles) {\n var initialRuleCount = sheet.rules.index.length;\n var originalRule = sheet.addRule(key, meta.dynamicStyles[key]); // Loop through all created rules, fixes updating dynamic rules\n\n for (var i = initialRuleCount; i < sheet.rules.index.length; i++) {\n var rule = sheet.rules.index[i];\n sheet.updateOne(rule, data); // If it's the original rule, we need to add it by the correct key so the hook and hoc\n // can correctly concat the dynamic class with the static one\n\n rules[originalRule === rule ? key : rule.key] = rule;\n }\n }\n\n return rules;\n};\n\nvar getSheetClasses = function getSheetClasses(sheet, dynamicRules) {\n if (!dynamicRules) {\n return sheet.classes;\n }\n\n var classes = {};\n var meta = getMeta(sheet);\n\n if (!meta) {\n return sheet.classes;\n }\n\n for (var key in meta.styles) {\n classes[key] = sheet.classes[key];\n\n if (key in dynamicRules) {\n classes[key] += \" \" + sheet.classes[dynamicRules[key].key];\n }\n }\n\n return classes;\n};\n\nvar NoRenderer = function NoRenderer(props) {\n return props.children || null;\n};\n\nvar noTheme = {};\n\n/**\n * HOC creator function that wrapps the user component.\n *\n * `withStyles(styles, [options])(Component)`\n */\nvar createWithStyles = function createWithStyles(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$index = _options.index,\n index = _options$index === void 0 ? getSheetIndex() : _options$index,\n theming = _options.theming,\n injectTheme = _options.injectTheme,\n sheetOptions = _objectWithoutPropertiesLoose(_options, [\"index\", \"theming\", \"injectTheme\"]);\n\n var isThemingEnabled = typeof styles === 'function';\n var ThemeConsumer = theming && theming.context.Consumer || ThemeContext.Consumer;\n return function (InnerComponent) {\n if (InnerComponent === void 0) {\n InnerComponent = NoRenderer;\n }\n\n var displayName = getDisplayName(InnerComponent);\n\n var getTheme = function getTheme(props) {\n return isThemingEnabled ? props.theme : noTheme;\n };\n\n var WithStyles =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(WithStyles, _React$Component);\n\n // $FlowFixMe[prop-missing]\n WithStyles.createState = function createState(props) {\n var sheet = createStyleSheet({\n styles: styles,\n theme: getTheme(props),\n index: index,\n name: displayName,\n context: props.jssContext,\n sheetOptions: sheetOptions\n });\n\n if (!sheet) {\n return {\n classes: {},\n dynamicRules: undefined,\n sheet: undefined\n };\n }\n\n var dynamicRules = addDynamicRules(sheet, props);\n return {\n sheet: sheet,\n dynamicRules: dynamicRules,\n classes: getSheetClasses(sheet, dynamicRules)\n };\n };\n\n WithStyles.manage = function manage(props, state) {\n var sheet = state.sheet;\n\n if (sheet) {\n manageSheet({\n sheet: sheet,\n index: index,\n context: props.jssContext,\n theme: getTheme(props)\n });\n }\n };\n\n WithStyles.unmanage = function unmanage(props, state) {\n var sheet = state.sheet,\n dynamicRules = state.dynamicRules;\n\n if (sheet) {\n unmanageSheet({\n context: props.jssContext,\n index: index,\n sheet: sheet,\n theme: getTheme(props)\n });\n\n if (dynamicRules) {\n removeDynamicRules(sheet, dynamicRules);\n }\n }\n };\n\n function WithStyles(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.mergeClassesProp = memoize(function (sheetClasses, classesProp) {\n return classesProp ? mergeClasses(sheetClasses, classesProp) : sheetClasses;\n });\n _this.state = WithStyles.createState(props);\n var registry = props.jssContext.registry;\n var sheet = _this.state.sheet;\n\n if (sheet && registry) {\n registry.add(sheet);\n }\n\n return _this;\n }\n\n var _proto = WithStyles.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var props = this.props,\n state = this.state;\n\n if (props && state) {\n WithStyles.manage(props, state);\n }\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (isThemingEnabled && this.props.theme !== prevProps.theme) {\n var newState = WithStyles.createState(this.props);\n WithStyles.manage(this.props, newState);\n WithStyles.unmanage(prevProps, prevState); // eslint-disable-next-line react/no-did-update-set-state\n\n this.setState(newState);\n } else if (this.state.sheet && this.state.dynamicRules) {\n // Only update the rules when we don't generate a new sheet\n updateDynamicRules(this.props, this.state.sheet, this.state.dynamicRules);\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n WithStyles.unmanage(this.props, this.state);\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n innerRef = _this$props.innerRef,\n jssContext = _this$props.jssContext,\n theme = _this$props.theme,\n classes = _this$props.classes,\n rest = _objectWithoutPropertiesLoose(_this$props, [\"innerRef\", \"jssContext\", \"theme\", \"classes\"]);\n\n var sheetClasses = this.state.classes;\n\n var props = _extends({}, rest, {\n classes: this.mergeClassesProp(sheetClasses, classes)\n });\n\n if (innerRef) props.ref = innerRef;\n if (injectTheme) props.theme = theme;\n return createElement$1(InnerComponent, props);\n };\n\n return WithStyles;\n }(Component);\n\n WithStyles.displayName = \"WithStyles(\" + displayName + \")\";\n WithStyles.defaultProps = _extends({}, InnerComponent.defaultProps);\n var JssContextSubscriber = forwardRef(function (props, ref) {\n return createElement$1(JssContext.Consumer, null, function (context) {\n if (isThemingEnabled || injectTheme) {\n return createElement$1(ThemeConsumer, null, function (theme) {\n return createElement$1(WithStyles, _extends({\n innerRef: ref,\n theme: theme\n }, props, {\n jssContext: context\n }));\n });\n }\n\n return createElement$1(WithStyles, _extends({\n innerRef: ref\n }, props, {\n jssContext: context,\n theme: noTheme\n }));\n });\n });\n JssContextSubscriber.displayName = \"JssContextSubscriber(\" + displayName + \")\"; // $FlowFixMe[prop-missing] - React's types should allow custom static properties on component.\n\n JssContextSubscriber.InnerComponent = InnerComponent;\n return hoistNonReactStatics(JssContextSubscriber, InnerComponent);\n };\n};\n\nvar useEffectOrLayoutEffect = isInBrowser ? useLayoutEffect : useEffect;\nvar noTheme$1 = {};\n\nvar createUseStyles = function createUseStyles(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$index = _options.index,\n index = _options$index === void 0 ? getSheetIndex() : _options$index,\n theming = _options.theming,\n name = _options.name,\n sheetOptions = _objectWithoutPropertiesLoose(_options, [\"index\", \"theming\", \"name\"]);\n\n var ThemeContext$1 = theming && theming.context || ThemeContext;\n var useTheme = typeof styles === 'function' ? // $FlowFixMe[incompatible-return]\n function () {\n return useContext(ThemeContext$1) || noTheme$1;\n } : // $FlowFixMe[incompatible-return]\n function () {\n return noTheme$1;\n };\n return function useStyles(data) {\n var isFirstMount = useRef(true);\n var context = useContext(JssContext);\n var theme = useTheme();\n\n var _React$useMemo = useMemo(function () {\n var newSheet = createStyleSheet({\n context: context,\n styles: styles,\n name: name,\n theme: theme,\n index: index,\n sheetOptions: sheetOptions\n });\n var newDynamicRules = newSheet ? addDynamicRules(newSheet, data) : null;\n\n if (newSheet) {\n manageSheet({\n index: index,\n context: context,\n sheet: newSheet,\n theme: theme\n });\n }\n\n return [newSheet, newDynamicRules];\n }, [context, theme]),\n sheet = _React$useMemo[0],\n dynamicRules = _React$useMemo[1];\n\n useEffectOrLayoutEffect(function () {\n // We only need to update the rules on a subsequent update and not in the first mount\n if (sheet && dynamicRules && !isFirstMount.current) {\n updateDynamicRules(data, sheet, dynamicRules);\n }\n }, [data]);\n useEffectOrLayoutEffect(function () {\n return (// cleanup only\n function () {\n if (sheet) {\n unmanageSheet({\n index: index,\n context: context,\n sheet: sheet,\n theme: theme\n });\n }\n\n if (sheet && dynamicRules) {\n removeDynamicRules(sheet, dynamicRules);\n }\n }\n );\n }, [sheet]);\n var classes = sheet && dynamicRules ? getSheetClasses(sheet, dynamicRules) : {};\n useDebugValue(classes);\n useDebugValue(theme === noTheme$1 ? 'No theme' : theme);\n useEffect(function () {\n isFirstMount.current = false;\n });\n return classes;\n };\n};\n\nvar initialContext = {};\n\nvar JssProvider =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(JssProvider, _React$Component);\n\n function JssProvider() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.managers = {};\n\n _this.createContext = function (parentContext, prevContext) {\n if (prevContext === void 0) {\n prevContext = initialContext;\n }\n\n var _this$props = _this.props,\n registry = _this$props.registry,\n classNamePrefix = _this$props.classNamePrefix,\n jss = _this$props.jss,\n generateId = _this$props.generateId,\n disableStylesGeneration = _this$props.disableStylesGeneration,\n media = _this$props.media,\n id = _this$props.id;\n\n var context = _extends({}, parentContext);\n\n if (registry) {\n context.registry = registry; // This way we identify a new request on the server, because user will create\n // a new Registry instance for each.\n\n if (registry !== _this.registry) {\n // We reset managers because we have to regenerate all sheets for the new request.\n _this.managers = {};\n _this.registry = registry;\n }\n }\n\n context.managers = _this.managers;\n\n if (id !== undefined) {\n context.id = id;\n }\n\n if (generateId !== undefined) {\n context.generateId = generateId;\n } else if (!context.generateId || !prevContext || context.id !== prevContext.id) {\n context.generateId = createGenerateId(context.id);\n }\n\n if (classNamePrefix) {\n context.classNamePrefix = (context.classNamePrefix || '') + classNamePrefix;\n }\n\n if (media !== undefined) {\n context.media = media;\n }\n\n if (jss) {\n context.jss = jss;\n }\n\n if (disableStylesGeneration !== undefined) {\n context.disableStylesGeneration = disableStylesGeneration;\n }\n\n if (prevContext && shallowEqualObjects(prevContext, context)) {\n return prevContext;\n }\n\n return context;\n };\n\n _this.prevContext = void 0;\n _this.generateId = void 0;\n _this.registry = void 0;\n\n _this.renderProvider = function (parentContext) {\n var children = _this.props.children;\n\n var context = _this.createContext(parentContext, _this.prevContext);\n\n _this.prevContext = context;\n return createElement$1(JssContext.Provider, {\n value: context\n }, children);\n };\n\n return _this;\n }\n\n var _proto = JssProvider.prototype;\n\n _proto.render = function render() {\n return createElement$1(JssContext.Consumer, null, this.renderProvider);\n };\n\n return JssProvider;\n}(Component);\n\nJssProvider.propTypes = {\n registry: PropTypes.instanceOf(SheetsRegistry),\n jss: PropTypes.instanceOf(defaultJss.constructor),\n generateId: PropTypes.func,\n classNamePrefix: PropTypes.string,\n disableStylesGeneration: PropTypes.bool,\n children: PropTypes.node.isRequired,\n media: PropTypes.string,\n id: PropTypes.shape({\n minify: PropTypes.bool\n })\n};\n\n// eslint-disable-next-line no-unused-vars\nvar parseStyles = function parseStyles(args) {\n var dynamicStyles = [];\n var staticStyle;\n var labels = []; // Not using ...rest to optimize perf.\n\n for (var key in args) {\n var style = args[key];\n if (!style) continue;\n\n if (typeof style === 'function') {\n dynamicStyles.push(style);\n } else {\n if (!staticStyle) staticStyle = {};\n Object.assign(staticStyle, style);\n\n if (staticStyle.label) {\n if (labels.indexOf(staticStyle.label) === -1) labels.push(staticStyle.label);\n }\n }\n }\n\n var styles = {};\n var label = labels.length === 0 ? 'sc' : labels.join('-');\n\n if (staticStyle) {\n // Label should not leak to the core.\n if ('label' in staticStyle) delete staticStyle.label;\n styles[label] = staticStyle;\n } // When there is only one function rule, we don't need to wrap it.\n\n\n if (dynamicStyles.length === 1) {\n styles['scd'] = dynamicStyles[0];\n } // We create a new function rule which will call all other function rules\n // and merge the styles they return.\n\n\n if (dynamicStyles.length > 1) {\n styles['scd'] = function (props) {\n var merged = {};\n\n for (var i = 0; i < dynamicStyles.length; i++) {\n var dynamicStyle = dynamicStyles[i](props);\n if (dynamicStyle) Object.assign(merged, dynamicStyle);\n }\n\n return merged;\n };\n }\n\n return {\n styles: styles,\n label: label\n };\n};\n\nvar shouldForwardPropSymbol = Symbol('react-jss-styled');\n\nvar getShouldForwardProp = function getShouldForwardProp(tagOrComponent, options) {\n var shouldForwardProp = options.shouldForwardProp; // $FlowFixMe[invalid-computed-prop]\n // $FlowFixMe[incompatible-type]\n\n var childShouldForwardProp = tagOrComponent[shouldForwardPropSymbol];\n var finalShouldForwardProp = shouldForwardProp || childShouldForwardProp;\n\n if (shouldForwardProp && childShouldForwardProp) {\n finalShouldForwardProp = function finalShouldForwardProp(prop) {\n return childShouldForwardProp(prop) && shouldForwardProp(prop);\n };\n }\n\n return finalShouldForwardProp;\n};\n\nvar getChildProps = function getChildProps(props, shouldForwardProp, isTag) {\n var childProps = {};\n\n for (var prop in props) {\n if (shouldForwardProp) {\n if (shouldForwardProp(prop) === true) {\n childProps[prop] = props[prop];\n }\n\n continue;\n } // We don't want to pass non-dom props to the DOM.\n\n\n if (isTag) {\n if (isPropValid(prop)) {\n childProps[prop] = props[prop];\n }\n\n continue;\n }\n\n childProps[prop] = props[prop];\n }\n\n return childProps;\n};\n\n// eslint-disable-next-line no-unused-vars\nvar configureStyled = function configureStyled(tagOrComponent, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n theming = _options.theming;\n var isTag = typeof tagOrComponent === 'string';\n var ThemeContext$1 = theming ? theming.context : ThemeContext;\n var shouldForwardProp = getShouldForwardProp(tagOrComponent, options);\n\n var _options2 = options,\n _ = _options2.shouldForwardProp,\n hookOptions = _objectWithoutPropertiesLoose(_options2, [\"shouldForwardProp\"]);\n\n return function createStyledComponent() {\n // eslint-disable-next-line prefer-rest-params\n var _parseStyles = parseStyles(arguments),\n styles = _parseStyles.styles,\n label = _parseStyles.label;\n\n var useStyles = createUseStyles(styles, hookOptions);\n\n var Styled = function Styled(props) {\n var as = props.as,\n className = props.className;\n var theme = useContext(ThemeContext$1);\n var propsWithTheme = Object.assign({\n theme: theme\n }, props);\n var classes = useStyles(propsWithTheme);\n var childProps = getChildProps(props, shouldForwardProp, isTag);\n var classNames = ((classes[label] || classes.sc || '') + \" \" + (classes.scd || '')).trim();\n childProps.className = className ? className + \" \" + classNames : classNames;\n\n if (!isTag && shouldForwardProp) {\n // $FlowFixMe[invalid-computed-prop] we are not supposed to attach random properties to component functions.\n // $FlowFixMe[incompatible-use]\n tagOrComponent[shouldForwardPropSymbol] = shouldForwardProp;\n }\n\n if (isTag && as) {\n return createElement$1(as, childProps);\n }\n\n return createElement$1(tagOrComponent, childProps);\n };\n\n return Styled;\n };\n};\n\n/* eslint-disable prefer-rest-params, prefer-spread */\nvar create = function create(css) {\n if (css === void 0) {\n css = defaultCss;\n }\n\n return function createElement(type, props\n /* :: , ..._args: any */\n ) {\n var args = arguments;\n\n if (props && props.css) {\n var className = css(props.css);\n var newProps = Object.assign({}, props);\n newProps.className = props.className ? props.className + \" \" + className : className;\n delete newProps.css;\n args[1] = newProps;\n } // $FlowFixMe[missing-arg]\n\n\n return createElement$1.apply(undefined, args);\n };\n};\nvar createElement = create();\n\nexport default createWithStyles;\nexport { JssContext, JssProvider, create as createJsx, createUseStyles, jss, createElement as jsx, configureStyled as styled, createWithStyles as withStyles };\n","function cachePlugin() {\n var cache = new WeakMap();\n\n function onCreateRule(name, decl, _ref) {\n var parent = _ref.parent;\n return parent && name ? cache.get(parent.rules.raw[name]) || null : null;\n }\n\n function onProcessRule(rule) {\n var _rule$options = rule.options,\n sheet = _rule$options.sheet,\n parent = _rule$options.parent;\n\n if (!parent || sheet && sheet.options.link) {\n return;\n }\n\n var originalStyle = parent.rules.raw[rule.key];\n if (!cache.get(originalStyle)) cache.set(originalStyle, rule);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}\n\nexport default cachePlugin;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe23',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20f0',\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nmodule.exports = upperFirst;\n","const upperFirst = require('lodash.upperfirst');\n\n// Global CSS variables for Neos.Ui\nconst config = {\n spacing: {\n goldenUnit: '40px',\n full: '16px',\n half: '8px',\n quarter: '4px'\n },\n size: {\n sidebarWidth: '320px'\n },\n transition: {\n fast: '.1s',\n default: '.25s',\n slow: '.5s'\n },\n zIndex: {\n secondaryToolbar: ['linkIconButtonFlyout'],\n flashMessageContainer: '6',\n loadingIndicatorContainer: '5',\n secondaryInspector: ['context', 'iframe', 'close'],\n secondaryInspectorElevated: ['context', 'dropdownContents'],\n dialog: ['context'],\n fullScreenClose: ['context'],\n drawer: ['context'],\n bar: ['context'],\n primaryToolbar: '4',\n checkboxInput: ['context'],\n dropdownContents: ['context'],\n selectBoxContents: '3',\n notInlineEditableOverlay: ['context'],\n calendarFakeInputMirror: ['context'],\n rdtPicker: ['context'],\n sideBar: ['dropTargetBefore', 'dropTargetAfter'],\n wrapperDropdown: ['context'],\n unappliedChangesOverlay: ['context'],\n nodeToolBar: '2147483646'\n },\n fontSize: {\n base: '14px',\n small: '12px'\n },\n fonts: {\n headings: {\n family: 'Noto Sans',\n style: 'Regular',\n cssWeight: '400'\n },\n copy: {\n family: 'Noto Sans',\n style: 'Regular',\n cssWeight: '400'\n }\n },\n colors: {\n primaryViolet: '#26224C',\n primaryVioletHover: '#342f5f',\n primaryBlue: '#00ADEE',\n primaryBlueHover: '#35c3f8',\n contrastDarkest: '#141414',\n contrastDarker: '#222',\n contrastDark: '#3f3f3f',\n contrastNeutral: '#323232',\n contrastBright: '#999',\n contrastBrighter: '#adadad',\n contrastBrightest: '#FFF',\n success: '#00a338',\n successHover: '#0bb344',\n warn: '#ff8700',\n warnHover: '#fda23d',\n error: '#ff460d',\n errorHover: '#ff6a3c',\n uncheckedCheckboxTick: '#5B5B5B'\n }\n};\n\nconst generateCssVarsObject = (subject = config, predicate = '') => {\n const hasPredicate = predicate && predicate.length;\n let target = {};\n\n Object.keys(subject).forEach(key => {\n const val = subject[key];\n const camelKey = upperFirst(key);\n const nestedPredicate = hasPredicate ? predicate + camelKey : key;\n\n if (Array.isArray(val)) {\n val.forEach((item, index) => {\n target[`--${predicate}-${camelKey}-${upperFirst(item)}`] = `${index + 1}`;\n });\n } else if (typeof val === 'object') {\n target = Object.assign({}, target, generateCssVarsObject(val, nestedPredicate));\n } else {\n target[`--${predicate}-${camelKey}`] = val;\n }\n });\n\n return target;\n};\n\nmodule.exports = {\n config,\n generateCssVarsObject\n};\n","import * as React from 'react';\nimport { createTheming, createUseStyles } from 'react-jss';\nimport jss from 'jss';\nimport jssPluginCache from 'jss-plugin-cache';\n\nimport { config } from '@neos-project/build-essentials/src/styles/styleConstants';\n\nconst ThemeContext = React.createContext({} as MediaUiTheme);\nconst theming = createTheming(ThemeContext);\nconst { ThemeProvider, useTheme } = theming;\n\njss.use(jssPluginCache());\n\nexport interface MediaUiTheme {\n spacing: {\n goldenUnit: string;\n full: string;\n half: string;\n quarter: string;\n };\n fontSize: {\n large: string;\n base: string;\n small: string;\n };\n size: {\n sidebarWidth: string;\n scrollbarSize: string;\n };\n colors: {\n success: string;\n warn: string;\n error: string;\n primary: string;\n text: string;\n mainBackground: string;\n alternatingBackground: string;\n border: string;\n inactive: string;\n generated: string;\n warning: string;\n deleted: string;\n disabled: string;\n moduleBackground: string;\n assetBackground: string;\n captionBackground: string;\n scrollbarBackground: string;\n scrollbarForeground: string;\n };\n transition: {\n fast: string;\n default: string;\n slow: string;\n };\n paginationZIndex: number;\n loadingIndicatorZIndex: number;\n lightboxZIndex: number;\n}\n\n// Extend theme config from Neos.Ui package\nconst mediaUiTheme: MediaUiTheme = {\n spacing: config.spacing,\n fontSize: {\n ...config.fontSize,\n large: '18px',\n },\n size: {\n ...config.size,\n sidebarWidth: '250px',\n scrollbarSize: '4px',\n },\n colors: {\n primary: config.colors.primaryBlue,\n text: config.colors.contrastBright,\n mainBackground: config.colors.contrastNeutral,\n alternatingBackground: config.colors.contrastDark,\n border: config.colors.contrastDark,\n inactive: config.colors.contrastBright,\n success: config.colors.success,\n warn: config.colors.warn,\n error: config.colors.error,\n generated: config.colors.success,\n warning: config.colors.warn,\n deleted: config.colors.error,\n disabled: config.colors.contrastDark,\n assetBackground: config.colors.contrastDarkest,\n captionBackground: config.colors.contrastNeutral,\n moduleBackground: config.colors.contrastDarker,\n scrollbarBackground: 'transparent',\n scrollbarForeground: config.colors.contrastBright,\n },\n transition: config.transition,\n loadingIndicatorZIndex: 10024,\n paginationZIndex: 10022,\n lightboxZIndex: 10023,\n};\n\nexport const useMediaUiTheme = useTheme;\n\nexport const createUseMediaUiStyles = (styles) =>\n createUseStyles, MediaUiTheme>(styles, { theming });\n\nexport function MediaUiThemeProvider({ children }: { children: React.ReactElement }) {\n return {children};\n}\n","import { NotifyProvider, useNotify, Notify } from './Notify';\nimport { MediaUiProvider, useMediaUi } from './MediaUiProvider';\nimport { IntlProvider, useIntl, I18nRegistry } from './Intl';\nimport { MediaUiThemeProvider, useMediaUiTheme, MediaUiTheme, createUseMediaUiStyles } from './MediaUiTheme';\n\nexport {\n I18nRegistry,\n IntlProvider,\n MediaUiProvider,\n MediaUiTheme,\n MediaUiThemeProvider,\n Notify,\n NotifyProvider,\n createUseMediaUiStyles,\n useIntl,\n useMediaUi,\n useMediaUiTheme,\n useNotify,\n};\n","import React from 'react';\nimport ReactDOM from 'react-dom';\n\ninterface InnerComponent extends React.Component {\n readonly handleClickOutside?: (e: MouseEvent | TouchEvent) => void;\n}\n\nconst isTargetExcludedForClickOutside : (el: any) => boolean = el => {\n if (!el) {\n // top level: the targt is not excluded\n return false;\n }\n\n return (el.dataset && el.dataset.ignore_click_outside) ? true : isTargetExcludedForClickOutside(el.parentNode);\n};\n\nconst enhanceWithClickOutside =

(Component: React.ComponentClass

): React.ComponentClass

=> {\n class EnhancedComponent extends React.Component

{\n private wrappedInstanceRef = React.createRef();\n\n public componentDidMount(): void {\n document.addEventListener('click', this.handleClickOutside, true);\n }\n\n public componentWillUnmount(): void {\n document.removeEventListener('click', this.handleClickOutside, true);\n }\n\n private handleClickOutside = (e: any) => {\n if (\n this.wrappedInstanceRef.current &&\n (e.target instanceof HTMLElement || e.target instanceof HTMLDocument)\n ) {\n const domNode = ReactDOM.findDOMNode(this.wrappedInstanceRef.current);\n\n // if the iframeTarget is set, we ignore the event's target, as there might\n // be rubbish in there.\n const target = e.iframeTarget || e.target;\n\n /**\n * Ignore target if it has the data attribute data-ignore_click_outside\n * with value true. We skip the click outside handling. For further information\n *\n * What happend:\n *\n * When you create a new node that has an empty renderedContent in RenderContentOutOfBand\n * response, the UI throw an error and reloads the GuestFrame.\n * This behavior is intended but lead to the error that it was not possible to use the NodeToolBar\n * after that reload on each node without reloading the whole window or changing the preview mode.\n *\n * Problem:\n *\n * We found out that we have an issue with the reload of the guestframe when it is triggered from\n * inside the guest frame. The events are all fired, but not in the right order.\n * So we want to handle the \"click outside handling\" when you click on the \"add Node\" Button to close\n * dropdowns like the publishing. But now we have the issue that the that the saga for the\n * nodeCreationWorkflow is fired to early and we close the dialog we just opened with\n * the \"click outside handling\" of the \"add node\" button.\n * We did not find a proper way to change the event order, yet. At the moment we add a\n * data-attribute to detect that we triggered the \"click outside handling\" from the NodeToolBar inside the\n * GuestFrame and skip the event.\n *\n * So it can happen that you have a opened publish drop down and it does not close when you open the\n * node creation dialog. But when you select the node type in the dialog the drop down will close.\n * And in general the drop down is opened before you click the \"add node\" button. Because you need\n * to click on the node to get the NodeToolBar and then the dialog will close.\n */\n if (isTargetExcludedForClickOutside(target)) {\n return;\n }\n\n if (\n (!domNode || !domNode.contains(target)) &&\n this.wrappedInstanceRef &&\n this.wrappedInstanceRef.current &&\n typeof this.wrappedInstanceRef.current.handleClickOutside === 'function'\n ) {\n this.wrappedInstanceRef.current.handleClickOutside(e);\n }\n }\n }\n\n public render(): JSX.Element {\n return (\n \n );\n }\n }\n\n (EnhancedComponent as any).displayName = `clickOutside(${Component.displayName || Component.name})`;\n\n return EnhancedComponent;\n};\n\nexport default enhanceWithClickOutside;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nvar _default = _propTypes[\"default\"].shape({\n theme: _propTypes[\"default\"].object.isRequired\n});\n\nexports[\"default\"] = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = require(\"react\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _themrShape = _interopRequireDefault(require(\"../utils/themr-shape\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar ThemeProvider = /*#__PURE__*/function (_Component) {\n _inherits(ThemeProvider, _Component);\n\n var _super = _createSuper(ThemeProvider);\n\n function ThemeProvider() {\n _classCallCheck(this, ThemeProvider);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(ThemeProvider, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n return {\n themr: {\n theme: this.props.theme\n }\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n return _react.Children.only(this.props.children);\n }\n }]);\n\n return ThemeProvider;\n}(_react.Component);\n\nexports[\"default\"] = ThemeProvider;\n\n_defineProperty(ThemeProvider, \"propTypes\", {\n children: _propTypes[\"default\"].element.isRequired,\n theme: _propTypes[\"default\"].object.isRequired\n});\n\n_defineProperty(ThemeProvider, \"defaultProps\", {\n theme: {}\n});\n\n_defineProperty(ThemeProvider, \"childContextTypes\", {\n themr: _themrShape[\"default\"].isRequired\n});","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.themeable = themeable;\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _hoistNonReactStatics = _interopRequireDefault(require(\"hoist-non-react-statics\"));\n\nvar _invariant = _interopRequireDefault(require(\"invariant\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * @typedef {Object.} TReactCSSThemrTheme\n */\n\n/**\n * @typedef {{}} TReactCSSThemrOptions\n * @property {String|Boolean} [composeTheme=COMPOSE_DEEPLY]\n */\nvar COMPOSE_DEEPLY = 'deeply';\nvar COMPOSE_SOFTLY = 'softly';\nvar DONT_COMPOSE = false;\nvar DEFAULT_OPTIONS = {\n composeTheme: COMPOSE_DEEPLY,\n mapThemrProps: defaultMapThemrProps\n};\nvar THEMR_CONFIG = typeof Symbol !== 'undefined' ? Symbol('THEMR_CONFIG') : '__REACT_CSS_THEMR_CONFIG__';\n/**\n * Themr decorator\n * @param {String|Number|Symbol} componentName - Component name\n * @param {TReactCSSThemrTheme} [localTheme] - Base theme\n * @param {{}} [options] - Themr options\n * @returns {function(ThemedComponent:Function):Function} - ThemedComponent\n */\n\nvar themr = function themr(componentName, localTheme) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return function (ThemedComponent) {\n var _DEFAULT_OPTIONS$opti = _objectSpread(_objectSpread({}, DEFAULT_OPTIONS), options),\n optionComposeTheme = _DEFAULT_OPTIONS$opti.composeTheme,\n optionMapThemrProps = _DEFAULT_OPTIONS$opti.mapThemrProps;\n\n validateComposeOption(optionComposeTheme);\n var config = ThemedComponent[THEMR_CONFIG];\n\n if (config && config.componentName === componentName) {\n config.localTheme = themeable(config.localTheme, localTheme);\n return ThemedComponent;\n }\n\n config = {\n componentName: componentName,\n localTheme: localTheme\n };\n /**\n * @property {{wrappedInstance: *}} refs\n */\n\n var Themed = /*#__PURE__*/function (_Component) {\n _inherits(Themed, _Component);\n\n var _super = _createSuper(Themed);\n\n function Themed() {\n var _this;\n\n _classCallCheck(this, Themed);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.theme_ = _this.calcTheme(_this.props);\n return _this;\n }\n\n _createClass(Themed, [{\n key: \"getWrappedInstance\",\n value: function getWrappedInstance() {\n (0, _invariant[\"default\"])(true, 'DEPRECATED: To access the wrapped instance, you have to pass ' + '{ innerRef: fn } and retrieve with a callback ref style.');\n return this.refs.wrappedInstance;\n }\n }, {\n key: \"getNamespacedTheme\",\n value: function getNamespacedTheme(props) {\n var themeNamespace = props.themeNamespace,\n theme = props.theme;\n if (!themeNamespace) return theme;\n\n if (themeNamespace && !theme) {\n throw new Error('Invalid themeNamespace use in friendsofreactjs/react-css-themr. ' + 'themeNamespace prop should be used only with theme prop.');\n }\n\n return Object.keys(theme).filter(function (key) {\n return key.startsWith(themeNamespace);\n }).reduce(function (result, key) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, removeNamespace(key, themeNamespace), theme[key]));\n }, {});\n }\n }, {\n key: \"getThemeNotComposed\",\n value: function getThemeNotComposed(props) {\n var theme = props.theme;\n if (theme) return this.getNamespacedTheme(props);\n if (config.localTheme) return config.localTheme;\n return this.getContextTheme();\n }\n }, {\n key: \"getContextTheme\",\n value: function getContextTheme() {\n return this.context.themr ? this.context.themr.theme[config.componentName] : {};\n }\n }, {\n key: \"getTheme\",\n value: function getTheme(props) {\n var composeTheme = props.composeTheme;\n return composeTheme === COMPOSE_SOFTLY ? _objectSpread(_objectSpread(_objectSpread({}, this.getContextTheme()), config.localTheme), this.getNamespacedTheme(props)) : themeable(themeable(this.getContextTheme(), config.localTheme), this.getNamespacedTheme(props));\n }\n }, {\n key: \"calcTheme\",\n value: function calcTheme(props) {\n var composeTheme = props.composeTheme;\n return composeTheme ? this.getTheme(props) : this.getThemeNotComposed(props);\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n var _this$props = this.props,\n composeTheme = _this$props.composeTheme,\n theme = _this$props.theme,\n themeNamespace = _this$props.themeNamespace;\n\n if (composeTheme !== nextProps.composeTheme || theme !== nextProps.theme || themeNamespace !== nextProps.themeNamespace) {\n this.theme_ = this.calcTheme(nextProps);\n }\n\n return true;\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react[\"default\"].createElement(ThemedComponent, this.props.mapThemrProps(this.props, this.theme_));\n }\n }]);\n\n return Themed;\n }(_react.Component);\n\n _defineProperty(Themed, \"displayName\", \"Themed\".concat(ThemedComponent.displayName || ThemedComponent.name || 'Component'));\n\n _defineProperty(Themed, \"contextTypes\", {\n themr: _propTypes[\"default\"].object\n });\n\n _defineProperty(Themed, \"propTypes\", _objectSpread(_objectSpread({}, ThemedComponent.propTypes), {}, {\n composeTheme: _propTypes[\"default\"].oneOf([COMPOSE_DEEPLY, COMPOSE_SOFTLY, DONT_COMPOSE]),\n innerRef: _propTypes[\"default\"].oneOfType([_propTypes[\"default\"].func, _propTypes[\"default\"].object]),\n theme: _propTypes[\"default\"].object,\n themeNamespace: _propTypes[\"default\"].string,\n mapThemrProps: _propTypes[\"default\"].func\n }));\n\n _defineProperty(Themed, \"defaultProps\", _objectSpread(_objectSpread({}, ThemedComponent.defaultProps), {}, {\n composeTheme: optionComposeTheme,\n mapThemrProps: optionMapThemrProps\n }));\n\n Themed[THEMR_CONFIG] = config;\n return (0, _hoistNonReactStatics[\"default\"])(Themed, ThemedComponent);\n };\n};\n\nvar _default = themr;\n/**\n * Merges passed themes by concatenating string keys and processing nested themes\n *\n * @param {...TReactCSSThemrTheme} themes - Themes\n * @returns {TReactCSSThemrTheme} - Resulting theme\n */\n\nexports[\"default\"] = _default;\n\nfunction themeable() {\n for (var _len2 = arguments.length, themes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n themes[_key2] = arguments[_key2];\n }\n\n return themes.reduce(function (acc, theme) {\n return merge(acc, theme);\n }, {});\n}\n/**\n * @param {TReactCSSThemrTheme} [original] - Original theme\n * @param {TReactCSSThemrTheme} [mixin] - Mixin theme\n * @returns {TReactCSSThemrTheme} - resulting theme\n */\n\n\nfunction merge() {\n var original = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var mixin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n //make a copy to avoid mutations of nested objects\n //also strip all functions injected by isomorphic-style-loader\n var result = Object.keys(original).reduce(function (acc, key) {\n var value = original[key];\n\n if (typeof value !== 'function') {\n acc[key] = value;\n }\n\n return acc;\n }, {}); //traverse mixin keys and merge them to resulting theme\n\n Object.keys(mixin).forEach(function (key) {\n //there's no need to set any defaults here\n var originalValue = result[key];\n var mixinValue = mixin[key];\n\n switch (_typeof(mixinValue)) {\n case 'object':\n {\n //possibly nested theme object\n switch (_typeof(originalValue)) {\n case 'object':\n {\n //exactly nested theme object - go recursive\n result[key] = merge(originalValue, mixinValue);\n break;\n }\n\n case 'undefined':\n {\n //original does not contain this nested key - just take it as is\n result[key] = mixinValue;\n break;\n }\n\n default:\n {\n //can't merge an object with a non-object\n throw new Error(\"You are merging object \".concat(key, \" with a non-object \").concat(originalValue));\n }\n }\n\n break;\n }\n\n case 'undefined': //fallthrough - handles accidentally unset values which may come from props\n\n case 'function':\n {\n //this handles issue when isomorphic-style-loader addes helper functions to css-module\n break; //just skip\n }\n\n default:\n {\n //plain values\n switch (_typeof(originalValue)) {\n case 'object':\n {\n //can't merge a non-object with an object\n throw new Error(\"You are merging non-object \".concat(mixinValue, \" with an object \").concat(key, \", (can occur when using empty or :global only base theme stylesheet)\"));\n }\n\n case 'undefined':\n {\n //mixin key is new to original theme - take it as is\n result[key] = mixinValue;\n break;\n }\n\n case 'function':\n {\n //this handles issue when isomorphic-style-loader addes helper functions to css-module\n break; //just skip\n }\n\n default:\n {\n //finally we can merge\n result[key] = originalValue.split(' ').concat(mixinValue.split(' ')).filter(function (item, pos, self) {\n return self.indexOf(item) === pos && item !== '';\n }).join(' ');\n break;\n }\n }\n\n break;\n }\n }\n });\n return result;\n}\n/**\n * Validates compose option\n *\n * @param {String|Boolean} composeTheme - Compose them option\n * @throws\n * @returns {undefined}\n */\n\n\nfunction validateComposeOption(composeTheme) {\n if ([COMPOSE_DEEPLY, COMPOSE_SOFTLY, DONT_COMPOSE].indexOf(composeTheme) === -1) {\n throw new Error(\"Invalid composeTheme option for friendsofreactjs/react-css-themr. Valid composition options are \".concat(COMPOSE_DEEPLY, \", \").concat(COMPOSE_SOFTLY, \" and \").concat(DONT_COMPOSE, \". The given option was \").concat(composeTheme));\n }\n}\n/**\n * Removes namespace from key\n *\n * @param {String} key - Key\n * @param {String} themeNamespace - Theme namespace\n * @returns {String} - Key\n */\n\n\nfunction removeNamespace(key, themeNamespace) {\n var capitalized = key.substr(themeNamespace.length);\n return capitalized.slice(0, 1).toLowerCase() + capitalized.slice(1);\n}\n/**\n * Maps props and theme to an object that will be used to pass down props to the\n * decorated component.\n *\n * @param {Object} ownProps - All props given to the decorated component\n * @param {Object} theme - Calculated then that should be passed down\n * @returns {Object} - Props that will be passed down to the decorated component\n */\n\n\nfunction defaultMapThemrProps(ownProps, theme) {\n var composeTheme = ownProps.composeTheme,\n innerRef = ownProps.innerRef,\n themeNamespace = ownProps.themeNamespace,\n mapThemrProps = ownProps.mapThemrProps,\n rest = _objectWithoutProperties(ownProps, [\"composeTheme\", \"innerRef\", \"themeNamespace\", \"mapThemrProps\"]);\n\n return _objectSpread(_objectSpread({}, rest), {}, {\n ref: innerRef,\n theme: theme\n });\n}","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"ThemeProvider\", {\n enumerable: true,\n get: function get() {\n return _ThemeProvider[\"default\"];\n }\n});\nObject.defineProperty(exports, \"themr\", {\n enumerable: true,\n get: function get() {\n return _themr[\"default\"];\n }\n});\nObject.defineProperty(exports, \"themeable\", {\n enumerable: true,\n get: function get() {\n return _themr.themeable;\n }\n});\n\nvar _ThemeProvider = _interopRequireDefault(require(\"./components/ThemeProvider\"));\n\nvar _themr = _interopRequireWildcard(require(\"./components/themr\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }","/* eslint-disable camelcase */\n//\n// Every component in this repository needs a uniquie identifier\n// to be used with `react-css-themr`, this opens up the possibility\n// for users of the UI to overide default css from the UI and\n// create custom themes / components.\n//\nexport default {\n badge: '@neos-project/react-ui-components/badge',\n bar: '@neos-project/react-ui-components/bar',\n button: '@neos-project/react-ui-components/button',\n buttonGroup: '@neos-project/react-ui-components/buttonGroup',\n checkBox: '@neos-project/react-ui-components/checkBox',\n dateInput: '@neos-project/react-ui-components/dateInput',\n dialog: '@neos-project/react-ui-components/dialog',\n dropDown: '@neos-project/react-ui-components/dropDown',\n dropDownContents: '@neos-project/react-ui-components/dropDownContents',\n dropDownHeader: '@neos-project/react-ui-components/dropDownHeader',\n frame: '@neos-project/react-ui-components/frame',\n grid: '@neos-project/react-ui-components/grid',\n gridItem: '@neos-project/react-ui-components/gridItem',\n headline: '@neos-project/react-ui-components/headline',\n icon: '@neos-project/react-ui-components/icon',\n iconButton: '@neos-project/react-ui-components/iconButton',\n iconButtonDropDown: '@neos-project/react-ui-components/iconButtonDropDown',\n label: '@neos-project/react-ui-components/label',\n listPreviewElement: '@neos-project/react-ui-components/listPreviewElement',\n multiSelectBox: '@neos-project/react-ui-components/multiSelectBox',\n multiSelectBox_ListPreviewSortable: '@neos-project/react-ui-components/multiSelectBox_ListPreviewSortable',\n multiSelectBox_ListPreviewSortable_DraggableListPreviewElement: '@neos-project/react-ui-components/multiSelectBox_ListPreviewSortable_DraggableListPreviewElement',\n selectBox: '@neos-project/react-ui-components/selectBox',\n selectBox_Header: '@neos-project/react-ui-components/selectBox_Header',\n selectBox_HeaderWithSearchInput: '@neos-project/react-ui-components/selectBox_HeaderWithSearchInput',\n selectBox_Option_MultiLineWithThumbnail: '@neos-project/react-ui-components/selectBox_Option_MultiLineWithThumbnail',\n sideBar: '@neos-project/react-ui-components/sideBar',\n tabs: '@neos-project/react-ui-components/tabs',\n tabsPanel: '@neos-project/react-ui-components/tabsPanel',\n textArea: '@neos-project/react-ui-components/textArea',\n textInput: '@neos-project/react-ui-components/textInput',\n toggablePanel: '@neos-project/react-ui-components/toggablePanel',\n toggablePanelContents: '@neos-project/react-ui-components/toggablePanelContents',\n toggablePanelHeader: '@neos-project/react-ui-components/toggablePanelHeader',\n tooltip: '@neos-project/react-ui-components/tooltip',\n tree: '@neos-project/react-ui-components/tree',\n treeNode: '@neos-project/react-ui-components/treeNode',\n treeNodeContents: '@neos-project/react-ui-components/treeNodeContents',\n treeNodeHeader: '@neos-project/react-ui-components/treeNodeHeader',\n treeDragLayer: '@neos-project/react-ui-components/treeDragLayer',\n};\n","/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString === Object.prototype.toString) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import mergeClassNames from 'classnames';\nimport React, {PureComponent} from 'react';\n\ninterface BadgeTheme {\n readonly badge: string;\n}\n\nexport interface BadgeProps {\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * Badge's label.\n */\n readonly label: string;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme?: BadgeTheme;\n}\n\nclass Badge extends PureComponent {\n public render(): JSX.Element {\n const {\n className,\n theme,\n label,\n ...rest\n } = this.props;\n const finalClassName = mergeClassNames(theme!.badge, className);\n\n return (\n

{label}
\n );\n }\n}\n\nexport default Badge;\n","import {themr} from '@friendsofreactjs/react-css-themr';\nimport identifiers from '../identifiers';\n\nimport Badge from './badge';\nimport style from './style.css';\n\nexport default themr(identifiers.badge, style)(Badge);\n","import mergeClassNames from 'classnames';\nimport React, {PureComponent} from 'react';\n\ntype BarPosition = 'top' | 'bottom';\n\ninterface BarTheme {\n readonly 'bar': string;\n readonly 'bar--top': string;\n readonly 'bar--bottom': string;\n}\n\nexport interface BarProps {\n /**\n * This prop controls the vertical positioning of the Bar.\n */\n readonly position: BarPosition;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme?: BarTheme;\n\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * The contents to be rendered within the `Bar`.\n */\n readonly children: React.ReactNode;\n}\n\nclass Bar extends PureComponent {\n public render(): JSX.Element {\n const {position, className, theme, children, ...rest} = this.props;\n const finalClassName = mergeClassNames(\n className,\n theme!.bar,\n {\n [theme!['bar--top']]: position === 'top',\n [theme!['bar--bottom']]: position === 'bottom'\n }\n );\n\n // TODO:\n // The prop 'rest' is empty here. I suppose it contains all the attributes that are not part of the Badge Api/Interface.\n // Consider enxtending Bagde with React.HTMLAttributes like we did in the Button component.\n // It also enables autocomplete for the whole div Api.\n // Consider this for the other components.\n return (\n
\n {children}\n
\n );\n }\n}\n\nexport default Bar;\n","import {themr} from '@friendsofreactjs/react-css-themr';\nimport identifiers from '../identifiers';\n\nimport Bar from './bar';\nimport style from './style.css';\n\nexport default themr(identifiers.bar, style)(Bar);\n","/**\n * Creates a curried function which can be used as a `ref` in React Components\n * to focus the rendered node.\n *\n * @param {Boolean} Indicates wether the node should be focused or not,\n */\nexport const makeFocusNode = (isFocused: boolean) => (node: any) => {\n if (node) {\n const method = isFocused ? 'focus' : 'blur';\n\n node[method]();\n }\n};\n","import mergeClassNames from 'classnames';\nimport React from 'react';\n\nimport {Omit, PickDefaultProps} from '../../types';\nimport {makeFocusNode} from '../_lib/focusNode';\n\nexport type ButtonStyle = 'clean' | 'brand' | 'lighter' | 'neutral' | 'transparent' | 'success' | 'warn' | 'error';\nexport type ButtonHoverStyle = 'clean' | 'brand' | 'darken' | 'success' | 'warn' | 'error';\nexport type ButtonSize = 'small' | 'regular';\n\ninterface ButtonTheme {\n readonly 'btn': string;\n readonly 'btn--clean': string;\n readonly 'btn--lighter': string;\n readonly 'btn--transparent': string;\n readonly 'btn--brand': string;\n readonly 'btn--brandActive': string;\n readonly 'btn--brandHover': string;\n readonly 'btn--cleanHover': string;\n readonly 'btn--isPressed': string;\n readonly 'btn--darkenHover': string;\n}\n\n// We omit the standard HTML button style attribute,\n// so we have no collision with the Button component's style property,\n// while still enjoying the intellisense and type checking for the rest of the HTML button attributes\nexport type HTMLButtonElementAttributesExceptStyle = Omit, 'style'>;\n\n// own props and (optional) HTML button attributes except 'style'\nexport interface ButtonProps extends HTMLButtonElementAttributesExceptStyle {\n /**\n * This prop controls the visual pressed state of the `Button`.\n */\n readonly isPressed?: boolean;\n\n /**\n * This prop controls the visual focused state of the `Button`.\n * When `true`, the node gets focused via the DOM API.\n */\n readonly isFocused?: boolean;\n\n /**\n * This prop controls the visual and interactive disabled state of the `Button`.\n * When `true`, the node gets rendered with a truthy `disabled` prop.\n */\n readonly disabled?: boolean;\n\n /**\n * DEPRECATED, will be removed in the future\n */\n readonly isDisabled?: boolean;\n\n /**\n * This prop controls the visual active state of the `Button`.\n */\n readonly isActive?: boolean;\n\n /**\n * The `kind` prop defines the regular visual style of the `Button`.\n */\n readonly style?: ButtonStyle;\n\n /**\n * As the `style` prop, this prop controls the visual :hover style of the `Button`.\n */\n readonly hoverStyle?: ButtonHoverStyle;\n\n /**\n * Defines the size of the button.\n */\n readonly size?: ButtonSize;\n\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * The contents to be rendered within the `Bar`.\n */\n readonly children: React.ReactNode;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme?: ButtonTheme;\n\n /**\n * An interal prop for testing purposes, do not set this prop manually.\n */\n readonly _refHandler?: (isFocused: boolean) => (node: any) => void;\n}\n\ntype DefaultProps = PickDefaultProps;\n\nexport const defaultProps: DefaultProps = {\n _refHandler: makeFocusNode,\n hoverStyle: 'brand',\n isActive: false,\n disabled: false,\n isFocused: false,\n size: 'regular',\n style: 'lighter',\n type: 'button',\n};\n\nclass Button extends React.PureComponent {\n public static readonly defaultProps = defaultProps;\n\n private getDisabled(): boolean {\n if (this.props.isDisabled !== undefined) {\n console.error('`isDisabled` prop on Button component is DEPRECATED, use `disabled instead`'); // tslint:disable-line no-console\n }\n return Boolean(this.props.disabled || this.props.isDisabled);\n }\n\n public render(): JSX.Element {\n const {\n children,\n className,\n isPressed,\n isFocused,\n isActive,\n style,\n hoverStyle,\n size,\n theme,\n type,\n _refHandler,\n ...rest\n } = this.props;\n const disabled = this.getDisabled();\n const effectiveStyle = isActive ? 'brand' : style;\n const effectiveHoverStyle = isActive ? 'brand' : hoverStyle;\n const finalClassName = mergeClassNames(\n theme!.btn,\n // @ts-ignore implizit any because ButtonTheme has no index signature\n theme![`btn--size-${size}`],\n // @ts-ignore implizit any because ButtonTheme has no index signature\n theme![`btn--${effectiveStyle!}`],\n // @ts-ignore implizit any because ButtonTheme has no index signature\n theme![`btn--${effectiveHoverStyle!}Hover`],\n {\n [theme!['btn--brandActive']]: isActive,\n [theme!['btn--isPressed']]: isPressed,\n },\n className,\n );\n\n return (\n \n );\n }\n}\n\nexport default Button;\n","import {themr} from '@friendsofreactjs/react-css-themr';\nimport identifiers from '../identifiers';\n\nimport Button from './button';\nimport style from './style.css';\n\nexport default themr(identifiers.button, style)(Button);\n","import React, {PureComponent} from 'react';\n\nexport type ButtonGroupItemId = string;\n\nexport interface ButtonGroupItemProps {\n readonly className?: string;\n readonly id: ButtonGroupItemId;\n readonly onClick: (id: ButtonGroupItemId) => void;\n readonly element: React.ReactElement;\n}\n\nclass ButtonGroupItem extends PureComponent {\n public render(): JSX.Element {\n const {element, ...restProps} = this.props;\n return (\n React.cloneElement(element, {\n ...restProps,\n onClick: this.handleButtonClick\n })\n );\n }\n\n private readonly handleButtonClick = () => {\n this.props.onClick(this.props.id);\n }\n}\n\nexport default ButtonGroupItem;\n","import mergeClassNames from 'classnames';\nimport React, {PureComponent} from 'react';\n\nimport ButtonGroupItem, {ButtonGroupItemId} from './buttonGroupItem';\n\ninterface ButtonGroupTheme {\n readonly buttonGroup: string;\n}\n\nexport interface ButtonGroupProps {\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * Current value\n */\n readonly value: any;\n\n /**\n * Called when new value is selected. Returns an id of the activated button\n */\n readonly onSelect: (value: any) => ButtonGroupItemId;\n\n /**\n * The contents to be rendered within the `Bar`.\n */\n readonly children: ReadonlyArray>;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme?: ButtonGroupTheme;\n}\n\nclass ButtonGroup extends PureComponent {\n public render(): JSX.Element {\n const {\n children,\n className,\n theme,\n value,\n onSelect,\n ...rest\n } = this.props;\n const finalClassName = mergeClassNames(\n theme!.buttonGroup,\n className,\n );\n\n return (\n
\n {\n children.map((child, index) => {\n return (\n \n );\n })\n }\n
\n );\n }\n}\n\nexport default ButtonGroup;\n","import {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport ButtonGroup from './buttonGroup';\nimport style from './style.css';\n\nexport default themr(identifiers.buttonGroup, style)(ButtonGroup);\n","/*!\n * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com\n * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)\n */\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nvar noop = function noop() {};\n\nvar _WINDOW = {};\nvar _DOCUMENT = {};\nvar _MUTATION_OBSERVER = null;\nvar _PERFORMANCE = {\n mark: noop,\n measure: noop\n};\n\ntry {\n if (typeof window !== 'undefined') _WINDOW = window;\n if (typeof document !== 'undefined') _DOCUMENT = document;\n if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;\n if (typeof performance !== 'undefined') _PERFORMANCE = performance;\n} catch (e) {}\n\nvar _ref = _WINDOW.navigator || {},\n _ref$userAgent = _ref.userAgent,\n userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;\n\nvar WINDOW = _WINDOW;\nvar DOCUMENT = _DOCUMENT;\nvar MUTATION_OBSERVER = _MUTATION_OBSERVER;\nvar PERFORMANCE = _PERFORMANCE;\nvar IS_BROWSER = !!WINDOW.document;\nvar IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';\nvar IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');\n\nvar NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';\nvar UNITS_IN_GRID = 16;\nvar DEFAULT_FAMILY_PREFIX = 'fa';\nvar DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';\nvar DATA_FA_I2SVG = 'data-fa-i2svg';\nvar DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';\nvar DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';\nvar DATA_PREFIX = 'data-prefix';\nvar DATA_ICON = 'data-icon';\nvar HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';\nvar MUTATION_APPROACH_ASYNC = 'async';\nvar TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];\nvar PRODUCTION = function () {\n try {\n return process.env.NODE_ENV === 'production';\n } catch (e) {\n return false;\n }\n}();\nvar PREFIX_TO_STYLE = {\n 'fas': 'solid',\n 'far': 'regular',\n 'fal': 'light',\n 'fad': 'duotone',\n 'fab': 'brands',\n 'fak': 'kit',\n 'fa': 'solid'\n};\nvar STYLE_TO_PREFIX = {\n 'solid': 'fas',\n 'regular': 'far',\n 'light': 'fal',\n 'duotone': 'fad',\n 'brands': 'fab',\n 'kit': 'fak'\n};\nvar LAYERS_TEXT_CLASSNAME = 'fa-layers-text';\nvar FONT_FAMILY_PATTERN = /Font Awesome ([5 ]*)(Solid|Regular|Light|Duotone|Brands|Free|Pro|Kit).*/; // TODO: do we need to handle font-weight for kit SVG pseudo-elements?\n\nvar FONT_WEIGHT_TO_PREFIX = {\n '900': 'fas',\n '400': 'far',\n 'normal': 'far',\n '300': 'fal'\n};\nvar oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\nvar oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);\nvar ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];\nvar DUOTONE_CLASSES = {\n GROUP: 'group',\n SWAP_OPACITY: 'swap-opacity',\n PRIMARY: 'primary',\n SECONDARY: 'secondary'\n};\nvar RESERVED_CLASSES = ['xs', 'sm', 'lg', 'fw', 'ul', 'li', 'border', 'pull-left', 'pull-right', 'spin', 'pulse', 'rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'flip-both', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY].concat(oneToTen.map(function (n) {\n return \"\".concat(n, \"x\");\n})).concat(oneToTwenty.map(function (n) {\n return \"w-\".concat(n);\n}));\n\nvar initial = WINDOW.FontAwesomeConfig || {};\n\nfunction getAttrConfig(attr) {\n var element = DOCUMENT.querySelector('script[' + attr + ']');\n\n if (element) {\n return element.getAttribute(attr);\n }\n}\n\nfunction coerce(val) {\n // Getting an empty string will occur if the attribute is set on the HTML tag but without a value\n // We'll assume that this is an indication that it should be toggled to true\n // For example \n if (val === '') return true;\n if (val === 'false') return false;\n if (val === 'true') return true;\n return val;\n}\n\nif (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {\n var attrs = [['data-family-prefix', 'familyPrefix'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];\n attrs.forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n attr = _ref2[0],\n key = _ref2[1];\n\n var val = coerce(getAttrConfig(attr));\n\n if (val !== undefined && val !== null) {\n initial[key] = val;\n }\n });\n}\n\nvar _default = {\n familyPrefix: DEFAULT_FAMILY_PREFIX,\n replacementClass: DEFAULT_REPLACEMENT_CLASS,\n autoReplaceSvg: true,\n autoAddCss: true,\n autoA11y: true,\n searchPseudoElements: false,\n observeMutations: true,\n mutateApproach: 'async',\n keepOriginalSource: true,\n measurePerformance: false,\n showMissingIcons: true\n};\n\nvar _config = _objectSpread({}, _default, initial);\n\nif (!_config.autoReplaceSvg) _config.observeMutations = false;\n\nvar config = _objectSpread({}, _config);\n\nWINDOW.FontAwesomeConfig = config;\n\nvar w = WINDOW || {};\nif (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};\nif (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};\nif (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};\nif (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];\nvar namespace = w[NAMESPACE_IDENTIFIER];\n\nvar functions = [];\n\nvar listener = function listener() {\n DOCUMENT.removeEventListener('DOMContentLoaded', listener);\n loaded = 1;\n functions.map(function (fn) {\n return fn();\n });\n};\n\nvar loaded = false;\n\nif (IS_DOM) {\n loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);\n if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);\n}\n\nfunction domready (fn) {\n if (!IS_DOM) return;\n loaded ? setTimeout(fn, 0) : functions.push(fn);\n}\n\nvar PENDING = 'pending';\nvar SETTLED = 'settled';\nvar FULFILLED = 'fulfilled';\nvar REJECTED = 'rejected';\n\nvar NOOP = function NOOP() {};\n\nvar isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';\nvar asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;\nvar asyncQueue = [];\nvar asyncTimer;\n\nfunction asyncFlush() {\n // run promise callbacks\n for (var i = 0; i < asyncQueue.length; i++) {\n asyncQueue[i][0](asyncQueue[i][1]);\n } // reset async asyncQueue\n\n\n asyncQueue = [];\n asyncTimer = false;\n}\n\nfunction asyncCall(callback, arg) {\n asyncQueue.push([callback, arg]);\n\n if (!asyncTimer) {\n asyncTimer = true;\n asyncSetTimer(asyncFlush, 0);\n }\n}\n\nfunction invokeResolver(resolver, promise) {\n function resolvePromise(value) {\n resolve(promise, value);\n }\n\n function rejectPromise(reason) {\n reject(promise, reason);\n }\n\n try {\n resolver(resolvePromise, rejectPromise);\n } catch (e) {\n rejectPromise(e);\n }\n}\n\nfunction invokeCallback(subscriber) {\n var owner = subscriber.owner;\n var settled = owner._state;\n var value = owner._data;\n var callback = subscriber[settled];\n var promise = subscriber.then;\n\n if (typeof callback === 'function') {\n settled = FULFILLED;\n\n try {\n value = callback(value);\n } catch (e) {\n reject(promise, e);\n }\n }\n\n if (!handleThenable(promise, value)) {\n if (settled === FULFILLED) {\n resolve(promise, value);\n }\n\n if (settled === REJECTED) {\n reject(promise, value);\n }\n }\n}\n\nfunction handleThenable(promise, value) {\n var resolved;\n\n try {\n if (promise === value) {\n throw new TypeError('A promises callback cannot return that same promise.');\n }\n\n if (value && (typeof value === 'function' || _typeof(value) === 'object')) {\n // then should be retrieved only once\n var then = value.then;\n\n if (typeof then === 'function') {\n then.call(value, function (val) {\n if (!resolved) {\n resolved = true;\n\n if (value === val) {\n fulfill(promise, val);\n } else {\n resolve(promise, val);\n }\n }\n }, function (reason) {\n if (!resolved) {\n resolved = true;\n reject(promise, reason);\n }\n });\n return true;\n }\n }\n } catch (e) {\n if (!resolved) {\n reject(promise, e);\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction resolve(promise, value) {\n if (promise === value || !handleThenable(promise, value)) {\n fulfill(promise, value);\n }\n}\n\nfunction fulfill(promise, value) {\n if (promise._state === PENDING) {\n promise._state = SETTLED;\n promise._data = value;\n asyncCall(publishFulfillment, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state === PENDING) {\n promise._state = SETTLED;\n promise._data = reason;\n asyncCall(publishRejection, promise);\n }\n}\n\nfunction publish(promise) {\n promise._then = promise._then.forEach(invokeCallback);\n}\n\nfunction publishFulfillment(promise) {\n promise._state = FULFILLED;\n publish(promise);\n}\n\nfunction publishRejection(promise) {\n promise._state = REJECTED;\n publish(promise);\n\n if (!promise._handled && isNode) {\n global.process.emit('unhandledRejection', promise._data, promise);\n }\n}\n\nfunction notifyRejectionHandled(promise) {\n global.process.emit('rejectionHandled', promise);\n}\n/**\n * @class\n */\n\n\nfunction P(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('Promise resolver ' + resolver + ' is not a function');\n }\n\n if (this instanceof P === false) {\n throw new TypeError('Failed to construct \\'Promise\\': Please use the \\'new\\' operator, this object constructor cannot be called as a function.');\n }\n\n this._then = [];\n invokeResolver(resolver, this);\n}\n\nP.prototype = {\n constructor: P,\n _state: PENDING,\n _then: null,\n _data: undefined,\n _handled: false,\n then: function then(onFulfillment, onRejection) {\n var subscriber = {\n owner: this,\n then: new this.constructor(NOOP),\n fulfilled: onFulfillment,\n rejected: onRejection\n };\n\n if ((onRejection || onFulfillment) && !this._handled) {\n this._handled = true;\n\n if (this._state === REJECTED && isNode) {\n asyncCall(notifyRejectionHandled, this);\n }\n }\n\n if (this._state === FULFILLED || this._state === REJECTED) {\n // already resolved, call callback async\n asyncCall(invokeCallback, subscriber);\n } else {\n // subscribe\n this._then.push(subscriber);\n }\n\n return subscriber.then;\n },\n catch: function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nP.all = function (promises) {\n if (!Array.isArray(promises)) {\n throw new TypeError('You must pass an array to Promise.all().');\n }\n\n return new P(function (resolve, reject) {\n var results = [];\n var remaining = 0;\n\n function resolver(index) {\n remaining++;\n return function (value) {\n results[index] = value;\n\n if (! --remaining) {\n resolve(results);\n }\n };\n }\n\n for (var i = 0, promise; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolver(i), reject);\n } else {\n results[i] = promise;\n }\n }\n\n if (!remaining) {\n resolve(results);\n }\n });\n};\n\nP.race = function (promises) {\n if (!Array.isArray(promises)) {\n throw new TypeError('You must pass an array to Promise.race().');\n }\n\n return new P(function (resolve, reject) {\n for (var i = 0, promise; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolve, reject);\n } else {\n resolve(promise);\n }\n }\n });\n};\n\nP.resolve = function (value) {\n if (value && _typeof(value) === 'object' && value.constructor === P) {\n return value;\n }\n\n return new P(function (resolve) {\n resolve(value);\n });\n};\n\nP.reject = function (reason) {\n return new P(function (resolve, reject) {\n reject(reason);\n });\n};\n\nvar picked = typeof Promise === 'function' ? Promise : P;\n\nvar d = UNITS_IN_GRID;\nvar meaninglessTransform = {\n size: 16,\n x: 0,\n y: 0,\n rotate: 0,\n flipX: false,\n flipY: false\n};\n\nfunction isReserved(name) {\n return ~RESERVED_CLASSES.indexOf(name);\n}\nfunction insertCss(css) {\n if (!css || !IS_DOM) {\n return;\n }\n\n var style = DOCUMENT.createElement('style');\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n var headChildren = DOCUMENT.head.childNodes;\n var beforeChild = null;\n\n for (var i = headChildren.length - 1; i > -1; i--) {\n var child = headChildren[i];\n var tagName = (child.tagName || '').toUpperCase();\n\n if (['STYLE', 'LINK'].indexOf(tagName) > -1) {\n beforeChild = child;\n }\n }\n\n DOCUMENT.head.insertBefore(style, beforeChild);\n return css;\n}\nvar idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\nfunction nextUniqueId() {\n var size = 12;\n var id = '';\n\n while (size-- > 0) {\n id += idPool[Math.random() * 62 | 0];\n }\n\n return id;\n}\nfunction toArray(obj) {\n var array = [];\n\n for (var i = (obj || []).length >>> 0; i--;) {\n array[i] = obj[i];\n }\n\n return array;\n}\nfunction classArray(node) {\n if (node.classList) {\n return toArray(node.classList);\n } else {\n return (node.getAttribute('class') || '').split(' ').filter(function (i) {\n return i;\n });\n }\n}\nfunction getIconName(familyPrefix, cls) {\n var parts = cls.split('-');\n var prefix = parts[0];\n var iconName = parts.slice(1).join('-');\n\n if (prefix === familyPrefix && iconName !== '' && !isReserved(iconName)) {\n return iconName;\n } else {\n return null;\n }\n}\nfunction htmlEscape(str) {\n return \"\".concat(str).replace(/&/g, '&').replace(/\"/g, '"').replace(/'/g, ''').replace(//g, '>');\n}\nfunction joinAttributes(attributes) {\n return Object.keys(attributes || {}).reduce(function (acc, attributeName) {\n return acc + \"\".concat(attributeName, \"=\\\"\").concat(htmlEscape(attributes[attributeName]), \"\\\" \");\n }, '').trim();\n}\nfunction joinStyles(styles) {\n return Object.keys(styles || {}).reduce(function (acc, styleName) {\n return acc + \"\".concat(styleName, \": \").concat(styles[styleName], \";\");\n }, '');\n}\nfunction transformIsMeaningful(transform) {\n return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;\n}\nfunction transformForSvg(_ref) {\n var transform = _ref.transform,\n containerWidth = _ref.containerWidth,\n iconWidth = _ref.iconWidth;\n var outer = {\n transform: \"translate(\".concat(containerWidth / 2, \" 256)\")\n };\n var innerTranslate = \"translate(\".concat(transform.x * 32, \", \").concat(transform.y * 32, \") \");\n var innerScale = \"scale(\".concat(transform.size / 16 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / 16 * (transform.flipY ? -1 : 1), \") \");\n var innerRotate = \"rotate(\".concat(transform.rotate, \" 0 0)\");\n var inner = {\n transform: \"\".concat(innerTranslate, \" \").concat(innerScale, \" \").concat(innerRotate)\n };\n var path = {\n transform: \"translate(\".concat(iconWidth / 2 * -1, \" -256)\")\n };\n return {\n outer: outer,\n inner: inner,\n path: path\n };\n}\nfunction transformForCss(_ref2) {\n var transform = _ref2.transform,\n _ref2$width = _ref2.width,\n width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,\n _ref2$height = _ref2.height,\n height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,\n _ref2$startCentered = _ref2.startCentered,\n startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;\n var val = '';\n\n if (startCentered && IS_IE) {\n val += \"translate(\".concat(transform.x / d - width / 2, \"em, \").concat(transform.y / d - height / 2, \"em) \");\n } else if (startCentered) {\n val += \"translate(calc(-50% + \".concat(transform.x / d, \"em), calc(-50% + \").concat(transform.y / d, \"em)) \");\n } else {\n val += \"translate(\".concat(transform.x / d, \"em, \").concat(transform.y / d, \"em) \");\n }\n\n val += \"scale(\".concat(transform.size / d * (transform.flipX ? -1 : 1), \", \").concat(transform.size / d * (transform.flipY ? -1 : 1), \") \");\n val += \"rotate(\".concat(transform.rotate, \"deg) \");\n return val;\n}\n\nvar ALL_SPACE = {\n x: 0,\n y: 0,\n width: '100%',\n height: '100%'\n};\n\nfunction fillBlack(abstract) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (abstract.attributes && (abstract.attributes.fill || force)) {\n abstract.attributes.fill = 'black';\n }\n\n return abstract;\n}\n\nfunction deGroup(abstract) {\n if (abstract.tag === 'g') {\n return abstract.children;\n } else {\n return [abstract];\n }\n}\n\nfunction makeIconMasking (_ref) {\n var children = _ref.children,\n attributes = _ref.attributes,\n main = _ref.main,\n mask = _ref.mask,\n explicitMaskId = _ref.maskId,\n transform = _ref.transform;\n var mainWidth = main.width,\n mainPath = main.icon;\n var maskWidth = mask.width,\n maskPath = mask.icon;\n var trans = transformForSvg({\n transform: transform,\n containerWidth: maskWidth,\n iconWidth: mainWidth\n });\n var maskRect = {\n tag: 'rect',\n attributes: _objectSpread({}, ALL_SPACE, {\n fill: 'white'\n })\n };\n var maskInnerGroupChildrenMixin = mainPath.children ? {\n children: mainPath.children.map(fillBlack)\n } : {};\n var maskInnerGroup = {\n tag: 'g',\n attributes: _objectSpread({}, trans.inner),\n children: [fillBlack(_objectSpread({\n tag: mainPath.tag,\n attributes: _objectSpread({}, mainPath.attributes, trans.path)\n }, maskInnerGroupChildrenMixin))]\n };\n var maskOuterGroup = {\n tag: 'g',\n attributes: _objectSpread({}, trans.outer),\n children: [maskInnerGroup]\n };\n var maskId = \"mask-\".concat(explicitMaskId || nextUniqueId());\n var clipId = \"clip-\".concat(explicitMaskId || nextUniqueId());\n var maskTag = {\n tag: 'mask',\n attributes: _objectSpread({}, ALL_SPACE, {\n id: maskId,\n maskUnits: 'userSpaceOnUse',\n maskContentUnits: 'userSpaceOnUse'\n }),\n children: [maskRect, maskOuterGroup]\n };\n var defs = {\n tag: 'defs',\n children: [{\n tag: 'clipPath',\n attributes: {\n id: clipId\n },\n children: deGroup(maskPath)\n }, maskTag]\n };\n children.push(defs, {\n tag: 'rect',\n attributes: _objectSpread({\n fill: 'currentColor',\n 'clip-path': \"url(#\".concat(clipId, \")\"),\n mask: \"url(#\".concat(maskId, \")\")\n }, ALL_SPACE)\n });\n return {\n children: children,\n attributes: attributes\n };\n}\n\nfunction makeIconStandard (_ref) {\n var children = _ref.children,\n attributes = _ref.attributes,\n main = _ref.main,\n transform = _ref.transform,\n styles = _ref.styles;\n var styleString = joinStyles(styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n if (transformIsMeaningful(transform)) {\n var trans = transformForSvg({\n transform: transform,\n containerWidth: main.width,\n iconWidth: main.width\n });\n children.push({\n tag: 'g',\n attributes: _objectSpread({}, trans.outer),\n children: [{\n tag: 'g',\n attributes: _objectSpread({}, trans.inner),\n children: [{\n tag: main.icon.tag,\n children: main.icon.children,\n attributes: _objectSpread({}, main.icon.attributes, trans.path)\n }]\n }]\n });\n } else {\n children.push(main.icon);\n }\n\n return {\n children: children,\n attributes: attributes\n };\n}\n\nfunction asIcon (_ref) {\n var children = _ref.children,\n main = _ref.main,\n mask = _ref.mask,\n attributes = _ref.attributes,\n styles = _ref.styles,\n transform = _ref.transform;\n\n if (transformIsMeaningful(transform) && main.found && !mask.found) {\n var width = main.width,\n height = main.height;\n var offset = {\n x: width / height / 2,\n y: 0.5\n };\n attributes['style'] = joinStyles(_objectSpread({}, styles, {\n 'transform-origin': \"\".concat(offset.x + transform.x / 16, \"em \").concat(offset.y + transform.y / 16, \"em\")\n }));\n }\n\n return [{\n tag: 'svg',\n attributes: attributes,\n children: children\n }];\n}\n\nfunction asSymbol (_ref) {\n var prefix = _ref.prefix,\n iconName = _ref.iconName,\n children = _ref.children,\n attributes = _ref.attributes,\n symbol = _ref.symbol;\n var id = symbol === true ? \"\".concat(prefix, \"-\").concat(config.familyPrefix, \"-\").concat(iconName) : symbol;\n return [{\n tag: 'svg',\n attributes: {\n style: 'display: none;'\n },\n children: [{\n tag: 'symbol',\n attributes: _objectSpread({}, attributes, {\n id: id\n }),\n children: children\n }]\n }];\n}\n\nfunction makeInlineSvgAbstract(params) {\n var _params$icons = params.icons,\n main = _params$icons.main,\n mask = _params$icons.mask,\n prefix = params.prefix,\n iconName = params.iconName,\n transform = params.transform,\n symbol = params.symbol,\n title = params.title,\n maskId = params.maskId,\n titleId = params.titleId,\n extra = params.extra,\n _params$watchable = params.watchable,\n watchable = _params$watchable === void 0 ? false : _params$watchable;\n\n var _ref = mask.found ? mask : main,\n width = _ref.width,\n height = _ref.height;\n\n var isUploadedIcon = prefix === 'fak';\n var widthClass = isUploadedIcon ? '' : \"fa-w-\".concat(Math.ceil(width / height * 16));\n var attrClass = [config.replacementClass, iconName ? \"\".concat(config.familyPrefix, \"-\").concat(iconName) : '', widthClass].filter(function (c) {\n return extra.classes.indexOf(c) === -1;\n }).filter(function (c) {\n return c !== '' || !!c;\n }).concat(extra.classes).join(' ');\n var content = {\n children: [],\n attributes: _objectSpread({}, extra.attributes, {\n 'data-prefix': prefix,\n 'data-icon': iconName,\n 'class': attrClass,\n 'role': extra.attributes.role || 'img',\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'viewBox': \"0 0 \".concat(width, \" \").concat(height)\n })\n };\n var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {\n width: \"\".concat(width / height * 16 * 0.0625, \"em\")\n } : {};\n\n if (watchable) {\n content.attributes[DATA_FA_I2SVG] = '';\n }\n\n if (title) content.children.push({\n tag: 'title',\n attributes: {\n id: content.attributes['aria-labelledby'] || \"title-\".concat(titleId || nextUniqueId())\n },\n children: [title]\n });\n\n var args = _objectSpread({}, content, {\n prefix: prefix,\n iconName: iconName,\n main: main,\n mask: mask,\n maskId: maskId,\n transform: transform,\n symbol: symbol,\n styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)\n });\n\n var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),\n children = _ref2.children,\n attributes = _ref2.attributes;\n\n args.children = children;\n args.attributes = attributes;\n\n if (symbol) {\n return asSymbol(args);\n } else {\n return asIcon(args);\n }\n}\nfunction makeLayersTextAbstract(params) {\n var content = params.content,\n width = params.width,\n height = params.height,\n transform = params.transform,\n title = params.title,\n extra = params.extra,\n _params$watchable2 = params.watchable,\n watchable = _params$watchable2 === void 0 ? false : _params$watchable2;\n\n var attributes = _objectSpread({}, extra.attributes, title ? {\n 'title': title\n } : {}, {\n 'class': extra.classes.join(' ')\n });\n\n if (watchable) {\n attributes[DATA_FA_I2SVG] = '';\n }\n\n var styles = _objectSpread({}, extra.styles);\n\n if (transformIsMeaningful(transform)) {\n styles['transform'] = transformForCss({\n transform: transform,\n startCentered: true,\n width: width,\n height: height\n });\n styles['-webkit-transform'] = styles['transform'];\n }\n\n var styleString = joinStyles(styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n var val = [];\n val.push({\n tag: 'span',\n attributes: attributes,\n children: [content]\n });\n\n if (title) {\n val.push({\n tag: 'span',\n attributes: {\n class: 'sr-only'\n },\n children: [title]\n });\n }\n\n return val;\n}\nfunction makeLayersCounterAbstract(params) {\n var content = params.content,\n title = params.title,\n extra = params.extra;\n\n var attributes = _objectSpread({}, extra.attributes, title ? {\n 'title': title\n } : {}, {\n 'class': extra.classes.join(' ')\n });\n\n var styleString = joinStyles(extra.styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n var val = [];\n val.push({\n tag: 'span',\n attributes: attributes,\n children: [content]\n });\n\n if (title) {\n val.push({\n tag: 'span',\n attributes: {\n class: 'sr-only'\n },\n children: [title]\n });\n }\n\n return val;\n}\n\nvar noop$1 = function noop() {};\n\nvar p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {\n mark: noop$1,\n measure: noop$1\n};\nvar preamble = \"FA \\\"5.15.3\\\"\";\n\nvar begin = function begin(name) {\n p.mark(\"\".concat(preamble, \" \").concat(name, \" begins\"));\n return function () {\n return end(name);\n };\n};\n\nvar end = function end(name) {\n p.mark(\"\".concat(preamble, \" \").concat(name, \" ends\"));\n p.measure(\"\".concat(preamble, \" \").concat(name), \"\".concat(preamble, \" \").concat(name, \" begins\"), \"\".concat(preamble, \" \").concat(name, \" ends\"));\n};\n\nvar perf = {\n begin: begin,\n end: end\n};\n\n/**\n * Internal helper to bind a function known to have 4 arguments\n * to a given context.\n */\n\nvar bindInternal4 = function bindInternal4(func, thisContext) {\n return function (a, b, c, d) {\n return func.call(thisContext, a, b, c, d);\n };\n};\n\n/**\n * # Reduce\n *\n * A fast object `.reduce()` implementation.\n *\n * @param {Object} subject The object to reduce over.\n * @param {Function} fn The reducer function.\n * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].\n * @param {Object} thisContext The context for the reducer.\n * @return {mixed} The final result.\n */\n\n\nvar reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {\n var keys = Object.keys(subject),\n length = keys.length,\n iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,\n i,\n key,\n result;\n\n if (initialValue === undefined) {\n i = 1;\n result = subject[keys[0]];\n } else {\n i = 0;\n result = initialValue;\n }\n\n for (; i < length; i++) {\n key = keys[i];\n result = iterator(result, subject[key], key, subject);\n }\n\n return result;\n};\n\nfunction toHex(unicode) {\n var result = '';\n\n for (var i = 0; i < unicode.length; i++) {\n var hex = unicode.charCodeAt(i).toString(16);\n result += ('000' + hex).slice(-4);\n }\n\n return result;\n}\n\nfunction defineIcons(prefix, icons) {\n var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var _params$skipHooks = params.skipHooks,\n skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;\n var normalized = Object.keys(icons).reduce(function (acc, iconName) {\n var icon = icons[iconName];\n var expanded = !!icon.icon;\n\n if (expanded) {\n acc[icon.iconName] = icon.icon;\n } else {\n acc[iconName] = icon;\n }\n\n return acc;\n }, {});\n\n if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {\n namespace.hooks.addPack(prefix, normalized);\n } else {\n namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);\n }\n /**\n * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction\n * of new styles we needed to differentiate between them. Prefix `fa` is now an alias\n * for `fas` so we'll easy the upgrade process for our users by automatically defining\n * this as well.\n */\n\n\n if (prefix === 'fas') {\n defineIcons('fa', icons);\n }\n}\n\nvar styles = namespace.styles,\n shims = namespace.shims;\nvar _byUnicode = {};\nvar _byLigature = {};\nvar _byOldName = {};\nvar build = function build() {\n var lookup = function lookup(reducer) {\n return reduce(styles, function (o, style, prefix) {\n o[prefix] = reduce(style, reducer, {});\n return o;\n }, {});\n };\n\n _byUnicode = lookup(function (acc, icon, iconName) {\n if (icon[3]) {\n acc[icon[3]] = iconName;\n }\n\n return acc;\n });\n _byLigature = lookup(function (acc, icon, iconName) {\n var ligatures = icon[2];\n acc[iconName] = iconName;\n ligatures.forEach(function (ligature) {\n acc[ligature] = iconName;\n });\n return acc;\n });\n var hasRegular = 'far' in styles;\n _byOldName = reduce(shims, function (acc, shim) {\n var oldName = shim[0];\n var prefix = shim[1];\n var iconName = shim[2];\n\n if (prefix === 'far' && !hasRegular) {\n prefix = 'fas';\n }\n\n acc[oldName] = {\n prefix: prefix,\n iconName: iconName\n };\n return acc;\n }, {});\n};\nbuild();\nfunction byUnicode(prefix, unicode) {\n return (_byUnicode[prefix] || {})[unicode];\n}\nfunction byLigature(prefix, ligature) {\n return (_byLigature[prefix] || {})[ligature];\n}\nfunction byOldName(name) {\n return _byOldName[name] || {\n prefix: null,\n iconName: null\n };\n}\n\nvar styles$1 = namespace.styles;\nvar emptyCanonicalIcon = function emptyCanonicalIcon() {\n return {\n prefix: null,\n iconName: null,\n rest: []\n };\n};\nfunction getCanonicalIcon(values) {\n return values.reduce(function (acc, cls) {\n var iconName = getIconName(config.familyPrefix, cls);\n\n if (styles$1[cls]) {\n acc.prefix = cls;\n } else if (config.autoFetchSvg && Object.keys(PREFIX_TO_STYLE).indexOf(cls) > -1) {\n acc.prefix = cls;\n } else if (iconName) {\n var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};\n acc.iconName = shim.iconName || iconName;\n acc.prefix = shim.prefix || acc.prefix;\n } else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {\n acc.rest.push(cls);\n }\n\n return acc;\n }, emptyCanonicalIcon());\n}\nfunction iconFromMapping(mapping, prefix, iconName) {\n if (mapping && mapping[prefix] && mapping[prefix][iconName]) {\n return {\n prefix: prefix,\n iconName: iconName,\n icon: mapping[prefix][iconName]\n };\n }\n}\n\nfunction toHtml(abstractNodes) {\n var tag = abstractNodes.tag,\n _abstractNodes$attrib = abstractNodes.attributes,\n attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,\n _abstractNodes$childr = abstractNodes.children,\n children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;\n\n if (typeof abstractNodes === 'string') {\n return htmlEscape(abstractNodes);\n } else {\n return \"<\".concat(tag, \" \").concat(joinAttributes(attributes), \">\").concat(children.map(toHtml).join(''), \"\");\n }\n}\n\nvar noop$2 = function noop() {};\n\nfunction isWatched(node) {\n var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;\n return typeof i2svg === 'string';\n}\n\nfunction getMutator() {\n if (config.autoReplaceSvg === true) {\n return mutators.replace;\n }\n\n var mutator = mutators[config.autoReplaceSvg];\n return mutator || mutators.replace;\n}\n\nvar mutators = {\n replace: function replace(mutation) {\n var node = mutation[0];\n var abstract = mutation[1];\n var newOuterHTML = abstract.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n\n if (node.parentNode && node.outerHTML) {\n node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? \"\") : '');\n } else if (node.parentNode) {\n var newNode = document.createElement('span');\n node.parentNode.replaceChild(newNode, node);\n newNode.outerHTML = newOuterHTML;\n }\n },\n nest: function nest(mutation) {\n var node = mutation[0];\n var abstract = mutation[1]; // If we already have a replaced node we do not want to continue nesting within it.\n // Short-circuit to the standard replacement\n\n if (~classArray(node).indexOf(config.replacementClass)) {\n return mutators.replace(mutation);\n }\n\n var forSvg = new RegExp(\"\".concat(config.familyPrefix, \"-.*\"));\n delete abstract[0].attributes.style;\n delete abstract[0].attributes.id;\n var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {\n if (cls === config.replacementClass || cls.match(forSvg)) {\n acc.toSvg.push(cls);\n } else {\n acc.toNode.push(cls);\n }\n\n return acc;\n }, {\n toNode: [],\n toSvg: []\n });\n abstract[0].attributes.class = splitClasses.toSvg.join(' ');\n var newInnerHTML = abstract.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n node.setAttribute('class', splitClasses.toNode.join(' '));\n node.setAttribute(DATA_FA_I2SVG, '');\n node.innerHTML = newInnerHTML;\n }\n};\n\nfunction performOperationSync(op) {\n op();\n}\n\nfunction perform(mutations, callback) {\n var callbackFunction = typeof callback === 'function' ? callback : noop$2;\n\n if (mutations.length === 0) {\n callbackFunction();\n } else {\n var frame = performOperationSync;\n\n if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {\n frame = WINDOW.requestAnimationFrame || performOperationSync;\n }\n\n frame(function () {\n var mutator = getMutator();\n var mark = perf.begin('mutate');\n mutations.map(mutator);\n mark();\n callbackFunction();\n });\n }\n}\nvar disabled = false;\nfunction disableObservation() {\n disabled = true;\n}\nfunction enableObservation() {\n disabled = false;\n}\nvar mo = null;\nfunction observe(options) {\n if (!MUTATION_OBSERVER) {\n return;\n }\n\n if (!config.observeMutations) {\n return;\n }\n\n var treeCallback = options.treeCallback,\n nodeCallback = options.nodeCallback,\n pseudoElementsCallback = options.pseudoElementsCallback,\n _options$observeMutat = options.observeMutationsRoot,\n observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;\n mo = new MUTATION_OBSERVER(function (objects) {\n if (disabled) return;\n toArray(objects).forEach(function (mutationRecord) {\n if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {\n if (config.searchPseudoElements) {\n pseudoElementsCallback(mutationRecord.target);\n }\n\n treeCallback(mutationRecord.target);\n }\n\n if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {\n pseudoElementsCallback(mutationRecord.target.parentNode);\n }\n\n if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {\n if (mutationRecord.attributeName === 'class') {\n var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),\n prefix = _getCanonicalIcon.prefix,\n iconName = _getCanonicalIcon.iconName;\n\n if (prefix) mutationRecord.target.setAttribute('data-prefix', prefix);\n if (iconName) mutationRecord.target.setAttribute('data-icon', iconName);\n } else {\n nodeCallback(mutationRecord.target);\n }\n }\n });\n });\n if (!IS_DOM) return;\n mo.observe(observeMutationsRoot, {\n childList: true,\n attributes: true,\n characterData: true,\n subtree: true\n });\n}\nfunction disconnect() {\n if (!mo) return;\n mo.disconnect();\n}\n\nfunction styleParser (node) {\n var style = node.getAttribute('style');\n var val = [];\n\n if (style) {\n val = style.split(';').reduce(function (acc, style) {\n var styles = style.split(':');\n var prop = styles[0];\n var value = styles.slice(1);\n\n if (prop && value.length > 0) {\n acc[prop] = value.join(':').trim();\n }\n\n return acc;\n }, {});\n }\n\n return val;\n}\n\nfunction classParser (node) {\n var existingPrefix = node.getAttribute('data-prefix');\n var existingIconName = node.getAttribute('data-icon');\n var innerText = node.innerText !== undefined ? node.innerText.trim() : '';\n var val = getCanonicalIcon(classArray(node));\n\n if (existingPrefix && existingIconName) {\n val.prefix = existingPrefix;\n val.iconName = existingIconName;\n }\n\n if (val.prefix && innerText.length > 1) {\n val.iconName = byLigature(val.prefix, node.innerText);\n } else if (val.prefix && innerText.length === 1) {\n val.iconName = byUnicode(val.prefix, toHex(node.innerText));\n }\n\n return val;\n}\n\nvar parseTransformString = function parseTransformString(transformString) {\n var transform = {\n size: 16,\n x: 0,\n y: 0,\n flipX: false,\n flipY: false,\n rotate: 0\n };\n\n if (!transformString) {\n return transform;\n } else {\n return transformString.toLowerCase().split(' ').reduce(function (acc, n) {\n var parts = n.toLowerCase().split('-');\n var first = parts[0];\n var rest = parts.slice(1).join('-');\n\n if (first && rest === 'h') {\n acc.flipX = true;\n return acc;\n }\n\n if (first && rest === 'v') {\n acc.flipY = true;\n return acc;\n }\n\n rest = parseFloat(rest);\n\n if (isNaN(rest)) {\n return acc;\n }\n\n switch (first) {\n case 'grow':\n acc.size = acc.size + rest;\n break;\n\n case 'shrink':\n acc.size = acc.size - rest;\n break;\n\n case 'left':\n acc.x = acc.x - rest;\n break;\n\n case 'right':\n acc.x = acc.x + rest;\n break;\n\n case 'up':\n acc.y = acc.y - rest;\n break;\n\n case 'down':\n acc.y = acc.y + rest;\n break;\n\n case 'rotate':\n acc.rotate = acc.rotate + rest;\n break;\n }\n\n return acc;\n }, transform);\n }\n};\nfunction transformParser (node) {\n return parseTransformString(node.getAttribute('data-fa-transform'));\n}\n\nfunction symbolParser (node) {\n var symbol = node.getAttribute('data-fa-symbol');\n return symbol === null ? false : symbol === '' ? true : symbol;\n}\n\nfunction attributesParser (node) {\n var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {\n if (acc.name !== 'class' && acc.name !== 'style') {\n acc[attr.name] = attr.value;\n }\n\n return acc;\n }, {});\n var title = node.getAttribute('title');\n var titleId = node.getAttribute('data-fa-title-id');\n\n if (config.autoA11y) {\n if (title) {\n extraAttributes['aria-labelledby'] = \"\".concat(config.replacementClass, \"-title-\").concat(titleId || nextUniqueId());\n } else {\n extraAttributes['aria-hidden'] = 'true';\n extraAttributes['focusable'] = 'false';\n }\n }\n\n return extraAttributes;\n}\n\nfunction maskParser (node) {\n var mask = node.getAttribute('data-fa-mask');\n\n if (!mask) {\n return emptyCanonicalIcon();\n } else {\n return getCanonicalIcon(mask.split(' ').map(function (i) {\n return i.trim();\n }));\n }\n}\n\nfunction blankMeta() {\n return {\n iconName: null,\n title: null,\n titleId: null,\n prefix: null,\n transform: meaninglessTransform,\n symbol: false,\n mask: null,\n maskId: null,\n extra: {\n classes: [],\n styles: {},\n attributes: {}\n }\n };\n}\nfunction parseMeta(node) {\n var _classParser = classParser(node),\n iconName = _classParser.iconName,\n prefix = _classParser.prefix,\n extraClasses = _classParser.rest;\n\n var extraStyles = styleParser(node);\n var transform = transformParser(node);\n var symbol = symbolParser(node);\n var extraAttributes = attributesParser(node);\n var mask = maskParser(node);\n return {\n iconName: iconName,\n title: node.getAttribute('title'),\n titleId: node.getAttribute('data-fa-title-id'),\n prefix: prefix,\n transform: transform,\n symbol: symbol,\n mask: mask,\n maskId: node.getAttribute('data-fa-mask-id'),\n extra: {\n classes: extraClasses,\n styles: extraStyles,\n attributes: extraAttributes\n }\n };\n}\n\nfunction MissingIcon(error) {\n this.name = 'MissingIcon';\n this.message = error || 'Icon unavailable';\n this.stack = new Error().stack;\n}\nMissingIcon.prototype = Object.create(Error.prototype);\nMissingIcon.prototype.constructor = MissingIcon;\n\nvar FILL = {\n fill: 'currentColor'\n};\nvar ANIMATION_BASE = {\n attributeType: 'XML',\n repeatCount: 'indefinite',\n dur: '2s'\n};\nvar RING = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'\n })\n};\n\nvar OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {\n attributeName: 'opacity'\n});\n\nvar DOT = {\n tag: 'circle',\n attributes: _objectSpread({}, FILL, {\n cx: '256',\n cy: '364',\n r: '28'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, ANIMATION_BASE, {\n attributeName: 'r',\n values: '28;14;28;28;14;28;'\n })\n }, {\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '1;0;1;1;0;1;'\n })\n }]\n};\nvar QUESTION = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n opacity: '1',\n d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '1;0;0;0;0;1;'\n })\n }]\n};\nvar EXCLAMATION = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n opacity: '0',\n d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '0;0;1;1;0;0;'\n })\n }]\n};\nvar missing = {\n tag: 'g',\n children: [RING, DOT, QUESTION, EXCLAMATION]\n};\n\nvar styles$2 = namespace.styles;\nfunction asFoundIcon(icon) {\n var width = icon[0];\n var height = icon[1];\n\n var _icon$slice = icon.slice(4),\n _icon$slice2 = _slicedToArray(_icon$slice, 1),\n vectorData = _icon$slice2[0];\n\n var element = null;\n\n if (Array.isArray(vectorData)) {\n element = {\n tag: 'g',\n attributes: {\n class: \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.GROUP)\n },\n children: [{\n tag: 'path',\n attributes: {\n class: \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.SECONDARY),\n fill: 'currentColor',\n d: vectorData[0]\n }\n }, {\n tag: 'path',\n attributes: {\n class: \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.PRIMARY),\n fill: 'currentColor',\n d: vectorData[1]\n }\n }]\n };\n } else {\n element = {\n tag: 'path',\n attributes: {\n fill: 'currentColor',\n d: vectorData\n }\n };\n }\n\n return {\n found: true,\n width: width,\n height: height,\n icon: element\n };\n}\nfunction findIcon(iconName, prefix) {\n return new picked(function (resolve, reject) {\n var val = {\n found: false,\n width: 512,\n height: 512,\n icon: missing\n };\n\n if (iconName && prefix && styles$2[prefix] && styles$2[prefix][iconName]) {\n var icon = styles$2[prefix][iconName];\n return resolve(asFoundIcon(icon));\n }\n\n if (iconName && prefix && !config.showMissingIcons) {\n reject(new MissingIcon(\"Icon is missing for prefix \".concat(prefix, \" with icon name \").concat(iconName)));\n } else {\n resolve(val);\n }\n });\n}\n\nvar styles$3 = namespace.styles;\n\nfunction generateSvgReplacementMutation(node, nodeMeta) {\n var iconName = nodeMeta.iconName,\n title = nodeMeta.title,\n titleId = nodeMeta.titleId,\n prefix = nodeMeta.prefix,\n transform = nodeMeta.transform,\n symbol = nodeMeta.symbol,\n mask = nodeMeta.mask,\n maskId = nodeMeta.maskId,\n extra = nodeMeta.extra;\n return new picked(function (resolve, reject) {\n picked.all([findIcon(iconName, prefix), findIcon(mask.iconName, mask.prefix)]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n main = _ref2[0],\n mask = _ref2[1];\n\n resolve([node, makeInlineSvgAbstract({\n icons: {\n main: main,\n mask: mask\n },\n prefix: prefix,\n iconName: iconName,\n transform: transform,\n symbol: symbol,\n mask: mask,\n maskId: maskId,\n title: title,\n titleId: titleId,\n extra: extra,\n watchable: true\n })]);\n });\n });\n}\n\nfunction generateLayersText(node, nodeMeta) {\n var title = nodeMeta.title,\n transform = nodeMeta.transform,\n extra = nodeMeta.extra;\n var width = null;\n var height = null;\n\n if (IS_IE) {\n var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);\n var boundingClientRect = node.getBoundingClientRect();\n width = boundingClientRect.width / computedFontSize;\n height = boundingClientRect.height / computedFontSize;\n }\n\n if (config.autoA11y && !title) {\n extra.attributes['aria-hidden'] = 'true';\n }\n\n return picked.resolve([node, makeLayersTextAbstract({\n content: node.innerHTML,\n width: width,\n height: height,\n transform: transform,\n title: title,\n extra: extra,\n watchable: true\n })]);\n}\n\nfunction generateMutation(node) {\n var nodeMeta = parseMeta(node);\n\n if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {\n return generateLayersText(node, nodeMeta);\n } else {\n return generateSvgReplacementMutation(node, nodeMeta);\n }\n}\n\nfunction onTree(root) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (!IS_DOM) return;\n var htmlClassList = DOCUMENT.documentElement.classList;\n\n var hclAdd = function hclAdd(suffix) {\n return htmlClassList.add(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n };\n\n var hclRemove = function hclRemove(suffix) {\n return htmlClassList.remove(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n };\n\n var prefixes = config.autoFetchSvg ? Object.keys(PREFIX_TO_STYLE) : Object.keys(styles$3);\n var prefixesDomQuery = [\".\".concat(LAYERS_TEXT_CLASSNAME, \":not([\").concat(DATA_FA_I2SVG, \"])\")].concat(prefixes.map(function (p) {\n return \".\".concat(p, \":not([\").concat(DATA_FA_I2SVG, \"])\");\n })).join(', ');\n\n if (prefixesDomQuery.length === 0) {\n return;\n }\n\n var candidates = [];\n\n try {\n candidates = toArray(root.querySelectorAll(prefixesDomQuery));\n } catch (e) {// noop\n }\n\n if (candidates.length > 0) {\n hclAdd('pending');\n hclRemove('complete');\n } else {\n return;\n }\n\n var mark = perf.begin('onTree');\n var mutations = candidates.reduce(function (acc, node) {\n try {\n var mutation = generateMutation(node);\n\n if (mutation) {\n acc.push(mutation);\n }\n } catch (e) {\n if (!PRODUCTION) {\n if (e instanceof MissingIcon) {\n console.error(e);\n }\n }\n }\n\n return acc;\n }, []);\n return new picked(function (resolve, reject) {\n picked.all(mutations).then(function (resolvedMutations) {\n perform(resolvedMutations, function () {\n hclAdd('active');\n hclAdd('complete');\n hclRemove('pending');\n if (typeof callback === 'function') callback();\n mark();\n resolve();\n });\n }).catch(function () {\n mark();\n reject();\n });\n });\n}\nfunction onNode(node) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n generateMutation(node).then(function (mutation) {\n if (mutation) {\n perform([mutation], callback);\n }\n });\n}\n\nfunction replaceForPosition(node, position) {\n var pendingAttribute = \"\".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));\n return new picked(function (resolve, reject) {\n if (node.getAttribute(pendingAttribute) !== null) {\n // This node is already being processed\n return resolve();\n }\n\n var children = toArray(node.children);\n var alreadyProcessedPseudoElement = children.filter(function (c) {\n return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;\n })[0];\n var styles = WINDOW.getComputedStyle(node, position);\n var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);\n var fontWeight = styles.getPropertyValue('font-weight');\n var content = styles.getPropertyValue('content');\n\n if (alreadyProcessedPseudoElement && !fontFamily) {\n // If we've already processed it but the current computed style does not result in a font-family,\n // that probably means that a class name that was previously present to make the icon has been\n // removed. So we now should delete the icon.\n node.removeChild(alreadyProcessedPseudoElement);\n return resolve();\n } else if (fontFamily && content !== 'none' && content !== '') {\n var _content = styles.getPropertyValue('content');\n\n var prefix = ~['Solid', 'Regular', 'Light', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];\n var hexValue = toHex(_content.length === 3 ? _content.substr(1, 1) : _content);\n var iconName = byUnicode(prefix, hexValue);\n var iconIdentifier = iconName; // Only convert the pseudo element in this :before/:after position into an icon if we haven't\n // already done so with the same prefix and iconName\n\n if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {\n node.setAttribute(pendingAttribute, iconIdentifier);\n\n if (alreadyProcessedPseudoElement) {\n // Delete the old one, since we're replacing it with a new one\n node.removeChild(alreadyProcessedPseudoElement);\n }\n\n var meta = blankMeta();\n var extra = meta.extra;\n extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;\n findIcon(iconName, prefix).then(function (main) {\n var abstract = makeInlineSvgAbstract(_objectSpread({}, meta, {\n icons: {\n main: main,\n mask: emptyCanonicalIcon()\n },\n prefix: prefix,\n iconName: iconIdentifier,\n extra: extra,\n watchable: true\n }));\n var element = DOCUMENT.createElement('svg');\n\n if (position === ':before') {\n node.insertBefore(element, node.firstChild);\n } else {\n node.appendChild(element);\n }\n\n element.outerHTML = abstract.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n node.removeAttribute(pendingAttribute);\n resolve();\n }).catch(reject);\n } else {\n resolve();\n }\n } else {\n resolve();\n }\n });\n}\n\nfunction replace(node) {\n return picked.all([replaceForPosition(node, ':before'), replaceForPosition(node, ':after')]);\n}\n\nfunction processable(node) {\n return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');\n}\n\nfunction searchPseudoElements (root) {\n if (!IS_DOM) return;\n return new picked(function (resolve, reject) {\n var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);\n var end = perf.begin('searchPseudoElements');\n disableObservation();\n picked.all(operations).then(function () {\n end();\n enableObservation();\n resolve();\n }).catch(function () {\n end();\n enableObservation();\n reject();\n });\n });\n}\n\nvar baseStyles = \"svg:not(:root).svg-inline--fa {\\n overflow: visible;\\n}\\n\\n.svg-inline--fa {\\n display: inline-block;\\n font-size: inherit;\\n height: 1em;\\n overflow: visible;\\n vertical-align: -0.125em;\\n}\\n.svg-inline--fa.fa-lg {\\n vertical-align: -0.225em;\\n}\\n.svg-inline--fa.fa-w-1 {\\n width: 0.0625em;\\n}\\n.svg-inline--fa.fa-w-2 {\\n width: 0.125em;\\n}\\n.svg-inline--fa.fa-w-3 {\\n width: 0.1875em;\\n}\\n.svg-inline--fa.fa-w-4 {\\n width: 0.25em;\\n}\\n.svg-inline--fa.fa-w-5 {\\n width: 0.3125em;\\n}\\n.svg-inline--fa.fa-w-6 {\\n width: 0.375em;\\n}\\n.svg-inline--fa.fa-w-7 {\\n width: 0.4375em;\\n}\\n.svg-inline--fa.fa-w-8 {\\n width: 0.5em;\\n}\\n.svg-inline--fa.fa-w-9 {\\n width: 0.5625em;\\n}\\n.svg-inline--fa.fa-w-10 {\\n width: 0.625em;\\n}\\n.svg-inline--fa.fa-w-11 {\\n width: 0.6875em;\\n}\\n.svg-inline--fa.fa-w-12 {\\n width: 0.75em;\\n}\\n.svg-inline--fa.fa-w-13 {\\n width: 0.8125em;\\n}\\n.svg-inline--fa.fa-w-14 {\\n width: 0.875em;\\n}\\n.svg-inline--fa.fa-w-15 {\\n width: 0.9375em;\\n}\\n.svg-inline--fa.fa-w-16 {\\n width: 1em;\\n}\\n.svg-inline--fa.fa-w-17 {\\n width: 1.0625em;\\n}\\n.svg-inline--fa.fa-w-18 {\\n width: 1.125em;\\n}\\n.svg-inline--fa.fa-w-19 {\\n width: 1.1875em;\\n}\\n.svg-inline--fa.fa-w-20 {\\n width: 1.25em;\\n}\\n.svg-inline--fa.fa-pull-left {\\n margin-right: 0.3em;\\n width: auto;\\n}\\n.svg-inline--fa.fa-pull-right {\\n margin-left: 0.3em;\\n width: auto;\\n}\\n.svg-inline--fa.fa-border {\\n height: 1.5em;\\n}\\n.svg-inline--fa.fa-li {\\n width: 2em;\\n}\\n.svg-inline--fa.fa-fw {\\n width: 1.25em;\\n}\\n\\n.fa-layers svg.svg-inline--fa {\\n bottom: 0;\\n left: 0;\\n margin: auto;\\n position: absolute;\\n right: 0;\\n top: 0;\\n}\\n\\n.fa-layers {\\n display: inline-block;\\n height: 1em;\\n position: relative;\\n text-align: center;\\n vertical-align: -0.125em;\\n width: 1em;\\n}\\n.fa-layers svg.svg-inline--fa {\\n -webkit-transform-origin: center center;\\n transform-origin: center center;\\n}\\n\\n.fa-layers-counter, .fa-layers-text {\\n display: inline-block;\\n position: absolute;\\n text-align: center;\\n}\\n\\n.fa-layers-text {\\n left: 50%;\\n top: 50%;\\n -webkit-transform: translate(-50%, -50%);\\n transform: translate(-50%, -50%);\\n -webkit-transform-origin: center center;\\n transform-origin: center center;\\n}\\n\\n.fa-layers-counter {\\n background-color: #ff253a;\\n border-radius: 1em;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n color: #fff;\\n height: 1.5em;\\n line-height: 1;\\n max-width: 5em;\\n min-width: 1.5em;\\n overflow: hidden;\\n padding: 0.25em;\\n right: 0;\\n text-overflow: ellipsis;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top right;\\n transform-origin: top right;\\n}\\n\\n.fa-layers-bottom-right {\\n bottom: 0;\\n right: 0;\\n top: auto;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: bottom right;\\n transform-origin: bottom right;\\n}\\n\\n.fa-layers-bottom-left {\\n bottom: 0;\\n left: 0;\\n right: auto;\\n top: auto;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: bottom left;\\n transform-origin: bottom left;\\n}\\n\\n.fa-layers-top-right {\\n right: 0;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top right;\\n transform-origin: top right;\\n}\\n\\n.fa-layers-top-left {\\n left: 0;\\n right: auto;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top left;\\n transform-origin: top left;\\n}\\n\\n.fa-lg {\\n font-size: 1.3333333333em;\\n line-height: 0.75em;\\n vertical-align: -0.0667em;\\n}\\n\\n.fa-xs {\\n font-size: 0.75em;\\n}\\n\\n.fa-sm {\\n font-size: 0.875em;\\n}\\n\\n.fa-1x {\\n font-size: 1em;\\n}\\n\\n.fa-2x {\\n font-size: 2em;\\n}\\n\\n.fa-3x {\\n font-size: 3em;\\n}\\n\\n.fa-4x {\\n font-size: 4em;\\n}\\n\\n.fa-5x {\\n font-size: 5em;\\n}\\n\\n.fa-6x {\\n font-size: 6em;\\n}\\n\\n.fa-7x {\\n font-size: 7em;\\n}\\n\\n.fa-8x {\\n font-size: 8em;\\n}\\n\\n.fa-9x {\\n font-size: 9em;\\n}\\n\\n.fa-10x {\\n font-size: 10em;\\n}\\n\\n.fa-fw {\\n text-align: center;\\n width: 1.25em;\\n}\\n\\n.fa-ul {\\n list-style-type: none;\\n margin-left: 2.5em;\\n padding-left: 0;\\n}\\n.fa-ul > li {\\n position: relative;\\n}\\n\\n.fa-li {\\n left: -2em;\\n position: absolute;\\n text-align: center;\\n width: 2em;\\n line-height: inherit;\\n}\\n\\n.fa-border {\\n border: solid 0.08em #eee;\\n border-radius: 0.1em;\\n padding: 0.2em 0.25em 0.15em;\\n}\\n\\n.fa-pull-left {\\n float: left;\\n}\\n\\n.fa-pull-right {\\n float: right;\\n}\\n\\n.fa.fa-pull-left,\\n.fas.fa-pull-left,\\n.far.fa-pull-left,\\n.fal.fa-pull-left,\\n.fab.fa-pull-left {\\n margin-right: 0.3em;\\n}\\n.fa.fa-pull-right,\\n.fas.fa-pull-right,\\n.far.fa-pull-right,\\n.fal.fa-pull-right,\\n.fab.fa-pull-right {\\n margin-left: 0.3em;\\n}\\n\\n.fa-spin {\\n -webkit-animation: fa-spin 2s infinite linear;\\n animation: fa-spin 2s infinite linear;\\n}\\n\\n.fa-pulse {\\n -webkit-animation: fa-spin 1s infinite steps(8);\\n animation: fa-spin 1s infinite steps(8);\\n}\\n\\n@-webkit-keyframes fa-spin {\\n 0% {\\n -webkit-transform: rotate(0deg);\\n transform: rotate(0deg);\\n }\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\\n@keyframes fa-spin {\\n 0% {\\n -webkit-transform: rotate(0deg);\\n transform: rotate(0deg);\\n }\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n.fa-rotate-90 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)\\\";\\n -webkit-transform: rotate(90deg);\\n transform: rotate(90deg);\\n}\\n\\n.fa-rotate-180 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)\\\";\\n -webkit-transform: rotate(180deg);\\n transform: rotate(180deg);\\n}\\n\\n.fa-rotate-270 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)\\\";\\n -webkit-transform: rotate(270deg);\\n transform: rotate(270deg);\\n}\\n\\n.fa-flip-horizontal {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)\\\";\\n -webkit-transform: scale(-1, 1);\\n transform: scale(-1, 1);\\n}\\n\\n.fa-flip-vertical {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\\\";\\n -webkit-transform: scale(1, -1);\\n transform: scale(1, -1);\\n}\\n\\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\\\";\\n -webkit-transform: scale(-1, -1);\\n transform: scale(-1, -1);\\n}\\n\\n:root .fa-rotate-90,\\n:root .fa-rotate-180,\\n:root .fa-rotate-270,\\n:root .fa-flip-horizontal,\\n:root .fa-flip-vertical,\\n:root .fa-flip-both {\\n -webkit-filter: none;\\n filter: none;\\n}\\n\\n.fa-stack {\\n display: inline-block;\\n height: 2em;\\n position: relative;\\n width: 2.5em;\\n}\\n\\n.fa-stack-1x,\\n.fa-stack-2x {\\n bottom: 0;\\n left: 0;\\n margin: auto;\\n position: absolute;\\n right: 0;\\n top: 0;\\n}\\n\\n.svg-inline--fa.fa-stack-1x {\\n height: 1em;\\n width: 1.25em;\\n}\\n.svg-inline--fa.fa-stack-2x {\\n height: 2em;\\n width: 2.5em;\\n}\\n\\n.fa-inverse {\\n color: #fff;\\n}\\n\\n.sr-only {\\n border: 0;\\n clip: rect(0, 0, 0, 0);\\n height: 1px;\\n margin: -1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px;\\n}\\n\\n.sr-only-focusable:active, .sr-only-focusable:focus {\\n clip: auto;\\n height: auto;\\n margin: 0;\\n overflow: visible;\\n position: static;\\n width: auto;\\n}\\n\\n.svg-inline--fa .fa-primary {\\n fill: var(--fa-primary-color, currentColor);\\n opacity: 1;\\n opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa .fa-secondary {\\n fill: var(--fa-secondary-color, currentColor);\\n opacity: 0.4;\\n opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-primary {\\n opacity: 0.4;\\n opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\\n opacity: 1;\\n opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa mask .fa-primary,\\n.svg-inline--fa mask .fa-secondary {\\n fill: black;\\n}\\n\\n.fad.fa-inverse {\\n color: #fff;\\n}\";\n\nfunction css () {\n var dfp = DEFAULT_FAMILY_PREFIX;\n var drc = DEFAULT_REPLACEMENT_CLASS;\n var fp = config.familyPrefix;\n var rc = config.replacementClass;\n var s = baseStyles;\n\n if (fp !== dfp || rc !== drc) {\n var dPatt = new RegExp(\"\\\\.\".concat(dfp, \"\\\\-\"), 'g');\n var customPropPatt = new RegExp(\"\\\\--\".concat(dfp, \"\\\\-\"), 'g');\n var rPatt = new RegExp(\"\\\\.\".concat(drc), 'g');\n s = s.replace(dPatt, \".\".concat(fp, \"-\")).replace(customPropPatt, \"--\".concat(fp, \"-\")).replace(rPatt, \".\".concat(rc));\n }\n\n return s;\n}\n\nvar Library =\n/*#__PURE__*/\nfunction () {\n function Library() {\n _classCallCheck(this, Library);\n\n this.definitions = {};\n }\n\n _createClass(Library, [{\n key: \"add\",\n value: function add() {\n var _this = this;\n\n for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {\n definitions[_key] = arguments[_key];\n }\n\n var additions = definitions.reduce(this._pullDefinitions, {});\n Object.keys(additions).forEach(function (key) {\n _this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);\n defineIcons(key, additions[key]);\n build();\n });\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.definitions = {};\n }\n }, {\n key: \"_pullDefinitions\",\n value: function _pullDefinitions(additions, definition) {\n var normalized = definition.prefix && definition.iconName && definition.icon ? {\n 0: definition\n } : definition;\n Object.keys(normalized).map(function (key) {\n var _normalized$key = normalized[key],\n prefix = _normalized$key.prefix,\n iconName = _normalized$key.iconName,\n icon = _normalized$key.icon;\n if (!additions[prefix]) additions[prefix] = {};\n additions[prefix][iconName] = icon;\n });\n return additions;\n }\n }]);\n\n return Library;\n}();\n\nfunction ensureCss() {\n if (config.autoAddCss && !_cssInserted) {\n insertCss(css());\n\n _cssInserted = true;\n }\n}\n\nfunction apiObject(val, abstractCreator) {\n Object.defineProperty(val, 'abstract', {\n get: abstractCreator\n });\n Object.defineProperty(val, 'html', {\n get: function get() {\n return val.abstract.map(function (a) {\n return toHtml(a);\n });\n }\n });\n Object.defineProperty(val, 'node', {\n get: function get() {\n if (!IS_DOM) return;\n var container = DOCUMENT.createElement('div');\n container.innerHTML = val.html;\n return container.children;\n }\n });\n return val;\n}\n\nfunction findIconDefinition(iconLookup) {\n var _iconLookup$prefix = iconLookup.prefix,\n prefix = _iconLookup$prefix === void 0 ? 'fa' : _iconLookup$prefix,\n iconName = iconLookup.iconName;\n if (!iconName) return;\n return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);\n}\n\nfunction resolveIcons(next) {\n return function (maybeIconDefinition) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});\n var mask = params.mask;\n\n if (mask) {\n mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});\n }\n\n return next(iconDefinition, _objectSpread({}, params, {\n mask: mask\n }));\n };\n}\n\nvar library = new Library();\nvar noAuto = function noAuto() {\n config.autoReplaceSvg = false;\n config.observeMutations = false;\n disconnect();\n};\nvar _cssInserted = false;\nvar dom = {\n i2svg: function i2svg() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (IS_DOM) {\n ensureCss();\n var _params$node = params.node,\n node = _params$node === void 0 ? DOCUMENT : _params$node,\n _params$callback = params.callback,\n callback = _params$callback === void 0 ? function () {} : _params$callback;\n\n if (config.searchPseudoElements) {\n searchPseudoElements(node);\n }\n\n return onTree(node, callback);\n } else {\n return picked.reject('Operation requires a DOM of some kind.');\n }\n },\n css: css,\n insertCss: function insertCss$$1() {\n if (!_cssInserted) {\n insertCss(css());\n\n _cssInserted = true;\n }\n },\n watch: function watch() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var autoReplaceSvgRoot = params.autoReplaceSvgRoot,\n observeMutationsRoot = params.observeMutationsRoot;\n\n if (config.autoReplaceSvg === false) {\n config.autoReplaceSvg = true;\n }\n\n config.observeMutations = true;\n domready(function () {\n autoReplace({\n autoReplaceSvgRoot: autoReplaceSvgRoot\n });\n observe({\n treeCallback: onTree,\n nodeCallback: onNode,\n pseudoElementsCallback: searchPseudoElements,\n observeMutationsRoot: observeMutationsRoot\n });\n });\n }\n};\nvar parse = {\n transform: function transform(transformString) {\n return parseTransformString(transformString);\n }\n};\nvar icon = resolveIcons(function (iconDefinition) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$transform = params.transform,\n transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,\n _params$symbol = params.symbol,\n symbol = _params$symbol === void 0 ? false : _params$symbol,\n _params$mask = params.mask,\n mask = _params$mask === void 0 ? null : _params$mask,\n _params$maskId = params.maskId,\n maskId = _params$maskId === void 0 ? null : _params$maskId,\n _params$title = params.title,\n title = _params$title === void 0 ? null : _params$title,\n _params$titleId = params.titleId,\n titleId = _params$titleId === void 0 ? null : _params$titleId,\n _params$classes = params.classes,\n classes = _params$classes === void 0 ? [] : _params$classes,\n _params$attributes = params.attributes,\n attributes = _params$attributes === void 0 ? {} : _params$attributes,\n _params$styles = params.styles,\n styles = _params$styles === void 0 ? {} : _params$styles;\n if (!iconDefinition) return;\n var prefix = iconDefinition.prefix,\n iconName = iconDefinition.iconName,\n icon = iconDefinition.icon;\n return apiObject(_objectSpread({\n type: 'icon'\n }, iconDefinition), function () {\n ensureCss();\n\n if (config.autoA11y) {\n if (title) {\n attributes['aria-labelledby'] = \"\".concat(config.replacementClass, \"-title-\").concat(titleId || nextUniqueId());\n } else {\n attributes['aria-hidden'] = 'true';\n attributes['focusable'] = 'false';\n }\n }\n\n return makeInlineSvgAbstract({\n icons: {\n main: asFoundIcon(icon),\n mask: mask ? asFoundIcon(mask.icon) : {\n found: false,\n width: null,\n height: null,\n icon: {}\n }\n },\n prefix: prefix,\n iconName: iconName,\n transform: _objectSpread({}, meaninglessTransform, transform),\n symbol: symbol,\n title: title,\n maskId: maskId,\n titleId: titleId,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: classes\n }\n });\n });\n});\nvar text = function text(content) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$transform2 = params.transform,\n transform = _params$transform2 === void 0 ? meaninglessTransform : _params$transform2,\n _params$title2 = params.title,\n title = _params$title2 === void 0 ? null : _params$title2,\n _params$classes2 = params.classes,\n classes = _params$classes2 === void 0 ? [] : _params$classes2,\n _params$attributes2 = params.attributes,\n attributes = _params$attributes2 === void 0 ? {} : _params$attributes2,\n _params$styles2 = params.styles,\n styles = _params$styles2 === void 0 ? {} : _params$styles2;\n return apiObject({\n type: 'text',\n content: content\n }, function () {\n ensureCss();\n return makeLayersTextAbstract({\n content: content,\n transform: _objectSpread({}, meaninglessTransform, transform),\n title: title,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: [\"\".concat(config.familyPrefix, \"-layers-text\")].concat(_toConsumableArray(classes))\n }\n });\n });\n};\nvar counter = function counter(content) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$title3 = params.title,\n title = _params$title3 === void 0 ? null : _params$title3,\n _params$classes3 = params.classes,\n classes = _params$classes3 === void 0 ? [] : _params$classes3,\n _params$attributes3 = params.attributes,\n attributes = _params$attributes3 === void 0 ? {} : _params$attributes3,\n _params$styles3 = params.styles,\n styles = _params$styles3 === void 0 ? {} : _params$styles3;\n return apiObject({\n type: 'counter',\n content: content\n }, function () {\n ensureCss();\n return makeLayersCounterAbstract({\n content: content.toString(),\n title: title,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: [\"\".concat(config.familyPrefix, \"-layers-counter\")].concat(_toConsumableArray(classes))\n }\n });\n });\n};\nvar layer = function layer(assembler) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$classes4 = params.classes,\n classes = _params$classes4 === void 0 ? [] : _params$classes4;\n return apiObject({\n type: 'layer'\n }, function () {\n ensureCss();\n var children = [];\n assembler(function (args) {\n Array.isArray(args) ? args.map(function (a) {\n children = children.concat(a.abstract);\n }) : children = children.concat(args.abstract);\n });\n return [{\n tag: 'span',\n attributes: {\n class: [\"\".concat(config.familyPrefix, \"-layers\")].concat(_toConsumableArray(classes)).join(' ')\n },\n children: children\n }];\n });\n};\nvar api = {\n noAuto: noAuto,\n config: config,\n dom: dom,\n library: library,\n parse: parse,\n findIconDefinition: findIconDefinition,\n icon: icon,\n text: text,\n counter: counter,\n layer: layer,\n toHtml: toHtml\n};\n\nvar autoReplace = function autoReplace() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _params$autoReplaceSv = params.autoReplaceSvgRoot,\n autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;\n if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({\n node: autoReplaceSvgRoot\n });\n};\n\nexport { icon, noAuto, config, toHtml, layer, text, counter, library, dom, parse, findIconDefinition };\n","import { parse, icon } from '@fortawesome/fontawesome-svg-core';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\n// Get CSS class list from a props object\nfunction classList(props) {\n var _classes;\n\n var spin = props.spin,\n pulse = props.pulse,\n fixedWidth = props.fixedWidth,\n inverse = props.inverse,\n border = props.border,\n listItem = props.listItem,\n flip = props.flip,\n size = props.size,\n rotation = props.rotation,\n pull = props.pull; // map of CSS class names to properties\n\n var classes = (_classes = {\n 'fa-spin': spin,\n 'fa-pulse': pulse,\n 'fa-fw': fixedWidth,\n 'fa-inverse': inverse,\n 'fa-border': border,\n 'fa-li': listItem,\n 'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',\n 'fa-flip-vertical': flip === 'vertical' || flip === 'both'\n }, _defineProperty(_classes, \"fa-\".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty(_classes, \"fa-rotate-\".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), _defineProperty(_classes, \"fa-pull-\".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object\n // return an array of the keys where the value for the key is not null\n\n return Object.keys(classes).map(function (key) {\n return classes[key] ? key : null;\n }).filter(function (key) {\n return key;\n });\n}\n\n// Camelize taken from humps\n// humps is copyright © 2012+ Dom Christie\n// Released under the MIT license.\n// Performant way to determine if object coerces to a number\nfunction _isNumerical(obj) {\n obj = obj - 0; // eslint-disable-next-line no-self-compare\n\n return obj === obj;\n}\n\nfunction camelize(string) {\n if (_isNumerical(string)) {\n return string;\n } // eslint-disable-next-line no-useless-escape\n\n\n string = string.replace(/[\\-_\\s]+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n }); // Ensure 1st char is always lowercase\n\n return string.substr(0, 1).toLowerCase() + string.substr(1);\n}\n\nfunction capitalize(val) {\n return val.charAt(0).toUpperCase() + val.slice(1);\n}\n\nfunction styleToObject(style) {\n return style.split(';').map(function (s) {\n return s.trim();\n }).filter(function (s) {\n return s;\n }).reduce(function (acc, pair) {\n var i = pair.indexOf(':');\n var prop = camelize(pair.slice(0, i));\n var value = pair.slice(i + 1).trim();\n prop.startsWith('webkit') ? acc[capitalize(prop)] = value : acc[prop] = value;\n return acc;\n }, {});\n}\n\nfunction convert(createElement, element) {\n var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (typeof element === 'string') {\n return element;\n }\n\n var children = (element.children || []).map(function (child) {\n return convert(createElement, child);\n });\n /* eslint-disable dot-notation */\n\n var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {\n var val = element.attributes[key];\n\n switch (key) {\n case 'class':\n acc.attrs['className'] = val;\n delete element.attributes['class'];\n break;\n\n case 'style':\n acc.attrs['style'] = styleToObject(val);\n break;\n\n default:\n if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0) {\n acc.attrs[key.toLowerCase()] = val;\n } else {\n acc.attrs[camelize(key)] = val;\n }\n\n }\n\n return acc;\n }, {\n attrs: {}\n });\n\n var _extraProps$style = extraProps.style,\n existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,\n remaining = _objectWithoutProperties(extraProps, [\"style\"]);\n\n mixins.attrs['style'] = _objectSpread2({}, mixins.attrs['style'], {}, existingStyle);\n /* eslint-enable */\n\n return createElement.apply(void 0, [element.tag, _objectSpread2({}, mixins.attrs, {}, remaining)].concat(_toConsumableArray(children)));\n}\n\nvar PRODUCTION = false;\n\ntry {\n PRODUCTION = process.env.NODE_ENV === 'production';\n} catch (e) {}\n\nfunction log () {\n if (!PRODUCTION && console && typeof console.error === 'function') {\n var _console;\n\n (_console = console).error.apply(_console, arguments);\n }\n}\n\nfunction normalizeIconArgs(icon) {\n if (parse.icon) {\n return parse.icon(icon);\n } // if the icon is null, there's nothing to do\n\n\n if (icon === null) {\n return null;\n } // if the icon is an object and has a prefix and an icon name, return it\n\n\n if (_typeof(icon) === 'object' && icon.prefix && icon.iconName) {\n return icon;\n } // if it's an array with length of two\n\n\n if (Array.isArray(icon) && icon.length === 2) {\n // use the first item as prefix, second as icon name\n return {\n prefix: icon[0],\n iconName: icon[1]\n };\n } // if it's a string, use it as the icon name\n\n\n if (typeof icon === 'string') {\n return {\n prefix: 'fas',\n iconName: icon\n };\n }\n}\n\n// creates an object with a key of key\n// and a value of value\n// if certain conditions are met\nfunction objectWithKey(key, value) {\n // if the value is a non-empty array\n // or it's not an array but it is truthy\n // then create the object with the key and the value\n // if not, return an empty array\n return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};\n}\n\nfunction FontAwesomeIcon(_ref) {\n var forwardedRef = _ref.forwardedRef,\n props = _objectWithoutProperties(_ref, [\"forwardedRef\"]);\n\n var iconArgs = props.icon,\n maskArgs = props.mask,\n symbol = props.symbol,\n className = props.className,\n title = props.title,\n titleId = props.titleId;\n var iconLookup = normalizeIconArgs(iconArgs);\n var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));\n var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);\n var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));\n var renderedIcon = icon(iconLookup, _objectSpread2({}, classes, {}, transform, {}, mask, {\n symbol: symbol,\n title: title,\n titleId: titleId\n }));\n\n if (!renderedIcon) {\n log('Could not find icon', iconLookup);\n return null;\n }\n\n var abstract = renderedIcon.abstract;\n var extraProps = {\n ref: forwardedRef\n };\n Object.keys(props).forEach(function (key) {\n // eslint-disable-next-line no-prototype-builtins\n if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {\n extraProps[key] = props[key];\n }\n });\n return convertCurry(abstract[0], extraProps);\n}\nFontAwesomeIcon.displayName = 'FontAwesomeIcon';\nFontAwesomeIcon.propTypes = {\n border: PropTypes.bool,\n className: PropTypes.string,\n mask: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),\n fixedWidth: PropTypes.bool,\n inverse: PropTypes.bool,\n flip: PropTypes.oneOf(['horizontal', 'vertical', 'both']),\n icon: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),\n listItem: PropTypes.bool,\n pull: PropTypes.oneOf(['right', 'left']),\n pulse: PropTypes.bool,\n rotation: PropTypes.oneOf([0, 90, 180, 270]),\n size: PropTypes.oneOf(['lg', 'xs', 'sm', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),\n spin: PropTypes.bool,\n symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n title: PropTypes.string,\n transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n swapOpacity: PropTypes.bool\n};\nFontAwesomeIcon.defaultProps = {\n border: false,\n className: '',\n mask: null,\n fixedWidth: false,\n inverse: false,\n flip: null,\n icon: null,\n listItem: false,\n pull: null,\n pulse: false,\n rotation: null,\n size: null,\n spin: false,\n symbol: false,\n title: '',\n transform: null,\n swapOpacity: false\n};\nvar convertCurry = convert.bind(null, React.createElement);\n\nexport { FontAwesomeIcon };\n","/**\n * Simple mapper from Neos Icon names to Fontawesome 5 icon classes.\n */\n// TODO: create type for this, so we can have autocompletion\n// alternatively just use IconName or even better IconLookup (has IconPrefix & IconName) of FontAwesome typings\nconst map: {readonly [key: string]: string} = {\n 'address-book-o': 'far fa-address-book',\n 'address-card-o': 'far fa-address-card',\n 'area-chart': 'fas fa-chart-area',\n 'arrow-circle-o-down': 'far fa-arrow-alt-circle-down',\n 'arrow-circle-o-left': 'far fa-arrow-alt-circle-left',\n 'arrow-circle-o-right': 'far fa-arrow-alt-circle-right',\n 'arrow-circle-o-up': 'far fa-arrow-alt-circle-up',\n 'arrows': 'fas fa-arrows-alt',\n 'arrows-alt': 'fas fa-expand-arrows-alt',\n 'arrows-h': 'fas fa-arrows-alt-h',\n 'arrows-v': 'fas fa-arrows-alt-v',\n 'asl-interpreting': 'fas fa-american-sign-language-interpreting',\n 'automobile': 'fas fa-car',\n 'bank': 'fas fa-university',\n 'bar-chart': 'far fa-chart-bar',\n 'bar-chart-o': 'far fa-chart-bar',\n 'bathtub': 'fas fa-bath',\n 'battery': 'fas fa-battery-full',\n 'battery-0': 'fas fa-battery-empty',\n 'battery-1': 'fas fa-battery-quarter',\n 'battery-2': 'fas fa-battery-half',\n 'battery-3': 'fas fa-battery-three-quarters',\n 'battery-4': 'fas fa-battery-full',\n 'bell-o': 'far fa-bell',\n 'bell-slash-o': 'far fa-bell-slash',\n 'bitbucket-square': 'fab fa-bitbucket',\n 'bitcoin': 'fab fa-btc',\n 'bookmark-o': 'far fa-bookmark',\n 'building-o': 'far fa-building',\n 'cab': 'fas fa-taxi',\n 'calendar': 'fas fa-calendar-alt',\n 'calendar-check-o': 'far fa-calendar-check',\n 'calendar-empty': 'far fa-calendar',\n 'calendar-minus-o': 'far fa-calendar-minus',\n 'calendar-o': 'far fa-calendar',\n 'calendar-plus-o': 'far fa-calendar-plus',\n 'calendar-times-o': 'far fa-calendar-times',\n 'caret-square-o-down': 'far fa-caret-square-down',\n 'caret-square-o-left': 'far fa-caret-square-left',\n 'caret-square-o-right': 'far fa-caret-square-right',\n 'caret-square-o-up': 'far fa-caret-square-up',\n 'cc': 'far fa-closed-captioning',\n 'chain': 'fas fa-link',\n 'chain-broken': 'fas fa-unlink',\n 'check-circle-o': 'far fa-check-circle',\n 'check-square-o': 'far fa-check-square',\n 'circle-o': 'far fa-circle',\n 'circle-o-notch': 'fas fa-circle-notch',\n 'circle-thin': 'far fa-circle',\n 'clock-o': 'far fa-clock',\n 'close': 'fas fa-times',\n 'cloud-download': 'fas fa-cloud-download-alt',\n 'cloud-upload': 'fas fa-cloud-upload-alt',\n 'cny': 'fas fa-yen-sign',\n 'code-fork': 'fas fa-code-branch',\n 'comment-o': 'far fa-comment',\n 'commenting': 'fas fa-comment-alt',\n 'commenting-o': 'far fa-comment-alt',\n 'comments-o': 'far fa-comments',\n 'copy': 'far fa-copy',\n 'credit-card-alt': 'fas fa-credit-card',\n 'cutlery': 'fas fa-utensils',\n 'dashboard': 'fas fa-tachometer-alt',\n 'deafness': 'fas fa-deaf',\n 'dedent': 'fas fa-outdent',\n 'diamond': 'far fa-gem',\n 'dollar': 'fas fa-dollar-sign',\n 'dot-circle-o': 'far fa-dot-circle',\n 'drivers-license': 'fas fa-id-card',\n 'drivers-license-o': 'far fa-id-card',\n 'eercast': 'fab fa-sellcast',\n 'envelope-alt': 'far fa-envelope',\n 'envelope-o': 'far fa-envelope',\n 'envelope-open-o': 'far fa-envelope-open',\n 'eur': 'fas fa-euro-sign',\n 'euro': 'fas fa-euro-sign',\n 'exchange': 'fas fa-exchange-alt',\n 'external-link': 'fas fa-external-link-alt',\n 'external-link-square': 'fas fa-external-link-square-alt',\n 'eyedropper': 'fas fa-eye-dropper',\n 'fa': 'fab fa-font-awesome',\n 'facebook': 'fab fa-facebook-f',\n 'facebook-f': 'fab fa-facebook-f',\n 'facebook-official': 'fab fa-facebook',\n 'feed': 'fas fa-rss',\n 'file-archive-o': 'far fa-file-archive',\n 'file-audio-o': 'far fa-file-audio',\n 'file-code-o': 'far fa-file-code',\n 'file-excel-o': 'far fa-file-excel',\n 'file-image-o': 'far fa-file-image',\n 'file-movie-o': 'far fa-file-video',\n 'file-o': 'far fa-file',\n 'file-pdf-o': 'far fa-file-pdf',\n 'file-photo-o': 'far fa-file-image',\n 'file-picture-o': 'far fa-file-image',\n 'file-powerpoint-o': 'far fa-file-powerpoint',\n 'file-sound-o': 'far fa-file-audio',\n 'file-text': 'fas fa-file-alt',\n 'file-text-o': 'far fa-file-alt',\n 'file-video-o': 'far fa-file-video',\n 'file-word-o': 'far fa-file-word',\n 'file-zip-o': 'far fa-file-archive',\n 'files-o': 'far fa-copy',\n 'flag-alt': 'far fa-flag',\n 'flag-o': 'far fa-flag',\n 'flash': 'fas fa-bolt',\n 'floppy-o': 'far fa-save',\n 'folder-o': 'far fa-folder',\n 'folder-open-alt': 'far fa-folder-open',\n 'folder-open-o': 'far fa-folder-open',\n 'frown-o': 'far fa-frown',\n 'futbol-o': 'far fa-futbol',\n 'gbp': 'fas fa-pound-sign',\n 'ge': 'fab fa-empire',\n 'gear': 'fas fa-cog',\n 'gears': 'fas fa-cogs',\n 'gittip': 'fab fa-gratipay',\n 'glass': 'fas fa-glass-martini',\n 'google-plus': 'fab fa-google-plus-g',\n 'google-plus-circle': 'fab fa-google-plus',\n 'google-plus-official': 'fab fa-google-plus',\n 'group': 'fas fa-users',\n 'hand-grab-o': 'far fa-hand-rock',\n 'hand-lizard-o': 'far fa-hand-lizard',\n 'hand-o-down': 'far fa-hand-point-down',\n 'hand-o-left': 'far fa-hand-point-left',\n 'hand-o-right': 'far fa-hand-point-right',\n 'hand-o-up': 'far fa-hand-point-up',\n 'hand-paper-o': 'far fa-hand-paper',\n 'hand-peace-o': 'far fa-hand-peace',\n 'hand-pointer-o': 'far fa-hand-pointer',\n 'hand-rock-o': 'far fa-hand-rock',\n 'hand-scissors-o': 'far fa-hand-scissors',\n 'hand-spock-o': 'far fa-hand-spock',\n 'hand-stop-o': 'far fa-hand-paper',\n 'handshake-o': 'far fa-handshake',\n 'hard-of-hearing': 'fas fa-deaf',\n 'hdd-o': 'far fa-hdd',\n 'header': 'fas fa-heading',\n 'heart-o': 'far fa-heart',\n 'hospital-o': 'far fa-hospital',\n 'hotel': 'fas fa-bed',\n 'hourglass-1': 'fas fa-hourglass-start',\n 'hourglass-2': 'fas fa-hourglass-half',\n 'hourglass-3': 'fas fa-hourglass-end',\n 'hourglass-o': 'far fa-hourglass',\n 'id-card-o': 'far fa-id-card',\n 'ils': 'fas fa-shekel-sign',\n 'image': 'far fa-image',\n 'inr': 'fas fa-rupee-sign',\n 'institution': 'fas fa-university',\n 'intersex': 'fas fa-transgender',\n 'jpy': 'fas fa-yen-sign',\n 'keyboard-o': 'far fa-keyboard',\n 'krw': 'fas fa-won-sign',\n 'legal': 'fas fa-gavel',\n 'lemon-o': 'far fa-lemon',\n 'level-down': 'fas fa-level-down-alt',\n 'level-up': 'fas fa-level-up-alt',\n 'life-bouy': 'far fa-life-ring',\n 'life-buoy': 'far fa-life-ring',\n 'life-saver': 'far fa-life-ring',\n 'lightbulb-o': 'far fa-lightbulb',\n 'line-chart': 'fas fa-chart-line',\n 'linkedin': 'fab fa-linkedin-in',\n 'linkedin-square': 'fab fa-linkedin',\n 'long-arrow-down': 'fas fa-long-arrow-alt-down',\n 'long-arrow-left': 'fas fa-long-arrow-alt-left',\n 'long-arrow-right': 'fas fa-long-arrow-alt-right',\n 'long-arrow-up': 'fas fa-long-arrow-alt-up',\n 'mail-forward': 'fas fa-share',\n 'mail-reply': 'fas fa-reply',\n 'mail-reply-all': 'fas fa-reply-all',\n 'map-marker': 'fas fa-map-marker-alt',\n 'map-o': 'far fa-map',\n 'meanpath': 'fab fa-font-awesome',\n 'meh-o': 'far fa-meh',\n 'minus-square-o': 'far fa-minus-square',\n 'mobile': 'fas fa-mobile-alt',\n 'mobile-phone': 'fas fa-mobile-alt',\n 'money': 'far fa-money-bill-alt',\n 'moon-o': 'far fa-moon',\n 'mortar-board': 'fas fa-graduation-cap',\n 'navicon': 'fas fa-bars',\n 'newspaper-o': 'far fa-newspaper',\n 'paper-plane-o': 'far fa-paper-plane',\n 'paste': 'far fa-clipboard',\n 'pause-circle-o': 'far fa-pause-circle',\n 'pencil': 'fas fa-pencil-alt',\n 'pencil-square': 'fas fa-pen-square',\n 'pencil-square-o': 'far fa-edit',\n 'photo': 'far fa-image',\n 'picture': 'far fa-image',\n 'picture-o': 'far fa-image',\n 'pie-chart': 'fas fa-chart-pie',\n 'play-circle-o': 'far fa-play-circle',\n 'plus-square-o': 'far fa-plus-square',\n 'question-circle-o': 'far fa-question-circle',\n 'ra': 'fab fa-rebel',\n 'refresh': 'fas fa-sync',\n 'remove': 'fas fa-times',\n 'remove-sign': 'fas fa-ban',\n 'reorder': 'fas fa-bars',\n 'repeat': 'fas fa-redo',\n 'resistance': 'fab fa-rebel',\n 'rmb': 'fas fa-yen-sign',\n 'rotate-left': 'fas fa-undo',\n 'rotate-right': 'fas fa-redo',\n 'rouble': 'fas fa-ruble-sign',\n 'rub': 'fas fa-ruble-sign',\n 'ruble': 'fas fa-ruble-sign',\n 'rupee': 'fas fa-rupee-sign',\n 's15': 'fas fa-bath',\n 'scissors': 'fas fa-cut',\n 'send': 'fas fa-paper-plane',\n 'send-o': 'far fa-paper-plane',\n 'share-square-o': 'far fa-share-square',\n 'shekel': 'fas fa-shekel-sign',\n 'sheqel': 'fas fa-shekel-sign',\n 'shield': 'fas fa-shield-alt',\n 'sign-in': 'fas fa-sign-in-alt',\n 'sign-out': 'fas fa-sign-out-alt',\n 'signing': 'fas fa-sign-language',\n 'sliders': 'fas fa-sliders-h',\n 'smile-o': 'far fa-smile',\n 'snowflake-o': 'far fa-snowflake',\n 'soccer-ball-o': 'far fa-futbol',\n 'sort-alpha-asc': 'fas fa-sort-alpha-down',\n 'sort-alpha-desc': 'fas fa-sort-alpha-up',\n 'sort-amount-asc': 'fas fa-sort-amount-down',\n 'sort-amount-desc': 'fas fa-sort-amount-up',\n 'sort-asc': 'fas fa-sort-up',\n 'sort-desc': 'fas fa-sort-down',\n 'sort-numeric-asc': 'fas fa-sort-numeric-down',\n 'sort-numeric-desc': 'fas fa-sort-numeric-up',\n 'spoon': 'fas fa-utensil-spoon',\n 'square-o': 'far fa-square',\n 'star-half-empty': 'far fa-star-half',\n 'star-half-full': 'far fa-star-half',\n 'star-half-o': 'far fa-star-half',\n 'star-o': 'far fa-star',\n 'sticky-note-o': 'far fa-sticky-note',\n 'stop-circle-o': 'far fa-stop-circle',\n 'sun-o': 'far fa-sun',\n 'support': 'far fa-life-ring',\n 'tablet': 'fas fa-tablet-alt',\n 'tachometer': 'fas fa-tachometer-alt',\n 'television': 'fas fa-tv',\n 'thermometer': 'fas fa-thermometer-full',\n 'thermometer-0': 'fas fa-thermometer-empty',\n 'thermometer-1': 'fas fa-thermometer-quarter',\n 'thermometer-2': 'fas fa-thermometer-half',\n 'thermometer-3': 'fas fa-thermometer-three-quarters',\n 'thermometer-4': 'fas fa-thermometer-full',\n 'thumb-tack': 'fas fa-thumbtack',\n 'thumbs-o-down': 'far fa-thumbs-down',\n 'thumbs-o-up': 'far fa-thumbs-up',\n 'ticket': 'fas fa-ticket-alt',\n 'times-circle-o': 'far fa-times-circle',\n 'times-rectangle': 'fas fa-window-close',\n 'times-rectangle-o': 'far fa-window-close',\n 'toggle-down': 'far fa-caret-square-down',\n 'toggle-left': 'far fa-caret-square-left',\n 'toggle-right': 'far fa-caret-square-right',\n 'toggle-up': 'far fa-caret-square-up',\n 'trash': 'fas fa-trash-alt',\n 'trash-o': 'far fa-trash-alt',\n 'try': 'fas fa-lira-sign',\n 'turkish-lira': 'fas fa-lira-sign',\n 'unsorted': 'fas fa-sort',\n 'upload-alt': 'fas fa-upload',\n 'usd': 'fas fa-dollar-sign',\n 'user-circle-o': 'far fa-user-circle',\n 'user-o': 'far fa-user',\n 'vcard': 'fas fa-address-card',\n 'vcard-o': 'far fa-address-card',\n 'video-camera': 'fas fa-video',\n 'vimeo': 'fab fa-vimeo-v',\n 'volume-control-phone': 'fas fa-phone-volume',\n 'warning': 'fas fa-exclamation-triangle',\n 'wechat': 'fab fa-weixin',\n 'wheelchair-alt': 'fab fa-accessible-icon',\n 'window-close-o': 'far fa-window-close',\n 'won': 'fas fa-won-sign',\n 'y-combinator-square': 'fab fa-hacker-news',\n 'yc': 'fab fa-y-combinator',\n 'yc-square': 'fab fa-hacker-news',\n 'yen': 'fas fa-yen-sign',\n 'youtube-play': 'fab fa-youtube',\n 'youtube-square': 'fab fa-youtube',\n};\n\n// all Icons from:\n// https://github.com/FortAwesome/Font-Awesome/blob/master/svg-with-js/js/fa-brands.js#L118\nconst brands: ReadonlyArray = [\n '500px',\n 'accessible-icon',\n 'accusoft',\n 'adn',\n 'adversal',\n 'affiliatetheme',\n 'algolia',\n 'amazon',\n 'amazon-pay',\n 'amilia',\n 'android',\n 'angellist',\n 'angrycreative',\n 'angular',\n 'app-store',\n 'app-store-ios',\n 'apper',\n 'apple',\n 'apple-pay',\n 'asymmetrik',\n 'audible',\n 'autoprefixer',\n 'avianex',\n 'aviato',\n 'aws',\n 'bandcamp',\n 'behance',\n 'behance-square',\n 'bimobject',\n 'bitbucket',\n 'bitcoin',\n 'bity',\n 'black-tie',\n 'blackberry',\n 'blogger',\n 'blogger-b',\n 'bluetooth',\n 'bluetooth-b',\n 'btc',\n 'buromobelexperte',\n 'buysellads',\n 'cc-amazon-pay',\n 'cc-amex',\n 'cc-apple-pay',\n 'cc-diners-club',\n 'cc-discover',\n 'cc-jcb',\n 'cc-mastercard',\n 'cc-paypal',\n 'cc-stripe',\n 'cc-visa',\n 'centercode',\n 'chrome',\n 'cloudscale',\n 'cloudsmith',\n 'cloudversify',\n 'codepen',\n 'codiepie',\n 'connectdevelop',\n 'contao',\n 'cpanel',\n 'creative-commons',\n 'creative-commons-by',\n 'creative-commons-nc',\n 'creative-commons-nc-eu',\n 'creative-commons-nc-jp',\n 'creative-commons-nd',\n 'creative-commons-pd',\n 'creative-commons-pd-alt',\n 'creative-commons-remix',\n 'creative-commons-sa',\n 'creative-commons-sampling',\n 'creative-commons-sampling-plus',\n 'creative-commons-share',\n 'css3',\n 'css3-alt',\n 'cuttlefish',\n 'd-and-d',\n 'dashcube',\n 'delicious',\n 'deploydog',\n 'deskpro',\n 'deviantart',\n 'digg',\n 'digital-ocean',\n 'discord',\n 'discourse',\n 'dochub',\n 'docker',\n 'draft2digital',\n 'dribbble',\n 'dribbble-square',\n 'dropbox',\n 'drupal',\n 'dyalog',\n 'earlybirds',\n 'ebay',\n 'edge',\n 'elementor',\n 'ello',\n 'ember',\n 'empire',\n 'envira',\n 'erlang',\n 'ethereum',\n 'etsy',\n 'expeditedssl',\n 'facebook',\n 'facebook-f',\n 'facebook-messenger',\n 'facebook-square',\n 'firefox',\n 'first-order',\n 'first-order-alt',\n 'firstdraft',\n 'flickr',\n 'flipboard',\n 'fly',\n 'font-awesome',\n 'font-awesome-alt',\n 'font-awesome-flag',\n 'font-awesome-logo-full',\n 'fonticons',\n 'fonticons-fi',\n 'fort-awesome',\n 'fort-awesome-alt',\n 'forumbee',\n 'foursquare',\n 'free-code-camp',\n 'freebsd',\n 'fulcrum',\n 'galactic-republic',\n 'galactic-senate',\n 'get-pocket',\n 'gg',\n 'gg-circle',\n 'git',\n 'git-square',\n 'github',\n 'github-alt',\n 'github-square',\n 'gitkraken',\n 'gitlab',\n 'gitter',\n 'glide',\n 'glide-g',\n 'gofore',\n 'goodreads',\n 'goodreads-g',\n 'google',\n 'google-drive',\n 'google-play',\n 'google-plus',\n 'google-plus-g',\n 'google-plus-square',\n 'google-wallet',\n 'gratipay',\n 'grav',\n 'gripfire',\n 'grunt',\n 'gulp',\n 'hacker-news',\n 'hacker-news-square',\n 'hackerrank',\n 'hips',\n 'hire-a-helper',\n 'hooli',\n 'hornbill',\n 'hotjar',\n 'houzz',\n 'html5',\n 'hubspot',\n 'imdb',\n 'instagram',\n 'internet-explorer',\n 'ioxhost',\n 'itunes',\n 'itunes-note',\n 'java',\n 'jedi-order',\n 'jenkins',\n 'joget',\n 'joomla',\n 'js',\n 'js-square',\n 'jsfiddle',\n 'kaggle',\n 'keybase',\n 'keycdn',\n 'kickstarter',\n 'kickstarter-k',\n 'korvue',\n 'laravel',\n 'lastfm',\n 'lastfm-square',\n 'leanpub',\n 'less',\n 'line',\n 'linkedin',\n 'linkedin-in',\n 'linode',\n 'linux',\n 'lyft',\n 'magento',\n 'mailchimp',\n 'mandalorian',\n 'markdown',\n 'mastodon',\n 'maxcdn',\n 'medapps',\n 'medium',\n 'medium-m',\n 'medrt',\n 'meetup',\n 'megaport',\n 'microsoft',\n 'mix',\n 'mixcloud',\n 'mizuni',\n 'modx',\n 'monero',\n 'napster',\n 'neos',\n 'nimblr',\n 'nintendo-switch',\n 'node',\n 'node-js',\n 'npm',\n 'ns8',\n 'nutritionix',\n 'odnoklassniki',\n 'odnoklassniki-square',\n 'old-republic',\n 'opencart',\n 'openid',\n 'opera',\n 'optin-monster',\n 'osi',\n 'page4',\n 'pagelines',\n 'palfed',\n 'patreon',\n 'paypal',\n 'periscope',\n 'phabricator',\n 'phoenix-framework',\n 'phoenix-squadron',\n 'php',\n 'pied-piper',\n 'pied-piper-alt',\n 'pied-piper-hat',\n 'pied-piper-pp',\n 'pinterest',\n 'pinterest-p',\n 'pinterest-square',\n 'playstation',\n 'product-hunt',\n 'pushed',\n 'python',\n 'qq',\n 'quinscape',\n 'quora',\n 'r-project',\n 'ravelry',\n 'react',\n 'readme',\n 'rebel',\n 'red-river',\n 'reddit',\n 'reddit-alien',\n 'reddit-square',\n 'rendact',\n 'renren',\n 'replyd',\n 'researchgate',\n 'resolving',\n 'rev',\n 'rocketchat',\n 'rockrms',\n 'safari',\n 'sass',\n 'schlix',\n 'scribd',\n 'searchengin',\n 'sellcast',\n 'sellsy',\n 'servicestack',\n 'shirtsinbulk',\n 'shopware',\n 'simplybuilt',\n 'sistrix',\n 'sith',\n 'skyatlas',\n 'skype',\n 'slack',\n 'slack-hash',\n 'slideshare',\n 'snapchat',\n 'snapchat-ghost',\n 'snapchat-square',\n 'soundcloud',\n 'speakap',\n 'spotify',\n 'squarespace',\n 'stack-exchange',\n 'stack-overflow',\n 'staylinked',\n 'steam',\n 'steam-square',\n 'steam-symbol',\n 'sticker-mule',\n 'strava',\n 'stripe',\n 'stripe-s',\n 'studiovinari',\n 'stumbleupon',\n 'stumbleupon-circle',\n 'superpowers',\n 'supple',\n 'teamspeak',\n 'telegram',\n 'telegram-plane',\n 'tencent-weibo',\n 'themeco',\n 'themeisle',\n 'trade-federation',\n 'trello',\n 'tripadvisor',\n 'tumblr',\n 'tumblr-square',\n 'twitch',\n 'twitter',\n 'twitter-square',\n 'typo3',\n 'uber',\n 'uikit',\n 'uniregistry',\n 'untappd',\n 'usb',\n 'ussunnah',\n 'vaadin',\n 'viacoin',\n 'viadeo',\n 'viadeo-square',\n 'viber',\n 'vimeo',\n 'vimeo-square',\n 'vimeo-v',\n 'vine',\n 'vk',\n 'vnv',\n 'vuejs',\n 'weebly',\n 'weibo',\n 'weixin',\n 'whatsapp',\n 'whatsapp-square',\n 'whmcs',\n 'wikipedia-w',\n 'windows',\n 'wix',\n 'wolf-pack-battalion',\n 'wordpress',\n 'wordpress-simple',\n 'wpbeginner',\n 'wpexplorer',\n 'wpforms',\n 'xbox',\n 'xing',\n 'xing-square',\n 'y-combinator',\n 'yahoo',\n 'yandex',\n 'yandex-international',\n 'yelp',\n 'yoast',\n 'youtube',\n 'youtube-square',\n 'zhihu'\n];\n\nconst mapper = (icon: string): string => {\n /**\n * Neos <= 3.3 prefixed icons with this, we need to strip those\n * otherwise the mapping would'nt work for brand icons\n */\n const iconName = trimPrefixes(icon).trim();\n\n if (map[iconName]) {\n return map[iconName];\n }\n\n if (brands.includes(iconName)) {\n return 'fab fa-' + iconName;\n }\n\n if (!iconName.includes(' ')) {\n return 'fas fa-' + iconName;\n }\n\n return iconName;\n};\n\nfunction trimPrefixes(icon: string): string {\n if (icon.startsWith('fas fa-')) {\n return icon.substr(7).split(' ')[0];\n }\n\n if (icon.startsWith('icon-')) {\n return icon.substr(5).split(' ')[0];\n }\n\n return icon;\n}\n\nexport default mapper;\n","import {IconName, IconPrefix, IconProp} from '@fortawesome/fontawesome-svg-core';\nimport {FontAwesomeIcon, Props} from '@fortawesome/react-fontawesome';\nimport mergeClassNames from 'classnames';\nimport React, {PureComponent} from 'react';\n\nimport {PickDefaultProps, Omit} from '../../types';\nimport mapper from './mapper';\n\ntype IconPadding = 'none' | 'left' | 'right';\ntype IconColor = 'default' | 'warn' | 'error' | 'primaryBlue';\n\ninterface IconTheme {\n readonly icon: string;\n readonly 'icon--big': string;\n readonly 'icon--small': string;\n readonly 'icon--tiny': string;\n readonly 'icon--paddedLeft': string;\n readonly 'icon--paddedRight': string;\n readonly 'icon--spin': string;\n readonly 'icon--color-warn': string;\n readonly 'icon--color-error': string;\n readonly 'icon--color-primaryBlue': string;\n}\n\nexport interface IconProps extends Omit {\n /**\n * We use the react component FortAwesome provides to render icons.\n * we will pass down all props to the component via {...rest} to expose it's api\n * https://github.com/FortAwesome/react-fontawesome/blob/master/README.md\n */\n\n /**\n * The ID of the icon to render.\n */\n readonly icon?: string;\n\n /**\n * The (accessibility) label for this icon\n */\n readonly label?: string;\n\n /**\n * Controls the padding around the icon in a standardized way.\n */\n readonly padded?: IconPadding;\n\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * Adjust the color of the icon\n */\n readonly color?: IconColor;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme?: IconTheme;\n}\n\ntype DefaultProps = PickDefaultProps;\n\nexport const defaultProps: DefaultProps = {\n color: 'default',\n padded: 'none'\n};\n\nclass Icon extends PureComponent {\n public static readonly defaultProps = defaultProps;\n\n public render(): JSX.Element | null {\n const {padded, theme, label, icon, className, color, ...rest} = this.props;\n const iconClassName = icon;\n const classNames = mergeClassNames(\n theme!.icon,\n iconClassName,\n className,\n {\n [theme!['icon--paddedLeft']]: padded === 'left',\n [theme!['icon--paddedRight']]: padded === 'right',\n [theme!['icon--color-warn']]: color === 'warn',\n [theme!['icon--color-error']]: color === 'error',\n [theme!['icon--color-primaryBlue']]: color === 'primaryBlue',\n }\n );\n\n return ;\n }\n\n private readonly getIconProp = (icon: string): IconProp => {\n const mappedIcon = mapper(icon);\n const iconArray = mappedIcon.split(' ');\n if (iconArray.length > 1) {\n const prefix = iconArray[0];\n const processedIcon = iconArray[1].startsWith('fa-') ? iconArray[1].substr(3) : iconArray[1];\n return [prefix as IconPrefix, processedIcon as IconName];\n } else {\n const prefix: IconPrefix = 'fas';\n return [prefix, mappedIcon as IconName];\n }\n }\n}\n\nexport default Icon;\n","import {config, IconPrefix, library} from '@fortawesome/fontawesome-svg-core';\nimport '@fortawesome/fontawesome-svg-core/styles.css';\nimport {fab} from '@fortawesome/free-brands-svg-icons';\nimport {far} from '@fortawesome/free-regular-svg-icons';\nimport {fas} from '@fortawesome/free-solid-svg-icons';\nimport {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport Icon from './icon';\n\nimport style from './style.css';\n\n// tslint:disable:no-object-mutation\nconfig.autoAddCss = false;\nconfig.familyPrefix = 'neos-fa' as IconPrefix;\nconfig.replacementClass = 'neos-svg-inline--fa';\n// tslint:enable:no-object-mutation\n\nlibrary.add(fab, fas, far);\n\nexport default themr(identifiers.icon, style)(Icon);\n","import mergeClassNames from 'classnames';\nimport React, {PureComponent} from 'react';\nimport {Omit} from '../../types';\nimport Icon from './../Icon';\n\ninterface CheckBoxTheme {\n readonly checkbox: string;\n readonly checkbox__checked: string;\n readonly checkbox__disabled: string;\n readonly checkbox__input: string; // eslint-disable-line\n readonly checkbox__inputMirror: string; // eslint-disable-line\n readonly 'checkbox__inputMirror--active': string;\n readonly checkbox__icon: string;\n}\n\ntype HTMLInputElementAttributesExceptOnChange = Omit, 'onChange'>;\n\nexport interface CheckBoxProps extends HTMLInputElementAttributesExceptOnChange {\n /**\n * This prop controls the visual active state of the CheckBox.\n */\n readonly isChecked: boolean;\n\n /**\n * This prop controls if the CheckBox is disabled or not.\n */\n readonly disabled?: boolean;\n\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * An optional change handler which gets called once the user clicks on the CheckBox.\n */\n readonly onChange?: (isChecked: boolean) => void;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme: CheckBoxTheme;\n}\n\nclass CheckBox extends PureComponent {\n public render(): JSX.Element {\n const {\n isChecked,\n disabled,\n className,\n theme,\n ...rest\n } = this.props;\n const finalClassName = mergeClassNames(\n className,\n theme.checkbox,\n {\n [theme.checkbox__checked]: isChecked,\n [theme.checkbox__disabled]: disabled,\n }\n );\n const mirrorClassNames = mergeClassNames(\n theme.checkbox__inputMirror,\n {\n [theme['checkbox__inputMirror--active']]: isChecked,\n }\n );\n\n return (\n
\n \n \n
\n
\n );\n }\n\n private readonly handleChange = () => {\n const {onChange, isChecked} = this.props;\n\n if (onChange) {\n onChange(!isChecked);\n }\n }\n}\n\nexport default CheckBox;\n","import {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport CheckBox from './checkBox';\nimport style from './style.css';\n\nexport default themr(identifiers.checkBox, style)(CheckBox);\n","//! moment.js\n//! version : 2.29.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n}(this, (function () { 'use strict';\n\n var hookCallback;\n\n function hooks() {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback(callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return (\n input instanceof Array ||\n Object.prototype.toString.call(input) === '[object Array]'\n );\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return (\n input != null &&\n Object.prototype.toString.call(input) === '[object Object]'\n );\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n for (k in obj) {\n if (hasOwnProp(obj, k)) {\n return false;\n }\n }\n return true;\n }\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return (\n typeof input === 'number' ||\n Object.prototype.toString.call(input) === '[object Number]'\n );\n }\n\n function isDate(input) {\n return (\n input instanceof Date ||\n Object.prototype.toString.call(input) === '[object Date]'\n );\n }\n\n function map(arr, fn) {\n var res = [],\n i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidEra: null,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n era: null,\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false,\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this),\n len = t.length >>> 0,\n i;\n\n for (i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m),\n parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n }),\n isNowValid =\n !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidEra &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.weekdayMismatch &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid =\n isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n }\n return m._isValid;\n }\n\n function createInvalid(flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n var momentProperties = (hooks.momentProperties = []),\n updateInProgress = false;\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment(obj) {\n return (\n obj instanceof Moment || (obj != null && obj._isAMomentObject != null)\n );\n }\n\n function warn(msg) {\n if (\n hooks.suppressDeprecationWarnings === false &&\n typeof console !== 'undefined' &&\n console.warn\n ) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [],\n arg,\n i,\n key;\n for (i = 0; i < arguments.length; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (key in arguments[0]) {\n if (hasOwnProp(arguments[0], key)) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(\n msg +\n '\\nArguments: ' +\n Array.prototype.slice.call(args).join('') +\n '\\n' +\n new Error().stack\n );\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }\n\n function set(config) {\n var prop, i;\n for (i in config) {\n if (hasOwnProp(config, i)) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' +\n /\\d{1,2}/.source\n );\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (\n hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])\n ) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i,\n res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n\n var defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n };\n\n function calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (\n (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +\n absNumber\n );\n }\n\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n formatFunctions = {},\n formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(\n func.apply(this, arguments),\n token\n );\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '',\n i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i])\n ? array[i].call(mom, format)\n : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] =\n formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(\n localFormattingTokens,\n replaceLongDateFormatTokens\n );\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A',\n };\n\n function longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper\n .match(formattingTokens)\n .map(function (tok) {\n if (\n tok === 'MMMM' ||\n tok === 'MM' ||\n tok === 'DD' ||\n tok === 'dddd'\n ) {\n return tok.slice(1);\n }\n return tok;\n })\n .join('');\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate() {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d',\n defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal(number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n };\n\n function relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output)\n ? output(number, withoutSuffix, string, isFuture)\n : output.replace(/%d/i, number);\n }\n\n function pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias(unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string'\n ? aliases[units] || aliases[units.toLowerCase()]\n : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [],\n u;\n for (u in unitsObj) {\n if (hasOwnProp(unitsObj, u)) {\n units.push({ unit: u, priority: priorities[u] });\n }\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n function absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n function makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get(mom, unit) {\n return mom.isValid()\n ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()\n : NaN;\n }\n\n function set$1(mom, unit, value) {\n if (mom.isValid() && !isNaN(value)) {\n if (\n unit === 'FullYear' &&\n isLeapYear(mom.year()) &&\n mom.month() === 1 &&\n mom.date() === 29\n ) {\n value = toInt(value);\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](\n value,\n mom.month(),\n daysInMonth(value, mom.month())\n );\n } else {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n }\n\n // MOMENTS\n\n function stringGet(units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n\n function stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units),\n i;\n for (i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n\n var match1 = /\\d/, // 0 - 9\n match2 = /\\d\\d/, // 00 - 99\n match3 = /\\d{3}/, // 000 - 999\n match4 = /\\d{4}/, // 0000 - 9999\n match6 = /[+-]?\\d{6}/, // -999999 - 999999\n match1to2 = /\\d\\d?/, // 0 - 99\n match3to4 = /\\d\\d\\d\\d?/, // 999 - 9999\n match5to6 = /\\d\\d\\d\\d\\d\\d?/, // 99999 - 999999\n match1to3 = /\\d{1,3}/, // 0 - 999\n match1to4 = /\\d{1,4}/, // 0 - 9999\n match1to6 = /[+-]?\\d{1,6}/, // -999999 - 999999\n matchUnsigned = /\\d+/, // 0 - inf\n matchSigned = /[+-]?\\d+/, // -inf - inf\n matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi, // +00:00 -00:00 +0000 -0000 or Z\n matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/, // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n regexes;\n\n regexes = {};\n\n function addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex)\n ? regex\n : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(\n s\n .replace('\\\\', '')\n .replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (\n matched,\n p1,\n p2,\n p3,\n p4\n ) {\n return p1 || p2 || p3 || p4;\n })\n );\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken(token, callback) {\n var i,\n func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0,\n MONTH = 1,\n DATE = 2,\n HOUR = 3,\n MINUTE = 4,\n SECOND = 5,\n MILLISECOND = 6,\n WEEK = 7,\n WEEKDAY = 8;\n\n function mod(n, x) {\n return ((n % x) + x) % x;\n }\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1\n ? isLeapYear(year)\n ? 29\n : 28\n : 31 - ((modMonth % 7) % 2);\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // ALIASES\n\n addUnitAlias('month', 'M');\n\n // PRIORITY\n\n addUnitPriority('month', 8);\n\n // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(\n '_'\n ),\n MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n defaultMonthsShortRegex = matchWord,\n defaultMonthsRegex = matchWord;\n\n function localeMonths(m, format) {\n if (!m) {\n return isArray(this._months)\n ? this._months\n : this._months['standalone'];\n }\n return isArray(this._months)\n ? this._months[m.month()]\n : this._months[\n (this._months.isFormat || MONTHS_IN_FORMAT).test(format)\n ? 'format'\n : 'standalone'\n ][m.month()];\n }\n\n function localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort)\n ? this._monthsShort\n : this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort)\n ? this._monthsShort[m.month()]\n : this._monthsShort[\n MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'\n ][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp(\n '^' + this.months(mom, '').replace('.', '') + '$',\n 'i'\n );\n this._shortMonthsParse[i] = new RegExp(\n '^' + this.monthsShort(mom, '').replace('.', '') + '$',\n 'i'\n );\n }\n if (!strict && !this._monthsParse[i]) {\n regex =\n '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'MMMM' &&\n this._longMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'MMM' &&\n this._shortMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth(mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n }\n\n function monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict\n ? this._monthsShortStrictRegex\n : this._monthsShortRegex;\n }\n }\n\n function monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict\n ? this._monthsStrictRegex\n : this._monthsRegex;\n }\n }\n\n function computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._monthsShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n });\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // ALIASES\n\n addUnitAlias('year', 'y');\n\n // PRIORITIES\n\n addUnitPriority('year', 1);\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] =\n input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n // HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear() {\n return isLeapYear(this.year());\n }\n\n function createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date;\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n }\n\n function createUTCDate(y) {\n var date, args;\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n args = Array.prototype.slice.call(arguments);\n // preserve leap years using a full 400 year cycle, then reset\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n\n return date;\n }\n\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n }\n\n // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear,\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear,\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n // FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n // PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5);\n\n // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (\n input,\n week,\n config,\n token\n ) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n // HELPERS\n\n // LOCALES\n\n function localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 6th is the first week of the year.\n };\n\n function localeFirstDayOfWeek() {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear() {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n // PRIORITY\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11);\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n // LOCALES\n function shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n defaultWeekdaysRegex = matchWord,\n defaultWeekdaysShortRegex = matchWord,\n defaultWeekdaysMinRegex = matchWord;\n\n function localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays)\n ? this._weekdays\n : this._weekdays[\n m && m !== true && this._weekdays.isFormat.test(format)\n ? 'format'\n : 'standalone'\n ];\n return m === true\n ? shiftWeekdays(weekdays, this._week.dow)\n : m\n ? weekdays[m.day()]\n : weekdays;\n }\n\n function localeWeekdaysShort(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysShort, this._week.dow)\n : m\n ? this._weekdaysShort[m.day()]\n : this._weekdaysShort;\n }\n\n function localeWeekdaysMin(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysMin, this._week.dow)\n : m\n ? this._weekdaysMin[m.day()]\n : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(\n mom,\n ''\n ).toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp(\n '^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._shortWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._minWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n }\n if (!this._weekdaysParse[i]) {\n regex =\n '^' +\n this.weekdays(mom, '') +\n '|^' +\n this.weekdaysShort(mom, '') +\n '|^' +\n this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'dddd' &&\n this._fullWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'ddd' &&\n this._shortWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'dd' &&\n this._minWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n function weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict\n ? this._weekdaysStrictRegex\n : this._weekdaysRegex;\n }\n }\n\n function weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict\n ? this._weekdaysShortStrictRegex\n : this._weekdaysShortRegex;\n }\n }\n\n function weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict\n ? this._weekdaysMinStrictRegex\n : this._weekdaysMinRegex;\n }\n }\n\n function computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = regexEscape(this.weekdaysMin(mom, ''));\n shortp = regexEscape(this.weekdaysShort(mom, ''));\n longp = regexEscape(this.weekdays(mom, ''));\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysMinStrictRegex = new RegExp(\n '^(' + minPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('hmmss', 0, 0, function () {\n return (\n '' +\n hFormat.apply(this) +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n });\n\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('Hmmss', 0, 0, function () {\n return (\n '' +\n this.hours() +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n });\n\n function meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(\n this.hours(),\n this.minutes(),\n lowercase\n );\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n // ALIASES\n\n addUnitAlias('hour', 'h');\n\n // PRIORITY\n addUnitPriority('hour', 13);\n\n // PARSING\n\n function matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n // LOCALES\n\n function localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n getSetHour = makeGetSet('Hours', true);\n\n function localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse,\n };\n\n // internal storage for locale config files\n var locales = {},\n localeFamilies = {},\n globalLocale;\n\n function commonPrefix(arr1, arr2) {\n var i,\n minl = Math.min(arr1.length, arr2.length);\n for (i = 0; i < minl; i += 1) {\n if (arr1[i] !== arr2[i]) {\n return i;\n }\n }\n return minl;\n }\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (\n next &&\n next.length >= j &&\n commonPrefix(split, next) >= j - 1\n ) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }\n\n function loadLocale(name) {\n var oldLocale = null,\n aliasedRequire;\n // TODO: Find a better way to register and load all the locales in Node\n if (\n locales[name] === undefined &&\n typeof module !== 'undefined' &&\n module &&\n module.exports\n ) {\n try {\n oldLocale = globalLocale._abbr;\n aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {\n // mark as not found to avoid repeating expensive file require call causing high CPU\n // when trying to find en-US, en_US, en-us for every format call\n locales[name] = null; // null means not found\n }\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple(\n 'defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'\n );\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config,\n });\n return null;\n }\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig;\n\n if (locales[name] != null && locales[name].parentLocale != null) {\n // Update existing child locale in-place to avoid memory-leaks\n locales[name].set(mergeConfigs(locales[name]._config, config));\n } else {\n // MERGE\n tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n config = mergeConfigs(parentConfig, config);\n if (tmpLocale == null) {\n // updateLocale is called for creating a new locale\n // Set abbr so it will have a name (getters return\n // undefined otherwise).\n config.abbr = name;\n }\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n }\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n if (name === getSetGlobalLocale()) {\n getSetGlobalLocale(name);\n }\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n // returns locale data\n function getLocale(key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys(locales);\n }\n\n function checkOverflow(m) {\n var overflow,\n a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11\n ? MONTH\n : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])\n ? DATE\n : a[HOUR] < 0 ||\n a[HOUR] > 24 ||\n (a[HOUR] === 24 &&\n (a[MINUTE] !== 0 ||\n a[SECOND] !== 0 ||\n a[MILLISECOND] !== 0))\n ? HOUR\n : a[MINUTE] < 0 || a[MINUTE] > 59\n ? MINUTE\n : a[SECOND] < 0 || a[SECOND] > 59\n ? SECOND\n : a[MILLISECOND] < 0 || a[MILLISECOND] > 999\n ? MILLISECOND\n : -1;\n\n if (\n getParsingFlags(m)._overflowDayOfYear &&\n (overflow < YEAR || overflow > DATE)\n ) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n // iso 8601 regex\n // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/],\n ['YYYYMM', /\\d{6}/, false],\n ['YYYY', /\\d{4}/, false],\n ],\n // iso time formats and regexes\n isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/],\n ],\n aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n };\n\n // date from iso format\n function configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n function extractFromRFC2822Strings(\n yearStr,\n monthStr,\n dayStr,\n hourStr,\n minuteStr,\n secondStr\n ) {\n var result = [\n untruncateYear(yearStr),\n defaultLocaleMonthsShort.indexOf(monthStr),\n parseInt(dayStr, 10),\n parseInt(hourStr, 10),\n parseInt(minuteStr, 10),\n ];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n }\n\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n return year;\n }\n\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^)]*\\)|[\\n\\t]/g, ' ')\n .replace(/(\\s\\s+)/g, ' ')\n .replace(/^\\s\\s*/, '')\n .replace(/\\s\\s*$/, '');\n }\n\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(\n parsedInput[0],\n parsedInput[1],\n parsedInput[2]\n ).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n return true;\n }\n\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10),\n m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n }\n\n // date and time from ref 2822 format\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i)),\n parsedArray;\n if (match) {\n parsedArray = extractFromRFC2822Strings(\n match[4],\n match[3],\n match[2],\n match[5],\n match[6],\n match[7]\n );\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n if (config._strict) {\n config._isValid = false;\n } else {\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n }\n\n hooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [\n nowValue.getUTCFullYear(),\n nowValue.getUTCMonth(),\n nowValue.getUTCDate(),\n ];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (\n config._dayOfYear > daysInYear(yearToUse) ||\n config._dayOfYear === 0\n ) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] =\n config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (\n config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0\n ) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(\n null,\n input\n );\n expectedWeekday = config._useUTC\n ? config._d.getUTCDay()\n : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (\n config._w &&\n typeof config._w.d !== 'undefined' &&\n config._w.d !== expectedWeekday\n ) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(\n w.GG,\n config._a[YEAR],\n weekOfYear(createLocal(), 1, 4).year\n );\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n // constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n // constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0,\n era;\n\n tokens =\n expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) ||\n [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(\n string.indexOf(parsedInput) + parsedInput.length\n );\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver =\n stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (\n config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0\n ) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(\n config._locale,\n config._a[HOUR],\n config._meridiem\n );\n\n // handle era\n era = getParsingFlags(config).era;\n if (era !== null) {\n config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n }\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n function meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n // date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n scoreToBeat,\n i,\n currentScore,\n validFormatFound,\n bestFormatIsValid = false;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n validFormatFound = false;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (isValid(tempConfig)) {\n validFormatFound = true;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (!bestFormatIsValid) {\n if (\n scoreToBeat == null ||\n currentScore < scoreToBeat ||\n validFormatFound\n ) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n if (validFormatFound) {\n bestFormatIsValid = true;\n }\n }\n } else {\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i),\n dayOrDate = i.day === undefined ? i.date : i.day;\n config._a = map(\n [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],\n function (obj) {\n return obj && parseInt(obj, 10);\n }\n );\n\n configFromArray(config);\n }\n\n function createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig(config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({ nullInput: true });\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n\n if (format === true || format === false) {\n strict = format;\n format = undefined;\n }\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if (\n (isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)\n ) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n ),\n prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +new Date();\n };\n\n var ordering = [\n 'year',\n 'quarter',\n 'month',\n 'week',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'millisecond',\n ];\n\n function isDurationValid(m) {\n var key,\n unitHasDecimal = false,\n i;\n for (key in m) {\n if (\n hasOwnProp(m, key) &&\n !(\n indexOf.call(ordering, key) !== -1 &&\n (m[key] == null || !isNaN(m[key]))\n )\n ) {\n return false;\n }\n }\n\n for (i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds =\n +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days + weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months + quarters * 3 + years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration(obj) {\n return obj instanceof Duration;\n }\n\n function absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n // compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n (dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n ) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n // FORMATTING\n\n function offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset(),\n sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return (\n sign +\n zeroFill(~~(offset / 60), 2) +\n separator +\n zeroFill(~~offset % 60, 2)\n );\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher),\n chunk,\n parts,\n minutes;\n\n if (matches === null) {\n return null;\n }\n\n chunk = matches[matches.length - 1] || [];\n parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff =\n (isMoment(input) || isDate(input)\n ? input.valueOf()\n : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset());\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(\n this,\n createDuration(input - offset, 'm'),\n 1,\n false\n );\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n\n function hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime() {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {},\n other;\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted =\n this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n // ASP.NET json date format regex\n var aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n isoRegex = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\n function createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months,\n };\n } else if (isNumber(input) || !isNaN(+input)) {\n duration = {};\n if (key) {\n duration[key] = +input;\n } else {\n duration.milliseconds = +input;\n }\n } else if ((match = aspNetRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match\n };\n } else if ((match = isoRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign),\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (\n typeof duration === 'object' &&\n ('from' in duration || 'to' in duration)\n ) {\n diffRes = momentsDifference(\n createLocal(duration.from),\n createLocal(duration.to)\n );\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n ret._isValid = input._isValid;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {};\n\n res.months =\n other.month() - base.month() + (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return { milliseconds: 0, months: 0 };\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n // TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add'),\n subtract = createAdder(-1, 'subtract');\n\n function isString(input) {\n return typeof input === 'string' || input instanceof String;\n }\n\n // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\n function isMomentInput(input) {\n return (\n isMoment(input) ||\n isDate(input) ||\n isString(input) ||\n isNumber(input) ||\n isNumberOrStringArray(input) ||\n isMomentInputObject(input) ||\n input === null ||\n input === undefined\n );\n }\n\n function isMomentInputObject(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'years',\n 'year',\n 'y',\n 'months',\n 'month',\n 'M',\n 'days',\n 'day',\n 'd',\n 'dates',\n 'date',\n 'D',\n 'hours',\n 'hour',\n 'h',\n 'minutes',\n 'minute',\n 'm',\n 'seconds',\n 'second',\n 's',\n 'milliseconds',\n 'millisecond',\n 'ms',\n ],\n i,\n property;\n\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n }\n\n function isNumberOrStringArray(input) {\n var arrayTest = isArray(input),\n dataTypeTest = false;\n if (arrayTest) {\n dataTypeTest =\n input.filter(function (item) {\n return !isNumber(item) && isString(input);\n }).length === 0;\n }\n return arrayTest && dataTypeTest;\n }\n\n function isCalendarSpec(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'sameDay',\n 'nextDay',\n 'lastDay',\n 'nextWeek',\n 'lastWeek',\n 'sameElse',\n ],\n i,\n property;\n\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n }\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6\n ? 'sameElse'\n : diff < -1\n ? 'lastWeek'\n : diff < 0\n ? 'lastDay'\n : diff < 1\n ? 'sameDay'\n : diff < 2\n ? 'nextDay'\n : diff < 7\n ? 'nextWeek'\n : 'sameElse';\n }\n\n function calendar$1(time, formats) {\n // Support for single parameter, formats only overload to the calendar function\n if (arguments.length === 1) {\n if (!arguments[0]) {\n time = undefined;\n formats = undefined;\n } else if (isMomentInput(arguments[0])) {\n time = arguments[0];\n formats = undefined;\n } else if (isCalendarSpec(arguments[0])) {\n formats = arguments[0];\n time = undefined;\n }\n }\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse',\n output =\n formats &&\n (isFunction(formats[format])\n ? formats[format].call(this, now)\n : formats[format]);\n\n return this.format(\n output || this.localeData().calendar(format, this, createLocal(now))\n );\n }\n\n function clone() {\n return new Moment(this);\n }\n\n function isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n inclusivity = inclusivity || '()';\n return (\n (inclusivity[0] === '('\n ? this.isAfter(localFrom, units)\n : !this.isBefore(localFrom, units)) &&\n (inclusivity[1] === ')'\n ? this.isBefore(localTo, units)\n : !this.isAfter(localTo, units))\n );\n }\n\n function isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return (\n this.clone().startOf(units).valueOf() <= inputMs &&\n inputMs <= this.clone().endOf(units).valueOf()\n );\n }\n }\n\n function isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n\n function isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n\n function diff(input, units, asFloat) {\n var that, zoneDelta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n case 'month':\n output = monthDiff(this, that);\n break;\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n case 'second':\n output = (this - that) / 1e3;\n break; // 1000\n case 'minute':\n output = (this - that) / 6e4;\n break; // 1000 * 60\n case 'hour':\n output = (this - that) / 36e5;\n break; // 1000 * 60 * 60\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break; // 1000 * 60 * 60 * 24, negate dst\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break; // 1000 * 60 * 60 * 24 * 7, negate dst\n default:\n output = this - that;\n }\n\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff(a, b) {\n if (a.date() < b.date()) {\n // end-of-month calculations work correct when the start month has more\n // days than the end month.\n return -monthDiff(b, a);\n }\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n var utc = keepOffset !== true,\n m = utc ? this.clone().utc() : this;\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(\n m,\n utc\n ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'\n : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)\n .toISOString()\n .replace('Z', formatMoment(m, 'Z'));\n }\n }\n return formatMoment(\n m,\n utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment',\n zone = '',\n prefix,\n year,\n datetime,\n suffix;\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n prefix = '[' + func + '(\"]';\n year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n datetime = '-MM-DD[T]HH:mm:ss.SSS';\n suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format(inputString) {\n if (!inputString) {\n inputString = this.isUtc()\n ? hooks.defaultFormatUtc\n : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ to: this, from: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ from: this, to: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n function locale(key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData() {\n return this._locale;\n }\n\n var MS_PER_SECOND = 1000,\n MS_PER_MINUTE = 60 * MS_PER_SECOND,\n MS_PER_HOUR = 60 * MS_PER_MINUTE,\n MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n // actual modulo - handles negative numbers (for dates before 1970):\n function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }\n\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n\n function startOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n case 'quarter':\n time = startOfDate(\n this.year(),\n this.month() - (this.month() % 3),\n 1\n );\n break;\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n case 'week':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday()\n );\n break;\n case 'isoWeek':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1)\n );\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n );\n break;\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function endOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n case 'quarter':\n time =\n startOfDate(\n this.year(),\n this.month() - (this.month() % 3) + 3,\n 1\n ) - 1;\n break;\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n case 'week':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday() + 7\n ) - 1;\n break;\n case 'isoWeek':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1) + 7\n ) - 1;\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n case 'hour':\n time = this._d.valueOf();\n time +=\n MS_PER_HOUR -\n mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n ) -\n 1;\n break;\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n }\n\n function unix() {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate() {\n return new Date(this.valueOf());\n }\n\n function toArray() {\n var m = this;\n return [\n m.year(),\n m.month(),\n m.date(),\n m.hour(),\n m.minute(),\n m.second(),\n m.millisecond(),\n ];\n }\n\n function toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds(),\n };\n }\n\n function toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2() {\n return isValid(this);\n }\n\n function parsingFlags() {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt() {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict,\n };\n }\n\n addFormatToken('N', 0, 0, 'eraAbbr');\n addFormatToken('NN', 0, 0, 'eraAbbr');\n addFormatToken('NNN', 0, 0, 'eraAbbr');\n addFormatToken('NNNN', 0, 0, 'eraName');\n addFormatToken('NNNNN', 0, 0, 'eraNarrow');\n\n addFormatToken('y', ['y', 1], 'yo', 'eraYear');\n addFormatToken('y', ['yy', 2], 0, 'eraYear');\n addFormatToken('y', ['yyy', 3], 0, 'eraYear');\n addFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n\n addRegexToken('N', matchEraAbbr);\n addRegexToken('NN', matchEraAbbr);\n addRegexToken('NNN', matchEraAbbr);\n addRegexToken('NNNN', matchEraName);\n addRegexToken('NNNNN', matchEraNarrow);\n\n addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (\n input,\n array,\n config,\n token\n ) {\n var era = config._locale.erasParse(input, token, config._strict);\n if (era) {\n getParsingFlags(config).era = era;\n } else {\n getParsingFlags(config).invalidEra = input;\n }\n });\n\n addRegexToken('y', matchUnsigned);\n addRegexToken('yy', matchUnsigned);\n addRegexToken('yyy', matchUnsigned);\n addRegexToken('yyyy', matchUnsigned);\n addRegexToken('yo', matchEraYearOrdinal);\n\n addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\n addParseToken(['yo'], function (input, array, config, token) {\n var match;\n if (config._locale._eraYearOrdinalRegex) {\n match = input.match(config._locale._eraYearOrdinalRegex);\n }\n\n if (config._locale.eraYearOrdinalParse) {\n array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n } else {\n array[YEAR] = parseInt(input, 10);\n }\n });\n\n function localeEras(m, format) {\n var i,\n l,\n date,\n eras = this._eras || getLocale('en')._eras;\n for (i = 0, l = eras.length; i < l; ++i) {\n switch (typeof eras[i].since) {\n case 'string':\n // truncate time\n date = hooks(eras[i].since).startOf('day');\n eras[i].since = date.valueOf();\n break;\n }\n\n switch (typeof eras[i].until) {\n case 'undefined':\n eras[i].until = +Infinity;\n break;\n case 'string':\n // truncate time\n date = hooks(eras[i].until).startOf('day').valueOf();\n eras[i].until = date.valueOf();\n break;\n }\n }\n return eras;\n }\n\n function localeErasParse(eraName, format, strict) {\n var i,\n l,\n eras = this.eras(),\n name,\n abbr,\n narrow;\n eraName = eraName.toUpperCase();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n name = eras[i].name.toUpperCase();\n abbr = eras[i].abbr.toUpperCase();\n narrow = eras[i].narrow.toUpperCase();\n\n if (strict) {\n switch (format) {\n case 'N':\n case 'NN':\n case 'NNN':\n if (abbr === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNN':\n if (name === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNNN':\n if (narrow === eraName) {\n return eras[i];\n }\n break;\n }\n } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n return eras[i];\n }\n }\n }\n\n function localeErasConvertYear(era, year) {\n var dir = era.since <= era.until ? +1 : -1;\n if (year === undefined) {\n return hooks(era.since).year();\n } else {\n return hooks(era.since).year() + (year - era.offset) * dir;\n }\n }\n\n function getEraName() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].name;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].name;\n }\n }\n\n return '';\n }\n\n function getEraNarrow() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].narrow;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].narrow;\n }\n }\n\n return '';\n }\n\n function getEraAbbr() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].abbr;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].abbr;\n }\n }\n\n return '';\n }\n\n function getEraYear() {\n var i,\n l,\n dir,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (\n (eras[i].since <= val && val <= eras[i].until) ||\n (eras[i].until <= val && val <= eras[i].since)\n ) {\n return (\n (this.year() - hooks(eras[i].since).year()) * dir +\n eras[i].offset\n );\n }\n }\n\n return this.year();\n }\n\n function erasNameRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNameRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNameRegex : this._erasRegex;\n }\n\n function erasAbbrRegex(isStrict) {\n if (!hasOwnProp(this, '_erasAbbrRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasAbbrRegex : this._erasRegex;\n }\n\n function erasNarrowRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNarrowRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNarrowRegex : this._erasRegex;\n }\n\n function matchEraAbbr(isStrict, locale) {\n return locale.erasAbbrRegex(isStrict);\n }\n\n function matchEraName(isStrict, locale) {\n return locale.erasNameRegex(isStrict);\n }\n\n function matchEraNarrow(isStrict, locale) {\n return locale.erasNarrowRegex(isStrict);\n }\n\n function matchEraYearOrdinal(isStrict, locale) {\n return locale._eraYearOrdinalRegex || matchUnsigned;\n }\n\n function computeErasParse() {\n var abbrPieces = [],\n namePieces = [],\n narrowPieces = [],\n mixedPieces = [],\n i,\n l,\n eras = this.eras();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n namePieces.push(regexEscape(eras[i].name));\n abbrPieces.push(regexEscape(eras[i].abbr));\n narrowPieces.push(regexEscape(eras[i].narrow));\n\n mixedPieces.push(regexEscape(eras[i].name));\n mixedPieces.push(regexEscape(eras[i].abbr));\n mixedPieces.push(regexEscape(eras[i].narrow));\n }\n\n this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n this._erasNarrowRegex = new RegExp(\n '^(' + narrowPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n // PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1);\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (\n input,\n week,\n config,\n token\n ) {\n week[token.substr(0, 2)] = toInt(input);\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n // MOMENTS\n\n function getSetWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy\n );\n }\n\n function getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.isoWeek(),\n this.isoWeekday(),\n 1,\n 4\n );\n }\n\n function getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getISOWeeksInISOWeekYear() {\n return weeksInYear(this.isoWeekYear(), 1, 4);\n }\n\n function getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getWeeksInWeekYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n // FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n // ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n // PRIORITY\n\n addUnitPriority('quarter', 7);\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter(input) {\n return input == null\n ? Math.ceil((this.month() + 1) / 3)\n : this.month((input - 1) * 3 + (this.month() % 3));\n }\n\n // FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // ALIASES\n\n addUnitAlias('date', 'D');\n\n // PRIORITY\n addUnitPriority('date', 9);\n\n // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict\n ? locale._dayOfMonthOrdinalParse || locale._ordinalParse\n : locale._dayOfMonthOrdinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n // PRIORITY\n addUnitPriority('dayOfYear', 4);\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n // MOMENTS\n\n function getSetDayOfYear(input) {\n var dayOfYear =\n Math.round(\n (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5\n ) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // ALIASES\n\n addUnitAlias('minute', 'm');\n\n // PRIORITY\n\n addUnitPriority('minute', 14);\n\n // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // ALIASES\n\n addUnitAlias('second', 's');\n\n // PRIORITY\n\n addUnitPriority('second', 15);\n\n // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n // ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n // PRIORITY\n\n addUnitPriority('millisecond', 16);\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token, getSetMillisecond;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n\n getSetMillisecond = makeGetSet('Milliseconds', false);\n\n // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n if (typeof Symbol !== 'undefined' && Symbol.for != null) {\n proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n return 'Moment<' + this.format() + '>';\n };\n }\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.eraName = getEraName;\n proto.eraNarrow = getEraNarrow;\n proto.eraAbbr = getEraAbbr;\n proto.eraYear = getEraYear;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.weeksInWeekYear = getWeeksInWeekYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate(\n 'dates accessor is deprecated. Use date instead.',\n getSetDayOfMonth\n );\n proto.months = deprecate(\n 'months accessor is deprecated. Use month instead',\n getSetMonth\n );\n proto.years = deprecate(\n 'years accessor is deprecated. Use year instead',\n getSetYear\n );\n proto.zone = deprecate(\n 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',\n getSetZone\n );\n proto.isDSTShifted = deprecate(\n 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',\n isDaylightSavingTimeShifted\n );\n\n function createUnix(input) {\n return createLocal(input * 1000);\n }\n\n function createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat(string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n proto$1.eras = localeEras;\n proto$1.erasParse = localeErasParse;\n proto$1.erasConvertYear = localeErasConvertYear;\n proto$1.erasAbbrRegex = erasAbbrRegex;\n proto$1.erasNameRegex = erasNameRegex;\n proto$1.erasNarrowRegex = erasNarrowRegex;\n\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1(format, index, field, setter) {\n var locale = getLocale(),\n utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i,\n out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n function listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0,\n i,\n out = [];\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n\n function listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n eras: [\n {\n since: '0001-01-01',\n until: +Infinity,\n offset: 1,\n name: 'Anno Domini',\n narrow: 'AD',\n abbr: 'AD',\n },\n {\n since: '0000-12-31',\n until: -Infinity,\n offset: 1,\n name: 'Before Christ',\n narrow: 'BC',\n abbr: 'BC',\n },\n ],\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n toInt((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n });\n\n // Side effect imports\n\n hooks.lang = deprecate(\n 'moment.lang is deprecated. Use moment.locale instead.',\n getSetGlobalLocale\n );\n hooks.langData = deprecate(\n 'moment.langData is deprecated. Use moment.localeData instead.',\n getLocale\n );\n\n var mathAbs = Math.abs;\n\n function abs() {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble() {\n var milliseconds = this._milliseconds,\n days = this._days,\n months = this._months,\n data = this._data,\n seconds,\n minutes,\n hours,\n years,\n monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (\n !(\n (milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0)\n )\n ) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return (days * 4800) / 146097;\n }\n\n function monthsToDays(months) {\n // the reverse of daysToMonths\n return (months * 146097) / 4800;\n }\n\n function as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days,\n months,\n milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n switch (units) {\n case 'month':\n return months;\n case 'quarter':\n return months / 3;\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n case 'day':\n return days + milliseconds / 864e5;\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n // TODO: Use this.as('ms')?\n function valueOf$1() {\n if (!this.isValid()) {\n return NaN;\n }\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms'),\n asSeconds = makeAs('s'),\n asMinutes = makeAs('m'),\n asHours = makeAs('h'),\n asDays = makeAs('d'),\n asWeeks = makeAs('w'),\n asMonths = makeAs('M'),\n asQuarters = makeAs('Q'),\n asYears = makeAs('y');\n\n function clone$1() {\n return createDuration(this);\n }\n\n function get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds'),\n seconds = makeGetter('seconds'),\n minutes = makeGetter('minutes'),\n hours = makeGetter('hours'),\n days = makeGetter('days'),\n months = makeGetter('months'),\n years = makeGetter('years');\n\n function weeks() {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round,\n thresholds = {\n ss: 44, // a few seconds to seconds\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month/week\n w: null, // weeks to month\n M: 11, // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n var duration = createDuration(posNegDuration).abs(),\n seconds = round(duration.as('s')),\n minutes = round(duration.as('m')),\n hours = round(duration.as('h')),\n days = round(duration.as('d')),\n months = round(duration.as('M')),\n weeks = round(duration.as('w')),\n years = round(duration.as('y')),\n a =\n (seconds <= thresholds.ss && ['s', seconds]) ||\n (seconds < thresholds.s && ['ss', seconds]) ||\n (minutes <= 1 && ['m']) ||\n (minutes < thresholds.m && ['mm', minutes]) ||\n (hours <= 1 && ['h']) ||\n (hours < thresholds.h && ['hh', hours]) ||\n (days <= 1 && ['d']) ||\n (days < thresholds.d && ['dd', days]);\n\n if (thresholds.w != null) {\n a =\n a ||\n (weeks <= 1 && ['w']) ||\n (weeks < thresholds.w && ['ww', weeks]);\n }\n a = a ||\n (months <= 1 && ['M']) ||\n (months < thresholds.M && ['MM', months]) ||\n (years <= 1 && ['y']) || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n // This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n\n function humanize(argWithSuffix, argThresholds) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var withSuffix = false,\n th = thresholds,\n locale,\n output;\n\n if (typeof argWithSuffix === 'object') {\n argThresholds = argWithSuffix;\n argWithSuffix = false;\n }\n if (typeof argWithSuffix === 'boolean') {\n withSuffix = argWithSuffix;\n }\n if (typeof argThresholds === 'object') {\n th = Object.assign({}, thresholds, argThresholds);\n if (argThresholds.s != null && argThresholds.ss == null) {\n th.ss = argThresholds.s - 1;\n }\n }\n\n locale = this.localeData();\n output = relativeTime$1(this, !withSuffix, th, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function sign(x) {\n return (x > 0) - (x < 0) || +x;\n }\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000,\n days = abs$1(this._days),\n months = abs$1(this._months),\n minutes,\n hours,\n years,\n s,\n total = this.asSeconds(),\n totalSign,\n ymSign,\n daysSign,\n hmsSign;\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n\n totalSign = total < 0 ? '-' : '';\n ymSign = sign(this._months) !== sign(total) ? '-' : '';\n daysSign = sign(this._days) !== sign(total) ? '-' : '';\n hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n\n return (\n totalSign +\n 'P' +\n (years ? ymSign + years + 'Y' : '') +\n (months ? ymSign + months + 'M' : '') +\n (days ? daysSign + days + 'D' : '') +\n (hours || minutes || seconds ? 'T' : '') +\n (hours ? hmsSign + hours + 'H' : '') +\n (minutes ? hmsSign + minutes + 'M' : '') +\n (seconds ? hmsSign + s + 'S' : '')\n );\n }\n\n var proto$2 = Duration.prototype;\n\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n\n proto$2.toIsoString = deprecate(\n 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',\n toISOString$1\n );\n proto$2.lang = lang;\n\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n //! moment.js\n\n hooks.version = '2.29.1';\n\n setHookCallback(createLocal);\n\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n // currently HTML5 input type only supports 24-hour formats\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // \n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // \n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // \n DATE: 'YYYY-MM-DD', // \n TIME: 'HH:mm', // \n TIME_SECONDS: 'HH:mm:ss', // \n TIME_MS: 'HH:mm:ss.SSS', // \n WEEK: 'GGGG-[W]WW', // \n MONTH: 'YYYY-MM', // \n };\n\n return hooks;\n\n})));\n","\n\n// currently used to initiate the velocity style object to 0\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = mapToZero;\n\nfunction mapToZero(obj) {\n var ret = {};\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n ret[key] = 0;\n }\n }\n return ret;\n}\n\nmodule.exports = exports['default'];","\n// turn {x: {val: 1, stiffness: 1, damping: 2}, y: 2} generated by\n// `{x: spring(1, {stiffness: 1, damping: 2}), y: 2}` into {x: 1, y: 2}\n\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = stripStyle;\n\nfunction stripStyle(style) {\n var ret = {};\n for (var key in style) {\n if (!Object.prototype.hasOwnProperty.call(style, key)) {\n continue;\n }\n ret[key] = typeof style[key] === 'number' ? style[key] : style[key].val;\n }\n return ret;\n}\n\nmodule.exports = exports['default'];","\n\n// stepper is used a lot. Saves allocation to return the same array wrapper.\n// This is fine and danger-free against mutations because the callsite\n// immediately destructures it and gets the numbers inside without passing the\n\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = stepper;\n\nvar reusedTuple = [0, 0];\n\nfunction stepper(secondPerFrame, x, v, destX, k, b, precision) {\n // Spring stiffness, in kg / s^2\n\n // for animations, destX is really spring length (spring at rest). initial\n // position is considered as the stretched/compressed position of a spring\n var Fspring = -k * (x - destX);\n\n // Damping, in kg / s\n var Fdamper = -b * v;\n\n // usually we put mass here, but for animation purposes, specifying mass is a\n // bit redundant. you could simply adjust k and b accordingly\n // let a = (Fspring + Fdamper) / mass;\n var a = Fspring + Fdamper;\n\n var newV = v + a * secondPerFrame;\n var newX = x + newV * secondPerFrame;\n\n if (Math.abs(newV) < precision && Math.abs(newX - destX) < precision) {\n reusedTuple[0] = destX;\n reusedTuple[1] = 0;\n return reusedTuple;\n }\n\n reusedTuple[0] = newX;\n reusedTuple[1] = newV;\n return reusedTuple;\n}\n\nmodule.exports = exports[\"default\"];\n// array reference around.","// Generated by CoffeeScript 1.7.1\n(function() {\n var getNanoSeconds, hrtime, loadTime;\n\n if ((typeof performance !== \"undefined\" && performance !== null) && performance.now) {\n module.exports = function() {\n return performance.now();\n };\n } else if ((typeof process !== \"undefined\" && process !== null) && process.hrtime) {\n module.exports = function() {\n return (getNanoSeconds() - loadTime) / 1e6;\n };\n hrtime = process.hrtime;\n getNanoSeconds = function() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n loadTime = getNanoSeconds();\n } else if (Date.now) {\n module.exports = function() {\n return Date.now() - loadTime;\n };\n loadTime = Date.now();\n } else {\n module.exports = function() {\n return new Date().getTime() - loadTime;\n };\n loadTime = new Date().getTime();\n }\n\n}).call(this);\n","if performance? and performance.now\n module.exports = -> performance.now()\nelse if process? and process.hrtime\n module.exports = -> (getNanoSeconds() - nodeLoadTime) / 1e6\n hrtime = process.hrtime\n getNanoSeconds = ->\n hr = hrtime()\n hr[0] * 1e9 + hr[1]\n moduleLoadTime = getNanoSeconds()\n upTime = process.uptime() * 1e9\n nodeLoadTime = moduleLoadTime - upTime\nelse if Date.now\n module.exports = -> Date.now() - loadTime\n loadTime = Date.now()\nelse\n module.exports = -> new Date().getTime() - loadTime\n loadTime = new Date().getTime()\n","var now = require('performance-now')\n , root = typeof window === 'undefined' ? global : window\n , vendors = ['moz', 'webkit']\n , suffix = 'AnimationFrame'\n , raf = root['request' + suffix]\n , caf = root['cancel' + suffix] || root['cancelRequest' + suffix]\n\nfor(var i = 0; !raf && i < vendors.length; i++) {\n raf = root[vendors[i] + 'Request' + suffix]\n caf = root[vendors[i] + 'Cancel' + suffix]\n || root[vendors[i] + 'CancelRequest' + suffix]\n}\n\n// Some versions of FF have rAF but not cAF\nif(!raf || !caf) {\n var last = 0\n , id = 0\n , queue = []\n , frameDuration = 1000 / 60\n\n raf = function(callback) {\n if(queue.length === 0) {\n var _now = now()\n , next = Math.max(0, frameDuration - (_now - last))\n last = next + _now\n setTimeout(function() {\n var cp = queue.slice(0)\n // Clear queue here to prevent\n // callbacks from appending listeners\n // to the current frame's queue\n queue.length = 0\n for(var i = 0; i < cp.length; i++) {\n if(!cp[i].cancelled) {\n try{\n cp[i].callback(last)\n } catch(e) {\n setTimeout(function() { throw e }, 0)\n }\n }\n }\n }, Math.round(next))\n }\n queue.push({\n handle: ++id,\n callback: callback,\n cancelled: false\n })\n return id\n }\n\n caf = function(handle) {\n for(var i = 0; i < queue.length; i++) {\n if(queue[i].handle === handle) {\n queue[i].cancelled = true\n }\n }\n }\n}\n\nmodule.exports = function(fn) {\n // Wrap in a new function to prevent\n // `cancel` potentially being assigned\n // to the native rAF function\n return raf.call(root, fn)\n}\nmodule.exports.cancel = function() {\n caf.apply(root, arguments)\n}\nmodule.exports.polyfill = function(object) {\n if (!object) {\n object = root;\n }\n object.requestAnimationFrame = raf\n object.cancelAnimationFrame = caf\n}\n","\n\n// usage assumption: currentStyle values have already been rendered but it says\n// nothing of whether currentStyle is stale (see unreadPropStyle)\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = shouldStopAnimation;\n\nfunction shouldStopAnimation(currentStyle, style, currentVelocity) {\n for (var key in style) {\n if (!Object.prototype.hasOwnProperty.call(style, key)) {\n continue;\n }\n\n if (currentVelocity[key] !== 0) {\n return false;\n }\n\n var styleValue = typeof style[key] === 'number' ? style[key] : style[key].val;\n // stepper will have already taken care of rounding precision errors, so\n // won't have such thing as 0.9999 !=== 1\n if (currentStyle[key] !== styleValue) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = exports['default'];","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\nvar Motion = (function (_React$Component) {\n _inherits(Motion, _React$Component);\n\n _createClass(Motion, null, [{\n key: 'propTypes',\n value: {\n // TOOD: warn against putting a config in here\n defaultStyle: _propTypes2['default'].objectOf(_propTypes2['default'].number),\n style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired,\n children: _propTypes2['default'].func.isRequired,\n onRest: _propTypes2['default'].func\n },\n enumerable: true\n }]);\n\n function Motion(props) {\n var _this = this;\n\n _classCallCheck(this, Motion);\n\n _React$Component.call(this, props);\n this.wasAnimating = false;\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyle = null;\n\n this.clearUnreadPropStyle = function (destStyle) {\n var dirty = false;\n var _state = _this.state;\n var currentStyle = _state.currentStyle;\n var currentVelocity = _state.currentVelocity;\n var lastIdealStyle = _state.lastIdealStyle;\n var lastIdealVelocity = _state.lastIdealVelocity;\n\n for (var key in destStyle) {\n if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {\n continue;\n }\n\n var styleValue = destStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n currentStyle = _extends({}, currentStyle);\n currentVelocity = _extends({}, currentVelocity);\n lastIdealStyle = _extends({}, lastIdealStyle);\n lastIdealVelocity = _extends({}, lastIdealVelocity);\n }\n\n currentStyle[key] = styleValue;\n currentVelocity[key] = 0;\n lastIdealStyle[key] = styleValue;\n lastIdealVelocity[key] = 0;\n }\n }\n\n if (dirty) {\n _this.setState({ currentStyle: currentStyle, currentVelocity: currentVelocity, lastIdealStyle: lastIdealStyle, lastIdealVelocity: lastIdealVelocity });\n }\n };\n\n this.startAnimationIfNecessary = function () {\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n // check if we need to animate in the first place\n var propsStyle = _this.props.style;\n if (_shouldStopAnimation2['default'](_this.state.currentStyle, propsStyle, _this.state.currentVelocity)) {\n if (_this.wasAnimating && _this.props.onRest) {\n _this.props.onRest();\n }\n\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.wasAnimating = false;\n _this.accumulatedTime = 0;\n return;\n }\n\n _this.wasAnimating = true;\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n\n for (var key in propsStyle) {\n if (!Object.prototype.hasOwnProperty.call(propsStyle, key)) {\n continue;\n }\n\n var styleValue = propsStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = _this.state.lastIdealStyle[key];\n var newLastIdealVelocityValue = _this.state.lastIdealVelocity[key];\n for (var i = 0; i < framesToCatchUp; i++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyle: newCurrentStyle,\n currentVelocity: newCurrentVelocity,\n lastIdealStyle: newLastIdealStyle,\n lastIdealVelocity: newLastIdealVelocity\n });\n\n _this.unreadPropStyle = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n Motion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyle = _props.defaultStyle;\n var style = _props.style;\n\n var currentStyle = defaultStyle || _stripStyle2['default'](style);\n var currentVelocity = _mapToZero2['default'](currentStyle);\n return {\n currentStyle: currentStyle,\n currentVelocity: currentVelocity,\n lastIdealStyle: currentStyle,\n lastIdealVelocity: currentVelocity\n };\n };\n\n // it's possible that currentStyle's value is stale: if props is immediately\n // changed from 0 to 400 to spring(0) again, the async currentStyle is still\n // at 0 (didn't have time to tick and interpolate even once). If we naively\n // compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n // In reality currentStyle should be 400\n\n Motion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n Motion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyle != null) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyle);\n }\n\n this.unreadPropStyle = props.style;\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n Motion.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n Motion.prototype.render = function render() {\n var renderedChildren = this.props.children(this.state.currentStyle);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return Motion;\n})(_react2['default'].Component);\n\nexports['default'] = Motion;\nmodule.exports = exports['default'];\n\n// after checking for unreadPropStyle != null, we manually go set the\n// non-interpolating values (those that are a number, without a spring\n// config)","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\nfunction shouldStopAnimationAll(currentStyles, styles, currentVelocities) {\n for (var i = 0; i < currentStyles.length; i++) {\n if (!_shouldStopAnimation2['default'](currentStyles[i], styles[i], currentVelocities[i])) {\n return false;\n }\n }\n return true;\n}\n\nvar StaggeredMotion = (function (_React$Component) {\n _inherits(StaggeredMotion, _React$Component);\n\n _createClass(StaggeredMotion, null, [{\n key: 'propTypes',\n value: {\n // TOOD: warn against putting a config in here\n defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].objectOf(_propTypes2['default'].number)),\n styles: _propTypes2['default'].func.isRequired,\n children: _propTypes2['default'].func.isRequired\n },\n enumerable: true\n }]);\n\n function StaggeredMotion(props) {\n var _this = this;\n\n _classCallCheck(this, StaggeredMotion);\n\n _React$Component.call(this, props);\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyles = null;\n\n this.clearUnreadPropStyle = function (unreadPropStyles) {\n var _state = _this.state;\n var currentStyles = _state.currentStyles;\n var currentVelocities = _state.currentVelocities;\n var lastIdealStyles = _state.lastIdealStyles;\n var lastIdealVelocities = _state.lastIdealVelocities;\n\n var someDirty = false;\n for (var i = 0; i < unreadPropStyles.length; i++) {\n var unreadPropStyle = unreadPropStyles[i];\n var dirty = false;\n\n for (var key in unreadPropStyle) {\n if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {\n continue;\n }\n\n var styleValue = unreadPropStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n someDirty = true;\n currentStyles[i] = _extends({}, currentStyles[i]);\n currentVelocities[i] = _extends({}, currentVelocities[i]);\n lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);\n lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);\n }\n currentStyles[i][key] = styleValue;\n currentVelocities[i][key] = 0;\n lastIdealStyles[i][key] = styleValue;\n lastIdealVelocities[i][key] = 0;\n }\n }\n }\n\n if (someDirty) {\n _this.setState({ currentStyles: currentStyles, currentVelocities: currentVelocities, lastIdealStyles: lastIdealStyles, lastIdealVelocities: lastIdealVelocities });\n }\n };\n\n this.startAnimationIfNecessary = function () {\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n var destStyles = _this.props.styles(_this.state.lastIdealStyles);\n\n // check if we need to animate in the first place\n if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities)) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.accumulatedTime = 0;\n return;\n }\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var newLastIdealStyles = [];\n var newLastIdealVelocities = [];\n var newCurrentStyles = [];\n var newCurrentVelocities = [];\n\n for (var i = 0; i < destStyles.length; i++) {\n var destStyle = destStyles[i];\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n\n for (var key in destStyle) {\n if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {\n continue;\n }\n\n var styleValue = destStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = _this.state.lastIdealStyles[i][key];\n var newLastIdealVelocityValue = _this.state.lastIdealVelocities[i][key];\n for (var j = 0; j < framesToCatchUp; j++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n newCurrentStyles[i] = newCurrentStyle;\n newCurrentVelocities[i] = newCurrentVelocity;\n newLastIdealStyles[i] = newLastIdealStyle;\n newLastIdealVelocities[i] = newLastIdealVelocity;\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyles: newCurrentStyles,\n currentVelocities: newCurrentVelocities,\n lastIdealStyles: newLastIdealStyles,\n lastIdealVelocities: newLastIdealVelocities\n });\n\n _this.unreadPropStyles = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n StaggeredMotion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyles = _props.defaultStyles;\n var styles = _props.styles;\n\n var currentStyles = defaultStyles || styles().map(_stripStyle2['default']);\n var currentVelocities = currentStyles.map(function (currentStyle) {\n return _mapToZero2['default'](currentStyle);\n });\n return {\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n lastIdealStyles: currentStyles,\n lastIdealVelocities: currentVelocities\n };\n };\n\n StaggeredMotion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n StaggeredMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyles != null) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyles);\n }\n\n this.unreadPropStyles = props.styles(this.state.lastIdealStyles);\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n StaggeredMotion.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n StaggeredMotion.prototype.render = function render() {\n var renderedChildren = this.props.children(this.state.currentStyles);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return StaggeredMotion;\n})(_react2['default'].Component);\n\nexports['default'] = StaggeredMotion;\nmodule.exports = exports['default'];\n\n// it's possible that currentStyle's value is stale: if props is immediately\n// changed from 0 to 400 to spring(0) again, the async currentStyle is still\n// at 0 (didn't have time to tick and interpolate even once). If we naively\n// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n// In reality currentStyle should be 400\n\n// after checking for unreadPropStyles != null, we manually go set the\n// non-interpolating values (those that are a number, without a spring\n// config)","\n\n// core keys merging algorithm. If previous render's keys are [a, b], and the\n// next render's [c, b, d], what's the final merged keys and ordering?\n\n// - c and a must both be before b\n// - b before d\n// - ordering between a and c ambiguous\n\n// this reduces to merging two partially ordered lists (e.g. lists where not\n// every item has a definite ordering, like comparing a and c above). For the\n// ambiguous ordering we deterministically choose to place the next render's\n// item after the previous'; so c after a\n\n// this is called a topological sorting. Except the existing algorithms don't\n// work well with js bc of the amount of allocation, and isn't optimized for our\n// current use-case bc the runtime is linear in terms of edges (see wiki for\n// meaning), which is huge when two lists have many common elements\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = mergeDiff;\n\nfunction mergeDiff(prev, next, onRemove) {\n // bookkeeping for easier access of a key's index below. This is 2 allocations +\n // potentially triggering chrome hash map mode for objs (so it might be faster\n\n var prevKeyIndex = {};\n for (var i = 0; i < prev.length; i++) {\n prevKeyIndex[prev[i].key] = i;\n }\n var nextKeyIndex = {};\n for (var i = 0; i < next.length; i++) {\n nextKeyIndex[next[i].key] = i;\n }\n\n // first, an overly elaborate way of merging prev and next, eliminating\n // duplicates (in terms of keys). If there's dupe, keep the item in next).\n // This way of writing it saves allocations\n var ret = [];\n for (var i = 0; i < next.length; i++) {\n ret[i] = next[i];\n }\n for (var i = 0; i < prev.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(nextKeyIndex, prev[i].key)) {\n // this is called my TM's `mergeAndSync`, which calls willLeave. We don't\n // merge in keys that the user desires to kill\n var fill = onRemove(i, prev[i]);\n if (fill != null) {\n ret.push(fill);\n }\n }\n }\n\n // now all the items all present. Core sorting logic to have the right order\n return ret.sort(function (a, b) {\n var nextOrderA = nextKeyIndex[a.key];\n var nextOrderB = nextKeyIndex[b.key];\n var prevOrderA = prevKeyIndex[a.key];\n var prevOrderB = prevKeyIndex[b.key];\n\n if (nextOrderA != null && nextOrderB != null) {\n // both keys in next\n return nextKeyIndex[a.key] - nextKeyIndex[b.key];\n } else if (prevOrderA != null && prevOrderB != null) {\n // both keys in prev\n return prevKeyIndex[a.key] - prevKeyIndex[b.key];\n } else if (nextOrderA != null) {\n // key a in next, key b in prev\n\n // how to determine the order between a and b? We find a \"pivot\" (term\n // abuse), a key present in both prev and next, that is sandwiched between\n // a and b. In the context of our above example, if we're comparing a and\n // d, b's (the only) pivot\n for (var i = 0; i < next.length; i++) {\n var pivot = next[i].key;\n if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {\n continue;\n }\n\n if (nextOrderA < nextKeyIndex[pivot] && prevOrderB > prevKeyIndex[pivot]) {\n return -1;\n } else if (nextOrderA > nextKeyIndex[pivot] && prevOrderB < prevKeyIndex[pivot]) {\n return 1;\n }\n }\n // pluggable. default to: next bigger than prev\n return 1;\n }\n // prevOrderA, nextOrderB\n for (var i = 0; i < next.length; i++) {\n var pivot = next[i].key;\n if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {\n continue;\n }\n if (nextOrderB < nextKeyIndex[pivot] && prevOrderA > prevKeyIndex[pivot]) {\n return 1;\n } else if (nextOrderB > nextKeyIndex[pivot] && prevOrderA < prevKeyIndex[pivot]) {\n return -1;\n }\n }\n // pluggable. default to: next bigger than prev\n return -1;\n });\n}\n\nmodule.exports = exports['default'];\n// to loop through and find a key's index each time), but I no longer care","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _mergeDiff = require('./mergeDiff');\n\nvar _mergeDiff2 = _interopRequireDefault(_mergeDiff);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\n// the children function & (potential) styles function asks as param an\n// Array, where each TransitionPlainStyle is of the format\n// {key: string, data?: any, style: PlainStyle}. However, the way we keep\n// internal states doesn't contain such a data structure (check the state and\n// TransitionMotionState). So when children function and others ask for such\n// data we need to generate them on the fly by combining mergedPropsStyles and\n// currentStyles/lastIdealStyles\nfunction rehydrateStyles(mergedPropsStyles, unreadPropStyles, plainStyles) {\n // Copy the value to a `const` so that Flow understands that the const won't\n // change and will be non-nullable in the callback below.\n var cUnreadPropStyles = unreadPropStyles;\n if (cUnreadPropStyles == null) {\n return mergedPropsStyles.map(function (mergedPropsStyle, i) {\n return {\n key: mergedPropsStyle.key,\n data: mergedPropsStyle.data,\n style: plainStyles[i]\n };\n });\n }\n return mergedPropsStyles.map(function (mergedPropsStyle, i) {\n for (var j = 0; j < cUnreadPropStyles.length; j++) {\n if (cUnreadPropStyles[j].key === mergedPropsStyle.key) {\n return {\n key: cUnreadPropStyles[j].key,\n data: cUnreadPropStyles[j].data,\n style: plainStyles[i]\n };\n }\n }\n return { key: mergedPropsStyle.key, data: mergedPropsStyle.data, style: plainStyles[i] };\n });\n}\n\nfunction shouldStopAnimationAll(currentStyles, destStyles, currentVelocities, mergedPropsStyles) {\n if (mergedPropsStyles.length !== destStyles.length) {\n return false;\n }\n\n for (var i = 0; i < mergedPropsStyles.length; i++) {\n if (mergedPropsStyles[i].key !== destStyles[i].key) {\n return false;\n }\n }\n\n // we have the invariant that mergedPropsStyles and\n // currentStyles/currentVelocities/last* are synced in terms of cells, see\n // mergeAndSync comment for more info\n for (var i = 0; i < mergedPropsStyles.length; i++) {\n if (!_shouldStopAnimation2['default'](currentStyles[i], destStyles[i].style, currentVelocities[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n// core key merging logic\n\n// things to do: say previously merged style is {a, b}, dest style (prop) is {b,\n// c}, previous current (interpolating) style is {a, b}\n// **invariant**: current[i] corresponds to merged[i] in terms of key\n\n// steps:\n// turn merged style into {a?, b, c}\n// add c, value of c is destStyles.c\n// maybe remove a, aka call willLeave(a), then merged is either {b, c} or {a, b, c}\n// turn current (interpolating) style from {a, b} into {a?, b, c}\n// maybe remove a\n// certainly add c, value of c is willEnter(c)\n// loop over merged and construct new current\n// dest doesn't change, that's owner's\nfunction mergeAndSync(willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldLastIdealStyles, oldLastIdealVelocities) {\n var newMergedPropsStyles = _mergeDiff2['default'](oldMergedPropsStyles, destStyles, function (oldIndex, oldMergedPropsStyle) {\n var leavingStyle = willLeave(oldMergedPropsStyle);\n if (leavingStyle == null) {\n didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });\n return null;\n }\n if (_shouldStopAnimation2['default'](oldCurrentStyles[oldIndex], leavingStyle, oldCurrentVelocities[oldIndex])) {\n didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });\n return null;\n }\n return { key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data, style: leavingStyle };\n });\n\n var newCurrentStyles = [];\n var newCurrentVelocities = [];\n var newLastIdealStyles = [];\n var newLastIdealVelocities = [];\n for (var i = 0; i < newMergedPropsStyles.length; i++) {\n var newMergedPropsStyleCell = newMergedPropsStyles[i];\n var foundOldIndex = null;\n for (var j = 0; j < oldMergedPropsStyles.length; j++) {\n if (oldMergedPropsStyles[j].key === newMergedPropsStyleCell.key) {\n foundOldIndex = j;\n break;\n }\n }\n // TODO: key search code\n if (foundOldIndex == null) {\n var plainStyle = willEnter(newMergedPropsStyleCell);\n newCurrentStyles[i] = plainStyle;\n newLastIdealStyles[i] = plainStyle;\n\n var velocity = _mapToZero2['default'](newMergedPropsStyleCell.style);\n newCurrentVelocities[i] = velocity;\n newLastIdealVelocities[i] = velocity;\n } else {\n newCurrentStyles[i] = oldCurrentStyles[foundOldIndex];\n newLastIdealStyles[i] = oldLastIdealStyles[foundOldIndex];\n newCurrentVelocities[i] = oldCurrentVelocities[foundOldIndex];\n newLastIdealVelocities[i] = oldLastIdealVelocities[foundOldIndex];\n }\n }\n\n return [newMergedPropsStyles, newCurrentStyles, newCurrentVelocities, newLastIdealStyles, newLastIdealVelocities];\n}\n\nvar TransitionMotion = (function (_React$Component) {\n _inherits(TransitionMotion, _React$Component);\n\n _createClass(TransitionMotion, null, [{\n key: 'propTypes',\n value: {\n defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].shape({\n key: _propTypes2['default'].string.isRequired,\n data: _propTypes2['default'].any,\n style: _propTypes2['default'].objectOf(_propTypes2['default'].number).isRequired\n })),\n styles: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].arrayOf(_propTypes2['default'].shape({\n key: _propTypes2['default'].string.isRequired,\n data: _propTypes2['default'].any,\n style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired\n }))]).isRequired,\n children: _propTypes2['default'].func.isRequired,\n willEnter: _propTypes2['default'].func,\n willLeave: _propTypes2['default'].func,\n didLeave: _propTypes2['default'].func\n },\n enumerable: true\n }, {\n key: 'defaultProps',\n value: {\n willEnter: function willEnter(styleThatEntered) {\n return _stripStyle2['default'](styleThatEntered.style);\n },\n // recall: returning null makes the current unmounting TransitionStyle\n // disappear immediately\n willLeave: function willLeave() {\n return null;\n },\n didLeave: function didLeave() {}\n },\n enumerable: true\n }]);\n\n function TransitionMotion(props) {\n var _this = this;\n\n _classCallCheck(this, TransitionMotion);\n\n _React$Component.call(this, props);\n this.unmounting = false;\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyles = null;\n\n this.clearUnreadPropStyle = function (unreadPropStyles) {\n var _mergeAndSync = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, unreadPropStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);\n\n var mergedPropsStyles = _mergeAndSync[0];\n var currentStyles = _mergeAndSync[1];\n var currentVelocities = _mergeAndSync[2];\n var lastIdealStyles = _mergeAndSync[3];\n var lastIdealVelocities = _mergeAndSync[4];\n\n for (var i = 0; i < unreadPropStyles.length; i++) {\n var unreadPropStyle = unreadPropStyles[i].style;\n var dirty = false;\n\n for (var key in unreadPropStyle) {\n if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {\n continue;\n }\n\n var styleValue = unreadPropStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n currentStyles[i] = _extends({}, currentStyles[i]);\n currentVelocities[i] = _extends({}, currentVelocities[i]);\n lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);\n lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);\n mergedPropsStyles[i] = {\n key: mergedPropsStyles[i].key,\n data: mergedPropsStyles[i].data,\n style: _extends({}, mergedPropsStyles[i].style)\n };\n }\n currentStyles[i][key] = styleValue;\n currentVelocities[i][key] = 0;\n lastIdealStyles[i][key] = styleValue;\n lastIdealVelocities[i][key] = 0;\n mergedPropsStyles[i].style[key] = styleValue;\n }\n }\n }\n\n // unlike the other 2 components, we can't detect staleness and optionally\n // opt out of setState here. each style object's data might contain new\n // stuff we're not/cannot compare\n _this.setState({\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n mergedPropsStyles: mergedPropsStyles,\n lastIdealStyles: lastIdealStyles,\n lastIdealVelocities: lastIdealVelocities\n });\n };\n\n this.startAnimationIfNecessary = function () {\n if (_this.unmounting) {\n return;\n }\n\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n // https://github.com/chenglou/react-motion/pull/420\n // > if execution passes the conditional if (this.unmounting), then\n // executes async defaultRaf and after that component unmounts and after\n // that the callback of defaultRaf is called, then setState will be called\n // on unmounted component.\n if (_this.unmounting) {\n return;\n }\n\n var propStyles = _this.props.styles;\n var destStyles = typeof propStyles === 'function' ? propStyles(rehydrateStyles(_this.state.mergedPropsStyles, _this.unreadPropStyles, _this.state.lastIdealStyles)) : propStyles;\n\n // check if we need to animate in the first place\n if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities, _this.state.mergedPropsStyles)) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.accumulatedTime = 0;\n return;\n }\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var _mergeAndSync2 = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, destStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);\n\n var newMergedPropsStyles = _mergeAndSync2[0];\n var newCurrentStyles = _mergeAndSync2[1];\n var newCurrentVelocities = _mergeAndSync2[2];\n var newLastIdealStyles = _mergeAndSync2[3];\n var newLastIdealVelocities = _mergeAndSync2[4];\n\n for (var i = 0; i < newMergedPropsStyles.length; i++) {\n var newMergedPropsStyle = newMergedPropsStyles[i].style;\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n\n for (var key in newMergedPropsStyle) {\n if (!Object.prototype.hasOwnProperty.call(newMergedPropsStyle, key)) {\n continue;\n }\n\n var styleValue = newMergedPropsStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = newLastIdealStyles[i][key];\n var newLastIdealVelocityValue = newLastIdealVelocities[i][key];\n for (var j = 0; j < framesToCatchUp; j++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n newLastIdealStyles[i] = newLastIdealStyle;\n newLastIdealVelocities[i] = newLastIdealVelocity;\n newCurrentStyles[i] = newCurrentStyle;\n newCurrentVelocities[i] = newCurrentVelocity;\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyles: newCurrentStyles,\n currentVelocities: newCurrentVelocities,\n lastIdealStyles: newLastIdealStyles,\n lastIdealVelocities: newLastIdealVelocities,\n mergedPropsStyles: newMergedPropsStyles\n });\n\n _this.unreadPropStyles = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n TransitionMotion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyles = _props.defaultStyles;\n var styles = _props.styles;\n var willEnter = _props.willEnter;\n var willLeave = _props.willLeave;\n var didLeave = _props.didLeave;\n\n var destStyles = typeof styles === 'function' ? styles(defaultStyles) : styles;\n\n // this is special. for the first time around, we don't have a comparison\n // between last (no last) and current merged props. we'll compute last so:\n // say default is {a, b} and styles (dest style) is {b, c}, we'll\n // fabricate last as {a, b}\n var oldMergedPropsStyles = undefined;\n if (defaultStyles == null) {\n oldMergedPropsStyles = destStyles;\n } else {\n oldMergedPropsStyles = defaultStyles.map(function (defaultStyleCell) {\n // TODO: key search code\n for (var i = 0; i < destStyles.length; i++) {\n if (destStyles[i].key === defaultStyleCell.key) {\n return destStyles[i];\n }\n }\n return defaultStyleCell;\n });\n }\n var oldCurrentStyles = defaultStyles == null ? destStyles.map(function (s) {\n return _stripStyle2['default'](s.style);\n }) : defaultStyles.map(function (s) {\n return _stripStyle2['default'](s.style);\n });\n var oldCurrentVelocities = defaultStyles == null ? destStyles.map(function (s) {\n return _mapToZero2['default'](s.style);\n }) : defaultStyles.map(function (s) {\n return _mapToZero2['default'](s.style);\n });\n\n var _mergeAndSync3 = mergeAndSync(\n // Because this is an old-style createReactClass component, Flow doesn't\n // understand that the willEnter and willLeave props have default values\n // and will always be present.\n willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldCurrentStyles, // oldLastIdealStyles really\n oldCurrentVelocities);\n\n var mergedPropsStyles = _mergeAndSync3[0];\n var currentStyles = _mergeAndSync3[1];\n var currentVelocities = _mergeAndSync3[2];\n var lastIdealStyles = _mergeAndSync3[3];\n var lastIdealVelocities = _mergeAndSync3[4];\n // oldLastIdealVelocities really\n\n return {\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n lastIdealStyles: lastIdealStyles,\n lastIdealVelocities: lastIdealVelocities,\n mergedPropsStyles: mergedPropsStyles\n };\n };\n\n // after checking for unreadPropStyles != null, we manually go set the\n // non-interpolating values (those that are a number, without a spring\n // config)\n\n TransitionMotion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n TransitionMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyles) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyles);\n }\n\n var styles = props.styles;\n if (typeof styles === 'function') {\n this.unreadPropStyles = styles(rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.lastIdealStyles));\n } else {\n this.unreadPropStyles = styles;\n }\n\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n TransitionMotion.prototype.componentWillUnmount = function componentWillUnmount() {\n this.unmounting = true;\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n TransitionMotion.prototype.render = function render() {\n var hydratedStyles = rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.currentStyles);\n var renderedChildren = this.props.children(hydratedStyles);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return TransitionMotion;\n})(_react2['default'].Component);\n\nexports['default'] = TransitionMotion;\nmodule.exports = exports['default'];\n\n// list of styles, each containing interpolating values. Part of what's passed\n// to children function. Notice that this is\n// Array, without the wrapper that is {key: ...,\n// data: ... style: ActualInterpolatingStyleObject}. Only mergedPropsStyles\n// contains the key & data info (so that we only have a single source of truth\n// for these, and to save space). Check the comment for `rehydrateStyles` to\n// see how we regenerate the entirety of what's passed to children function\n\n// the array that keeps track of currently rendered stuff! Including stuff\n// that you've unmounted but that's still animating. This is where it lives\n\n// it's possible that currentStyle's value is stale: if props is immediately\n// changed from 0 to 400 to spring(0) again, the async currentStyle is still\n// at 0 (didn't have time to tick and interpolate even once). If we naively\n// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n// In reality currentStyle should be 400","\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = {\n noWobble: { stiffness: 170, damping: 26 }, // the default, if nothing provided\n gentle: { stiffness: 120, damping: 14 },\n wobbly: { stiffness: 180, damping: 12 },\n stiff: { stiffness: 210, damping: 20 }\n};\nmodule.exports = exports[\"default\"];","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports['default'] = spring;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _presets = require('./presets');\n\nvar _presets2 = _interopRequireDefault(_presets);\n\nvar defaultConfig = _extends({}, _presets2['default'].noWobble, {\n precision: 0.01\n});\n\nfunction spring(val, config) {\n return _extends({}, defaultConfig, config, { val: val });\n}\n\nmodule.exports = exports['default'];","'use strict';\n\nexports.__esModule = true;\nexports['default'] = reorderKeys;\n\nvar hasWarned = false;\n\nfunction reorderKeys() {\n if (process.env.NODE_ENV === 'development') {\n if (!hasWarned) {\n hasWarned = true;\n console.error('`reorderKeys` has been removed, since it is no longer needed for TransitionMotion\\'s new styles array API.');\n }\n }\n}\n\nmodule.exports = exports['default'];","'use strict';\n\nexports.__esModule = true;\n\nfunction _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; }\n\nvar _Motion = require('./Motion');\n\nexports.Motion = _interopRequire(_Motion);\n\nvar _StaggeredMotion = require('./StaggeredMotion');\n\nexports.StaggeredMotion = _interopRequire(_StaggeredMotion);\n\nvar _TransitionMotion = require('./TransitionMotion');\n\nexports.TransitionMotion = _interopRequire(_TransitionMotion);\n\nvar _spring = require('./spring');\n\nexports.spring = _interopRequire(_spring);\n\nvar _presets = require('./presets');\n\nexports.presets = _interopRequire(_presets);\n\nvar _stripStyle = require('./stripStyle');\n\nexports.stripStyle = _interopRequire(_stripStyle);\n\n// deprecated, dummy warning function\n\nvar _reorderKeys = require('./reorderKeys');\n\nexports.reorderKeys = _interopRequire(_reorderKeys);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ReactHeight = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar getElementHeightDefault = function getElementHeightDefault(el) {\n return el.clientHeight;\n};\n\nvar ReactHeight =\n/*#__PURE__*/\nfunction (_PureComponent) {\n _inherits(ReactHeight, _PureComponent);\n\n function ReactHeight(props) {\n var _this;\n\n _classCallCheck(this, ReactHeight);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactHeight).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"setWrapperRef\", function (el) {\n _this.wrapper = el;\n });\n\n _this.state = {\n dirty: props.dirty,\n height: 0\n };\n return _this;\n }\n\n _createClass(ReactHeight, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n var getElementHeight = this.props.getElementHeight;\n var height = getElementHeight(this.wrapper);\n var dirty = false;\n this.setState({\n height: height,\n dirty: dirty\n }, function () {\n var onHeightReady = _this2.props.onHeightReady;\n var currentHeight = _this2.state.height;\n onHeightReady(currentHeight);\n });\n } // eslint-disable-next-line react/no-deprecated\n\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(_ref) {\n var children = _ref.children,\n dirty = _ref.dirty;\n var oldChildren = this.props.children;\n\n if (children !== oldChildren || dirty) {\n this.setState({\n dirty: true\n });\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n var _this3 = this;\n\n var getElementHeight = this.props.getElementHeight;\n var height = getElementHeight(this.wrapper);\n var dirty = false;\n var currentSavedHeight = this.state.height;\n\n if (height === currentSavedHeight) {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n dirty: dirty\n });\n } else {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n height: height,\n dirty: dirty\n }, function () {\n var onHeightReady = _this3.props.onHeightReady;\n var currentHeight = _this3.state.height;\n onHeightReady(currentHeight);\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n _onHeightReady = _this$props.onHeightReady,\n _getElementHeight = _this$props.getElementHeight,\n _dirty = _this$props.dirty,\n hidden = _this$props.hidden,\n children = _this$props.children,\n props = _objectWithoutProperties(_this$props, [\"onHeightReady\", \"getElementHeight\", \"dirty\", \"hidden\", \"children\"]);\n\n var dirty = this.state.dirty;\n\n if (hidden && !dirty) {\n return null;\n }\n\n if (hidden) {\n return _react[\"default\"].createElement(\"div\", {\n style: {\n height: 0,\n overflow: 'hidden'\n }\n }, _react[\"default\"].createElement(\"div\", _extends({\n ref: this.setWrapperRef\n }, props), children));\n }\n\n return _react[\"default\"].createElement(\"div\", _extends({\n ref: this.setWrapperRef\n }, props), children);\n }\n }]);\n\n return ReactHeight;\n}(_react.PureComponent);\n\nexports.ReactHeight = ReactHeight;\n\n_defineProperty(ReactHeight, \"defaultProps\", {\n hidden: false,\n dirty: true,\n getElementHeight: getElementHeightDefault\n});","\"use strict\";\n\nvar _require = require('./ReactHeight'),\n ReactHeight = _require.ReactHeight;\n\nReactHeight.ReactHeight = ReactHeight;\nmodule.exports = ReactHeight;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {Motion, spring} from 'react-motion';\nimport HeightReporter from 'react-height';\n\n\nconst PRECISION = 0.5;\n\n\nconst stringHeight = height => Math.max(0, parseFloat(height)).toFixed(1);\n\n\nexport default class Collapse extends React.Component {\n static propTypes = {\n isOpened: PropTypes.bool.isRequired,\n children: PropTypes.node.isRequired,\n fixedHeight: PropTypes.number,\n style: PropTypes.object, // eslint-disable-line react/forbid-prop-types\n springConfig: PropTypes.objectOf(PropTypes.number),\n keepCollapsedContent: PropTypes.bool,\n onRest: PropTypes.func,\n onHeightReady: PropTypes.func\n };\n\n\n static defaultProps = {\n fixedHeight: -1,\n style: {},\n keepCollapsedContent: false,\n onHeightReady: () => {} // eslint-disable-line no-empty-function\n };\n\n\n constructor(props) {\n super(props);\n this.state = {height: -1, isOpenedChanged: false};\n }\n\n\n componentWillMount() {\n this.height = stringHeight(0);\n this.renderStatic = true;\n }\n\n\n componentWillReceiveProps({isOpened}) {\n this.setState({isOpenedChanged: isOpened !== this.props.isOpened});\n }\n\n\n componentDidUpdate({isOpened}) {\n if (isOpened !== this.props.isOpened) {\n const report = this.props.isOpened ? this.state.height : 0;\n\n this.props.onHeightReady(report);\n }\n }\n\n\n onHeightReady = height => {\n const {isOpened, onHeightReady} = this.props;\n\n if (this.renderStatic && isOpened) {\n this.height = stringHeight(height);\n }\n\n this.setState({height: isOpened || !this.renderStatic ? height : 0});\n\n const reportHeight = isOpened ? height : 0;\n\n if (this.state.height !== reportHeight) {\n onHeightReady(reportHeight);\n }\n };\n\n\n getMotionHeight(height) {\n const {isOpened, springConfig, fixedHeight} = this.props;\n const {isOpenedChanged} = this.state;\n\n const newHeight = isOpened ? Math.max(0, parseFloat(height)).toFixed(1) : stringHeight(0);\n\n // No need to animate if content is closed and it was closed previously\n // Also no need to animate if height did not change\n const skipAnimation = !isOpenedChanged && !isOpened ||\n this.height === newHeight && fixedHeight === -1;\n\n const springHeight = spring(isOpened ? Math.max(0, height) : 0, {\n precision: PRECISION,\n ...springConfig\n });\n const instantHeight = isOpened ? Math.max(0, height) : 0;\n\n return skipAnimation ? instantHeight : springHeight;\n }\n\n\n renderFixed() {\n const {\n springConfig: _springConfig,\n onHeightReady: _onHeightReady,\n onRest: _onRest,\n isOpened,\n style,\n children,\n fixedHeight,\n keepCollapsedContent,\n ...props\n } = this.props;\n\n if (this.renderStatic) {\n this.renderStatic = false;\n const newStyle = {overflow: 'hidden', height: isOpened ? fixedHeight : 0};\n\n if (!keepCollapsedContent && !isOpened) {\n return null;\n }\n this.height = stringHeight(fixedHeight);\n return
{children}
;\n }\n\n return (\n \n {({height}) => {\n this.height = stringHeight(height);\n\n // TODO: this should be done using onEnd from ReactMotion, which is not yet implemented\n // See https://github.com/chenglou/react-motion/issues/235\n if (!keepCollapsedContent && !isOpened && this.height === stringHeight(0)) {\n return null;\n }\n\n const newStyle = {overflow: 'hidden', height};\n\n return
{children}
;\n }}\n \n );\n }\n\n\n render() {\n const {\n springConfig: _springConfig,\n onHeightReady: _onHeightReady,\n isOpened,\n style,\n children,\n fixedHeight,\n keepCollapsedContent,\n onRest,\n ...props\n } = this.props;\n\n if (fixedHeight > -1) {\n return this.renderFixed();\n }\n\n const renderStatic = this.renderStatic;\n const {height} = this.state;\n const currentStringHeight = parseFloat(height).toFixed(1);\n\n if (height > -1 && renderStatic) {\n this.renderStatic = false;\n }\n\n // Cache Content so it is not re-rendered on each animation step\n const content = {children};\n\n if (renderStatic) {\n const newStyle = isOpened ? {height: 'auto'} : {overflow: 'hidden', height: 0};\n\n if (!isOpened && height > -1) {\n if (!keepCollapsedContent) {\n return null;\n }\n\n return (\n
\n {content}\n
\n );\n }\n\n // to prevent loosing input after causing this component to rerender\n return (\n \n {() =>\n
{content}
\n }\n
\n );\n }\n\n return (\n \n {st => {\n this.height = stringHeight(st.height);\n\n // TODO: this should be done using onEnd from ReactMotion, which is not yet implemented\n // See https://github.com/chenglou/react-motion/issues/235\n if (!isOpened && this.height === '0.0') {\n if (!keepCollapsedContent) {\n return null;\n }\n return (\n
{content}
\n );\n }\n\n const newStyle = isOpened && this.height === currentStringHeight ? {height: 'auto'} : {\n height: st.height, overflow: 'hidden'\n };\n\n return
{content}
;\n }}\n \n );\n }\n}\n","'use strict';\n\n// Babel6 does not hack the default behaviour of ES Modules anymore, so we should export\nconst Collapse = require('./Collapse').default;\n\nmodule.exports = Collapse;\n","'use strict';\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction ToObject(val) {\n\tif (val == null) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction ownEnumerableKeys(obj) {\n\tvar keys = Object.getOwnPropertyNames(obj);\n\n\tif (Object.getOwnPropertySymbols) {\n\t\tkeys = keys.concat(Object.getOwnPropertySymbols(obj));\n\t}\n\n\treturn keys.filter(function (key) {\n\t\treturn propIsEnumerable.call(obj, key);\n\t});\n}\n\nmodule.exports = Object.assign || function (target, source) {\n\tvar from;\n\tvar keys;\n\tvar to = ToObject(target);\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = arguments[s];\n\t\tkeys = ownEnumerableKeys(Object(from));\n\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tto[keys[i]] = from[keys[i]];\n\t\t}\n\t}\n\n\treturn to;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\n// -- Inlined from fbjs --\n\nvar emptyObject = {};\n\nif (process.env.NODE_ENV !== 'production') {\n Object.freeze(emptyObject);\n}\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction _invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nvar warning = function(){};\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\n// /-- Inlined from fbjs --\n\nvar MIXINS_KEY = 'mixins';\n\n// Helper function to allow the creation of anonymous functions which do not\n// have .name set to the name of the variable being assigned to.\nfunction identity(fn) {\n return fn;\n}\n\nvar ReactPropTypeLocationNames;\nif (process.env.NODE_ENV !== 'production') {\n ReactPropTypeLocationNames = {\n prop: 'prop',\n context: 'context',\n childContext: 'child context'\n };\n} else {\n ReactPropTypeLocationNames = {};\n}\n\nfunction factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {\n /**\n * Policies that describe methods in `ReactClassInterface`.\n */\n\n var injectedMixins = [];\n\n /**\n * Composite components are higher-level components that compose other composite\n * or host components.\n *\n * To create a new type of `ReactClass`, pass a specification of\n * your new class to `React.createClass`. The only requirement of your class\n * specification is that you implement a `render` method.\n *\n * var MyComponent = React.createClass({\n * render: function() {\n * return
Hello World
;\n * }\n * });\n *\n * The class specification supports a specific protocol of methods that have\n * special meaning (e.g. `render`). See `ReactClassInterface` for\n * more the comprehensive protocol. Any other properties and methods in the\n * class specification will be available on the prototype.\n *\n * @interface ReactClassInterface\n * @internal\n */\n var ReactClassInterface = {\n /**\n * An array of Mixin objects to include when defining your component.\n *\n * @type {array}\n * @optional\n */\n mixins: 'DEFINE_MANY',\n\n /**\n * An object containing properties and methods that should be defined on\n * the component's constructor instead of its prototype (static methods).\n *\n * @type {object}\n * @optional\n */\n statics: 'DEFINE_MANY',\n\n /**\n * Definition of prop types for this component.\n *\n * @type {object}\n * @optional\n */\n propTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types for this component.\n *\n * @type {object}\n * @optional\n */\n contextTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types this component sets for its children.\n *\n * @type {object}\n * @optional\n */\n childContextTypes: 'DEFINE_MANY',\n\n // ==== Definition methods ====\n\n /**\n * Invoked when the component is mounted. Values in the mapping will be set on\n * `this.props` if that prop is not specified (i.e. using an `in` check).\n *\n * This method is invoked before `getInitialState` and therefore cannot rely\n * on `this.state` or use `this.setState`.\n *\n * @return {object}\n * @optional\n */\n getDefaultProps: 'DEFINE_MANY_MERGED',\n\n /**\n * Invoked once before the component is mounted. The return value will be used\n * as the initial value of `this.state`.\n *\n * getInitialState: function() {\n * return {\n * isOn: false,\n * fooBaz: new BazFoo()\n * }\n * }\n *\n * @return {object}\n * @optional\n */\n getInitialState: 'DEFINE_MANY_MERGED',\n\n /**\n * @return {object}\n * @optional\n */\n getChildContext: 'DEFINE_MANY_MERGED',\n\n /**\n * Uses props from `this.props` and state from `this.state` to render the\n * structure of the component.\n *\n * No guarantees are made about when or how often this method is invoked, so\n * it must not have side effects.\n *\n * render: function() {\n * var name = this.props.name;\n * return
Hello, {name}!
;\n * }\n *\n * @return {ReactComponent}\n * @required\n */\n render: 'DEFINE_ONCE',\n\n // ==== Delegate methods ====\n\n /**\n * Invoked when the component is initially created and about to be mounted.\n * This may have side effects, but any external subscriptions or data created\n * by this method must be cleaned up in `componentWillUnmount`.\n *\n * @optional\n */\n componentWillMount: 'DEFINE_MANY',\n\n /**\n * Invoked when the component has been mounted and has a DOM representation.\n * However, there is no guarantee that the DOM node is in the document.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been mounted (initialized and rendered) for the first time.\n *\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidMount: 'DEFINE_MANY',\n\n /**\n * Invoked before the component receives new props.\n *\n * Use this as an opportunity to react to a prop transition by updating the\n * state using `this.setState`. Current props are accessed via `this.props`.\n *\n * componentWillReceiveProps: function(nextProps, nextContext) {\n * this.setState({\n * likesIncreasing: nextProps.likeCount > this.props.likeCount\n * });\n * }\n *\n * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop\n * transition may cause a state change, but the opposite is not true. If you\n * need it, you are probably looking for `componentWillUpdate`.\n *\n * @param {object} nextProps\n * @optional\n */\n componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Invoked while deciding if the component should be updated as a result of\n * receiving new props, state and/or context.\n *\n * Use this as an opportunity to `return false` when you're certain that the\n * transition to the new props/state/context will not require a component\n * update.\n *\n * shouldComponentUpdate: function(nextProps, nextState, nextContext) {\n * return !equal(nextProps, this.props) ||\n * !equal(nextState, this.state) ||\n * !equal(nextContext, this.context);\n * }\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @return {boolean} True if the component should update.\n * @optional\n */\n shouldComponentUpdate: 'DEFINE_ONCE',\n\n /**\n * Invoked when the component is about to update due to a transition from\n * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`\n * and `nextContext`.\n *\n * Use this as an opportunity to perform preparation before an update occurs.\n *\n * NOTE: You **cannot** use `this.setState()` in this method.\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @param {ReactReconcileTransaction} transaction\n * @optional\n */\n componentWillUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component's DOM representation has been updated.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been updated.\n *\n * @param {object} prevProps\n * @param {?object} prevState\n * @param {?object} prevContext\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component is about to be removed from its parent and have\n * its DOM representation destroyed.\n *\n * Use this as an opportunity to deallocate any external resources.\n *\n * NOTE: There is no `componentDidUnmount` since your component will have been\n * destroyed by that point.\n *\n * @optional\n */\n componentWillUnmount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillMount`.\n *\n * @optional\n */\n UNSAFE_componentWillMount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillReceiveProps`.\n *\n * @optional\n */\n UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillUpdate`.\n *\n * @optional\n */\n UNSAFE_componentWillUpdate: 'DEFINE_MANY',\n\n // ==== Advanced methods ====\n\n /**\n * Updates the component's currently mounted DOM representation.\n *\n * By default, this implements React's rendering and reconciliation algorithm.\n * Sophisticated clients may wish to override this.\n *\n * @param {ReactReconcileTransaction} transaction\n * @internal\n * @overridable\n */\n updateComponent: 'OVERRIDE_BASE'\n };\n\n /**\n * Similar to ReactClassInterface but for static methods.\n */\n var ReactClassStaticInterface = {\n /**\n * This method is invoked after a component is instantiated and when it\n * receives new props. Return an object to update state in response to\n * prop changes. Return null to indicate no change to state.\n *\n * If an object is returned, its keys will be merged into the existing state.\n *\n * @return {object || null}\n * @optional\n */\n getDerivedStateFromProps: 'DEFINE_MANY_MERGED'\n };\n\n /**\n * Mapping from class specification keys to special processing functions.\n *\n * Although these are declared like instance properties in the specification\n * when defining classes using `React.createClass`, they are actually static\n * and are accessible on the constructor instead of the prototype. Despite\n * being static, they must be defined outside of the \"statics\" key under\n * which all other static methods are defined.\n */\n var RESERVED_SPEC_KEYS = {\n displayName: function(Constructor, displayName) {\n Constructor.displayName = displayName;\n },\n mixins: function(Constructor, mixins) {\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n mixSpecIntoComponent(Constructor, mixins[i]);\n }\n }\n },\n childContextTypes: function(Constructor, childContextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, childContextTypes, 'childContext');\n }\n Constructor.childContextTypes = _assign(\n {},\n Constructor.childContextTypes,\n childContextTypes\n );\n },\n contextTypes: function(Constructor, contextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, contextTypes, 'context');\n }\n Constructor.contextTypes = _assign(\n {},\n Constructor.contextTypes,\n contextTypes\n );\n },\n /**\n * Special case getDefaultProps which should move into statics but requires\n * automatic merging.\n */\n getDefaultProps: function(Constructor, getDefaultProps) {\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps = createMergedResultFunction(\n Constructor.getDefaultProps,\n getDefaultProps\n );\n } else {\n Constructor.getDefaultProps = getDefaultProps;\n }\n },\n propTypes: function(Constructor, propTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, propTypes, 'prop');\n }\n Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);\n },\n statics: function(Constructor, statics) {\n mixStaticSpecIntoComponent(Constructor, statics);\n },\n autobind: function() {}\n };\n\n function validateTypeDef(Constructor, typeDef, location) {\n for (var propName in typeDef) {\n if (typeDef.hasOwnProperty(propName)) {\n // use a warning instead of an _invariant so components\n // don't show up in prod but only in __DEV__\n if (process.env.NODE_ENV !== 'production') {\n warning(\n typeof typeDef[propName] === 'function',\n '%s: %s type `%s` is invalid; it must be a function, usually from ' +\n 'React.PropTypes.',\n Constructor.displayName || 'ReactClass',\n ReactPropTypeLocationNames[location],\n propName\n );\n }\n }\n }\n }\n\n function validateMethodOverride(isAlreadyDefined, name) {\n var specPolicy = ReactClassInterface.hasOwnProperty(name)\n ? ReactClassInterface[name]\n : null;\n\n // Disallow overriding of base class methods unless explicitly allowed.\n if (ReactClassMixin.hasOwnProperty(name)) {\n _invariant(\n specPolicy === 'OVERRIDE_BASE',\n 'ReactClassInterface: You are attempting to override ' +\n '`%s` from your class specification. Ensure that your method names ' +\n 'do not overlap with React methods.',\n name\n );\n }\n\n // Disallow defining methods more than once unless explicitly allowed.\n if (isAlreadyDefined) {\n _invariant(\n specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',\n 'ReactClassInterface: You are attempting to define ' +\n '`%s` on your component more than once. This conflict may be due ' +\n 'to a mixin.',\n name\n );\n }\n }\n\n /**\n * Mixin helper which handles policy validation and reserved\n * specification keys when building React classes.\n */\n function mixSpecIntoComponent(Constructor, spec) {\n if (!spec) {\n if (process.env.NODE_ENV !== 'production') {\n var typeofSpec = typeof spec;\n var isMixinValid = typeofSpec === 'object' && spec !== null;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n isMixinValid,\n \"%s: You're attempting to include a mixin that is either null \" +\n 'or not an object. Check the mixins included by the component, ' +\n 'as well as any mixins they include themselves. ' +\n 'Expected object but got %s.',\n Constructor.displayName || 'ReactClass',\n spec === null ? null : typeofSpec\n );\n }\n }\n\n return;\n }\n\n _invariant(\n typeof spec !== 'function',\n \"ReactClass: You're attempting to \" +\n 'use a component class or function as a mixin. Instead, just use a ' +\n 'regular object.'\n );\n _invariant(\n !isValidElement(spec),\n \"ReactClass: You're attempting to \" +\n 'use a component as a mixin. Instead, just use a regular object.'\n );\n\n var proto = Constructor.prototype;\n var autoBindPairs = proto.__reactAutoBindPairs;\n\n // By handling mixins before any other properties, we ensure the same\n // chaining order is applied to methods with DEFINE_MANY policy, whether\n // mixins are listed before or after these methods in the spec.\n if (spec.hasOwnProperty(MIXINS_KEY)) {\n RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n }\n\n for (var name in spec) {\n if (!spec.hasOwnProperty(name)) {\n continue;\n }\n\n if (name === MIXINS_KEY) {\n // We have already handled mixins in a special case above.\n continue;\n }\n\n var property = spec[name];\n var isAlreadyDefined = proto.hasOwnProperty(name);\n validateMethodOverride(isAlreadyDefined, name);\n\n if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n RESERVED_SPEC_KEYS[name](Constructor, property);\n } else {\n // Setup methods on prototype:\n // The following member methods should not be automatically bound:\n // 1. Expected ReactClass methods (in the \"interface\").\n // 2. Overridden methods (that were mixed in).\n var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n var isFunction = typeof property === 'function';\n var shouldAutoBind =\n isFunction &&\n !isReactClassMethod &&\n !isAlreadyDefined &&\n spec.autobind !== false;\n\n if (shouldAutoBind) {\n autoBindPairs.push(name, property);\n proto[name] = property;\n } else {\n if (isAlreadyDefined) {\n var specPolicy = ReactClassInterface[name];\n\n // These cases should already be caught by validateMethodOverride.\n _invariant(\n isReactClassMethod &&\n (specPolicy === 'DEFINE_MANY_MERGED' ||\n specPolicy === 'DEFINE_MANY'),\n 'ReactClass: Unexpected spec policy %s for key %s ' +\n 'when mixing in component specs.',\n specPolicy,\n name\n );\n\n // For methods which are defined more than once, call the existing\n // methods before calling the new property, merging if appropriate.\n if (specPolicy === 'DEFINE_MANY_MERGED') {\n proto[name] = createMergedResultFunction(proto[name], property);\n } else if (specPolicy === 'DEFINE_MANY') {\n proto[name] = createChainedFunction(proto[name], property);\n }\n } else {\n proto[name] = property;\n if (process.env.NODE_ENV !== 'production') {\n // Add verbose displayName to the function, which helps when looking\n // at profiling tools.\n if (typeof property === 'function' && spec.displayName) {\n proto[name].displayName = spec.displayName + '_' + name;\n }\n }\n }\n }\n }\n }\n }\n\n function mixStaticSpecIntoComponent(Constructor, statics) {\n if (!statics) {\n return;\n }\n\n for (var name in statics) {\n var property = statics[name];\n if (!statics.hasOwnProperty(name)) {\n continue;\n }\n\n var isReserved = name in RESERVED_SPEC_KEYS;\n _invariant(\n !isReserved,\n 'ReactClass: You are attempting to define a reserved ' +\n 'property, `%s`, that shouldn\\'t be on the \"statics\" key. Define it ' +\n 'as an instance property instead; it will still be accessible on the ' +\n 'constructor.',\n name\n );\n\n var isAlreadyDefined = name in Constructor;\n if (isAlreadyDefined) {\n var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)\n ? ReactClassStaticInterface[name]\n : null;\n\n _invariant(\n specPolicy === 'DEFINE_MANY_MERGED',\n 'ReactClass: You are attempting to define ' +\n '`%s` on your component more than once. This conflict may be ' +\n 'due to a mixin.',\n name\n );\n\n Constructor[name] = createMergedResultFunction(Constructor[name], property);\n\n return;\n }\n\n Constructor[name] = property;\n }\n }\n\n /**\n * Merge two objects, but throw if both contain the same key.\n *\n * @param {object} one The first object, which is mutated.\n * @param {object} two The second object\n * @return {object} one after it has been mutated to contain everything in two.\n */\n function mergeIntoWithNoDuplicateKeys(one, two) {\n _invariant(\n one && two && typeof one === 'object' && typeof two === 'object',\n 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'\n );\n\n for (var key in two) {\n if (two.hasOwnProperty(key)) {\n _invariant(\n one[key] === undefined,\n 'mergeIntoWithNoDuplicateKeys(): ' +\n 'Tried to merge two objects with the same key: `%s`. This conflict ' +\n 'may be due to a mixin; in particular, this may be caused by two ' +\n 'getInitialState() or getDefaultProps() methods returning objects ' +\n 'with clashing keys.',\n key\n );\n one[key] = two[key];\n }\n }\n return one;\n }\n\n /**\n * Creates a function that invokes two functions and merges their return values.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n function createMergedResultFunction(one, two) {\n return function mergedResult() {\n var a = one.apply(this, arguments);\n var b = two.apply(this, arguments);\n if (a == null) {\n return b;\n } else if (b == null) {\n return a;\n }\n var c = {};\n mergeIntoWithNoDuplicateKeys(c, a);\n mergeIntoWithNoDuplicateKeys(c, b);\n return c;\n };\n }\n\n /**\n * Creates a function that invokes two functions and ignores their return vales.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n function createChainedFunction(one, two) {\n return function chainedFunction() {\n one.apply(this, arguments);\n two.apply(this, arguments);\n };\n }\n\n /**\n * Binds a method to the component.\n *\n * @param {object} component Component whose method is going to be bound.\n * @param {function} method Method to be bound.\n * @return {function} The bound method.\n */\n function bindAutoBindMethod(component, method) {\n var boundMethod = method.bind(component);\n if (process.env.NODE_ENV !== 'production') {\n boundMethod.__reactBoundContext = component;\n boundMethod.__reactBoundMethod = method;\n boundMethod.__reactBoundArguments = null;\n var componentName = component.constructor.displayName;\n var _bind = boundMethod.bind;\n boundMethod.bind = function(newThis) {\n for (\n var _len = arguments.length,\n args = Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n // User is trying to bind() an autobound method; we effectively will\n // ignore the value of \"this\" that the user is trying to use, so\n // let's warn.\n if (newThis !== component && newThis !== null) {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n 'bind(): React component methods may only be bound to the ' +\n 'component instance. See %s',\n componentName\n );\n }\n } else if (!args.length) {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n 'bind(): You are binding a component method to the component. ' +\n 'React does this for you automatically in a high-performance ' +\n 'way, so you can safely remove this call. See %s',\n componentName\n );\n }\n return boundMethod;\n }\n var reboundMethod = _bind.apply(boundMethod, arguments);\n reboundMethod.__reactBoundContext = component;\n reboundMethod.__reactBoundMethod = method;\n reboundMethod.__reactBoundArguments = args;\n return reboundMethod;\n };\n }\n return boundMethod;\n }\n\n /**\n * Binds all auto-bound methods in a component.\n *\n * @param {object} component Component whose method is going to be bound.\n */\n function bindAutoBindMethods(component) {\n var pairs = component.__reactAutoBindPairs;\n for (var i = 0; i < pairs.length; i += 2) {\n var autoBindKey = pairs[i];\n var method = pairs[i + 1];\n component[autoBindKey] = bindAutoBindMethod(component, method);\n }\n }\n\n var IsMountedPreMixin = {\n componentDidMount: function() {\n this.__isMounted = true;\n }\n };\n\n var IsMountedPostMixin = {\n componentWillUnmount: function() {\n this.__isMounted = false;\n }\n };\n\n /**\n * Add more to the ReactClass base class. These are all legacy features and\n * therefore not already part of the modern ReactComponent.\n */\n var ReactClassMixin = {\n /**\n * TODO: This will be deprecated because state should always keep a consistent\n * type signature and the only use case for this, is to avoid that.\n */\n replaceState: function(newState, callback) {\n this.updater.enqueueReplaceState(this, newState, callback);\n },\n\n /**\n * Checks whether or not this composite component is mounted.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function() {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this.__didWarnIsMounted,\n '%s: isMounted is deprecated. Instead, make sure to clean up ' +\n 'subscriptions and pending requests in componentWillUnmount to ' +\n 'prevent memory leaks.',\n (this.constructor && this.constructor.displayName) ||\n this.name ||\n 'Component'\n );\n this.__didWarnIsMounted = true;\n }\n return !!this.__isMounted;\n }\n };\n\n var ReactClassComponent = function() {};\n _assign(\n ReactClassComponent.prototype,\n ReactComponent.prototype,\n ReactClassMixin\n );\n\n /**\n * Creates a composite component class given a class specification.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass\n *\n * @param {object} spec Class specification (which must define `render`).\n * @return {function} Component constructor function.\n * @public\n */\n function createClass(spec) {\n // To keep our warnings more understandable, we'll use a little hack here to\n // ensure that Constructor.name !== 'Constructor'. This makes sure we don't\n // unnecessarily identify a class without displayName as 'Constructor'.\n var Constructor = identity(function(props, context, updater) {\n // This constructor gets overridden by mocks. The argument is used\n // by mocks to assert on what gets mounted.\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this instanceof Constructor,\n 'Something is calling a React component directly. Use a factory or ' +\n 'JSX instead. See: https://fb.me/react-legacyfactory'\n );\n }\n\n // Wire up auto-binding\n if (this.__reactAutoBindPairs.length) {\n bindAutoBindMethods(this);\n }\n\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n\n this.state = null;\n\n // ReactClasses doesn't have constructors. Instead, they use the\n // getInitialState and componentWillMount methods for initialization.\n\n var initialState = this.getInitialState ? this.getInitialState() : null;\n if (process.env.NODE_ENV !== 'production') {\n // We allow auto-mocks to proceed as if they're returning null.\n if (\n initialState === undefined &&\n this.getInitialState._isMockFunction\n ) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n initialState = null;\n }\n }\n _invariant(\n typeof initialState === 'object' && !Array.isArray(initialState),\n '%s.getInitialState(): must return an object or null',\n Constructor.displayName || 'ReactCompositeComponent'\n );\n\n this.state = initialState;\n });\n Constructor.prototype = new ReactClassComponent();\n Constructor.prototype.constructor = Constructor;\n Constructor.prototype.__reactAutoBindPairs = [];\n\n injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));\n\n mixSpecIntoComponent(Constructor, IsMountedPreMixin);\n mixSpecIntoComponent(Constructor, spec);\n mixSpecIntoComponent(Constructor, IsMountedPostMixin);\n\n // Initialize the defaultProps property after all mixins have been merged.\n if (Constructor.getDefaultProps) {\n Constructor.defaultProps = Constructor.getDefaultProps();\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // This is a tag to indicate that the use of these method names is ok,\n // since it's used with createClass. If it's not, then it's likely a\n // mistake so we'll warn you to use the static property, property\n // initializer or constructor respectively.\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps.isReactClassApproved = {};\n }\n if (Constructor.prototype.getInitialState) {\n Constructor.prototype.getInitialState.isReactClassApproved = {};\n }\n }\n\n _invariant(\n Constructor.prototype.render,\n 'createClass(...): Class specification must implement a `render` method.'\n );\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n !Constructor.prototype.componentShouldUpdate,\n '%s has a method called ' +\n 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +\n 'The name is phrased as a question because the function is ' +\n 'expected to return a value.',\n spec.displayName || 'A component'\n );\n warning(\n !Constructor.prototype.componentWillRecieveProps,\n '%s has a method called ' +\n 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',\n spec.displayName || 'A component'\n );\n warning(\n !Constructor.prototype.UNSAFE_componentWillRecieveProps,\n '%s has a method called UNSAFE_componentWillRecieveProps(). ' +\n 'Did you mean UNSAFE_componentWillReceiveProps()?',\n spec.displayName || 'A component'\n );\n }\n\n // Reduce time spent doing lookups by setting these on the prototype.\n for (var methodName in ReactClassInterface) {\n if (!Constructor.prototype[methodName]) {\n Constructor.prototype[methodName] = null;\n }\n }\n\n return Constructor;\n }\n\n return createClass;\n}\n\nmodule.exports = factory;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar React = require('react');\nvar factory = require('./factory');\n\nif (typeof React === 'undefined') {\n throw Error(\n 'create-react-class could not find the React object. If you are using script tags, ' +\n 'make sure that React is being loaded before create-react-class.'\n );\n}\n\n// Hack to grab NoopUpdateQueue from isomorphic React\nvar ReactNoopUpdateQueue = new React.Component().updater;\n\nmodule.exports = factory(\n React.Component,\n React.isValidElement,\n ReactNoopUpdateQueue\n);\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class'),\n\tmoment = require('moment')\n\t;\n\nvar DateTimePickerDays = createClass({\n\trender: function() {\n\t\tvar footer = this.renderFooter(),\n\t\t\tdate = this.props.viewDate,\n\t\t\tlocale = date.localeData(),\n\t\t\ttableChildren\n\t\t\t;\n\n\t\ttableChildren = [\n\t\t\tReact.createElement('thead', { key: 'th' }, [\n\t\t\t\tReact.createElement('tr', { key: 'h' }, [\n\t\t\t\t\tReact.createElement('th', { key: 'p', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'months' )}, React.createElement('span', {}, '‹' )),\n\t\t\t\t\tReact.createElement('th', { key: 's', className: 'rdtSwitch', onClick: this.props.showView( 'months' ), colSpan: 5, 'data-value': this.props.viewDate.month() }, locale.months( date ) + ' ' + date.year() ),\n\t\t\t\t\tReact.createElement('th', { key: 'n', className: 'rdtNext', onClick: this.props.addTime( 1, 'months' )}, React.createElement('span', {}, '›' ))\n\t\t\t\t]),\n\t\t\t\tReact.createElement('tr', { key: 'd'}, this.getDaysOfWeek( locale ).map( function( day, index ) { return React.createElement('th', { key: day + index, className: 'dow'}, day ); }) )\n\t\t\t]),\n\t\t\tReact.createElement('tbody', { key: 'tb' }, this.renderDays())\n\t\t];\n\n\t\tif ( footer )\n\t\t\ttableChildren.push( footer );\n\n\t\treturn React.createElement('div', { className: 'rdtDays' },\n\t\t\tReact.createElement('table', {}, tableChildren )\n\t\t);\n\t},\n\n\t/**\n\t * Get a list of the days of the week\n\t * depending on the current locale\n\t * @return {array} A list with the shortname of the days\n\t */\n\tgetDaysOfWeek: function( locale ) {\n\t\tvar days = locale._weekdaysMin,\n\t\t\tfirst = locale.firstDayOfWeek(),\n\t\t\tdow = [],\n\t\t\ti = 0\n\t\t\t;\n\n\t\tdays.forEach( function( day ) {\n\t\t\tdow[ (7 + ( i++ ) - first) % 7 ] = day;\n\t\t});\n\n\t\treturn dow;\n\t},\n\n\trenderDays: function() {\n\t\tvar date = this.props.viewDate,\n\t\t\tselected = this.props.selectedDate && this.props.selectedDate.clone(),\n\t\t\tprevMonth = date.clone().subtract( 1, 'months' ),\n\t\t\tcurrentYear = date.year(),\n\t\t\tcurrentMonth = date.month(),\n\t\t\tweeks = [],\n\t\t\tdays = [],\n\t\t\trenderer = this.props.renderDay || this.renderDay,\n\t\t\tisValid = this.props.isValidDate || this.alwaysValidDate,\n\t\t\tclasses, isDisabled, dayProps, currentDate\n\t\t\t;\n\n\t\t// Go to the last week of the previous month\n\t\tprevMonth.date( prevMonth.daysInMonth() ).startOf( 'week' );\n\t\tvar lastDay = prevMonth.clone().add( 42, 'd' );\n\n\t\twhile ( prevMonth.isBefore( lastDay ) ) {\n\t\t\tclasses = 'rdtDay';\n\t\t\tcurrentDate = prevMonth.clone();\n\n\t\t\tif ( ( prevMonth.year() === currentYear && prevMonth.month() < currentMonth ) || ( prevMonth.year() < currentYear ) )\n\t\t\t\tclasses += ' rdtOld';\n\t\t\telse if ( ( prevMonth.year() === currentYear && prevMonth.month() > currentMonth ) || ( prevMonth.year() > currentYear ) )\n\t\t\t\tclasses += ' rdtNew';\n\n\t\t\tif ( selected && prevMonth.isSame( selected, 'day' ) )\n\t\t\t\tclasses += ' rdtActive';\n\n\t\t\tif ( prevMonth.isSame( moment(), 'day' ) )\n\t\t\t\tclasses += ' rdtToday';\n\n\t\t\tisDisabled = !isValid( currentDate, selected );\n\t\t\tif ( isDisabled )\n\t\t\t\tclasses += ' rdtDisabled';\n\n\t\t\tdayProps = {\n\t\t\t\tkey: prevMonth.format( 'M_D' ),\n\t\t\t\t'data-value': prevMonth.date(),\n\t\t\t\tclassName: classes\n\t\t\t};\n\n\t\t\tif ( !isDisabled )\n\t\t\t\tdayProps.onClick = this.updateSelectedDate;\n\n\t\t\tdays.push( renderer( dayProps, currentDate, selected ) );\n\n\t\t\tif ( days.length === 7 ) {\n\t\t\t\tweeks.push( React.createElement('tr', { key: prevMonth.format( 'M_D' )}, days ) );\n\t\t\t\tdays = [];\n\t\t\t}\n\n\t\t\tprevMonth.add( 1, 'd' );\n\t\t}\n\n\t\treturn weeks;\n\t},\n\n\tupdateSelectedDate: function( event ) {\n\t\tthis.props.updateSelectedDate( event, true );\n\t},\n\n\trenderDay: function( props, currentDate ) {\n\t\treturn React.createElement('td', props, currentDate.date() );\n\t},\n\n\trenderFooter: function() {\n\t\tif ( !this.props.timeFormat )\n\t\t\treturn '';\n\n\t\tvar date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn React.createElement('tfoot', { key: 'tf'},\n\t\t\tReact.createElement('tr', {},\n\t\t\t\tReact.createElement('td', { onClick: this.props.showView( 'time' ), colSpan: 7, className: 'rdtTimeToggle' }, date.format( this.props.timeFormat ))\n\t\t\t)\n\t\t);\n\t},\n\n\talwaysValidDate: function() {\n\t\treturn 1;\n\t}\n});\n\nmodule.exports = DateTimePickerDays;\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class')\n;\n\nvar DateTimePickerMonths = createClass({\n\trender: function() {\n\t\treturn React.createElement('div', { className: 'rdtMonths' }, [\n\t\t\tReact.createElement('table', { key: 'a' }, React.createElement('thead', {}, React.createElement('tr', {}, [\n\t\t\t\tReact.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'years' )}, React.createElement('span', {}, '‹' )),\n\t\t\t\tReact.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2, 'data-value': this.props.viewDate.year() }, this.props.viewDate.year() ),\n\t\t\t\tReact.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 1, 'years' )}, React.createElement('span', {}, '›' ))\n\t\t\t]))),\n\t\t\tReact.createElement('table', { key: 'months' }, React.createElement('tbody', { key: 'b' }, this.renderMonths()))\n\t\t]);\n\t},\n\n\trenderMonths: function() {\n\t\tvar date = this.props.selectedDate,\n\t\t\tmonth = this.props.viewDate.month(),\n\t\t\tyear = this.props.viewDate.year(),\n\t\t\trows = [],\n\t\t\ti = 0,\n\t\t\tmonths = [],\n\t\t\trenderer = this.props.renderMonth || this.renderMonth,\n\t\t\tisValid = this.props.isValidDate || this.alwaysValidDate,\n\t\t\tclasses, props, currentMonth, isDisabled, noOfDaysInMonth, daysInMonth, validDay,\n\t\t\t// Date is irrelevant because we're only interested in month\n\t\t\tirrelevantDate = 1\n\t\t\t;\n\n\t\twhile (i < 12) {\n\t\t\tclasses = 'rdtMonth';\n\t\t\tcurrentMonth =\n\t\t\t\tthis.props.viewDate.clone().set({ year: year, month: i, date: irrelevantDate });\n\n\t\t\tnoOfDaysInMonth = currentMonth.endOf( 'month' ).format( 'D' );\n\t\t\tdaysInMonth = Array.from({ length: noOfDaysInMonth }, function( e, i ) {\n\t\t\t\treturn i + 1;\n\t\t\t});\n\n\t\t\tvalidDay = daysInMonth.find(function( d ) {\n\t\t\t\tvar day = currentMonth.clone().set( 'date', d );\n\t\t\t\treturn isValid( day );\n\t\t\t});\n\n\t\t\tisDisabled = ( validDay === undefined );\n\n\t\t\tif ( isDisabled )\n\t\t\t\tclasses += ' rdtDisabled';\n\n\t\t\tif ( date && i === date.month() && year === date.year() )\n\t\t\t\tclasses += ' rdtActive';\n\n\t\t\tprops = {\n\t\t\t\tkey: i,\n\t\t\t\t'data-value': i,\n\t\t\t\tclassName: classes\n\t\t\t};\n\n\t\t\tif ( !isDisabled )\n\t\t\t\tprops.onClick = ( this.props.updateOn === 'months' ?\n\t\t\t\t\tthis.updateSelectedMonth : this.props.setDate( 'month' ) );\n\n\t\t\tmonths.push( renderer( props, i, year, date && date.clone() ) );\n\n\t\t\tif ( months.length === 4 ) {\n\t\t\t\trows.push( React.createElement('tr', { key: month + '_' + rows.length }, months ) );\n\t\t\t\tmonths = [];\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\n\t\treturn rows;\n\t},\n\n\tupdateSelectedMonth: function( event ) {\n\t\tthis.props.updateSelectedDate( event );\n\t},\n\n\trenderMonth: function( props, month ) {\n\t\tvar localMoment = this.props.viewDate;\n\t\tvar monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\t\tvar strLength = 3;\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\tvar monthStrFixedLength = monthStr.substring( 0, strLength );\n\t\treturn React.createElement('td', props, capitalize( monthStrFixedLength ) );\n\t},\n\n\talwaysValidDate: function() {\n\t\treturn 1;\n\t},\n});\n\nfunction capitalize( str ) {\n\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n}\n\nmodule.exports = DateTimePickerMonths;\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class')\n;\n\nvar DateTimePickerYears = createClass({\n\trender: function() {\n\t\tvar year = parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\n\t\treturn React.createElement('div', { className: 'rdtYears' }, [\n\t\t\tReact.createElement('table', { key: 'a' }, React.createElement('thead', {}, React.createElement('tr', {}, [\n\t\t\t\tReact.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 10, 'years' )}, React.createElement('span', {}, '‹' )),\n\t\t\t\tReact.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2 }, year + '-' + ( year + 9 ) ),\n\t\t\t\tReact.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 10, 'years' )}, React.createElement('span', {}, '›' ))\n\t\t\t]))),\n\t\t\tReact.createElement('table', { key: 'years' }, React.createElement('tbody', {}, this.renderYears( year )))\n\t\t]);\n\t},\n\n\trenderYears: function( year ) {\n\t\tvar years = [],\n\t\t\ti = -1,\n\t\t\trows = [],\n\t\t\trenderer = this.props.renderYear || this.renderYear,\n\t\t\tselectedDate = this.props.selectedDate,\n\t\t\tisValid = this.props.isValidDate || this.alwaysValidDate,\n\t\t\tclasses, props, currentYear, isDisabled, noOfDaysInYear, daysInYear, validDay,\n\t\t\t// Month and date are irrelevant here because\n\t\t\t// we're only interested in the year\n\t\t\tirrelevantMonth = 0,\n\t\t\tirrelevantDate = 1\n\t\t\t;\n\n\t\tyear--;\n\t\twhile (i < 11) {\n\t\t\tclasses = 'rdtYear';\n\t\t\tcurrentYear = this.props.viewDate.clone().set(\n\t\t\t\t{ year: year, month: irrelevantMonth, date: irrelevantDate } );\n\n\t\t\t// Not sure what 'rdtOld' is for, commenting out for now as it's not working properly\n\t\t\t// if ( i === -1 | i === 10 )\n\t\t\t\t// classes += ' rdtOld';\n\n\t\t\tnoOfDaysInYear = currentYear.endOf( 'year' ).format( 'DDD' );\n\t\t\tdaysInYear = Array.from({ length: noOfDaysInYear }, function( e, i ) {\n\t\t\t\treturn i + 1;\n\t\t\t});\n\n\t\t\tvalidDay = daysInYear.find(function( d ) {\n\t\t\t\tvar day = currentYear.clone().dayOfYear( d );\n\t\t\t\treturn isValid( day );\n\t\t\t});\n\n\t\t\tisDisabled = ( validDay === undefined );\n\n\t\t\tif ( isDisabled )\n\t\t\t\tclasses += ' rdtDisabled';\n\n\t\t\tif ( selectedDate && selectedDate.year() === year )\n\t\t\t\tclasses += ' rdtActive';\n\n\t\t\tprops = {\n\t\t\t\tkey: year,\n\t\t\t\t'data-value': year,\n\t\t\t\tclassName: classes\n\t\t\t};\n\n\t\t\tif ( !isDisabled )\n\t\t\t\tprops.onClick = ( this.props.updateOn === 'years' ?\n\t\t\t\t\tthis.updateSelectedYear : this.props.setDate('year') );\n\n\t\t\tyears.push( renderer( props, year, selectedDate && selectedDate.clone() ));\n\n\t\t\tif ( years.length === 4 ) {\n\t\t\t\trows.push( React.createElement('tr', { key: i }, years ) );\n\t\t\t\tyears = [];\n\t\t\t}\n\n\t\t\tyear++;\n\t\t\ti++;\n\t\t}\n\n\t\treturn rows;\n\t},\n\n\tupdateSelectedYear: function( event ) {\n\t\tthis.props.updateSelectedDate( event );\n\t},\n\n\trenderYear: function( props, year ) {\n\t\treturn React.createElement('td', props, year );\n\t},\n\n\talwaysValidDate: function() {\n\t\treturn 1;\n\t},\n});\n\nmodule.exports = DateTimePickerYears;\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class'),\n\tassign = require('object-assign')\n\t;\n\nvar DateTimePickerTime = createClass({\n\tgetInitialState: function() {\n\t\treturn this.calculateState( this.props );\n\t},\n\n\tcalculateState: function( props ) {\n\t\tvar date = props.selectedDate || props.viewDate,\n\t\t\tformat = props.timeFormat,\n\t\t\tcounters = []\n\t\t\t;\n\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar hours = date.format( 'H' );\n\n\t\tvar daypart = false;\n\t\tif ( this.state !== null && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {\n\t\t\tif ( this.props.timeFormat.indexOf( ' A' ) !== -1 ) {\n\t\t\t\tdaypart = ( hours >= 12 ) ? 'PM' : 'AM';\n\t\t\t} else {\n\t\t\t\tdaypart = ( hours >= 12 ) ? 'pm' : 'am';\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\thours: hours,\n\t\t\tminutes: date.format( 'mm' ),\n\t\t\tseconds: date.format( 'ss' ),\n\t\t\tmilliseconds: date.format( 'SSS' ),\n\t\t\tdaypart: daypart,\n\t\t\tcounters: counters\n\t\t};\n\t},\n\n\trenderCounter: function( type ) {\n\t\tif ( type !== 'daypart' ) {\n\t\t\tvar value = this.state[ type ];\n\t\t\tif ( type === 'hours' && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {\n\t\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\t\tif ( value === 0 ) {\n\t\t\t\t\tvalue = 12;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn React.createElement('div', { key: type, className: 'rdtCounter' }, [\n\t\t\t\tReact.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'increase', type ), onContextMenu: this.disableContextMenu }, '▲' ),\n\t\t\t\tReact.createElement('div', { key: 'c', className: 'rdtCount' }, value ),\n\t\t\t\tReact.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'decrease', type ), onContextMenu: this.disableContextMenu }, '▼' )\n\t\t\t]);\n\t\t}\n\t\treturn '';\n\t},\n\n\trenderDayPart: function() {\n\t\treturn React.createElement('div', { key: 'dayPart', className: 'rdtCounter' }, [\n\t\t\tReact.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▲' ),\n\t\t\tReact.createElement('div', { key: this.state.daypart, className: 'rdtCount' }, this.state.daypart ),\n\t\t\tReact.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▼' )\n\t\t]);\n\t},\n\n\trender: function() {\n\t\tvar me = this,\n\t\t\tcounters = []\n\t\t;\n\n\t\tthis.state.counters.forEach( function( c ) {\n\t\t\tif ( counters.length )\n\t\t\t\tcounters.push( React.createElement('div', { key: 'sep' + counters.length, className: 'rdtCounterSeparator' }, ':' ) );\n\t\t\tcounters.push( me.renderCounter( c ) );\n\t\t});\n\n\t\tif ( this.state.daypart !== false ) {\n\t\t\tcounters.push( me.renderDayPart() );\n\t\t}\n\n\t\tif ( this.state.counters.length === 3 && this.props.timeFormat.indexOf( 'S' ) !== -1 ) {\n\t\t\tcounters.push( React.createElement('div', { className: 'rdtCounterSeparator', key: 'sep5' }, ':' ) );\n\t\t\tcounters.push(\n\t\t\t\tReact.createElement('div', { className: 'rdtCounter rdtMilli', key: 'm' },\n\t\t\t\t\tReact.createElement('input', { value: this.state.milliseconds, type: 'text', onChange: this.updateMilli } )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('div', { className: 'rdtTime' },\n\t\t\tReact.createElement('table', {}, [\n\t\t\t\tthis.renderHeader(),\n\t\t\t\tReact.createElement('tbody', { key: 'b'}, React.createElement('tr', {}, React.createElement('td', {},\n\t\t\t\t\tReact.createElement('div', { className: 'rdtCounters' }, counters )\n\t\t\t\t)))\n\t\t\t])\n\t\t);\n\t},\n\n\tcomponentWillMount: function() {\n\t\tvar me = this;\n\t\tme.timeConstraints = {\n\t\t\thours: {\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 23,\n\t\t\t\tstep: 1\n\t\t\t},\n\t\t\tminutes: {\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 59,\n\t\t\t\tstep: 1\n\t\t\t},\n\t\t\tseconds: {\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 59,\n\t\t\t\tstep: 1\n\t\t\t},\n\t\t\tmilliseconds: {\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 999,\n\t\t\t\tstep: 1\n\t\t\t}\n\t\t};\n\t\t['hours', 'minutes', 'seconds', 'milliseconds'].forEach( function( type ) {\n\t\t\tassign(me.timeConstraints[ type ], me.props.timeConstraints[ type ]);\n\t\t});\n\t\tthis.setState( this.calculateState( this.props ) );\n\t},\n\n\tcomponentWillReceiveProps: function( nextProps ) {\n\t\tthis.setState( this.calculateState( nextProps ) );\n\t},\n\n\tupdateMilli: function( e ) {\n\t\tvar milli = parseInt( e.target.value, 10 );\n\t\tif ( milli === e.target.value && milli >= 0 && milli < 1000 ) {\n\t\t\tthis.props.setTime( 'milliseconds', milli );\n\t\t\tthis.setState( { milliseconds: milli } );\n\t\t}\n\t},\n\n\trenderHeader: function() {\n\t\tif ( !this.props.dateFormat )\n\t\t\treturn null;\n\n\t\tvar date = this.props.selectedDate || this.props.viewDate;\n\t\treturn React.createElement('thead', { key: 'h' }, React.createElement('tr', {},\n\t\t\tReact.createElement('th', { className: 'rdtSwitch', colSpan: 4, onClick: this.props.showView( 'days' ) }, date.format( this.props.dateFormat ) )\n\t\t));\n\t},\n\n\tonStartClicking: function( action, type ) {\n\t\tvar me = this;\n\n\t\treturn function() {\n\t\t\tvar update = {};\n\t\t\tupdate[ type ] = me[ action ]( type );\n\t\t\tme.setState( update );\n\n\t\t\tme.timer = setTimeout( function() {\n\t\t\t\tme.increaseTimer = setInterval( function() {\n\t\t\t\t\tupdate[ type ] = me[ action ]( type );\n\t\t\t\t\tme.setState( update );\n\t\t\t\t}, 70);\n\t\t\t}, 500);\n\n\t\t\tme.mouseUpListener = function() {\n\t\t\t\tclearTimeout( me.timer );\n\t\t\t\tclearInterval( me.increaseTimer );\n\t\t\t\tme.props.setTime( type, me.state[ type ] );\n\t\t\t\tdocument.body.removeEventListener( 'mouseup', me.mouseUpListener );\n\t\t\t\tdocument.body.removeEventListener( 'touchend', me.mouseUpListener );\n\t\t\t};\n\n\t\t\tdocument.body.addEventListener( 'mouseup', me.mouseUpListener );\n\t\t\tdocument.body.addEventListener( 'touchend', me.mouseUpListener );\n\t\t};\n\t},\n\n\tdisableContextMenu: function( event ) {\n\t\tevent.preventDefault();\n\t\treturn false;\n\t},\n\n\tpadValues: {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t},\n\n\ttoggleDayPart: function( type ) { // type is always 'hours'\n\t\tvar value = parseInt( this.state[ type ], 10) + 12;\n\t\tif ( value > this.timeConstraints[ type ].max )\n\t\t\tvalue = this.timeConstraints[ type ].min + ( value - ( this.timeConstraints[ type ].max + 1 ) );\n\t\treturn this.pad( type, value );\n\t},\n\n\tincrease: function( type ) {\n\t\tvar value = parseInt( this.state[ type ], 10) + this.timeConstraints[ type ].step;\n\t\tif ( value > this.timeConstraints[ type ].max )\n\t\t\tvalue = this.timeConstraints[ type ].min + ( value - ( this.timeConstraints[ type ].max + 1 ) );\n\t\treturn this.pad( type, value );\n\t},\n\n\tdecrease: function( type ) {\n\t\tvar value = parseInt( this.state[ type ], 10) - this.timeConstraints[ type ].step;\n\t\tif ( value < this.timeConstraints[ type ].min )\n\t\t\tvalue = this.timeConstraints[ type ].max + 1 - ( this.timeConstraints[ type ].min - value );\n\t\treturn this.pad( type, value );\n\t},\n\n\tpad: function( type, value ) {\n\t\tvar str = value + '';\n\t\twhile ( str.length < this.padValues[ type ] )\n\t\t\tstr = '0' + str;\n\t\treturn str;\n\t},\n});\n\nmodule.exports = DateTimePickerTime;\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class'),\n\tDaysView = require('./DaysView'),\n\tMonthsView = require('./MonthsView'),\n\tYearsView = require('./YearsView'),\n\tTimeView = require('./TimeView')\n\t;\n\nvar CalendarContainer = createClass({\n\tviewComponents: {\n\t\tdays: DaysView,\n\t\tmonths: MonthsView,\n\t\tyears: YearsView,\n\t\ttime: TimeView\n\t},\n\n\trender: function() {\n\t\treturn React.createElement( this.viewComponents[ this.props.view ], this.props.viewProps );\n\t}\n});\n\nmodule.exports = CalendarContainer;\n","import { Component, createElement } from 'react';\nimport { findDOMNode } from 'react-dom';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n\n\n while (current.parentNode) {\n if (isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}\n\n// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};\n\nfunction autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();\n\nvar passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_this, eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_this, eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (!WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n };\n /**\n * Remove all document's event listeners for this component\n */\n\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n };\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _props = this.props,\n excludeScrollbar = _props.excludeScrollbar,\n props = _objectWithoutProperties(_props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}\n\nexport { IGNORE_CLASS_NAME };\nexport default onClickOutsideHOC;\n","'use strict';\n\nvar assign = require('object-assign'),\n\tPropTypes = require('prop-types'),\n\tcreateClass = require('create-react-class'),\n\tmoment = require('moment'),\n\tReact = require('react'),\n\tCalendarContainer = require('./src/CalendarContainer'),\n\tonClickOutside = require('react-onclickoutside').default\n\t;\n\nvar viewModes = Object.freeze({\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n});\n\nvar TYPES = PropTypes;\nvar Datetime = createClass({\n\tdisplayName: 'DateTime',\n\tpropTypes: {\n\t\t// value: TYPES.object | TYPES.string,\n\t\t// defaultValue: TYPES.object | TYPES.string,\n\t\t// viewDate: TYPES.object | TYPES.string,\n\t\tonFocus: TYPES.func,\n\t\tonBlur: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonViewModeChange: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\t// dateFormat: TYPES.string | TYPES.bool,\n\t\t// timeFormat: TYPES.string | TYPES.bool,\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tviewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool\n\t},\n\n\tgetInitialState: function() {\n\t\tthis.checkTZ( this.props );\n\t\t\n\t\tvar state = this.getStateFromProps( this.props );\n\n\t\tif ( state.open === undefined )\n\t\t\tstate.open = !this.props.input;\n\n\t\tstate.currentView = this.props.dateFormat ?\n\t\t\t(this.props.viewMode || state.updateOn || viewModes.DAYS) : viewModes.TIME;\n\n\t\treturn state;\n\t},\n\n\tparseDate: function (date, formats) {\n\t\tvar parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, formats.datetime);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t},\n\n\tgetStateFromProps: function( props ) {\n\t\tvar formats = this.getFormats( props ),\n\t\t\tdate = props.value || props.defaultValue,\n\t\t\tselectedDate, viewDate, updateOn, inputValue\n\t\t\t;\n\n\t\tselectedDate = this.parseDate(date, formats);\n\n\t\tviewDate = this.parseDate(props.viewDate, formats);\n\n\t\tviewDate = selectedDate ?\n\t\t\tselectedDate.clone().startOf('month') :\n\t\t\tviewDate ? viewDate.clone().startOf('month') : this.localMoment().startOf('month');\n\n\t\tupdateOn = this.getUpdateOn(formats);\n\n\t\tif ( selectedDate )\n\t\t\tinputValue = selectedDate.format(formats.datetime);\n\t\telse if ( date.isValid && !date.isValid() )\n\t\t\tinputValue = '';\n\t\telse\n\t\t\tinputValue = date || '';\n\n\t\treturn {\n\t\t\tupdateOn: updateOn,\n\t\t\tinputFormat: formats.datetime,\n\t\t\tviewDate: viewDate,\n\t\t\tselectedDate: selectedDate,\n\t\t\tinputValue: inputValue,\n\t\t\topen: props.open\n\t\t};\n\t},\n\n\tgetUpdateOn: function( formats ) {\n\t\tif ( formats.date.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t} else if ( formats.date.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t} else if ( formats.date.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t},\n\n\tgetFormats: function( props ) {\n\t\tvar formats = {\n\t\t\t\tdate: props.dateFormat || '',\n\t\t\t\ttime: props.timeFormat || ''\n\t\t\t},\n\t\t\tlocale = this.localMoment( props.date, null, props ).localeData()\n\t\t\t;\n\n\t\tif ( formats.date === true ) {\n\t\t\tformats.date = locale.longDateFormat('L');\n\t\t}\n\t\telse if ( this.getUpdateOn(formats) !== viewModes.DAYS ) {\n\t\t\tformats.time = '';\n\t\t}\n\n\t\tif ( formats.time === true ) {\n\t\t\tformats.time = locale.longDateFormat('LT');\n\t\t}\n\n\t\tformats.datetime = formats.date && formats.time ?\n\t\t\tformats.date + ' ' + formats.time :\n\t\t\tformats.date || formats.time\n\t\t;\n\n\t\treturn formats;\n\t},\n\n\tcomponentWillReceiveProps: function( nextProps ) {\n\t\tvar formats = this.getFormats( nextProps ),\n\t\t\tupdatedState = {}\n\t\t;\n\n\t\tif ( nextProps.value !== this.props.value ||\n\t\t\tformats.datetime !== this.getFormats( this.props ).datetime ) {\n\t\t\tupdatedState = this.getStateFromProps( nextProps );\n\t\t}\n\n\t\tif ( updatedState.open === undefined ) {\n\t\t\tif ( typeof nextProps.open !== 'undefined' ) {\n\t\t\t\tupdatedState.open = nextProps.open;\n\t\t\t} else if ( this.props.closeOnSelect && this.state.currentView !== viewModes.TIME ) {\n\t\t\t\tupdatedState.open = false;\n\t\t\t} else {\n\t\t\t\tupdatedState.open = this.state.open;\n\t\t\t}\n\t\t}\n\n\t\tif ( nextProps.viewMode !== this.props.viewMode ) {\n\t\t\tupdatedState.currentView = nextProps.viewMode;\n\t\t}\n\n\t\tif ( nextProps.locale !== this.props.locale ) {\n\t\t\tif ( this.state.viewDate ) {\n\t\t\t\tvar updatedViewDate = this.state.viewDate.clone().locale( nextProps.locale );\n\t\t\t\tupdatedState.viewDate = updatedViewDate;\n\t\t\t}\n\t\t\tif ( this.state.selectedDate ) {\n\t\t\t\tvar updatedSelectedDate = this.state.selectedDate.clone().locale( nextProps.locale );\n\t\t\t\tupdatedState.selectedDate = updatedSelectedDate;\n\t\t\t\tupdatedState.inputValue = updatedSelectedDate.format( formats.datetime );\n\t\t\t}\n\t\t}\n\n\t\tif ( nextProps.utc !== this.props.utc || nextProps.displayTimeZone !== this.props.displayTimeZone ) {\n\t\t\tif ( nextProps.utc ) {\n\t\t\t\tif ( this.state.viewDate )\n\t\t\t\t\tupdatedState.viewDate = this.state.viewDate.clone().utc();\n\t\t\t\tif ( this.state.selectedDate ) {\n\t\t\t\t\tupdatedState.selectedDate = this.state.selectedDate.clone().utc();\n\t\t\t\t\tupdatedState.inputValue = updatedState.selectedDate.format( formats.datetime );\n\t\t\t\t}\n\t\t\t} else if ( nextProps.displayTimeZone ) {\n\t\t\t\tif ( this.state.viewDate )\n\t\t\t\t\tupdatedState.viewDate = this.state.viewDate.clone().tz(nextProps.displayTimeZone);\n\t\t\t\tif ( this.state.selectedDate ) {\n\t\t\t\t\tupdatedState.selectedDate = this.state.selectedDate.clone().tz(nextProps.displayTimeZone);\n\t\t\t\t\tupdatedState.inputValue = updatedState.selectedDate.tz(nextProps.displayTimeZone).format( formats.datetime );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( this.state.viewDate )\n\t\t\t\t\tupdatedState.viewDate = this.state.viewDate.clone().local();\n\t\t\t\tif ( this.state.selectedDate ) {\n\t\t\t\t\tupdatedState.selectedDate = this.state.selectedDate.clone().local();\n\t\t\t\t\tupdatedState.inputValue = updatedState.selectedDate.format(formats.datetime);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( nextProps.viewDate !== this.props.viewDate ) {\n\t\t\tupdatedState.viewDate = moment(nextProps.viewDate);\n\t\t}\n\n\t\tthis.checkTZ( nextProps );\n\n\t\tthis.setState( updatedState );\n\t},\n\n\tonInputChange: function( e ) {\n\t\tvar value = e.target === null ? e : e.target.value,\n\t\t\tlocalMoment = this.localMoment( value, this.state.inputFormat ),\n\t\t\tupdate = { inputValue: value }\n\t\t\t;\n\n\t\tif ( localMoment.isValid() && !this.props.value ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t} else {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\treturn this.setState( update, function() {\n\t\t\treturn this.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t},\n\n\tonInputKey: function( e ) {\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis.closeCalendar();\n\t\t}\n\t},\n\n\tshowView: function( view ) {\n\t\tvar me = this;\n\t\treturn function() {\n\t\t\tme.state.currentView !== view && me.props.onViewModeChange( view );\n\t\t\tme.setState({ currentView: view });\n\t\t};\n\t},\n\n\tsetDate: function( type ) {\n\t\tvar me = this,\n\t\t\tnextViews = {\n\t\t\t\tmonth: viewModes.DAYS,\n\t\t\t\tyear: viewModes.MONTHS,\n\t\t\t}\n\t\t;\n\t\treturn function( e ) {\n\t\t\tme.setState({\n\t\t\t\tviewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.getAttribute('data-value'), 10) ).startOf( type ),\n\t\t\t\tcurrentView: nextViews[ type ]\n\t\t\t});\n\t\t\tme.props.onViewModeChange( nextViews[ type ] );\n\t\t};\n\t},\n\n\tsubtractTime: function( amount, type, toSelected ) {\n\t\tvar me = this;\n\t\treturn function() {\n\t\t\tme.props.onNavigateBack( amount, type );\n\t\t\tme.updateTime( 'subtract', amount, type, toSelected );\n\t\t};\n\t},\n\n\taddTime: function( amount, type, toSelected ) {\n\t\tvar me = this;\n\t\treturn function() {\n\t\t\tme.props.onNavigateForward( amount, type );\n\t\t\tme.updateTime( 'add', amount, type, toSelected );\n\t\t};\n\t},\n\n\tupdateTime: function( op, amount, type, toSelected ) {\n\t\tvar update = {},\n\t\t\tdate = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t},\n\n\tallowedSetTime: ['hours', 'minutes', 'seconds', 'milliseconds'],\n\tsetTime: function( type, value ) {\n\t\tvar index = this.allowedSetTime.indexOf( type ) + 1,\n\t\t\tstate = this.state,\n\t\t\tdate = (state.selectedDate || state.viewDate).clone(),\n\t\t\tnextType\n\t\t\t;\n\n\t\t// It is needed to set all the time properties\n\t\t// to not to reset the time\n\t\tdate[ type ]( value );\n\t\tfor (; index < this.allowedSetTime.length; index++) {\n\t\t\tnextType = this.allowedSetTime[index];\n\t\t\tdate[ nextType ]( date[nextType]() );\n\t\t}\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tinputValue: date.format( state.inputFormat )\n\t\t\t});\n\t\t}\n\t\tthis.props.onChange( date );\n\t},\n\n\tupdateSelectedDate: function( e, close ) {\n\t\tvar target = e.currentTarget,\n\t\t\tmodifier = 0,\n\t\t\tviewDate = this.state.viewDate,\n\t\t\tcurrentDate = this.state.selectedDate || viewDate,\n\t\t\tdate\n\t\t\t;\n\n\t\tif (target.className.indexOf('rdtDay') !== -1) {\n\t\t\tif (target.className.indexOf('rdtNew') !== -1)\n\t\t\t\tmodifier = 1;\n\t\t\telse if (target.className.indexOf('rdtOld') !== -1)\n\t\t\t\tmodifier = -1;\n\n\t\t\tdate = viewDate.clone()\n\t\t\t\t.month( viewDate.month() + modifier )\n\t\t\t\t.date( parseInt( target.getAttribute('data-value'), 10 ) );\n\t\t} else if (target.className.indexOf('rdtMonth') !== -1) {\n\t\t\tdate = viewDate.clone()\n\t\t\t\t.month( parseInt( target.getAttribute('data-value'), 10 ) )\n\t\t\t\t.date( currentDate.date() );\n\t\t} else if (target.className.indexOf('rdtYear') !== -1) {\n\t\t\tdate = viewDate.clone()\n\t\t\t\t.month( currentDate.month() )\n\t\t\t\t.date( currentDate.date() )\n\t\t\t\t.year( parseInt( target.getAttribute('data-value'), 10 ) );\n\t\t}\n\n\t\tdate.hours( currentDate.hours() )\n\t\t\t.minutes( currentDate.minutes() )\n\t\t\t.seconds( currentDate.seconds() )\n\t\t\t.milliseconds( currentDate.milliseconds() );\n\n\t\tif ( !this.props.value ) {\n\t\t\tvar open = !( this.props.closeOnSelect && close );\n\t\t\tif ( !open ) {\n\t\t\t\tthis.props.onBlur( date );\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone().startOf('month'),\n\t\t\t\tinputValue: date.format( this.state.inputFormat ),\n\t\t\t\topen: open\n\t\t\t});\n\t\t} else {\n\t\t\tif ( this.props.closeOnSelect && close ) {\n\t\t\t\tthis.closeCalendar();\n\t\t\t}\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t},\n\n\topenCalendar: function( e ) {\n\t\tif ( !this.state.open ) {\n\t\t\tthis.setState({ open: true }, function() {\n\t\t\t\tthis.props.onFocus( e );\n\t\t\t});\n\t\t}\n\t},\n\n\tcloseCalendar: function() {\n\t\tthis.setState({ open: false }, function () {\n\t\t\tthis.props.onBlur( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t},\n\n\thandleClickOutside: function() {\n\t\tif ( this.props.input && this.state.open && this.props.open === undefined && !this.props.disableCloseOnClickOutside ) {\n\t\t\tthis.setState({ open: false }, function() {\n\t\t\t\tthis.props.onBlur( this.state.selectedDate || this.state.inputValue );\n\t\t\t});\n\t\t}\n\t},\n\n\tlocalMoment: function( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tvar m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t},\n\n\tcheckTZ: function( props ) {\n\t\tvar con = console;\n\n\t\tif ( props.displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tcon && con.error('react-datetime: displayTimeZone prop with value \"' + props.displayTimeZone + '\" is used but moment.js timezone is not loaded.');\n\t\t}\n\t},\n\n\tcomponentProps: {\n\t\tfromProps: ['value', 'isValidDate', 'renderDay', 'renderMonth', 'renderYear', 'timeConstraints'],\n\t\tfromState: ['viewDate', 'selectedDate', 'updateOn'],\n\t\tfromThis: ['setDate', 'setTime', 'showView', 'addTime', 'subtractTime', 'updateSelectedDate', 'localMoment', 'handleClickOutside']\n\t},\n\n\tgetComponentProps: function() {\n\t\tvar me = this,\n\t\t\tformats = this.getFormats( this.props ),\n\t\t\tprops = {dateFormat: formats.date, timeFormat: formats.time}\n\t\t\t;\n\n\t\tthis.componentProps.fromProps.forEach( function( name ) {\n\t\t\tprops[ name ] = me.props[ name ];\n\t\t});\n\t\tthis.componentProps.fromState.forEach( function( name ) {\n\t\t\tprops[ name ] = me.state[ name ];\n\t\t});\n\t\tthis.componentProps.fromThis.forEach( function( name ) {\n\t\t\tprops[ name ] = me[ name ];\n\t\t});\n\n\t\treturn props;\n\t},\n\n\toverrideEvent: function( handler, action ) {\n\t\tif ( !this.overridenEvents ) {\n\t\t\tthis.overridenEvents = {};\n\t\t}\n\n\t\tif ( !this.overridenEvents[handler] ) {\n\t\t\tvar me = this;\n\t\t\tthis.overridenEvents[handler] = function( e ) {\n\t\t\t\tvar result;\n\t\t\t\tif ( me.props.inputProps && me.props.inputProps[handler] ) {\n\t\t\t\t\tresult = me.props.inputProps[handler]( e );\n\t\t\t\t}\n\t\t\t\tif ( result !== false ) {\n\t\t\t\t\taction( e );\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\treturn this.overridenEvents[handler];\n\t},\n\n\trender: function() {\n\t\t// TODO: Make a function or clean up this code,\n\t\t// logic right now is really hard to follow\n\t\tvar className = 'rdt' + (this.props.className ?\n\t\t\t\t\t\t\t\t\t( Array.isArray( this.props.className ) ?\n\t\t\t\t\t\t\t\t\t' ' + this.props.className.join( ' ' ) : ' ' + this.props.className) : ''),\n\t\t\tchildren = [];\n\n\t\tif ( this.props.input ) {\n\t\t\tvar finalInputProps = assign(\n\t\t\t\t{ type: 'text', className: 'form-control', value: this.state.inputValue },\n\t\t\t\tthis.props.inputProps,\n\t\t\t\t{\n\t\t\t\t\tonClick: this.overrideEvent( 'onClick', this.openCalendar ),\n\t\t\t\t\tonFocus: this.overrideEvent( 'onFocus', this.openCalendar ),\n\t\t\t\t\tonChange: this.overrideEvent( 'onChange', this.onInputChange ),\n\t\t\t\t\tonKeyDown: this.overrideEvent( 'onKeyDown', this.onInputKey ),\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( this.props.renderInput ) {\n\t\t\t\tchildren = [ React.createElement('div', { key: 'i' }, this.props.renderInput( finalInputProps, this.openCalendar, this.closeCalendar )) ];\n\t\t\t} else {\n\t\t\t\tchildren = [ React.createElement('input', assign({ key: 'i' }, finalInputProps ))];\n\t\t\t}\n\t\t} else {\n\t\t\tclassName += ' rdtStatic';\n\t\t}\n\n\t\tif ( this.props.open || (this.props.open === undefined && this.state.open ) )\n\t\t\tclassName += ' rdtOpen';\n\n\t\treturn React.createElement( ClickableWrapper, {className: className, onClickOut: this.handleClickOutside}, children.concat(\n\t\t\tReact.createElement( 'div',\n\t\t\t\t{ key: 'dt', className: 'rdtPicker' },\n\t\t\t\tReact.createElement( CalendarContainer, { view: this.state.currentView, viewProps: this.getComponentProps() })\n\t\t\t)\n\t\t));\n\t}\n});\n\nvar ClickableWrapper = onClickOutside( createClass({\n\trender: function() {\n\t\treturn React.createElement( 'div', { className: this.props.className }, this.props.children );\n\t},\n\thandleClickOutside: function( e ) {\n\t\tthis.props.onClickOut( e );\n\t}\n}));\n\nDatetime.defaultProps = {\n\tclassName: '',\n\tdefaultValue: '',\n\tinputProps: {},\n\tinput: true,\n\tonFocus: function() {},\n\tonBlur: function() {},\n\tonChange: function() {},\n\tonViewModeChange: function() {},\n\tonNavigateBack: function() {},\n\tonNavigateForward: function() {},\n\ttimeFormat: true,\n\ttimeConstraints: {},\n\tdateFormat: true,\n\tstrictParsing: true,\n\tcloseOnSelect: false,\n\tcloseOnTab: true,\n\tutc: false\n};\n\n// Make moment accessible through the Datetime class\nDatetime.moment = moment;\n\nmodule.exports = Datetime;\n","import React, {PureComponent} from 'react';\nimport enhanceWithClickOutside from '../enhanceWithClickOutside/index';\nimport moment, {Moment, isMoment} from 'moment';\nimport mergeClassNames from 'classnames';\n// @ts-ignore missing typings - we can not update due to a know issue with firefox (https://github.com/neos/neos-ui/pull/1874)\nimport Collapse from 'react-collapse';\nimport DatePicker, {TimeConstraints} from 'react-datetime';\n\nimport {PickDefaultProps} from '../../types';\nimport Button from '../Button';\nimport Icon from '../Icon';\n\n\nexport interface DateInputProps {\n /**\n * The Date instance which represents the selected value.\n */\n readonly value?: Date;\n\n /**\n * Additional className to render into the wrapper div\n */\n readonly className?: string;\n\n /**\n * An optional placeholder which will be rendered if no date was selected.\n */\n readonly placeholder?: string;\n\n /**\n * An optional id for the input.\n */\n readonly id?: string;\n\n /**\n * The label which will be displayed within the `Select Today` btn.\n */\n readonly todayLabel: string;\n\n /**\n * The label which will be displayed within the `Apply` btn.\n */\n readonly applyLabel: string;\n\n /**\n * The moment format string to use to format the passed value.\n */\n readonly labelFormat?: string;\n\n /**\n * Display only date picker\n */\n readonly dateOnly?: boolean;\n\n /**\n * Display only time picker\n */\n readonly timeOnly?: boolean;\n\n /**\n * Add some constraints to the timepicker.\n * It accepts an object with the format { hours: { min: 9, max: 15, step: 2 }},\n * this example means the hours can't be lower than 9 and higher than 15,\n * and it will change adding or subtracting 2 hours everytime the buttons are clicked.\n * The constraints can be added to the hours, minutes, seconds and milliseconds.\n */\n readonly timeConstraints?: TimeConstraints;\n\n /**\n * Locale for the date picker (determines time format)\n */\n readonly locale: string;\n\n /**\n * Disable the DateInput\n */\n readonly disabled?: boolean;\n\n /**\n * The changehandler to call when the date changes.\n */\n readonly onChange: (date: Date | null) => void;\n\n /**\n * An optional theme using tremr\n */\n readonly theme?: DateInputTheme;\n}\n\ninterface DateInputTheme {\n 'wrapper': string;\n 'disabled': string;\n 'disabled-cursor': string;\n 'calendarInputWrapper': string;\n 'calendarIconBtn': string;\n 'calendarFakeInputWrapper': string;\n 'calendarFakeInputMirror': string;\n 'calendarFakeInput': string;\n 'applyBtn': string;\n 'closeCalendarIconBtn': string;\n 'selectTodayBtn': string;\n}\n\nconst defaultProps: PickDefaultProps = {\n labelFormat: 'DD-MM-YYYY hh:mm',\n timeConstraints: {\n minutes: {\n min: 0,\n max: 59,\n step: 5\n }\n },\n};\n\ninterface DateInputState {\n readonly isOpen: boolean;\n readonly transientDate: Date | null; // TODO do we have a breaking change when we use 'undefined' in favor of 'null'?\n}\n\nconst initialState: DateInputState = {\n isOpen: false,\n transientDate: null\n};\n\nexport class DateInput extends PureComponent {\n public static readonly defaultProps = defaultProps;\n public readonly state = initialState;\n\n public render(): JSX.Element {\n const {\n placeholder,\n theme,\n value,\n className,\n id,\n todayLabel,\n applyLabel,\n labelFormat,\n dateOnly,\n timeOnly,\n locale,\n disabled\n } = this.props;\n const selectedDate = value ? moment(value).format(labelFormat) : '';\n\n const wrapper = mergeClassNames(\n theme!.wrapper,\n {\n [theme!.disabled]: disabled,\n },\n );\n\n const calendarInputWrapper = mergeClassNames(className, theme!.calendarInputWrapper);\n\n const calendarFakeInputMirror = mergeClassNames(\n theme!.calendarFakeInputMirror,\n {\n [theme!['disabled-cursor']]: disabled,\n },\n );\n\n const calendarIconBtn = mergeClassNames(\n theme!.calendarIconBtn,\n {\n [theme!['disabled-cursor']]: disabled,\n },\n );\n\n const closeCalendarIconBtn = mergeClassNames(\n theme!.closeCalendarIconBtn,\n {\n [theme!['disabled-cursor']]: disabled,\n },\n );\n\n return (\n
\n
\n \n \n \n
\n \n \n
\n \n \n \n
\n \n \n {todayLabel}\n \n \n \n {applyLabel}\n \n \n
\n );\n }\n\n private readonly handleClick = () => {\n if (!this.props.disabled) {\n this.toggle();\n }\n }\n\n private readonly handleFocus = () => {\n if (!this.props.disabled) {\n this.open();\n }\n }\n\n private readonly handleClearValueClick = () => {\n if (!this.props.disabled) {\n this.setState({isOpen: false}, () => {\n this.props.onChange(null);\n });\n }\n }\n\n private readonly handleApply = () => {\n this.setState({\n isOpen: false\n }, () => {\n this.props.onChange(this.state.transientDate);\n });\n }\n\n private readonly handleChange = (value: Moment | string) => {\n const momentVal: Moment = isMoment(value) ? value : moment(value);\n this.setState({\n transientDate: momentVal.toDate()\n });\n }\n\n private readonly handleSelectTodayBtnClick = () => {\n this.setState({\n isOpen: false\n }, () => {\n let date = moment().toDate();\n if (this.props.dateOnly) {\n date = moment().utc().startOf('day').toDate();\n }\n this.props.onChange(date);\n });\n }\n\n public handleClickOutside = () => this.close();\n\n private readonly toggle = () => {\n this.setState({\n isOpen: !this.state.isOpen\n });\n }\n\n private readonly open = () => {\n this.setState({\n isOpen: true\n });\n }\n\n private readonly close = () => {\n this.setState({\n isOpen: false\n });\n }\n}\n\n//\n// Add the click-outside functionality to the DateInput component.\n//\nconst EnhancedDateInput = enhanceWithClickOutside(DateInput);\n\nexport default EnhancedDateInput;\n","import {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport DateInput from './dateInput';\nimport style from './style.css';\n\nexport default themr(identifiers.dateInput, style)(DateInput);\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CloseOnEscape = function (_Component) {\n _inherits(CloseOnEscape, _Component);\n\n function CloseOnEscape() {\n _classCallCheck(this, CloseOnEscape);\n\n var _this = _possibleConstructorReturn(this, (CloseOnEscape.__proto__ || Object.getPrototypeOf(CloseOnEscape)).call(this));\n\n _this.onEscape = _this.onEscape.bind(_this);\n return _this;\n }\n\n _createClass(CloseOnEscape, [{\n key: 'onEscape',\n value: function onEscape(_ref) {\n var keyCode = _ref.keyCode;\n\n if (keyCode === 27) {\n this.props.onEscape();\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n document.addEventListener('keydown', this.onEscape);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n document.removeEventListener('keydown', this.onEscape);\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children;\n }\n }]);\n\n return CloseOnEscape;\n}(_react.Component);\n\nexports.default = CloseOnEscape;\n\n\nCloseOnEscape.propTypes = {\n onEscape: _propTypes2.default.func.isRequired\n};","export var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport { canUseDOM } from './utils';\n\nvar Portal = function (_React$Component) {\n _inherits(Portal, _React$Component);\n\n function Portal() {\n _classCallCheck(this, Portal);\n\n return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));\n }\n\n _createClass(Portal, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.defaultNode) {\n document.body.removeChild(this.defaultNode);\n }\n this.defaultNode = null;\n }\n }, {\n key: 'render',\n value: function render() {\n if (!canUseDOM) {\n return null;\n }\n if (!this.props.node && !this.defaultNode) {\n this.defaultNode = document.createElement('div');\n document.body.appendChild(this.defaultNode);\n }\n return ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);\n }\n }]);\n\n return Portal;\n}(React.Component);\n\nPortal.propTypes = {\n children: PropTypes.node.isRequired,\n node: PropTypes.any\n};\n\nexport default Portal;","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// This file is a fallback for a consumer who is not yet on React 16\n// as createPortal was introduced in React 16\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\n\nvar Portal = function (_React$Component) {\n _inherits(Portal, _React$Component);\n\n function Portal() {\n _classCallCheck(this, Portal);\n\n return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));\n }\n\n _createClass(Portal, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.renderPortal();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(props) {\n this.renderPortal();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n ReactDOM.unmountComponentAtNode(this.defaultNode || this.props.node);\n if (this.defaultNode) {\n document.body.removeChild(this.defaultNode);\n }\n this.defaultNode = null;\n this.portal = null;\n }\n }, {\n key: 'renderPortal',\n value: function renderPortal(props) {\n if (!this.props.node && !this.defaultNode) {\n this.defaultNode = document.createElement('div');\n document.body.appendChild(this.defaultNode);\n }\n\n var children = this.props.children;\n // https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b\n if (typeof this.props.children.type === 'function') {\n children = React.cloneElement(this.props.children);\n }\n\n this.portal = ReactDOM.unstable_renderSubtreeIntoContainer(this, children, this.props.node || this.defaultNode);\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return Portal;\n}(React.Component);\n\nexport default Portal;\n\n\nPortal.propTypes = {\n children: PropTypes.node.isRequired,\n node: PropTypes.any\n};","import ReactDOM from 'react-dom';\n\nimport Portalv4 from './Portal';\nimport LegacyPortal from './LegacyPortal';\n\nvar Portal = void 0;\n\nif (ReactDOM.createPortal) {\n Portal = Portalv4;\n} else {\n Portal = LegacyPortal;\n}\n\nexport default Portal;","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Portal from './PortalCompat';\n\nvar KEYCODES = {\n ESCAPE: 27\n};\n\nvar PortalWithState = function (_React$Component) {\n _inherits(PortalWithState, _React$Component);\n\n function PortalWithState(props) {\n _classCallCheck(this, PortalWithState);\n\n var _this = _possibleConstructorReturn(this, (PortalWithState.__proto__ || Object.getPrototypeOf(PortalWithState)).call(this, props));\n\n _this.portalNode = null;\n _this.state = { active: !!props.defaultOpen };\n _this.openPortal = _this.openPortal.bind(_this);\n _this.closePortal = _this.closePortal.bind(_this);\n _this.wrapWithPortal = _this.wrapWithPortal.bind(_this);\n _this.handleOutsideMouseClick = _this.handleOutsideMouseClick.bind(_this);\n _this.handleKeydown = _this.handleKeydown.bind(_this);\n return _this;\n }\n\n _createClass(PortalWithState, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (this.props.closeOnEsc) {\n document.addEventListener('keydown', this.handleKeydown);\n }\n if (this.props.closeOnOutsideClick) {\n document.addEventListener('click', this.handleOutsideMouseClick);\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.props.closeOnEsc) {\n document.removeEventListener('keydown', this.handleKeydown);\n }\n if (this.props.closeOnOutsideClick) {\n document.removeEventListener('click', this.handleOutsideMouseClick);\n }\n }\n }, {\n key: 'openPortal',\n value: function openPortal(e) {\n if (this.state.active) {\n return;\n }\n if (e && e.nativeEvent) {\n e.nativeEvent.stopImmediatePropagation();\n }\n this.setState({ active: true }, this.props.onOpen);\n }\n }, {\n key: 'closePortal',\n value: function closePortal() {\n if (!this.state.active) {\n return;\n }\n this.setState({ active: false }, this.props.onClose);\n }\n }, {\n key: 'wrapWithPortal',\n value: function wrapWithPortal(children) {\n var _this2 = this;\n\n if (!this.state.active) {\n return null;\n }\n return React.createElement(\n Portal,\n {\n node: this.props.node,\n key: 'react-portal',\n ref: function ref(portalNode) {\n return _this2.portalNode = portalNode;\n }\n },\n children\n );\n }\n }, {\n key: 'handleOutsideMouseClick',\n value: function handleOutsideMouseClick(e) {\n if (!this.state.active) {\n return;\n }\n var root = this.portalNode && (this.portalNode.props.node || this.portalNode.defaultNode);\n if (!root || root.contains(e.target) || e.button && e.button !== 0) {\n return;\n }\n this.closePortal();\n }\n }, {\n key: 'handleKeydown',\n value: function handleKeydown(e) {\n if (e.keyCode === KEYCODES.ESCAPE && this.state.active) {\n this.closePortal();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children({\n openPortal: this.openPortal,\n closePortal: this.closePortal,\n portal: this.wrapWithPortal,\n isOpen: this.state.active\n });\n }\n }]);\n\n return PortalWithState;\n}(React.Component);\n\nPortalWithState.propTypes = {\n children: PropTypes.func.isRequired,\n defaultOpen: PropTypes.bool,\n node: PropTypes.any,\n closeOnEsc: PropTypes.bool,\n closeOnOutsideClick: PropTypes.bool,\n onOpen: PropTypes.func,\n onClose: PropTypes.func\n};\n\nPortalWithState.defaultProps = {\n onOpen: function onOpen() {},\n onClose: function onClose() {}\n};\n\nexport default PortalWithState;","import Portal from './PortalCompat';\nimport PortalWithState from './PortalWithState';\n\nexport { Portal, PortalWithState };","import mergeClassNames from 'classnames';\nimport React, {PureComponent, ReactNode} from 'react';\nimport enhanceWithClickOutside from '../enhanceWithClickOutside/index';\nimport CloseOnEscape from 'react-close-on-escape';\nimport {Portal} from 'react-portal';\n\ntype DialogType = 'success' | 'warn' | 'error';\ntype DialogStyle = 'wide' | 'jumbo' | 'narrow';\n\ninterface DialogTheme {\n readonly 'dialog': string;\n readonly 'dialog__body': string;\n readonly 'dialog__contentsPosition': string;\n readonly 'dialog__contents': string;\n readonly 'dialog__title': string;\n readonly 'dialog__closeBtn': string;\n readonly 'dialog__actions': string;\n readonly 'dialog--wide': string;\n readonly 'dialog--jumbo': string;\n readonly 'dialog--narrow': string;\n readonly 'dialog--success': string;\n readonly 'dialog--warn': string;\n readonly 'dialog--error': string;\n}\n\nexport interface DialogProps {\n /**\n * This prop controls the rendered state of the Dialog, when falsy, nothing gets rendered into the DOM.\n */\n readonly isOpen: boolean;\n\n /**\n * The handler which gets called once the user clicks on the close symbol in the top right corner of the Dialog.\n */\n readonly onRequestClose: () => void;\n\n /**\n * The title to be rendered on top of the Dialogs contents.\n */\n readonly title: ReactNode;\n\n /**\n * The `type` prop defines the type of the `Dialog`.\n */\n readonly type: DialogType;\n\n /**\n * The `style` prop defines the visual style of the `Dialog`.\n */\n readonly style: DialogStyle;\n\n /**\n * The contents to be rendered within the Dialog.\n */\n readonly children: ReactNode;\n\n /**\n * An Array of nodes(e.g. Action Buttons) which are placed at the bottom of the Dialog.\n */\n readonly actions: ReadonlyArray;\n\n /**\n * This prop controls the focus state of the Dialog.\n */\n readonly autoFocus: boolean;\n\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * An optional `contentsClassName` to attach to the content area of the dialog.\n */\n readonly contentsClassName?: string;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme: DialogTheme;\n}\n\nexport class DialogWithoutEscape extends PureComponent {\n // tslint:disable-next-line:readonly-keyword\n private ref?: HTMLDivElement;\n\n public render(): JSX.Element {\n const {\n title,\n children,\n actions,\n theme,\n type\n } = this.props;\n\n const finalClassNameBody = mergeClassNames(\n theme.dialog__body,\n {\n [theme['dialog--success']]: type === 'success',\n [theme['dialog--warn']]: type === 'warn',\n [theme['dialog--error']]: type === 'error',\n },\n 'dialog__body'\n );\n\n return (\n
\n
\n\n
\n {title}\n
\n
\n {children}\n
\n\n {actions && actions.length ?\n
\n {React.Children.map(actions, (action, index) => {action})}\n
: null\n }\n
\n
\n );\n }\n\n private readonly handleReference = (ref: HTMLDivElement) => {\n // tslint:disable-next-line:no-object-mutation\n this.ref = ref;\n }\n\n public readonly handleClickOutside = () => {\n this.props.onRequestClose();\n }\n\n public readonly componentDidMount = (): void => {\n document.addEventListener('keydown', (event : KeyboardEvent) => this.handleKeyPress(event));\n const {autoFocus} = this.props;\n if (this.ref && autoFocus) {\n this.ref.focus();\n }\n }\n\n public readonly componentWillUnmount = (): void => {\n document.removeEventListener('keydown', (event : KeyboardEvent) => this.handleKeyPress(event));\n }\n\n /**\n * Closes the dialog when the escape key has been pressed.\n *\n * @param {KeyboardEvent} event\n * @returns {void}\n */\n public readonly handleKeyPress = (event : KeyboardEvent): void => {\n if (event.key === 'Escape') {\n this.props.onRequestClose();\n }\n }\n}\n\nconst EnhancedDialogWithoutEscapeWithClickOutside = enhanceWithClickOutside(DialogWithoutEscape);\n\n// tslint:disable-next-line:max-classes-per-file\nclass DialogWithEscape extends PureComponent {\n public render(): JSX.Element | null {\n const {\n className,\n title,\n style,\n children,\n isOpen,\n actions,\n theme,\n type,\n onRequestClose,\n ...rest\n } = this.props;\n\n const sectionClassName = mergeClassNames(\n theme.dialog,\n {\n [theme['dialog--wide']]: style === 'wide',\n [theme['dialog--jumbo']]: style === 'jumbo',\n [theme['dialog--narrow']]: style === 'narrow',\n },\n {\n [theme['dialog--success']]: type === 'success',\n [theme['dialog--warn']]: type === 'warn',\n [theme['dialog--error']]: type === 'error',\n },\n className,\n );\n\n if (!this.props.isOpen) {\n return null;\n }\n\n return (\n \n \n
\n \n
\n
\n
\n );\n }\n\n private readonly onEscape = () => {\n this.props.onRequestClose();\n }\n}\n\nexport default DialogWithEscape;\n","import {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport Dialog from './dialog';\nimport style from './style.css';\n\nexport default themr(identifiers.dialog, style)(Dialog);\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

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

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '\n if (val === '') return true;\n if (val === 'false') return false;\n if (val === 'true') return true;\n return val;\n}\n\nif (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {\n var attrs = [['data-family-prefix', 'familyPrefix'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];\n attrs.forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n attr = _ref2[0],\n key = _ref2[1];\n\n var val = coerce(getAttrConfig(attr));\n\n if (val !== undefined && val !== null) {\n initial[key] = val;\n }\n });\n}\n\nvar _default = {\n familyPrefix: DEFAULT_FAMILY_PREFIX,\n replacementClass: DEFAULT_REPLACEMENT_CLASS,\n autoReplaceSvg: true,\n autoAddCss: true,\n autoA11y: true,\n searchPseudoElements: false,\n observeMutations: true,\n mutateApproach: 'async',\n keepOriginalSource: true,\n measurePerformance: false,\n showMissingIcons: true\n};\n\nvar _config = _objectSpread({}, _default, initial);\n\nif (!_config.autoReplaceSvg) _config.observeMutations = false;\n\nvar config = _objectSpread({}, _config);\n\nWINDOW.FontAwesomeConfig = config;\n\nvar w = WINDOW || {};\nif (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};\nif (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};\nif (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};\nif (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];\nvar namespace = w[NAMESPACE_IDENTIFIER];\n\nvar functions = [];\n\nvar listener = function listener() {\n DOCUMENT.removeEventListener('DOMContentLoaded', listener);\n loaded = 1;\n functions.map(function (fn) {\n return fn();\n });\n};\n\nvar loaded = false;\n\nif (IS_DOM) {\n loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);\n if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);\n}\n\nfunction domready (fn) {\n if (!IS_DOM) return;\n loaded ? setTimeout(fn, 0) : functions.push(fn);\n}\n\nvar PENDING = 'pending';\nvar SETTLED = 'settled';\nvar FULFILLED = 'fulfilled';\nvar REJECTED = 'rejected';\n\nvar NOOP = function NOOP() {};\n\nvar isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';\nvar asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;\nvar asyncQueue = [];\nvar asyncTimer;\n\nfunction asyncFlush() {\n // run promise callbacks\n for (var i = 0; i < asyncQueue.length; i++) {\n asyncQueue[i][0](asyncQueue[i][1]);\n } // reset async asyncQueue\n\n\n asyncQueue = [];\n asyncTimer = false;\n}\n\nfunction asyncCall(callback, arg) {\n asyncQueue.push([callback, arg]);\n\n if (!asyncTimer) {\n asyncTimer = true;\n asyncSetTimer(asyncFlush, 0);\n }\n}\n\nfunction invokeResolver(resolver, promise) {\n function resolvePromise(value) {\n resolve(promise, value);\n }\n\n function rejectPromise(reason) {\n reject(promise, reason);\n }\n\n try {\n resolver(resolvePromise, rejectPromise);\n } catch (e) {\n rejectPromise(e);\n }\n}\n\nfunction invokeCallback(subscriber) {\n var owner = subscriber.owner;\n var settled = owner._state;\n var value = owner._data;\n var callback = subscriber[settled];\n var promise = subscriber.then;\n\n if (typeof callback === 'function') {\n settled = FULFILLED;\n\n try {\n value = callback(value);\n } catch (e) {\n reject(promise, e);\n }\n }\n\n if (!handleThenable(promise, value)) {\n if (settled === FULFILLED) {\n resolve(promise, value);\n }\n\n if (settled === REJECTED) {\n reject(promise, value);\n }\n }\n}\n\nfunction handleThenable(promise, value) {\n var resolved;\n\n try {\n if (promise === value) {\n throw new TypeError('A promises callback cannot return that same promise.');\n }\n\n if (value && (typeof value === 'function' || _typeof(value) === 'object')) {\n // then should be retrieved only once\n var then = value.then;\n\n if (typeof then === 'function') {\n then.call(value, function (val) {\n if (!resolved) {\n resolved = true;\n\n if (value === val) {\n fulfill(promise, val);\n } else {\n resolve(promise, val);\n }\n }\n }, function (reason) {\n if (!resolved) {\n resolved = true;\n reject(promise, reason);\n }\n });\n return true;\n }\n }\n } catch (e) {\n if (!resolved) {\n reject(promise, e);\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction resolve(promise, value) {\n if (promise === value || !handleThenable(promise, value)) {\n fulfill(promise, value);\n }\n}\n\nfunction fulfill(promise, value) {\n if (promise._state === PENDING) {\n promise._state = SETTLED;\n promise._data = value;\n asyncCall(publishFulfillment, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state === PENDING) {\n promise._state = SETTLED;\n promise._data = reason;\n asyncCall(publishRejection, promise);\n }\n}\n\nfunction publish(promise) {\n promise._then = promise._then.forEach(invokeCallback);\n}\n\nfunction publishFulfillment(promise) {\n promise._state = FULFILLED;\n publish(promise);\n}\n\nfunction publishRejection(promise) {\n promise._state = REJECTED;\n publish(promise);\n\n if (!promise._handled && isNode) {\n global.process.emit('unhandledRejection', promise._data, promise);\n }\n}\n\nfunction notifyRejectionHandled(promise) {\n global.process.emit('rejectionHandled', promise);\n}\n/**\n * @class\n */\n\n\nfunction P(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('Promise resolver ' + resolver + ' is not a function');\n }\n\n if (this instanceof P === false) {\n throw new TypeError('Failed to construct \\'Promise\\': Please use the \\'new\\' operator, this object constructor cannot be called as a function.');\n }\n\n this._then = [];\n invokeResolver(resolver, this);\n}\n\nP.prototype = {\n constructor: P,\n _state: PENDING,\n _then: null,\n _data: undefined,\n _handled: false,\n then: function then(onFulfillment, onRejection) {\n var subscriber = {\n owner: this,\n then: new this.constructor(NOOP),\n fulfilled: onFulfillment,\n rejected: onRejection\n };\n\n if ((onRejection || onFulfillment) && !this._handled) {\n this._handled = true;\n\n if (this._state === REJECTED && isNode) {\n asyncCall(notifyRejectionHandled, this);\n }\n }\n\n if (this._state === FULFILLED || this._state === REJECTED) {\n // already resolved, call callback async\n asyncCall(invokeCallback, subscriber);\n } else {\n // subscribe\n this._then.push(subscriber);\n }\n\n return subscriber.then;\n },\n catch: function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nP.all = function (promises) {\n if (!Array.isArray(promises)) {\n throw new TypeError('You must pass an array to Promise.all().');\n }\n\n return new P(function (resolve, reject) {\n var results = [];\n var remaining = 0;\n\n function resolver(index) {\n remaining++;\n return function (value) {\n results[index] = value;\n\n if (! --remaining) {\n resolve(results);\n }\n };\n }\n\n for (var i = 0, promise; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolver(i), reject);\n } else {\n results[i] = promise;\n }\n }\n\n if (!remaining) {\n resolve(results);\n }\n });\n};\n\nP.race = function (promises) {\n if (!Array.isArray(promises)) {\n throw new TypeError('You must pass an array to Promise.race().');\n }\n\n return new P(function (resolve, reject) {\n for (var i = 0, promise; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolve, reject);\n } else {\n resolve(promise);\n }\n }\n });\n};\n\nP.resolve = function (value) {\n if (value && _typeof(value) === 'object' && value.constructor === P) {\n return value;\n }\n\n return new P(function (resolve) {\n resolve(value);\n });\n};\n\nP.reject = function (reason) {\n return new P(function (resolve, reject) {\n reject(reason);\n });\n};\n\nvar picked = typeof Promise === 'function' ? Promise : P;\n\nvar d = UNITS_IN_GRID;\nvar meaninglessTransform = {\n size: 16,\n x: 0,\n y: 0,\n rotate: 0,\n flipX: false,\n flipY: false\n};\n\nfunction isReserved(name) {\n return ~RESERVED_CLASSES.indexOf(name);\n}\nfunction insertCss(css) {\n if (!css || !IS_DOM) {\n return;\n }\n\n var style = DOCUMENT.createElement('style');\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n var headChildren = DOCUMENT.head.childNodes;\n var beforeChild = null;\n\n for (var i = headChildren.length - 1; i > -1; i--) {\n var child = headChildren[i];\n var tagName = (child.tagName || '').toUpperCase();\n\n if (['STYLE', 'LINK'].indexOf(tagName) > -1) {\n beforeChild = child;\n }\n }\n\n DOCUMENT.head.insertBefore(style, beforeChild);\n return css;\n}\nvar idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\nfunction nextUniqueId() {\n var size = 12;\n var id = '';\n\n while (size-- > 0) {\n id += idPool[Math.random() * 62 | 0];\n }\n\n return id;\n}\nfunction toArray(obj) {\n var array = [];\n\n for (var i = (obj || []).length >>> 0; i--;) {\n array[i] = obj[i];\n }\n\n return array;\n}\nfunction classArray(node) {\n if (node.classList) {\n return toArray(node.classList);\n } else {\n return (node.getAttribute('class') || '').split(' ').filter(function (i) {\n return i;\n });\n }\n}\nfunction getIconName(familyPrefix, cls) {\n var parts = cls.split('-');\n var prefix = parts[0];\n var iconName = parts.slice(1).join('-');\n\n if (prefix === familyPrefix && iconName !== '' && !isReserved(iconName)) {\n return iconName;\n } else {\n return null;\n }\n}\nfunction htmlEscape(str) {\n return \"\".concat(str).replace(/&/g, '&').replace(/\"/g, '"').replace(/'/g, ''').replace(//g, '>');\n}\nfunction joinAttributes(attributes) {\n return Object.keys(attributes || {}).reduce(function (acc, attributeName) {\n return acc + \"\".concat(attributeName, \"=\\\"\").concat(htmlEscape(attributes[attributeName]), \"\\\" \");\n }, '').trim();\n}\nfunction joinStyles(styles) {\n return Object.keys(styles || {}).reduce(function (acc, styleName) {\n return acc + \"\".concat(styleName, \": \").concat(styles[styleName], \";\");\n }, '');\n}\nfunction transformIsMeaningful(transform) {\n return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;\n}\nfunction transformForSvg(_ref) {\n var transform = _ref.transform,\n containerWidth = _ref.containerWidth,\n iconWidth = _ref.iconWidth;\n var outer = {\n transform: \"translate(\".concat(containerWidth / 2, \" 256)\")\n };\n var innerTranslate = \"translate(\".concat(transform.x * 32, \", \").concat(transform.y * 32, \") \");\n var innerScale = \"scale(\".concat(transform.size / 16 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / 16 * (transform.flipY ? -1 : 1), \") \");\n var innerRotate = \"rotate(\".concat(transform.rotate, \" 0 0)\");\n var inner = {\n transform: \"\".concat(innerTranslate, \" \").concat(innerScale, \" \").concat(innerRotate)\n };\n var path = {\n transform: \"translate(\".concat(iconWidth / 2 * -1, \" -256)\")\n };\n return {\n outer: outer,\n inner: inner,\n path: path\n };\n}\nfunction transformForCss(_ref2) {\n var transform = _ref2.transform,\n _ref2$width = _ref2.width,\n width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,\n _ref2$height = _ref2.height,\n height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,\n _ref2$startCentered = _ref2.startCentered,\n startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;\n var val = '';\n\n if (startCentered && IS_IE) {\n val += \"translate(\".concat(transform.x / d - width / 2, \"em, \").concat(transform.y / d - height / 2, \"em) \");\n } else if (startCentered) {\n val += \"translate(calc(-50% + \".concat(transform.x / d, \"em), calc(-50% + \").concat(transform.y / d, \"em)) \");\n } else {\n val += \"translate(\".concat(transform.x / d, \"em, \").concat(transform.y / d, \"em) \");\n }\n\n val += \"scale(\".concat(transform.size / d * (transform.flipX ? -1 : 1), \", \").concat(transform.size / d * (transform.flipY ? -1 : 1), \") \");\n val += \"rotate(\".concat(transform.rotate, \"deg) \");\n return val;\n}\n\nvar ALL_SPACE = {\n x: 0,\n y: 0,\n width: '100%',\n height: '100%'\n};\n\nfunction fillBlack(abstract) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (abstract.attributes && (abstract.attributes.fill || force)) {\n abstract.attributes.fill = 'black';\n }\n\n return abstract;\n}\n\nfunction deGroup(abstract) {\n if (abstract.tag === 'g') {\n return abstract.children;\n } else {\n return [abstract];\n }\n}\n\nfunction makeIconMasking (_ref) {\n var children = _ref.children,\n attributes = _ref.attributes,\n main = _ref.main,\n mask = _ref.mask,\n explicitMaskId = _ref.maskId,\n transform = _ref.transform;\n var mainWidth = main.width,\n mainPath = main.icon;\n var maskWidth = mask.width,\n maskPath = mask.icon;\n var trans = transformForSvg({\n transform: transform,\n containerWidth: maskWidth,\n iconWidth: mainWidth\n });\n var maskRect = {\n tag: 'rect',\n attributes: _objectSpread({}, ALL_SPACE, {\n fill: 'white'\n })\n };\n var maskInnerGroupChildrenMixin = mainPath.children ? {\n children: mainPath.children.map(fillBlack)\n } : {};\n var maskInnerGroup = {\n tag: 'g',\n attributes: _objectSpread({}, trans.inner),\n children: [fillBlack(_objectSpread({\n tag: mainPath.tag,\n attributes: _objectSpread({}, mainPath.attributes, trans.path)\n }, maskInnerGroupChildrenMixin))]\n };\n var maskOuterGroup = {\n tag: 'g',\n attributes: _objectSpread({}, trans.outer),\n children: [maskInnerGroup]\n };\n var maskId = \"mask-\".concat(explicitMaskId || nextUniqueId());\n var clipId = \"clip-\".concat(explicitMaskId || nextUniqueId());\n var maskTag = {\n tag: 'mask',\n attributes: _objectSpread({}, ALL_SPACE, {\n id: maskId,\n maskUnits: 'userSpaceOnUse',\n maskContentUnits: 'userSpaceOnUse'\n }),\n children: [maskRect, maskOuterGroup]\n };\n var defs = {\n tag: 'defs',\n children: [{\n tag: 'clipPath',\n attributes: {\n id: clipId\n },\n children: deGroup(maskPath)\n }, maskTag]\n };\n children.push(defs, {\n tag: 'rect',\n attributes: _objectSpread({\n fill: 'currentColor',\n 'clip-path': \"url(#\".concat(clipId, \")\"),\n mask: \"url(#\".concat(maskId, \")\")\n }, ALL_SPACE)\n });\n return {\n children: children,\n attributes: attributes\n };\n}\n\nfunction makeIconStandard (_ref) {\n var children = _ref.children,\n attributes = _ref.attributes,\n main = _ref.main,\n transform = _ref.transform,\n styles = _ref.styles;\n var styleString = joinStyles(styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n if (transformIsMeaningful(transform)) {\n var trans = transformForSvg({\n transform: transform,\n containerWidth: main.width,\n iconWidth: main.width\n });\n children.push({\n tag: 'g',\n attributes: _objectSpread({}, trans.outer),\n children: [{\n tag: 'g',\n attributes: _objectSpread({}, trans.inner),\n children: [{\n tag: main.icon.tag,\n children: main.icon.children,\n attributes: _objectSpread({}, main.icon.attributes, trans.path)\n }]\n }]\n });\n } else {\n children.push(main.icon);\n }\n\n return {\n children: children,\n attributes: attributes\n };\n}\n\nfunction asIcon (_ref) {\n var children = _ref.children,\n main = _ref.main,\n mask = _ref.mask,\n attributes = _ref.attributes,\n styles = _ref.styles,\n transform = _ref.transform;\n\n if (transformIsMeaningful(transform) && main.found && !mask.found) {\n var width = main.width,\n height = main.height;\n var offset = {\n x: width / height / 2,\n y: 0.5\n };\n attributes['style'] = joinStyles(_objectSpread({}, styles, {\n 'transform-origin': \"\".concat(offset.x + transform.x / 16, \"em \").concat(offset.y + transform.y / 16, \"em\")\n }));\n }\n\n return [{\n tag: 'svg',\n attributes: attributes,\n children: children\n }];\n}\n\nfunction asSymbol (_ref) {\n var prefix = _ref.prefix,\n iconName = _ref.iconName,\n children = _ref.children,\n attributes = _ref.attributes,\n symbol = _ref.symbol;\n var id = symbol === true ? \"\".concat(prefix, \"-\").concat(config.familyPrefix, \"-\").concat(iconName) : symbol;\n return [{\n tag: 'svg',\n attributes: {\n style: 'display: none;'\n },\n children: [{\n tag: 'symbol',\n attributes: _objectSpread({}, attributes, {\n id: id\n }),\n children: children\n }]\n }];\n}\n\nfunction makeInlineSvgAbstract(params) {\n var _params$icons = params.icons,\n main = _params$icons.main,\n mask = _params$icons.mask,\n prefix = params.prefix,\n iconName = params.iconName,\n transform = params.transform,\n symbol = params.symbol,\n title = params.title,\n maskId = params.maskId,\n titleId = params.titleId,\n extra = params.extra,\n _params$watchable = params.watchable,\n watchable = _params$watchable === void 0 ? false : _params$watchable;\n\n var _ref = mask.found ? mask : main,\n width = _ref.width,\n height = _ref.height;\n\n var isUploadedIcon = prefix === 'fak';\n var widthClass = isUploadedIcon ? '' : \"fa-w-\".concat(Math.ceil(width / height * 16));\n var attrClass = [config.replacementClass, iconName ? \"\".concat(config.familyPrefix, \"-\").concat(iconName) : '', widthClass].filter(function (c) {\n return extra.classes.indexOf(c) === -1;\n }).filter(function (c) {\n return c !== '' || !!c;\n }).concat(extra.classes).join(' ');\n var content = {\n children: [],\n attributes: _objectSpread({}, extra.attributes, {\n 'data-prefix': prefix,\n 'data-icon': iconName,\n 'class': attrClass,\n 'role': extra.attributes.role || 'img',\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'viewBox': \"0 0 \".concat(width, \" \").concat(height)\n })\n };\n var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {\n width: \"\".concat(width / height * 16 * 0.0625, \"em\")\n } : {};\n\n if (watchable) {\n content.attributes[DATA_FA_I2SVG] = '';\n }\n\n if (title) content.children.push({\n tag: 'title',\n attributes: {\n id: content.attributes['aria-labelledby'] || \"title-\".concat(titleId || nextUniqueId())\n },\n children: [title]\n });\n\n var args = _objectSpread({}, content, {\n prefix: prefix,\n iconName: iconName,\n main: main,\n mask: mask,\n maskId: maskId,\n transform: transform,\n symbol: symbol,\n styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)\n });\n\n var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),\n children = _ref2.children,\n attributes = _ref2.attributes;\n\n args.children = children;\n args.attributes = attributes;\n\n if (symbol) {\n return asSymbol(args);\n } else {\n return asIcon(args);\n }\n}\nfunction makeLayersTextAbstract(params) {\n var content = params.content,\n width = params.width,\n height = params.height,\n transform = params.transform,\n title = params.title,\n extra = params.extra,\n _params$watchable2 = params.watchable,\n watchable = _params$watchable2 === void 0 ? false : _params$watchable2;\n\n var attributes = _objectSpread({}, extra.attributes, title ? {\n 'title': title\n } : {}, {\n 'class': extra.classes.join(' ')\n });\n\n if (watchable) {\n attributes[DATA_FA_I2SVG] = '';\n }\n\n var styles = _objectSpread({}, extra.styles);\n\n if (transformIsMeaningful(transform)) {\n styles['transform'] = transformForCss({\n transform: transform,\n startCentered: true,\n width: width,\n height: height\n });\n styles['-webkit-transform'] = styles['transform'];\n }\n\n var styleString = joinStyles(styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n var val = [];\n val.push({\n tag: 'span',\n attributes: attributes,\n children: [content]\n });\n\n if (title) {\n val.push({\n tag: 'span',\n attributes: {\n class: 'sr-only'\n },\n children: [title]\n });\n }\n\n return val;\n}\nfunction makeLayersCounterAbstract(params) {\n var content = params.content,\n title = params.title,\n extra = params.extra;\n\n var attributes = _objectSpread({}, extra.attributes, title ? {\n 'title': title\n } : {}, {\n 'class': extra.classes.join(' ')\n });\n\n var styleString = joinStyles(extra.styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n var val = [];\n val.push({\n tag: 'span',\n attributes: attributes,\n children: [content]\n });\n\n if (title) {\n val.push({\n tag: 'span',\n attributes: {\n class: 'sr-only'\n },\n children: [title]\n });\n }\n\n return val;\n}\n\nvar noop$1 = function noop() {};\n\nvar p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {\n mark: noop$1,\n measure: noop$1\n};\nvar preamble = \"FA \\\"5.15.3\\\"\";\n\nvar begin = function begin(name) {\n p.mark(\"\".concat(preamble, \" \").concat(name, \" begins\"));\n return function () {\n return end(name);\n };\n};\n\nvar end = function end(name) {\n p.mark(\"\".concat(preamble, \" \").concat(name, \" ends\"));\n p.measure(\"\".concat(preamble, \" \").concat(name), \"\".concat(preamble, \" \").concat(name, \" begins\"), \"\".concat(preamble, \" \").concat(name, \" ends\"));\n};\n\nvar perf = {\n begin: begin,\n end: end\n};\n\n/**\n * Internal helper to bind a function known to have 4 arguments\n * to a given context.\n */\n\nvar bindInternal4 = function bindInternal4(func, thisContext) {\n return function (a, b, c, d) {\n return func.call(thisContext, a, b, c, d);\n };\n};\n\n/**\n * # Reduce\n *\n * A fast object `.reduce()` implementation.\n *\n * @param {Object} subject The object to reduce over.\n * @param {Function} fn The reducer function.\n * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].\n * @param {Object} thisContext The context for the reducer.\n * @return {mixed} The final result.\n */\n\n\nvar reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {\n var keys = Object.keys(subject),\n length = keys.length,\n iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,\n i,\n key,\n result;\n\n if (initialValue === undefined) {\n i = 1;\n result = subject[keys[0]];\n } else {\n i = 0;\n result = initialValue;\n }\n\n for (; i < length; i++) {\n key = keys[i];\n result = iterator(result, subject[key], key, subject);\n }\n\n return result;\n};\n\nfunction toHex(unicode) {\n var result = '';\n\n for (var i = 0; i < unicode.length; i++) {\n var hex = unicode.charCodeAt(i).toString(16);\n result += ('000' + hex).slice(-4);\n }\n\n return result;\n}\n\nfunction defineIcons(prefix, icons) {\n var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var _params$skipHooks = params.skipHooks,\n skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;\n var normalized = Object.keys(icons).reduce(function (acc, iconName) {\n var icon = icons[iconName];\n var expanded = !!icon.icon;\n\n if (expanded) {\n acc[icon.iconName] = icon.icon;\n } else {\n acc[iconName] = icon;\n }\n\n return acc;\n }, {});\n\n if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {\n namespace.hooks.addPack(prefix, normalized);\n } else {\n namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);\n }\n /**\n * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction\n * of new styles we needed to differentiate between them. Prefix `fa` is now an alias\n * for `fas` so we'll easy the upgrade process for our users by automatically defining\n * this as well.\n */\n\n\n if (prefix === 'fas') {\n defineIcons('fa', icons);\n }\n}\n\nvar styles = namespace.styles,\n shims = namespace.shims;\nvar _byUnicode = {};\nvar _byLigature = {};\nvar _byOldName = {};\nvar build = function build() {\n var lookup = function lookup(reducer) {\n return reduce(styles, function (o, style, prefix) {\n o[prefix] = reduce(style, reducer, {});\n return o;\n }, {});\n };\n\n _byUnicode = lookup(function (acc, icon, iconName) {\n if (icon[3]) {\n acc[icon[3]] = iconName;\n }\n\n return acc;\n });\n _byLigature = lookup(function (acc, icon, iconName) {\n var ligatures = icon[2];\n acc[iconName] = iconName;\n ligatures.forEach(function (ligature) {\n acc[ligature] = iconName;\n });\n return acc;\n });\n var hasRegular = 'far' in styles;\n _byOldName = reduce(shims, function (acc, shim) {\n var oldName = shim[0];\n var prefix = shim[1];\n var iconName = shim[2];\n\n if (prefix === 'far' && !hasRegular) {\n prefix = 'fas';\n }\n\n acc[oldName] = {\n prefix: prefix,\n iconName: iconName\n };\n return acc;\n }, {});\n};\nbuild();\nfunction byUnicode(prefix, unicode) {\n return (_byUnicode[prefix] || {})[unicode];\n}\nfunction byLigature(prefix, ligature) {\n return (_byLigature[prefix] || {})[ligature];\n}\nfunction byOldName(name) {\n return _byOldName[name] || {\n prefix: null,\n iconName: null\n };\n}\n\nvar styles$1 = namespace.styles;\nvar emptyCanonicalIcon = function emptyCanonicalIcon() {\n return {\n prefix: null,\n iconName: null,\n rest: []\n };\n};\nfunction getCanonicalIcon(values) {\n return values.reduce(function (acc, cls) {\n var iconName = getIconName(config.familyPrefix, cls);\n\n if (styles$1[cls]) {\n acc.prefix = cls;\n } else if (config.autoFetchSvg && Object.keys(PREFIX_TO_STYLE).indexOf(cls) > -1) {\n acc.prefix = cls;\n } else if (iconName) {\n var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};\n acc.iconName = shim.iconName || iconName;\n acc.prefix = shim.prefix || acc.prefix;\n } else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {\n acc.rest.push(cls);\n }\n\n return acc;\n }, emptyCanonicalIcon());\n}\nfunction iconFromMapping(mapping, prefix, iconName) {\n if (mapping && mapping[prefix] && mapping[prefix][iconName]) {\n return {\n prefix: prefix,\n iconName: iconName,\n icon: mapping[prefix][iconName]\n };\n }\n}\n\nfunction toHtml(abstractNodes) {\n var tag = abstractNodes.tag,\n _abstractNodes$attrib = abstractNodes.attributes,\n attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,\n _abstractNodes$childr = abstractNodes.children,\n children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;\n\n if (typeof abstractNodes === 'string') {\n return htmlEscape(abstractNodes);\n } else {\n return \"<\".concat(tag, \" \").concat(joinAttributes(attributes), \">\").concat(children.map(toHtml).join(''), \"\");\n }\n}\n\nvar noop$2 = function noop() {};\n\nfunction isWatched(node) {\n var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;\n return typeof i2svg === 'string';\n}\n\nfunction getMutator() {\n if (config.autoReplaceSvg === true) {\n return mutators.replace;\n }\n\n var mutator = mutators[config.autoReplaceSvg];\n return mutator || mutators.replace;\n}\n\nvar mutators = {\n replace: function replace(mutation) {\n var node = mutation[0];\n var abstract = mutation[1];\n var newOuterHTML = abstract.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n\n if (node.parentNode && node.outerHTML) {\n node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? \"\") : '');\n } else if (node.parentNode) {\n var newNode = document.createElement('span');\n node.parentNode.replaceChild(newNode, node);\n newNode.outerHTML = newOuterHTML;\n }\n },\n nest: function nest(mutation) {\n var node = mutation[0];\n var abstract = mutation[1]; // If we already have a replaced node we do not want to continue nesting within it.\n // Short-circuit to the standard replacement\n\n if (~classArray(node).indexOf(config.replacementClass)) {\n return mutators.replace(mutation);\n }\n\n var forSvg = new RegExp(\"\".concat(config.familyPrefix, \"-.*\"));\n delete abstract[0].attributes.style;\n delete abstract[0].attributes.id;\n var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {\n if (cls === config.replacementClass || cls.match(forSvg)) {\n acc.toSvg.push(cls);\n } else {\n acc.toNode.push(cls);\n }\n\n return acc;\n }, {\n toNode: [],\n toSvg: []\n });\n abstract[0].attributes.class = splitClasses.toSvg.join(' ');\n var newInnerHTML = abstract.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n node.setAttribute('class', splitClasses.toNode.join(' '));\n node.setAttribute(DATA_FA_I2SVG, '');\n node.innerHTML = newInnerHTML;\n }\n};\n\nfunction performOperationSync(op) {\n op();\n}\n\nfunction perform(mutations, callback) {\n var callbackFunction = typeof callback === 'function' ? callback : noop$2;\n\n if (mutations.length === 0) {\n callbackFunction();\n } else {\n var frame = performOperationSync;\n\n if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {\n frame = WINDOW.requestAnimationFrame || performOperationSync;\n }\n\n frame(function () {\n var mutator = getMutator();\n var mark = perf.begin('mutate');\n mutations.map(mutator);\n mark();\n callbackFunction();\n });\n }\n}\nvar disabled = false;\nfunction disableObservation() {\n disabled = true;\n}\nfunction enableObservation() {\n disabled = false;\n}\nvar mo = null;\nfunction observe(options) {\n if (!MUTATION_OBSERVER) {\n return;\n }\n\n if (!config.observeMutations) {\n return;\n }\n\n var treeCallback = options.treeCallback,\n nodeCallback = options.nodeCallback,\n pseudoElementsCallback = options.pseudoElementsCallback,\n _options$observeMutat = options.observeMutationsRoot,\n observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;\n mo = new MUTATION_OBSERVER(function (objects) {\n if (disabled) return;\n toArray(objects).forEach(function (mutationRecord) {\n if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {\n if (config.searchPseudoElements) {\n pseudoElementsCallback(mutationRecord.target);\n }\n\n treeCallback(mutationRecord.target);\n }\n\n if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {\n pseudoElementsCallback(mutationRecord.target.parentNode);\n }\n\n if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {\n if (mutationRecord.attributeName === 'class') {\n var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),\n prefix = _getCanonicalIcon.prefix,\n iconName = _getCanonicalIcon.iconName;\n\n if (prefix) mutationRecord.target.setAttribute('data-prefix', prefix);\n if (iconName) mutationRecord.target.setAttribute('data-icon', iconName);\n } else {\n nodeCallback(mutationRecord.target);\n }\n }\n });\n });\n if (!IS_DOM) return;\n mo.observe(observeMutationsRoot, {\n childList: true,\n attributes: true,\n characterData: true,\n subtree: true\n });\n}\nfunction disconnect() {\n if (!mo) return;\n mo.disconnect();\n}\n\nfunction styleParser (node) {\n var style = node.getAttribute('style');\n var val = [];\n\n if (style) {\n val = style.split(';').reduce(function (acc, style) {\n var styles = style.split(':');\n var prop = styles[0];\n var value = styles.slice(1);\n\n if (prop && value.length > 0) {\n acc[prop] = value.join(':').trim();\n }\n\n return acc;\n }, {});\n }\n\n return val;\n}\n\nfunction classParser (node) {\n var existingPrefix = node.getAttribute('data-prefix');\n var existingIconName = node.getAttribute('data-icon');\n var innerText = node.innerText !== undefined ? node.innerText.trim() : '';\n var val = getCanonicalIcon(classArray(node));\n\n if (existingPrefix && existingIconName) {\n val.prefix = existingPrefix;\n val.iconName = existingIconName;\n }\n\n if (val.prefix && innerText.length > 1) {\n val.iconName = byLigature(val.prefix, node.innerText);\n } else if (val.prefix && innerText.length === 1) {\n val.iconName = byUnicode(val.prefix, toHex(node.innerText));\n }\n\n return val;\n}\n\nvar parseTransformString = function parseTransformString(transformString) {\n var transform = {\n size: 16,\n x: 0,\n y: 0,\n flipX: false,\n flipY: false,\n rotate: 0\n };\n\n if (!transformString) {\n return transform;\n } else {\n return transformString.toLowerCase().split(' ').reduce(function (acc, n) {\n var parts = n.toLowerCase().split('-');\n var first = parts[0];\n var rest = parts.slice(1).join('-');\n\n if (first && rest === 'h') {\n acc.flipX = true;\n return acc;\n }\n\n if (first && rest === 'v') {\n acc.flipY = true;\n return acc;\n }\n\n rest = parseFloat(rest);\n\n if (isNaN(rest)) {\n return acc;\n }\n\n switch (first) {\n case 'grow':\n acc.size = acc.size + rest;\n break;\n\n case 'shrink':\n acc.size = acc.size - rest;\n break;\n\n case 'left':\n acc.x = acc.x - rest;\n break;\n\n case 'right':\n acc.x = acc.x + rest;\n break;\n\n case 'up':\n acc.y = acc.y - rest;\n break;\n\n case 'down':\n acc.y = acc.y + rest;\n break;\n\n case 'rotate':\n acc.rotate = acc.rotate + rest;\n break;\n }\n\n return acc;\n }, transform);\n }\n};\nfunction transformParser (node) {\n return parseTransformString(node.getAttribute('data-fa-transform'));\n}\n\nfunction symbolParser (node) {\n var symbol = node.getAttribute('data-fa-symbol');\n return symbol === null ? false : symbol === '' ? true : symbol;\n}\n\nfunction attributesParser (node) {\n var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {\n if (acc.name !== 'class' && acc.name !== 'style') {\n acc[attr.name] = attr.value;\n }\n\n return acc;\n }, {});\n var title = node.getAttribute('title');\n var titleId = node.getAttribute('data-fa-title-id');\n\n if (config.autoA11y) {\n if (title) {\n extraAttributes['aria-labelledby'] = \"\".concat(config.replacementClass, \"-title-\").concat(titleId || nextUniqueId());\n } else {\n extraAttributes['aria-hidden'] = 'true';\n extraAttributes['focusable'] = 'false';\n }\n }\n\n return extraAttributes;\n}\n\nfunction maskParser (node) {\n var mask = node.getAttribute('data-fa-mask');\n\n if (!mask) {\n return emptyCanonicalIcon();\n } else {\n return getCanonicalIcon(mask.split(' ').map(function (i) {\n return i.trim();\n }));\n }\n}\n\nfunction blankMeta() {\n return {\n iconName: null,\n title: null,\n titleId: null,\n prefix: null,\n transform: meaninglessTransform,\n symbol: false,\n mask: null,\n maskId: null,\n extra: {\n classes: [],\n styles: {},\n attributes: {}\n }\n };\n}\nfunction parseMeta(node) {\n var _classParser = classParser(node),\n iconName = _classParser.iconName,\n prefix = _classParser.prefix,\n extraClasses = _classParser.rest;\n\n var extraStyles = styleParser(node);\n var transform = transformParser(node);\n var symbol = symbolParser(node);\n var extraAttributes = attributesParser(node);\n var mask = maskParser(node);\n return {\n iconName: iconName,\n title: node.getAttribute('title'),\n titleId: node.getAttribute('data-fa-title-id'),\n prefix: prefix,\n transform: transform,\n symbol: symbol,\n mask: mask,\n maskId: node.getAttribute('data-fa-mask-id'),\n extra: {\n classes: extraClasses,\n styles: extraStyles,\n attributes: extraAttributes\n }\n };\n}\n\nfunction MissingIcon(error) {\n this.name = 'MissingIcon';\n this.message = error || 'Icon unavailable';\n this.stack = new Error().stack;\n}\nMissingIcon.prototype = Object.create(Error.prototype);\nMissingIcon.prototype.constructor = MissingIcon;\n\nvar FILL = {\n fill: 'currentColor'\n};\nvar ANIMATION_BASE = {\n attributeType: 'XML',\n repeatCount: 'indefinite',\n dur: '2s'\n};\nvar RING = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'\n })\n};\n\nvar OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {\n attributeName: 'opacity'\n});\n\nvar DOT = {\n tag: 'circle',\n attributes: _objectSpread({}, FILL, {\n cx: '256',\n cy: '364',\n r: '28'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, ANIMATION_BASE, {\n attributeName: 'r',\n values: '28;14;28;28;14;28;'\n })\n }, {\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '1;0;1;1;0;1;'\n })\n }]\n};\nvar QUESTION = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n opacity: '1',\n d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '1;0;0;0;0;1;'\n })\n }]\n};\nvar EXCLAMATION = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n opacity: '0',\n d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '0;0;1;1;0;0;'\n })\n }]\n};\nvar missing = {\n tag: 'g',\n children: [RING, DOT, QUESTION, EXCLAMATION]\n};\n\nvar styles$2 = namespace.styles;\nfunction asFoundIcon(icon) {\n var width = icon[0];\n var height = icon[1];\n\n var _icon$slice = icon.slice(4),\n _icon$slice2 = _slicedToArray(_icon$slice, 1),\n vectorData = _icon$slice2[0];\n\n var element = null;\n\n if (Array.isArray(vectorData)) {\n element = {\n tag: 'g',\n attributes: {\n class: \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.GROUP)\n },\n children: [{\n tag: 'path',\n attributes: {\n class: \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.SECONDARY),\n fill: 'currentColor',\n d: vectorData[0]\n }\n }, {\n tag: 'path',\n attributes: {\n class: \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.PRIMARY),\n fill: 'currentColor',\n d: vectorData[1]\n }\n }]\n };\n } else {\n element = {\n tag: 'path',\n attributes: {\n fill: 'currentColor',\n d: vectorData\n }\n };\n }\n\n return {\n found: true,\n width: width,\n height: height,\n icon: element\n };\n}\nfunction findIcon(iconName, prefix) {\n return new picked(function (resolve, reject) {\n var val = {\n found: false,\n width: 512,\n height: 512,\n icon: missing\n };\n\n if (iconName && prefix && styles$2[prefix] && styles$2[prefix][iconName]) {\n var icon = styles$2[prefix][iconName];\n return resolve(asFoundIcon(icon));\n }\n\n if (iconName && prefix && !config.showMissingIcons) {\n reject(new MissingIcon(\"Icon is missing for prefix \".concat(prefix, \" with icon name \").concat(iconName)));\n } else {\n resolve(val);\n }\n });\n}\n\nvar styles$3 = namespace.styles;\n\nfunction generateSvgReplacementMutation(node, nodeMeta) {\n var iconName = nodeMeta.iconName,\n title = nodeMeta.title,\n titleId = nodeMeta.titleId,\n prefix = nodeMeta.prefix,\n transform = nodeMeta.transform,\n symbol = nodeMeta.symbol,\n mask = nodeMeta.mask,\n maskId = nodeMeta.maskId,\n extra = nodeMeta.extra;\n return new picked(function (resolve, reject) {\n picked.all([findIcon(iconName, prefix), findIcon(mask.iconName, mask.prefix)]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n main = _ref2[0],\n mask = _ref2[1];\n\n resolve([node, makeInlineSvgAbstract({\n icons: {\n main: main,\n mask: mask\n },\n prefix: prefix,\n iconName: iconName,\n transform: transform,\n symbol: symbol,\n mask: mask,\n maskId: maskId,\n title: title,\n titleId: titleId,\n extra: extra,\n watchable: true\n })]);\n });\n });\n}\n\nfunction generateLayersText(node, nodeMeta) {\n var title = nodeMeta.title,\n transform = nodeMeta.transform,\n extra = nodeMeta.extra;\n var width = null;\n var height = null;\n\n if (IS_IE) {\n var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);\n var boundingClientRect = node.getBoundingClientRect();\n width = boundingClientRect.width / computedFontSize;\n height = boundingClientRect.height / computedFontSize;\n }\n\n if (config.autoA11y && !title) {\n extra.attributes['aria-hidden'] = 'true';\n }\n\n return picked.resolve([node, makeLayersTextAbstract({\n content: node.innerHTML,\n width: width,\n height: height,\n transform: transform,\n title: title,\n extra: extra,\n watchable: true\n })]);\n}\n\nfunction generateMutation(node) {\n var nodeMeta = parseMeta(node);\n\n if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {\n return generateLayersText(node, nodeMeta);\n } else {\n return generateSvgReplacementMutation(node, nodeMeta);\n }\n}\n\nfunction onTree(root) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (!IS_DOM) return;\n var htmlClassList = DOCUMENT.documentElement.classList;\n\n var hclAdd = function hclAdd(suffix) {\n return htmlClassList.add(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n };\n\n var hclRemove = function hclRemove(suffix) {\n return htmlClassList.remove(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n };\n\n var prefixes = config.autoFetchSvg ? Object.keys(PREFIX_TO_STYLE) : Object.keys(styles$3);\n var prefixesDomQuery = [\".\".concat(LAYERS_TEXT_CLASSNAME, \":not([\").concat(DATA_FA_I2SVG, \"])\")].concat(prefixes.map(function (p) {\n return \".\".concat(p, \":not([\").concat(DATA_FA_I2SVG, \"])\");\n })).join(', ');\n\n if (prefixesDomQuery.length === 0) {\n return;\n }\n\n var candidates = [];\n\n try {\n candidates = toArray(root.querySelectorAll(prefixesDomQuery));\n } catch (e) {// noop\n }\n\n if (candidates.length > 0) {\n hclAdd('pending');\n hclRemove('complete');\n } else {\n return;\n }\n\n var mark = perf.begin('onTree');\n var mutations = candidates.reduce(function (acc, node) {\n try {\n var mutation = generateMutation(node);\n\n if (mutation) {\n acc.push(mutation);\n }\n } catch (e) {\n if (!PRODUCTION) {\n if (e instanceof MissingIcon) {\n console.error(e);\n }\n }\n }\n\n return acc;\n }, []);\n return new picked(function (resolve, reject) {\n picked.all(mutations).then(function (resolvedMutations) {\n perform(resolvedMutations, function () {\n hclAdd('active');\n hclAdd('complete');\n hclRemove('pending');\n if (typeof callback === 'function') callback();\n mark();\n resolve();\n });\n }).catch(function () {\n mark();\n reject();\n });\n });\n}\nfunction onNode(node) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n generateMutation(node).then(function (mutation) {\n if (mutation) {\n perform([mutation], callback);\n }\n });\n}\n\nfunction replaceForPosition(node, position) {\n var pendingAttribute = \"\".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));\n return new picked(function (resolve, reject) {\n if (node.getAttribute(pendingAttribute) !== null) {\n // This node is already being processed\n return resolve();\n }\n\n var children = toArray(node.children);\n var alreadyProcessedPseudoElement = children.filter(function (c) {\n return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;\n })[0];\n var styles = WINDOW.getComputedStyle(node, position);\n var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);\n var fontWeight = styles.getPropertyValue('font-weight');\n var content = styles.getPropertyValue('content');\n\n if (alreadyProcessedPseudoElement && !fontFamily) {\n // If we've already processed it but the current computed style does not result in a font-family,\n // that probably means that a class name that was previously present to make the icon has been\n // removed. So we now should delete the icon.\n node.removeChild(alreadyProcessedPseudoElement);\n return resolve();\n } else if (fontFamily && content !== 'none' && content !== '') {\n var _content = styles.getPropertyValue('content');\n\n var prefix = ~['Solid', 'Regular', 'Light', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];\n var hexValue = toHex(_content.length === 3 ? _content.substr(1, 1) : _content);\n var iconName = byUnicode(prefix, hexValue);\n var iconIdentifier = iconName; // Only convert the pseudo element in this :before/:after position into an icon if we haven't\n // already done so with the same prefix and iconName\n\n if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {\n node.setAttribute(pendingAttribute, iconIdentifier);\n\n if (alreadyProcessedPseudoElement) {\n // Delete the old one, since we're replacing it with a new one\n node.removeChild(alreadyProcessedPseudoElement);\n }\n\n var meta = blankMeta();\n var extra = meta.extra;\n extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;\n findIcon(iconName, prefix).then(function (main) {\n var abstract = makeInlineSvgAbstract(_objectSpread({}, meta, {\n icons: {\n main: main,\n mask: emptyCanonicalIcon()\n },\n prefix: prefix,\n iconName: iconIdentifier,\n extra: extra,\n watchable: true\n }));\n var element = DOCUMENT.createElement('svg');\n\n if (position === ':before') {\n node.insertBefore(element, node.firstChild);\n } else {\n node.appendChild(element);\n }\n\n element.outerHTML = abstract.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n node.removeAttribute(pendingAttribute);\n resolve();\n }).catch(reject);\n } else {\n resolve();\n }\n } else {\n resolve();\n }\n });\n}\n\nfunction replace(node) {\n return picked.all([replaceForPosition(node, ':before'), replaceForPosition(node, ':after')]);\n}\n\nfunction processable(node) {\n return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');\n}\n\nfunction searchPseudoElements (root) {\n if (!IS_DOM) return;\n return new picked(function (resolve, reject) {\n var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);\n var end = perf.begin('searchPseudoElements');\n disableObservation();\n picked.all(operations).then(function () {\n end();\n enableObservation();\n resolve();\n }).catch(function () {\n end();\n enableObservation();\n reject();\n });\n });\n}\n\nvar baseStyles = \"svg:not(:root).svg-inline--fa {\\n overflow: visible;\\n}\\n\\n.svg-inline--fa {\\n display: inline-block;\\n font-size: inherit;\\n height: 1em;\\n overflow: visible;\\n vertical-align: -0.125em;\\n}\\n.svg-inline--fa.fa-lg {\\n vertical-align: -0.225em;\\n}\\n.svg-inline--fa.fa-w-1 {\\n width: 0.0625em;\\n}\\n.svg-inline--fa.fa-w-2 {\\n width: 0.125em;\\n}\\n.svg-inline--fa.fa-w-3 {\\n width: 0.1875em;\\n}\\n.svg-inline--fa.fa-w-4 {\\n width: 0.25em;\\n}\\n.svg-inline--fa.fa-w-5 {\\n width: 0.3125em;\\n}\\n.svg-inline--fa.fa-w-6 {\\n width: 0.375em;\\n}\\n.svg-inline--fa.fa-w-7 {\\n width: 0.4375em;\\n}\\n.svg-inline--fa.fa-w-8 {\\n width: 0.5em;\\n}\\n.svg-inline--fa.fa-w-9 {\\n width: 0.5625em;\\n}\\n.svg-inline--fa.fa-w-10 {\\n width: 0.625em;\\n}\\n.svg-inline--fa.fa-w-11 {\\n width: 0.6875em;\\n}\\n.svg-inline--fa.fa-w-12 {\\n width: 0.75em;\\n}\\n.svg-inline--fa.fa-w-13 {\\n width: 0.8125em;\\n}\\n.svg-inline--fa.fa-w-14 {\\n width: 0.875em;\\n}\\n.svg-inline--fa.fa-w-15 {\\n width: 0.9375em;\\n}\\n.svg-inline--fa.fa-w-16 {\\n width: 1em;\\n}\\n.svg-inline--fa.fa-w-17 {\\n width: 1.0625em;\\n}\\n.svg-inline--fa.fa-w-18 {\\n width: 1.125em;\\n}\\n.svg-inline--fa.fa-w-19 {\\n width: 1.1875em;\\n}\\n.svg-inline--fa.fa-w-20 {\\n width: 1.25em;\\n}\\n.svg-inline--fa.fa-pull-left {\\n margin-right: 0.3em;\\n width: auto;\\n}\\n.svg-inline--fa.fa-pull-right {\\n margin-left: 0.3em;\\n width: auto;\\n}\\n.svg-inline--fa.fa-border {\\n height: 1.5em;\\n}\\n.svg-inline--fa.fa-li {\\n width: 2em;\\n}\\n.svg-inline--fa.fa-fw {\\n width: 1.25em;\\n}\\n\\n.fa-layers svg.svg-inline--fa {\\n bottom: 0;\\n left: 0;\\n margin: auto;\\n position: absolute;\\n right: 0;\\n top: 0;\\n}\\n\\n.fa-layers {\\n display: inline-block;\\n height: 1em;\\n position: relative;\\n text-align: center;\\n vertical-align: -0.125em;\\n width: 1em;\\n}\\n.fa-layers svg.svg-inline--fa {\\n -webkit-transform-origin: center center;\\n transform-origin: center center;\\n}\\n\\n.fa-layers-counter, .fa-layers-text {\\n display: inline-block;\\n position: absolute;\\n text-align: center;\\n}\\n\\n.fa-layers-text {\\n left: 50%;\\n top: 50%;\\n -webkit-transform: translate(-50%, -50%);\\n transform: translate(-50%, -50%);\\n -webkit-transform-origin: center center;\\n transform-origin: center center;\\n}\\n\\n.fa-layers-counter {\\n background-color: #ff253a;\\n border-radius: 1em;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n color: #fff;\\n height: 1.5em;\\n line-height: 1;\\n max-width: 5em;\\n min-width: 1.5em;\\n overflow: hidden;\\n padding: 0.25em;\\n right: 0;\\n text-overflow: ellipsis;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top right;\\n transform-origin: top right;\\n}\\n\\n.fa-layers-bottom-right {\\n bottom: 0;\\n right: 0;\\n top: auto;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: bottom right;\\n transform-origin: bottom right;\\n}\\n\\n.fa-layers-bottom-left {\\n bottom: 0;\\n left: 0;\\n right: auto;\\n top: auto;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: bottom left;\\n transform-origin: bottom left;\\n}\\n\\n.fa-layers-top-right {\\n right: 0;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top right;\\n transform-origin: top right;\\n}\\n\\n.fa-layers-top-left {\\n left: 0;\\n right: auto;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top left;\\n transform-origin: top left;\\n}\\n\\n.fa-lg {\\n font-size: 1.3333333333em;\\n line-height: 0.75em;\\n vertical-align: -0.0667em;\\n}\\n\\n.fa-xs {\\n font-size: 0.75em;\\n}\\n\\n.fa-sm {\\n font-size: 0.875em;\\n}\\n\\n.fa-1x {\\n font-size: 1em;\\n}\\n\\n.fa-2x {\\n font-size: 2em;\\n}\\n\\n.fa-3x {\\n font-size: 3em;\\n}\\n\\n.fa-4x {\\n font-size: 4em;\\n}\\n\\n.fa-5x {\\n font-size: 5em;\\n}\\n\\n.fa-6x {\\n font-size: 6em;\\n}\\n\\n.fa-7x {\\n font-size: 7em;\\n}\\n\\n.fa-8x {\\n font-size: 8em;\\n}\\n\\n.fa-9x {\\n font-size: 9em;\\n}\\n\\n.fa-10x {\\n font-size: 10em;\\n}\\n\\n.fa-fw {\\n text-align: center;\\n width: 1.25em;\\n}\\n\\n.fa-ul {\\n list-style-type: none;\\n margin-left: 2.5em;\\n padding-left: 0;\\n}\\n.fa-ul > li {\\n position: relative;\\n}\\n\\n.fa-li {\\n left: -2em;\\n position: absolute;\\n text-align: center;\\n width: 2em;\\n line-height: inherit;\\n}\\n\\n.fa-border {\\n border: solid 0.08em #eee;\\n border-radius: 0.1em;\\n padding: 0.2em 0.25em 0.15em;\\n}\\n\\n.fa-pull-left {\\n float: left;\\n}\\n\\n.fa-pull-right {\\n float: right;\\n}\\n\\n.fa.fa-pull-left,\\n.fas.fa-pull-left,\\n.far.fa-pull-left,\\n.fal.fa-pull-left,\\n.fab.fa-pull-left {\\n margin-right: 0.3em;\\n}\\n.fa.fa-pull-right,\\n.fas.fa-pull-right,\\n.far.fa-pull-right,\\n.fal.fa-pull-right,\\n.fab.fa-pull-right {\\n margin-left: 0.3em;\\n}\\n\\n.fa-spin {\\n -webkit-animation: fa-spin 2s infinite linear;\\n animation: fa-spin 2s infinite linear;\\n}\\n\\n.fa-pulse {\\n -webkit-animation: fa-spin 1s infinite steps(8);\\n animation: fa-spin 1s infinite steps(8);\\n}\\n\\n@-webkit-keyframes fa-spin {\\n 0% {\\n -webkit-transform: rotate(0deg);\\n transform: rotate(0deg);\\n }\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\\n@keyframes fa-spin {\\n 0% {\\n -webkit-transform: rotate(0deg);\\n transform: rotate(0deg);\\n }\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n.fa-rotate-90 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)\\\";\\n -webkit-transform: rotate(90deg);\\n transform: rotate(90deg);\\n}\\n\\n.fa-rotate-180 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)\\\";\\n -webkit-transform: rotate(180deg);\\n transform: rotate(180deg);\\n}\\n\\n.fa-rotate-270 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)\\\";\\n -webkit-transform: rotate(270deg);\\n transform: rotate(270deg);\\n}\\n\\n.fa-flip-horizontal {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)\\\";\\n -webkit-transform: scale(-1, 1);\\n transform: scale(-1, 1);\\n}\\n\\n.fa-flip-vertical {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\\\";\\n -webkit-transform: scale(1, -1);\\n transform: scale(1, -1);\\n}\\n\\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\\\";\\n -webkit-transform: scale(-1, -1);\\n transform: scale(-1, -1);\\n}\\n\\n:root .fa-rotate-90,\\n:root .fa-rotate-180,\\n:root .fa-rotate-270,\\n:root .fa-flip-horizontal,\\n:root .fa-flip-vertical,\\n:root .fa-flip-both {\\n -webkit-filter: none;\\n filter: none;\\n}\\n\\n.fa-stack {\\n display: inline-block;\\n height: 2em;\\n position: relative;\\n width: 2.5em;\\n}\\n\\n.fa-stack-1x,\\n.fa-stack-2x {\\n bottom: 0;\\n left: 0;\\n margin: auto;\\n position: absolute;\\n right: 0;\\n top: 0;\\n}\\n\\n.svg-inline--fa.fa-stack-1x {\\n height: 1em;\\n width: 1.25em;\\n}\\n.svg-inline--fa.fa-stack-2x {\\n height: 2em;\\n width: 2.5em;\\n}\\n\\n.fa-inverse {\\n color: #fff;\\n}\\n\\n.sr-only {\\n border: 0;\\n clip: rect(0, 0, 0, 0);\\n height: 1px;\\n margin: -1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px;\\n}\\n\\n.sr-only-focusable:active, .sr-only-focusable:focus {\\n clip: auto;\\n height: auto;\\n margin: 0;\\n overflow: visible;\\n position: static;\\n width: auto;\\n}\\n\\n.svg-inline--fa .fa-primary {\\n fill: var(--fa-primary-color, currentColor);\\n opacity: 1;\\n opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa .fa-secondary {\\n fill: var(--fa-secondary-color, currentColor);\\n opacity: 0.4;\\n opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-primary {\\n opacity: 0.4;\\n opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\\n opacity: 1;\\n opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa mask .fa-primary,\\n.svg-inline--fa mask .fa-secondary {\\n fill: black;\\n}\\n\\n.fad.fa-inverse {\\n color: #fff;\\n}\";\n\nfunction css () {\n var dfp = DEFAULT_FAMILY_PREFIX;\n var drc = DEFAULT_REPLACEMENT_CLASS;\n var fp = config.familyPrefix;\n var rc = config.replacementClass;\n var s = baseStyles;\n\n if (fp !== dfp || rc !== drc) {\n var dPatt = new RegExp(\"\\\\.\".concat(dfp, \"\\\\-\"), 'g');\n var customPropPatt = new RegExp(\"\\\\--\".concat(dfp, \"\\\\-\"), 'g');\n var rPatt = new RegExp(\"\\\\.\".concat(drc), 'g');\n s = s.replace(dPatt, \".\".concat(fp, \"-\")).replace(customPropPatt, \"--\".concat(fp, \"-\")).replace(rPatt, \".\".concat(rc));\n }\n\n return s;\n}\n\nvar Library =\n/*#__PURE__*/\nfunction () {\n function Library() {\n _classCallCheck(this, Library);\n\n this.definitions = {};\n }\n\n _createClass(Library, [{\n key: \"add\",\n value: function add() {\n var _this = this;\n\n for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {\n definitions[_key] = arguments[_key];\n }\n\n var additions = definitions.reduce(this._pullDefinitions, {});\n Object.keys(additions).forEach(function (key) {\n _this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);\n defineIcons(key, additions[key]);\n build();\n });\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.definitions = {};\n }\n }, {\n key: \"_pullDefinitions\",\n value: function _pullDefinitions(additions, definition) {\n var normalized = definition.prefix && definition.iconName && definition.icon ? {\n 0: definition\n } : definition;\n Object.keys(normalized).map(function (key) {\n var _normalized$key = normalized[key],\n prefix = _normalized$key.prefix,\n iconName = _normalized$key.iconName,\n icon = _normalized$key.icon;\n if (!additions[prefix]) additions[prefix] = {};\n additions[prefix][iconName] = icon;\n });\n return additions;\n }\n }]);\n\n return Library;\n}();\n\nfunction ensureCss() {\n if (config.autoAddCss && !_cssInserted) {\n insertCss(css());\n\n _cssInserted = true;\n }\n}\n\nfunction apiObject(val, abstractCreator) {\n Object.defineProperty(val, 'abstract', {\n get: abstractCreator\n });\n Object.defineProperty(val, 'html', {\n get: function get() {\n return val.abstract.map(function (a) {\n return toHtml(a);\n });\n }\n });\n Object.defineProperty(val, 'node', {\n get: function get() {\n if (!IS_DOM) return;\n var container = DOCUMENT.createElement('div');\n container.innerHTML = val.html;\n return container.children;\n }\n });\n return val;\n}\n\nfunction findIconDefinition(iconLookup) {\n var _iconLookup$prefix = iconLookup.prefix,\n prefix = _iconLookup$prefix === void 0 ? 'fa' : _iconLookup$prefix,\n iconName = iconLookup.iconName;\n if (!iconName) return;\n return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);\n}\n\nfunction resolveIcons(next) {\n return function (maybeIconDefinition) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});\n var mask = params.mask;\n\n if (mask) {\n mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});\n }\n\n return next(iconDefinition, _objectSpread({}, params, {\n mask: mask\n }));\n };\n}\n\nvar library = new Library();\nvar noAuto = function noAuto() {\n config.autoReplaceSvg = false;\n config.observeMutations = false;\n disconnect();\n};\nvar _cssInserted = false;\nvar dom = {\n i2svg: function i2svg() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (IS_DOM) {\n ensureCss();\n var _params$node = params.node,\n node = _params$node === void 0 ? DOCUMENT : _params$node,\n _params$callback = params.callback,\n callback = _params$callback === void 0 ? function () {} : _params$callback;\n\n if (config.searchPseudoElements) {\n searchPseudoElements(node);\n }\n\n return onTree(node, callback);\n } else {\n return picked.reject('Operation requires a DOM of some kind.');\n }\n },\n css: css,\n insertCss: function insertCss$$1() {\n if (!_cssInserted) {\n insertCss(css());\n\n _cssInserted = true;\n }\n },\n watch: function watch() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var autoReplaceSvgRoot = params.autoReplaceSvgRoot,\n observeMutationsRoot = params.observeMutationsRoot;\n\n if (config.autoReplaceSvg === false) {\n config.autoReplaceSvg = true;\n }\n\n config.observeMutations = true;\n domready(function () {\n autoReplace({\n autoReplaceSvgRoot: autoReplaceSvgRoot\n });\n observe({\n treeCallback: onTree,\n nodeCallback: onNode,\n pseudoElementsCallback: searchPseudoElements,\n observeMutationsRoot: observeMutationsRoot\n });\n });\n }\n};\nvar parse = {\n transform: function transform(transformString) {\n return parseTransformString(transformString);\n }\n};\nvar icon = resolveIcons(function (iconDefinition) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$transform = params.transform,\n transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,\n _params$symbol = params.symbol,\n symbol = _params$symbol === void 0 ? false : _params$symbol,\n _params$mask = params.mask,\n mask = _params$mask === void 0 ? null : _params$mask,\n _params$maskId = params.maskId,\n maskId = _params$maskId === void 0 ? null : _params$maskId,\n _params$title = params.title,\n title = _params$title === void 0 ? null : _params$title,\n _params$titleId = params.titleId,\n titleId = _params$titleId === void 0 ? null : _params$titleId,\n _params$classes = params.classes,\n classes = _params$classes === void 0 ? [] : _params$classes,\n _params$attributes = params.attributes,\n attributes = _params$attributes === void 0 ? {} : _params$attributes,\n _params$styles = params.styles,\n styles = _params$styles === void 0 ? {} : _params$styles;\n if (!iconDefinition) return;\n var prefix = iconDefinition.prefix,\n iconName = iconDefinition.iconName,\n icon = iconDefinition.icon;\n return apiObject(_objectSpread({\n type: 'icon'\n }, iconDefinition), function () {\n ensureCss();\n\n if (config.autoA11y) {\n if (title) {\n attributes['aria-labelledby'] = \"\".concat(config.replacementClass, \"-title-\").concat(titleId || nextUniqueId());\n } else {\n attributes['aria-hidden'] = 'true';\n attributes['focusable'] = 'false';\n }\n }\n\n return makeInlineSvgAbstract({\n icons: {\n main: asFoundIcon(icon),\n mask: mask ? asFoundIcon(mask.icon) : {\n found: false,\n width: null,\n height: null,\n icon: {}\n }\n },\n prefix: prefix,\n iconName: iconName,\n transform: _objectSpread({}, meaninglessTransform, transform),\n symbol: symbol,\n title: title,\n maskId: maskId,\n titleId: titleId,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: classes\n }\n });\n });\n});\nvar text = function text(content) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$transform2 = params.transform,\n transform = _params$transform2 === void 0 ? meaninglessTransform : _params$transform2,\n _params$title2 = params.title,\n title = _params$title2 === void 0 ? null : _params$title2,\n _params$classes2 = params.classes,\n classes = _params$classes2 === void 0 ? [] : _params$classes2,\n _params$attributes2 = params.attributes,\n attributes = _params$attributes2 === void 0 ? {} : _params$attributes2,\n _params$styles2 = params.styles,\n styles = _params$styles2 === void 0 ? {} : _params$styles2;\n return apiObject({\n type: 'text',\n content: content\n }, function () {\n ensureCss();\n return makeLayersTextAbstract({\n content: content,\n transform: _objectSpread({}, meaninglessTransform, transform),\n title: title,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: [\"\".concat(config.familyPrefix, \"-layers-text\")].concat(_toConsumableArray(classes))\n }\n });\n });\n};\nvar counter = function counter(content) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$title3 = params.title,\n title = _params$title3 === void 0 ? null : _params$title3,\n _params$classes3 = params.classes,\n classes = _params$classes3 === void 0 ? [] : _params$classes3,\n _params$attributes3 = params.attributes,\n attributes = _params$attributes3 === void 0 ? {} : _params$attributes3,\n _params$styles3 = params.styles,\n styles = _params$styles3 === void 0 ? {} : _params$styles3;\n return apiObject({\n type: 'counter',\n content: content\n }, function () {\n ensureCss();\n return makeLayersCounterAbstract({\n content: content.toString(),\n title: title,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: [\"\".concat(config.familyPrefix, \"-layers-counter\")].concat(_toConsumableArray(classes))\n }\n });\n });\n};\nvar layer = function layer(assembler) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$classes4 = params.classes,\n classes = _params$classes4 === void 0 ? [] : _params$classes4;\n return apiObject({\n type: 'layer'\n }, function () {\n ensureCss();\n var children = [];\n assembler(function (args) {\n Array.isArray(args) ? args.map(function (a) {\n children = children.concat(a.abstract);\n }) : children = children.concat(args.abstract);\n });\n return [{\n tag: 'span',\n attributes: {\n class: [\"\".concat(config.familyPrefix, \"-layers\")].concat(_toConsumableArray(classes)).join(' ')\n },\n children: children\n }];\n });\n};\nvar api = {\n noAuto: noAuto,\n config: config,\n dom: dom,\n library: library,\n parse: parse,\n findIconDefinition: findIconDefinition,\n icon: icon,\n text: text,\n counter: counter,\n layer: layer,\n toHtml: toHtml\n};\n\nvar autoReplace = function autoReplace() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _params$autoReplaceSv = params.autoReplaceSvgRoot,\n autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;\n if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({\n node: autoReplaceSvgRoot\n });\n};\n\nexport { icon, noAuto, config, toHtml, layer, text, counter, library, dom, parse, findIconDefinition };\n","import { parse, icon } from '@fortawesome/fontawesome-svg-core';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\n// Get CSS class list from a props object\nfunction classList(props) {\n var _classes;\n\n var spin = props.spin,\n pulse = props.pulse,\n fixedWidth = props.fixedWidth,\n inverse = props.inverse,\n border = props.border,\n listItem = props.listItem,\n flip = props.flip,\n size = props.size,\n rotation = props.rotation,\n pull = props.pull; // map of CSS class names to properties\n\n var classes = (_classes = {\n 'fa-spin': spin,\n 'fa-pulse': pulse,\n 'fa-fw': fixedWidth,\n 'fa-inverse': inverse,\n 'fa-border': border,\n 'fa-li': listItem,\n 'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',\n 'fa-flip-vertical': flip === 'vertical' || flip === 'both'\n }, _defineProperty(_classes, \"fa-\".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty(_classes, \"fa-rotate-\".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), _defineProperty(_classes, \"fa-pull-\".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object\n // return an array of the keys where the value for the key is not null\n\n return Object.keys(classes).map(function (key) {\n return classes[key] ? key : null;\n }).filter(function (key) {\n return key;\n });\n}\n\n// Camelize taken from humps\n// humps is copyright © 2012+ Dom Christie\n// Released under the MIT license.\n// Performant way to determine if object coerces to a number\nfunction _isNumerical(obj) {\n obj = obj - 0; // eslint-disable-next-line no-self-compare\n\n return obj === obj;\n}\n\nfunction camelize(string) {\n if (_isNumerical(string)) {\n return string;\n } // eslint-disable-next-line no-useless-escape\n\n\n string = string.replace(/[\\-_\\s]+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n }); // Ensure 1st char is always lowercase\n\n return string.substr(0, 1).toLowerCase() + string.substr(1);\n}\n\nfunction capitalize(val) {\n return val.charAt(0).toUpperCase() + val.slice(1);\n}\n\nfunction styleToObject(style) {\n return style.split(';').map(function (s) {\n return s.trim();\n }).filter(function (s) {\n return s;\n }).reduce(function (acc, pair) {\n var i = pair.indexOf(':');\n var prop = camelize(pair.slice(0, i));\n var value = pair.slice(i + 1).trim();\n prop.startsWith('webkit') ? acc[capitalize(prop)] = value : acc[prop] = value;\n return acc;\n }, {});\n}\n\nfunction convert(createElement, element) {\n var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (typeof element === 'string') {\n return element;\n }\n\n var children = (element.children || []).map(function (child) {\n return convert(createElement, child);\n });\n /* eslint-disable dot-notation */\n\n var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {\n var val = element.attributes[key];\n\n switch (key) {\n case 'class':\n acc.attrs['className'] = val;\n delete element.attributes['class'];\n break;\n\n case 'style':\n acc.attrs['style'] = styleToObject(val);\n break;\n\n default:\n if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0) {\n acc.attrs[key.toLowerCase()] = val;\n } else {\n acc.attrs[camelize(key)] = val;\n }\n\n }\n\n return acc;\n }, {\n attrs: {}\n });\n\n var _extraProps$style = extraProps.style,\n existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,\n remaining = _objectWithoutProperties(extraProps, [\"style\"]);\n\n mixins.attrs['style'] = _objectSpread2({}, mixins.attrs['style'], {}, existingStyle);\n /* eslint-enable */\n\n return createElement.apply(void 0, [element.tag, _objectSpread2({}, mixins.attrs, {}, remaining)].concat(_toConsumableArray(children)));\n}\n\nvar PRODUCTION = false;\n\ntry {\n PRODUCTION = process.env.NODE_ENV === 'production';\n} catch (e) {}\n\nfunction log () {\n if (!PRODUCTION && console && typeof console.error === 'function') {\n var _console;\n\n (_console = console).error.apply(_console, arguments);\n }\n}\n\nfunction normalizeIconArgs(icon) {\n if (parse.icon) {\n return parse.icon(icon);\n } // if the icon is null, there's nothing to do\n\n\n if (icon === null) {\n return null;\n } // if the icon is an object and has a prefix and an icon name, return it\n\n\n if (_typeof(icon) === 'object' && icon.prefix && icon.iconName) {\n return icon;\n } // if it's an array with length of two\n\n\n if (Array.isArray(icon) && icon.length === 2) {\n // use the first item as prefix, second as icon name\n return {\n prefix: icon[0],\n iconName: icon[1]\n };\n } // if it's a string, use it as the icon name\n\n\n if (typeof icon === 'string') {\n return {\n prefix: 'fas',\n iconName: icon\n };\n }\n}\n\n// creates an object with a key of key\n// and a value of value\n// if certain conditions are met\nfunction objectWithKey(key, value) {\n // if the value is a non-empty array\n // or it's not an array but it is truthy\n // then create the object with the key and the value\n // if not, return an empty array\n return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};\n}\n\nfunction FontAwesomeIcon(_ref) {\n var forwardedRef = _ref.forwardedRef,\n props = _objectWithoutProperties(_ref, [\"forwardedRef\"]);\n\n var iconArgs = props.icon,\n maskArgs = props.mask,\n symbol = props.symbol,\n className = props.className,\n title = props.title,\n titleId = props.titleId;\n var iconLookup = normalizeIconArgs(iconArgs);\n var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));\n var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);\n var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));\n var renderedIcon = icon(iconLookup, _objectSpread2({}, classes, {}, transform, {}, mask, {\n symbol: symbol,\n title: title,\n titleId: titleId\n }));\n\n if (!renderedIcon) {\n log('Could not find icon', iconLookup);\n return null;\n }\n\n var abstract = renderedIcon.abstract;\n var extraProps = {\n ref: forwardedRef\n };\n Object.keys(props).forEach(function (key) {\n // eslint-disable-next-line no-prototype-builtins\n if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {\n extraProps[key] = props[key];\n }\n });\n return convertCurry(abstract[0], extraProps);\n}\nFontAwesomeIcon.displayName = 'FontAwesomeIcon';\nFontAwesomeIcon.propTypes = {\n border: PropTypes.bool,\n className: PropTypes.string,\n mask: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),\n fixedWidth: PropTypes.bool,\n inverse: PropTypes.bool,\n flip: PropTypes.oneOf(['horizontal', 'vertical', 'both']),\n icon: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),\n listItem: PropTypes.bool,\n pull: PropTypes.oneOf(['right', 'left']),\n pulse: PropTypes.bool,\n rotation: PropTypes.oneOf([0, 90, 180, 270]),\n size: PropTypes.oneOf(['lg', 'xs', 'sm', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),\n spin: PropTypes.bool,\n symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n title: PropTypes.string,\n transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n swapOpacity: PropTypes.bool\n};\nFontAwesomeIcon.defaultProps = {\n border: false,\n className: '',\n mask: null,\n fixedWidth: false,\n inverse: false,\n flip: null,\n icon: null,\n listItem: false,\n pull: null,\n pulse: false,\n rotation: null,\n size: null,\n spin: false,\n symbol: false,\n title: '',\n transform: null,\n swapOpacity: false\n};\nvar convertCurry = convert.bind(null, React.createElement);\n\nexport { FontAwesomeIcon };\n","/**\n * Simple mapper from Neos Icon names to Fontawesome 5 icon classes.\n */\n// TODO: create type for this, so we can have autocompletion\n// alternatively just use IconName or even better IconLookup (has IconPrefix & IconName) of FontAwesome typings\nconst map: {readonly [key: string]: string} = {\n 'address-book-o': 'far fa-address-book',\n 'address-card-o': 'far fa-address-card',\n 'area-chart': 'fas fa-chart-area',\n 'arrow-circle-o-down': 'far fa-arrow-alt-circle-down',\n 'arrow-circle-o-left': 'far fa-arrow-alt-circle-left',\n 'arrow-circle-o-right': 'far fa-arrow-alt-circle-right',\n 'arrow-circle-o-up': 'far fa-arrow-alt-circle-up',\n 'arrows': 'fas fa-arrows-alt',\n 'arrows-alt': 'fas fa-expand-arrows-alt',\n 'arrows-h': 'fas fa-arrows-alt-h',\n 'arrows-v': 'fas fa-arrows-alt-v',\n 'asl-interpreting': 'fas fa-american-sign-language-interpreting',\n 'automobile': 'fas fa-car',\n 'bank': 'fas fa-university',\n 'bar-chart': 'far fa-chart-bar',\n 'bar-chart-o': 'far fa-chart-bar',\n 'bathtub': 'fas fa-bath',\n 'battery': 'fas fa-battery-full',\n 'battery-0': 'fas fa-battery-empty',\n 'battery-1': 'fas fa-battery-quarter',\n 'battery-2': 'fas fa-battery-half',\n 'battery-3': 'fas fa-battery-three-quarters',\n 'battery-4': 'fas fa-battery-full',\n 'bell-o': 'far fa-bell',\n 'bell-slash-o': 'far fa-bell-slash',\n 'bitbucket-square': 'fab fa-bitbucket',\n 'bitcoin': 'fab fa-btc',\n 'bookmark-o': 'far fa-bookmark',\n 'building-o': 'far fa-building',\n 'cab': 'fas fa-taxi',\n 'calendar': 'fas fa-calendar-alt',\n 'calendar-check-o': 'far fa-calendar-check',\n 'calendar-empty': 'far fa-calendar',\n 'calendar-minus-o': 'far fa-calendar-minus',\n 'calendar-o': 'far fa-calendar',\n 'calendar-plus-o': 'far fa-calendar-plus',\n 'calendar-times-o': 'far fa-calendar-times',\n 'caret-square-o-down': 'far fa-caret-square-down',\n 'caret-square-o-left': 'far fa-caret-square-left',\n 'caret-square-o-right': 'far fa-caret-square-right',\n 'caret-square-o-up': 'far fa-caret-square-up',\n 'cc': 'far fa-closed-captioning',\n 'chain': 'fas fa-link',\n 'chain-broken': 'fas fa-unlink',\n 'check-circle-o': 'far fa-check-circle',\n 'check-square-o': 'far fa-check-square',\n 'circle-o': 'far fa-circle',\n 'circle-o-notch': 'fas fa-circle-notch',\n 'circle-thin': 'far fa-circle',\n 'clock-o': 'far fa-clock',\n 'close': 'fas fa-times',\n 'cloud-download': 'fas fa-cloud-download-alt',\n 'cloud-upload': 'fas fa-cloud-upload-alt',\n 'cny': 'fas fa-yen-sign',\n 'code-fork': 'fas fa-code-branch',\n 'comment-o': 'far fa-comment',\n 'commenting': 'fas fa-comment-alt',\n 'commenting-o': 'far fa-comment-alt',\n 'comments-o': 'far fa-comments',\n 'copy': 'far fa-copy',\n 'credit-card-alt': 'fas fa-credit-card',\n 'cutlery': 'fas fa-utensils',\n 'dashboard': 'fas fa-tachometer-alt',\n 'deafness': 'fas fa-deaf',\n 'dedent': 'fas fa-outdent',\n 'diamond': 'far fa-gem',\n 'dollar': 'fas fa-dollar-sign',\n 'dot-circle-o': 'far fa-dot-circle',\n 'drivers-license': 'fas fa-id-card',\n 'drivers-license-o': 'far fa-id-card',\n 'eercast': 'fab fa-sellcast',\n 'envelope-alt': 'far fa-envelope',\n 'envelope-o': 'far fa-envelope',\n 'envelope-open-o': 'far fa-envelope-open',\n 'eur': 'fas fa-euro-sign',\n 'euro': 'fas fa-euro-sign',\n 'exchange': 'fas fa-exchange-alt',\n 'external-link': 'fas fa-external-link-alt',\n 'external-link-square': 'fas fa-external-link-square-alt',\n 'eyedropper': 'fas fa-eye-dropper',\n 'fa': 'fab fa-font-awesome',\n 'facebook': 'fab fa-facebook-f',\n 'facebook-f': 'fab fa-facebook-f',\n 'facebook-official': 'fab fa-facebook',\n 'feed': 'fas fa-rss',\n 'file-archive-o': 'far fa-file-archive',\n 'file-audio-o': 'far fa-file-audio',\n 'file-code-o': 'far fa-file-code',\n 'file-excel-o': 'far fa-file-excel',\n 'file-image-o': 'far fa-file-image',\n 'file-movie-o': 'far fa-file-video',\n 'file-o': 'far fa-file',\n 'file-pdf-o': 'far fa-file-pdf',\n 'file-photo-o': 'far fa-file-image',\n 'file-picture-o': 'far fa-file-image',\n 'file-powerpoint-o': 'far fa-file-powerpoint',\n 'file-sound-o': 'far fa-file-audio',\n 'file-text': 'fas fa-file-alt',\n 'file-text-o': 'far fa-file-alt',\n 'file-video-o': 'far fa-file-video',\n 'file-word-o': 'far fa-file-word',\n 'file-zip-o': 'far fa-file-archive',\n 'files-o': 'far fa-copy',\n 'flag-alt': 'far fa-flag',\n 'flag-o': 'far fa-flag',\n 'flash': 'fas fa-bolt',\n 'floppy-o': 'far fa-save',\n 'folder-o': 'far fa-folder',\n 'folder-open-alt': 'far fa-folder-open',\n 'folder-open-o': 'far fa-folder-open',\n 'frown-o': 'far fa-frown',\n 'futbol-o': 'far fa-futbol',\n 'gbp': 'fas fa-pound-sign',\n 'ge': 'fab fa-empire',\n 'gear': 'fas fa-cog',\n 'gears': 'fas fa-cogs',\n 'gittip': 'fab fa-gratipay',\n 'glass': 'fas fa-glass-martini',\n 'google-plus': 'fab fa-google-plus-g',\n 'google-plus-circle': 'fab fa-google-plus',\n 'google-plus-official': 'fab fa-google-plus',\n 'group': 'fas fa-users',\n 'hand-grab-o': 'far fa-hand-rock',\n 'hand-lizard-o': 'far fa-hand-lizard',\n 'hand-o-down': 'far fa-hand-point-down',\n 'hand-o-left': 'far fa-hand-point-left',\n 'hand-o-right': 'far fa-hand-point-right',\n 'hand-o-up': 'far fa-hand-point-up',\n 'hand-paper-o': 'far fa-hand-paper',\n 'hand-peace-o': 'far fa-hand-peace',\n 'hand-pointer-o': 'far fa-hand-pointer',\n 'hand-rock-o': 'far fa-hand-rock',\n 'hand-scissors-o': 'far fa-hand-scissors',\n 'hand-spock-o': 'far fa-hand-spock',\n 'hand-stop-o': 'far fa-hand-paper',\n 'handshake-o': 'far fa-handshake',\n 'hard-of-hearing': 'fas fa-deaf',\n 'hdd-o': 'far fa-hdd',\n 'header': 'fas fa-heading',\n 'heart-o': 'far fa-heart',\n 'hospital-o': 'far fa-hospital',\n 'hotel': 'fas fa-bed',\n 'hourglass-1': 'fas fa-hourglass-start',\n 'hourglass-2': 'fas fa-hourglass-half',\n 'hourglass-3': 'fas fa-hourglass-end',\n 'hourglass-o': 'far fa-hourglass',\n 'id-card-o': 'far fa-id-card',\n 'ils': 'fas fa-shekel-sign',\n 'image': 'far fa-image',\n 'inr': 'fas fa-rupee-sign',\n 'institution': 'fas fa-university',\n 'intersex': 'fas fa-transgender',\n 'jpy': 'fas fa-yen-sign',\n 'keyboard-o': 'far fa-keyboard',\n 'krw': 'fas fa-won-sign',\n 'legal': 'fas fa-gavel',\n 'lemon-o': 'far fa-lemon',\n 'level-down': 'fas fa-level-down-alt',\n 'level-up': 'fas fa-level-up-alt',\n 'life-bouy': 'far fa-life-ring',\n 'life-buoy': 'far fa-life-ring',\n 'life-saver': 'far fa-life-ring',\n 'lightbulb-o': 'far fa-lightbulb',\n 'line-chart': 'fas fa-chart-line',\n 'linkedin': 'fab fa-linkedin-in',\n 'linkedin-square': 'fab fa-linkedin',\n 'long-arrow-down': 'fas fa-long-arrow-alt-down',\n 'long-arrow-left': 'fas fa-long-arrow-alt-left',\n 'long-arrow-right': 'fas fa-long-arrow-alt-right',\n 'long-arrow-up': 'fas fa-long-arrow-alt-up',\n 'mail-forward': 'fas fa-share',\n 'mail-reply': 'fas fa-reply',\n 'mail-reply-all': 'fas fa-reply-all',\n 'map-marker': 'fas fa-map-marker-alt',\n 'map-o': 'far fa-map',\n 'meanpath': 'fab fa-font-awesome',\n 'meh-o': 'far fa-meh',\n 'minus-square-o': 'far fa-minus-square',\n 'mobile': 'fas fa-mobile-alt',\n 'mobile-phone': 'fas fa-mobile-alt',\n 'money': 'far fa-money-bill-alt',\n 'moon-o': 'far fa-moon',\n 'mortar-board': 'fas fa-graduation-cap',\n 'navicon': 'fas fa-bars',\n 'newspaper-o': 'far fa-newspaper',\n 'paper-plane-o': 'far fa-paper-plane',\n 'paste': 'far fa-clipboard',\n 'pause-circle-o': 'far fa-pause-circle',\n 'pencil': 'fas fa-pencil-alt',\n 'pencil-square': 'fas fa-pen-square',\n 'pencil-square-o': 'far fa-edit',\n 'photo': 'far fa-image',\n 'picture': 'far fa-image',\n 'picture-o': 'far fa-image',\n 'pie-chart': 'fas fa-chart-pie',\n 'play-circle-o': 'far fa-play-circle',\n 'plus-square-o': 'far fa-plus-square',\n 'question-circle-o': 'far fa-question-circle',\n 'ra': 'fab fa-rebel',\n 'refresh': 'fas fa-sync',\n 'remove': 'fas fa-times',\n 'remove-sign': 'fas fa-ban',\n 'reorder': 'fas fa-bars',\n 'repeat': 'fas fa-redo',\n 'resistance': 'fab fa-rebel',\n 'rmb': 'fas fa-yen-sign',\n 'rotate-left': 'fas fa-undo',\n 'rotate-right': 'fas fa-redo',\n 'rouble': 'fas fa-ruble-sign',\n 'rub': 'fas fa-ruble-sign',\n 'ruble': 'fas fa-ruble-sign',\n 'rupee': 'fas fa-rupee-sign',\n 's15': 'fas fa-bath',\n 'scissors': 'fas fa-cut',\n 'send': 'fas fa-paper-plane',\n 'send-o': 'far fa-paper-plane',\n 'share-square-o': 'far fa-share-square',\n 'shekel': 'fas fa-shekel-sign',\n 'sheqel': 'fas fa-shekel-sign',\n 'shield': 'fas fa-shield-alt',\n 'sign-in': 'fas fa-sign-in-alt',\n 'sign-out': 'fas fa-sign-out-alt',\n 'signing': 'fas fa-sign-language',\n 'sliders': 'fas fa-sliders-h',\n 'smile-o': 'far fa-smile',\n 'snowflake-o': 'far fa-snowflake',\n 'soccer-ball-o': 'far fa-futbol',\n 'sort-alpha-asc': 'fas fa-sort-alpha-down',\n 'sort-alpha-desc': 'fas fa-sort-alpha-up',\n 'sort-amount-asc': 'fas fa-sort-amount-down',\n 'sort-amount-desc': 'fas fa-sort-amount-up',\n 'sort-asc': 'fas fa-sort-up',\n 'sort-desc': 'fas fa-sort-down',\n 'sort-numeric-asc': 'fas fa-sort-numeric-down',\n 'sort-numeric-desc': 'fas fa-sort-numeric-up',\n 'spoon': 'fas fa-utensil-spoon',\n 'square-o': 'far fa-square',\n 'star-half-empty': 'far fa-star-half',\n 'star-half-full': 'far fa-star-half',\n 'star-half-o': 'far fa-star-half',\n 'star-o': 'far fa-star',\n 'sticky-note-o': 'far fa-sticky-note',\n 'stop-circle-o': 'far fa-stop-circle',\n 'sun-o': 'far fa-sun',\n 'support': 'far fa-life-ring',\n 'tablet': 'fas fa-tablet-alt',\n 'tachometer': 'fas fa-tachometer-alt',\n 'television': 'fas fa-tv',\n 'thermometer': 'fas fa-thermometer-full',\n 'thermometer-0': 'fas fa-thermometer-empty',\n 'thermometer-1': 'fas fa-thermometer-quarter',\n 'thermometer-2': 'fas fa-thermometer-half',\n 'thermometer-3': 'fas fa-thermometer-three-quarters',\n 'thermometer-4': 'fas fa-thermometer-full',\n 'thumb-tack': 'fas fa-thumbtack',\n 'thumbs-o-down': 'far fa-thumbs-down',\n 'thumbs-o-up': 'far fa-thumbs-up',\n 'ticket': 'fas fa-ticket-alt',\n 'times-circle-o': 'far fa-times-circle',\n 'times-rectangle': 'fas fa-window-close',\n 'times-rectangle-o': 'far fa-window-close',\n 'toggle-down': 'far fa-caret-square-down',\n 'toggle-left': 'far fa-caret-square-left',\n 'toggle-right': 'far fa-caret-square-right',\n 'toggle-up': 'far fa-caret-square-up',\n 'trash': 'fas fa-trash-alt',\n 'trash-o': 'far fa-trash-alt',\n 'try': 'fas fa-lira-sign',\n 'turkish-lira': 'fas fa-lira-sign',\n 'unsorted': 'fas fa-sort',\n 'upload-alt': 'fas fa-upload',\n 'usd': 'fas fa-dollar-sign',\n 'user-circle-o': 'far fa-user-circle',\n 'user-o': 'far fa-user',\n 'vcard': 'fas fa-address-card',\n 'vcard-o': 'far fa-address-card',\n 'video-camera': 'fas fa-video',\n 'vimeo': 'fab fa-vimeo-v',\n 'volume-control-phone': 'fas fa-phone-volume',\n 'warning': 'fas fa-exclamation-triangle',\n 'wechat': 'fab fa-weixin',\n 'wheelchair-alt': 'fab fa-accessible-icon',\n 'window-close-o': 'far fa-window-close',\n 'won': 'fas fa-won-sign',\n 'y-combinator-square': 'fab fa-hacker-news',\n 'yc': 'fab fa-y-combinator',\n 'yc-square': 'fab fa-hacker-news',\n 'yen': 'fas fa-yen-sign',\n 'youtube-play': 'fab fa-youtube',\n 'youtube-square': 'fab fa-youtube',\n};\n\n// all Icons from:\n// https://github.com/FortAwesome/Font-Awesome/blob/master/svg-with-js/js/fa-brands.js#L118\nconst brands: ReadonlyArray = [\n '500px',\n 'accessible-icon',\n 'accusoft',\n 'adn',\n 'adversal',\n 'affiliatetheme',\n 'algolia',\n 'amazon',\n 'amazon-pay',\n 'amilia',\n 'android',\n 'angellist',\n 'angrycreative',\n 'angular',\n 'app-store',\n 'app-store-ios',\n 'apper',\n 'apple',\n 'apple-pay',\n 'asymmetrik',\n 'audible',\n 'autoprefixer',\n 'avianex',\n 'aviato',\n 'aws',\n 'bandcamp',\n 'behance',\n 'behance-square',\n 'bimobject',\n 'bitbucket',\n 'bitcoin',\n 'bity',\n 'black-tie',\n 'blackberry',\n 'blogger',\n 'blogger-b',\n 'bluetooth',\n 'bluetooth-b',\n 'btc',\n 'buromobelexperte',\n 'buysellads',\n 'cc-amazon-pay',\n 'cc-amex',\n 'cc-apple-pay',\n 'cc-diners-club',\n 'cc-discover',\n 'cc-jcb',\n 'cc-mastercard',\n 'cc-paypal',\n 'cc-stripe',\n 'cc-visa',\n 'centercode',\n 'chrome',\n 'cloudscale',\n 'cloudsmith',\n 'cloudversify',\n 'codepen',\n 'codiepie',\n 'connectdevelop',\n 'contao',\n 'cpanel',\n 'creative-commons',\n 'creative-commons-by',\n 'creative-commons-nc',\n 'creative-commons-nc-eu',\n 'creative-commons-nc-jp',\n 'creative-commons-nd',\n 'creative-commons-pd',\n 'creative-commons-pd-alt',\n 'creative-commons-remix',\n 'creative-commons-sa',\n 'creative-commons-sampling',\n 'creative-commons-sampling-plus',\n 'creative-commons-share',\n 'css3',\n 'css3-alt',\n 'cuttlefish',\n 'd-and-d',\n 'dashcube',\n 'delicious',\n 'deploydog',\n 'deskpro',\n 'deviantart',\n 'digg',\n 'digital-ocean',\n 'discord',\n 'discourse',\n 'dochub',\n 'docker',\n 'draft2digital',\n 'dribbble',\n 'dribbble-square',\n 'dropbox',\n 'drupal',\n 'dyalog',\n 'earlybirds',\n 'ebay',\n 'edge',\n 'elementor',\n 'ello',\n 'ember',\n 'empire',\n 'envira',\n 'erlang',\n 'ethereum',\n 'etsy',\n 'expeditedssl',\n 'facebook',\n 'facebook-f',\n 'facebook-messenger',\n 'facebook-square',\n 'firefox',\n 'first-order',\n 'first-order-alt',\n 'firstdraft',\n 'flickr',\n 'flipboard',\n 'fly',\n 'font-awesome',\n 'font-awesome-alt',\n 'font-awesome-flag',\n 'font-awesome-logo-full',\n 'fonticons',\n 'fonticons-fi',\n 'fort-awesome',\n 'fort-awesome-alt',\n 'forumbee',\n 'foursquare',\n 'free-code-camp',\n 'freebsd',\n 'fulcrum',\n 'galactic-republic',\n 'galactic-senate',\n 'get-pocket',\n 'gg',\n 'gg-circle',\n 'git',\n 'git-square',\n 'github',\n 'github-alt',\n 'github-square',\n 'gitkraken',\n 'gitlab',\n 'gitter',\n 'glide',\n 'glide-g',\n 'gofore',\n 'goodreads',\n 'goodreads-g',\n 'google',\n 'google-drive',\n 'google-play',\n 'google-plus',\n 'google-plus-g',\n 'google-plus-square',\n 'google-wallet',\n 'gratipay',\n 'grav',\n 'gripfire',\n 'grunt',\n 'gulp',\n 'hacker-news',\n 'hacker-news-square',\n 'hackerrank',\n 'hips',\n 'hire-a-helper',\n 'hooli',\n 'hornbill',\n 'hotjar',\n 'houzz',\n 'html5',\n 'hubspot',\n 'imdb',\n 'instagram',\n 'internet-explorer',\n 'ioxhost',\n 'itunes',\n 'itunes-note',\n 'java',\n 'jedi-order',\n 'jenkins',\n 'joget',\n 'joomla',\n 'js',\n 'js-square',\n 'jsfiddle',\n 'kaggle',\n 'keybase',\n 'keycdn',\n 'kickstarter',\n 'kickstarter-k',\n 'korvue',\n 'laravel',\n 'lastfm',\n 'lastfm-square',\n 'leanpub',\n 'less',\n 'line',\n 'linkedin',\n 'linkedin-in',\n 'linode',\n 'linux',\n 'lyft',\n 'magento',\n 'mailchimp',\n 'mandalorian',\n 'markdown',\n 'mastodon',\n 'maxcdn',\n 'medapps',\n 'medium',\n 'medium-m',\n 'medrt',\n 'meetup',\n 'megaport',\n 'microsoft',\n 'mix',\n 'mixcloud',\n 'mizuni',\n 'modx',\n 'monero',\n 'napster',\n 'neos',\n 'nimblr',\n 'nintendo-switch',\n 'node',\n 'node-js',\n 'npm',\n 'ns8',\n 'nutritionix',\n 'odnoklassniki',\n 'odnoklassniki-square',\n 'old-republic',\n 'opencart',\n 'openid',\n 'opera',\n 'optin-monster',\n 'osi',\n 'page4',\n 'pagelines',\n 'palfed',\n 'patreon',\n 'paypal',\n 'periscope',\n 'phabricator',\n 'phoenix-framework',\n 'phoenix-squadron',\n 'php',\n 'pied-piper',\n 'pied-piper-alt',\n 'pied-piper-hat',\n 'pied-piper-pp',\n 'pinterest',\n 'pinterest-p',\n 'pinterest-square',\n 'playstation',\n 'product-hunt',\n 'pushed',\n 'python',\n 'qq',\n 'quinscape',\n 'quora',\n 'r-project',\n 'ravelry',\n 'react',\n 'readme',\n 'rebel',\n 'red-river',\n 'reddit',\n 'reddit-alien',\n 'reddit-square',\n 'rendact',\n 'renren',\n 'replyd',\n 'researchgate',\n 'resolving',\n 'rev',\n 'rocketchat',\n 'rockrms',\n 'safari',\n 'sass',\n 'schlix',\n 'scribd',\n 'searchengin',\n 'sellcast',\n 'sellsy',\n 'servicestack',\n 'shirtsinbulk',\n 'shopware',\n 'simplybuilt',\n 'sistrix',\n 'sith',\n 'skyatlas',\n 'skype',\n 'slack',\n 'slack-hash',\n 'slideshare',\n 'snapchat',\n 'snapchat-ghost',\n 'snapchat-square',\n 'soundcloud',\n 'speakap',\n 'spotify',\n 'squarespace',\n 'stack-exchange',\n 'stack-overflow',\n 'staylinked',\n 'steam',\n 'steam-square',\n 'steam-symbol',\n 'sticker-mule',\n 'strava',\n 'stripe',\n 'stripe-s',\n 'studiovinari',\n 'stumbleupon',\n 'stumbleupon-circle',\n 'superpowers',\n 'supple',\n 'teamspeak',\n 'telegram',\n 'telegram-plane',\n 'tencent-weibo',\n 'themeco',\n 'themeisle',\n 'trade-federation',\n 'trello',\n 'tripadvisor',\n 'tumblr',\n 'tumblr-square',\n 'twitch',\n 'twitter',\n 'twitter-square',\n 'typo3',\n 'uber',\n 'uikit',\n 'uniregistry',\n 'untappd',\n 'usb',\n 'ussunnah',\n 'vaadin',\n 'viacoin',\n 'viadeo',\n 'viadeo-square',\n 'viber',\n 'vimeo',\n 'vimeo-square',\n 'vimeo-v',\n 'vine',\n 'vk',\n 'vnv',\n 'vuejs',\n 'weebly',\n 'weibo',\n 'weixin',\n 'whatsapp',\n 'whatsapp-square',\n 'whmcs',\n 'wikipedia-w',\n 'windows',\n 'wix',\n 'wolf-pack-battalion',\n 'wordpress',\n 'wordpress-simple',\n 'wpbeginner',\n 'wpexplorer',\n 'wpforms',\n 'xbox',\n 'xing',\n 'xing-square',\n 'y-combinator',\n 'yahoo',\n 'yandex',\n 'yandex-international',\n 'yelp',\n 'yoast',\n 'youtube',\n 'youtube-square',\n 'zhihu'\n];\n\nconst mapper = (icon: string): string => {\n /**\n * Neos <= 3.3 prefixed icons with this, we need to strip those\n * otherwise the mapping would'nt work for brand icons\n */\n const iconName = trimPrefixes(icon).trim();\n\n if (map[iconName]) {\n return map[iconName];\n }\n\n if (brands.includes(iconName)) {\n return 'fab fa-' + iconName;\n }\n\n if (!iconName.includes(' ')) {\n return 'fas fa-' + iconName;\n }\n\n return iconName;\n};\n\nfunction trimPrefixes(icon: string): string {\n if (icon.startsWith('fas fa-')) {\n return icon.substr(7).split(' ')[0];\n }\n\n if (icon.startsWith('icon-')) {\n return icon.substr(5).split(' ')[0];\n }\n\n return icon;\n}\n\nexport default mapper;\n","import {IconName, IconPrefix, IconProp} from '@fortawesome/fontawesome-svg-core';\nimport {FontAwesomeIcon, Props} from '@fortawesome/react-fontawesome';\nimport mergeClassNames from 'classnames';\nimport React, {PureComponent} from 'react';\n\nimport {PickDefaultProps, Omit} from '../../types';\nimport mapper from './mapper';\n\ntype IconPadding = 'none' | 'left' | 'right';\ntype IconColor = 'default' | 'warn' | 'error' | 'primaryBlue';\n\ninterface IconTheme {\n readonly icon: string;\n readonly 'icon--big': string;\n readonly 'icon--small': string;\n readonly 'icon--tiny': string;\n readonly 'icon--paddedLeft': string;\n readonly 'icon--paddedRight': string;\n readonly 'icon--spin': string;\n readonly 'icon--color-warn': string;\n readonly 'icon--color-error': string;\n readonly 'icon--color-primaryBlue': string;\n}\n\nexport interface IconProps extends Omit {\n /**\n * We use the react component FortAwesome provides to render icons.\n * we will pass down all props to the component via {...rest} to expose it's api\n * https://github.com/FortAwesome/react-fontawesome/blob/master/README.md\n */\n\n /**\n * The ID of the icon to render.\n */\n readonly icon?: string;\n\n /**\n * The (accessibility) label for this icon\n */\n readonly label?: string;\n\n /**\n * Controls the padding around the icon in a standardized way.\n */\n readonly padded?: IconPadding;\n\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * Adjust the color of the icon\n */\n readonly color?: IconColor;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme?: IconTheme;\n}\n\ntype DefaultProps = PickDefaultProps;\n\nexport const defaultProps: DefaultProps = {\n color: 'default',\n padded: 'none'\n};\n\nclass Icon extends PureComponent {\n public static readonly defaultProps = defaultProps;\n\n public render(): JSX.Element | null {\n const {padded, theme, label, icon, className, color, ...rest} = this.props;\n const iconClassName = icon;\n const classNames = mergeClassNames(\n theme!.icon,\n iconClassName,\n className,\n {\n [theme!['icon--paddedLeft']]: padded === 'left',\n [theme!['icon--paddedRight']]: padded === 'right',\n [theme!['icon--color-warn']]: color === 'warn',\n [theme!['icon--color-error']]: color === 'error',\n [theme!['icon--color-primaryBlue']]: color === 'primaryBlue',\n }\n );\n\n return ;\n }\n\n private readonly getIconProp = (icon: string): IconProp => {\n const mappedIcon = mapper(icon);\n const iconArray = mappedIcon.split(' ');\n if (iconArray.length > 1) {\n const prefix = iconArray[0];\n const processedIcon = iconArray[1].startsWith('fa-') ? iconArray[1].substr(3) : iconArray[1];\n return [prefix as IconPrefix, processedIcon as IconName];\n } else {\n const prefix: IconPrefix = 'fas';\n return [prefix, mappedIcon as IconName];\n }\n }\n}\n\nexport default Icon;\n","import {config, IconPrefix, library} from '@fortawesome/fontawesome-svg-core';\nimport '@fortawesome/fontawesome-svg-core/styles.css';\nimport {fab} from '@fortawesome/free-brands-svg-icons';\nimport {far} from '@fortawesome/free-regular-svg-icons';\nimport {fas} from '@fortawesome/free-solid-svg-icons';\nimport {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport Icon from './icon';\n\nimport style from './style.css';\n\n// tslint:disable:no-object-mutation\nconfig.autoAddCss = false;\nconfig.familyPrefix = 'neos-fa' as IconPrefix;\nconfig.replacementClass = 'neos-svg-inline--fa';\n// tslint:enable:no-object-mutation\n\nlibrary.add(fab, fas, far);\n\nexport default themr(identifiers.icon, style)(Icon);\n","import mergeClassNames from 'classnames';\nimport React, {PureComponent} from 'react';\nimport {Omit} from '../../types';\nimport Icon from './../Icon';\n\ninterface CheckBoxTheme {\n readonly checkbox: string;\n readonly checkbox__checked: string;\n readonly checkbox__disabled: string;\n readonly checkbox__input: string; // eslint-disable-line\n readonly checkbox__inputMirror: string; // eslint-disable-line\n readonly 'checkbox__inputMirror--active': string;\n readonly checkbox__icon: string;\n}\n\ntype HTMLInputElementAttributesExceptOnChange = Omit, 'onChange'>;\n\nexport interface CheckBoxProps extends HTMLInputElementAttributesExceptOnChange {\n /**\n * This prop controls the visual active state of the CheckBox.\n */\n readonly isChecked: boolean;\n\n /**\n * This prop controls if the CheckBox is disabled or not.\n */\n readonly disabled?: boolean;\n\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * An optional change handler which gets called once the user clicks on the CheckBox.\n */\n readonly onChange?: (isChecked: boolean) => void;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme: CheckBoxTheme;\n}\n\nclass CheckBox extends PureComponent {\n public render(): JSX.Element {\n const {\n isChecked,\n disabled,\n className,\n theme,\n ...rest\n } = this.props;\n const finalClassName = mergeClassNames(\n className,\n theme.checkbox,\n {\n [theme.checkbox__checked]: isChecked,\n [theme.checkbox__disabled]: disabled,\n }\n );\n const mirrorClassNames = mergeClassNames(\n theme.checkbox__inputMirror,\n {\n [theme['checkbox__inputMirror--active']]: isChecked,\n }\n );\n\n return (\n
\n \n \n
\n
\n );\n }\n\n private readonly handleChange = () => {\n const {onChange, isChecked} = this.props;\n\n if (onChange) {\n onChange(!isChecked);\n }\n }\n}\n\nexport default CheckBox;\n","import {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport CheckBox from './checkBox';\nimport style from './style.css';\n\nexport default themr(identifiers.checkBox, style)(CheckBox);\n","//! moment.js\n//! version : 2.29.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n}(this, (function () { 'use strict';\n\n var hookCallback;\n\n function hooks() {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback(callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return (\n input instanceof Array ||\n Object.prototype.toString.call(input) === '[object Array]'\n );\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return (\n input != null &&\n Object.prototype.toString.call(input) === '[object Object]'\n );\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n for (k in obj) {\n if (hasOwnProp(obj, k)) {\n return false;\n }\n }\n return true;\n }\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return (\n typeof input === 'number' ||\n Object.prototype.toString.call(input) === '[object Number]'\n );\n }\n\n function isDate(input) {\n return (\n input instanceof Date ||\n Object.prototype.toString.call(input) === '[object Date]'\n );\n }\n\n function map(arr, fn) {\n var res = [],\n i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidEra: null,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n era: null,\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false,\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this),\n len = t.length >>> 0,\n i;\n\n for (i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m),\n parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n }),\n isNowValid =\n !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidEra &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.weekdayMismatch &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid =\n isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n }\n return m._isValid;\n }\n\n function createInvalid(flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n var momentProperties = (hooks.momentProperties = []),\n updateInProgress = false;\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment(obj) {\n return (\n obj instanceof Moment || (obj != null && obj._isAMomentObject != null)\n );\n }\n\n function warn(msg) {\n if (\n hooks.suppressDeprecationWarnings === false &&\n typeof console !== 'undefined' &&\n console.warn\n ) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [],\n arg,\n i,\n key;\n for (i = 0; i < arguments.length; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (key in arguments[0]) {\n if (hasOwnProp(arguments[0], key)) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(\n msg +\n '\\nArguments: ' +\n Array.prototype.slice.call(args).join('') +\n '\\n' +\n new Error().stack\n );\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }\n\n function set(config) {\n var prop, i;\n for (i in config) {\n if (hasOwnProp(config, i)) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' +\n /\\d{1,2}/.source\n );\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (\n hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])\n ) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i,\n res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n\n var defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n };\n\n function calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (\n (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +\n absNumber\n );\n }\n\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n formatFunctions = {},\n formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(\n func.apply(this, arguments),\n token\n );\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '',\n i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i])\n ? array[i].call(mom, format)\n : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] =\n formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(\n localFormattingTokens,\n replaceLongDateFormatTokens\n );\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A',\n };\n\n function longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper\n .match(formattingTokens)\n .map(function (tok) {\n if (\n tok === 'MMMM' ||\n tok === 'MM' ||\n tok === 'DD' ||\n tok === 'dddd'\n ) {\n return tok.slice(1);\n }\n return tok;\n })\n .join('');\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate() {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d',\n defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal(number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n };\n\n function relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output)\n ? output(number, withoutSuffix, string, isFuture)\n : output.replace(/%d/i, number);\n }\n\n function pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias(unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string'\n ? aliases[units] || aliases[units.toLowerCase()]\n : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [],\n u;\n for (u in unitsObj) {\n if (hasOwnProp(unitsObj, u)) {\n units.push({ unit: u, priority: priorities[u] });\n }\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n function absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n function makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get(mom, unit) {\n return mom.isValid()\n ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()\n : NaN;\n }\n\n function set$1(mom, unit, value) {\n if (mom.isValid() && !isNaN(value)) {\n if (\n unit === 'FullYear' &&\n isLeapYear(mom.year()) &&\n mom.month() === 1 &&\n mom.date() === 29\n ) {\n value = toInt(value);\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](\n value,\n mom.month(),\n daysInMonth(value, mom.month())\n );\n } else {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n }\n\n // MOMENTS\n\n function stringGet(units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n\n function stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units),\n i;\n for (i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n\n var match1 = /\\d/, // 0 - 9\n match2 = /\\d\\d/, // 00 - 99\n match3 = /\\d{3}/, // 000 - 999\n match4 = /\\d{4}/, // 0000 - 9999\n match6 = /[+-]?\\d{6}/, // -999999 - 999999\n match1to2 = /\\d\\d?/, // 0 - 99\n match3to4 = /\\d\\d\\d\\d?/, // 999 - 9999\n match5to6 = /\\d\\d\\d\\d\\d\\d?/, // 99999 - 999999\n match1to3 = /\\d{1,3}/, // 0 - 999\n match1to4 = /\\d{1,4}/, // 0 - 9999\n match1to6 = /[+-]?\\d{1,6}/, // -999999 - 999999\n matchUnsigned = /\\d+/, // 0 - inf\n matchSigned = /[+-]?\\d+/, // -inf - inf\n matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi, // +00:00 -00:00 +0000 -0000 or Z\n matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/, // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n regexes;\n\n regexes = {};\n\n function addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex)\n ? regex\n : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(\n s\n .replace('\\\\', '')\n .replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (\n matched,\n p1,\n p2,\n p3,\n p4\n ) {\n return p1 || p2 || p3 || p4;\n })\n );\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken(token, callback) {\n var i,\n func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0,\n MONTH = 1,\n DATE = 2,\n HOUR = 3,\n MINUTE = 4,\n SECOND = 5,\n MILLISECOND = 6,\n WEEK = 7,\n WEEKDAY = 8;\n\n function mod(n, x) {\n return ((n % x) + x) % x;\n }\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1\n ? isLeapYear(year)\n ? 29\n : 28\n : 31 - ((modMonth % 7) % 2);\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // ALIASES\n\n addUnitAlias('month', 'M');\n\n // PRIORITY\n\n addUnitPriority('month', 8);\n\n // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(\n '_'\n ),\n MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n defaultMonthsShortRegex = matchWord,\n defaultMonthsRegex = matchWord;\n\n function localeMonths(m, format) {\n if (!m) {\n return isArray(this._months)\n ? this._months\n : this._months['standalone'];\n }\n return isArray(this._months)\n ? this._months[m.month()]\n : this._months[\n (this._months.isFormat || MONTHS_IN_FORMAT).test(format)\n ? 'format'\n : 'standalone'\n ][m.month()];\n }\n\n function localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort)\n ? this._monthsShort\n : this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort)\n ? this._monthsShort[m.month()]\n : this._monthsShort[\n MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'\n ][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp(\n '^' + this.months(mom, '').replace('.', '') + '$',\n 'i'\n );\n this._shortMonthsParse[i] = new RegExp(\n '^' + this.monthsShort(mom, '').replace('.', '') + '$',\n 'i'\n );\n }\n if (!strict && !this._monthsParse[i]) {\n regex =\n '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'MMMM' &&\n this._longMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'MMM' &&\n this._shortMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth(mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n }\n\n function monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict\n ? this._monthsShortStrictRegex\n : this._monthsShortRegex;\n }\n }\n\n function monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict\n ? this._monthsStrictRegex\n : this._monthsRegex;\n }\n }\n\n function computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._monthsShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n });\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // ALIASES\n\n addUnitAlias('year', 'y');\n\n // PRIORITIES\n\n addUnitPriority('year', 1);\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] =\n input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n // HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear() {\n return isLeapYear(this.year());\n }\n\n function createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date;\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n }\n\n function createUTCDate(y) {\n var date, args;\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n args = Array.prototype.slice.call(arguments);\n // preserve leap years using a full 400 year cycle, then reset\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n\n return date;\n }\n\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n }\n\n // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear,\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear,\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n // FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n // PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5);\n\n // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (\n input,\n week,\n config,\n token\n ) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n // HELPERS\n\n // LOCALES\n\n function localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 6th is the first week of the year.\n };\n\n function localeFirstDayOfWeek() {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear() {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n // PRIORITY\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11);\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n // LOCALES\n function shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n defaultWeekdaysRegex = matchWord,\n defaultWeekdaysShortRegex = matchWord,\n defaultWeekdaysMinRegex = matchWord;\n\n function localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays)\n ? this._weekdays\n : this._weekdays[\n m && m !== true && this._weekdays.isFormat.test(format)\n ? 'format'\n : 'standalone'\n ];\n return m === true\n ? shiftWeekdays(weekdays, this._week.dow)\n : m\n ? weekdays[m.day()]\n : weekdays;\n }\n\n function localeWeekdaysShort(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysShort, this._week.dow)\n : m\n ? this._weekdaysShort[m.day()]\n : this._weekdaysShort;\n }\n\n function localeWeekdaysMin(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysMin, this._week.dow)\n : m\n ? this._weekdaysMin[m.day()]\n : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(\n mom,\n ''\n ).toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp(\n '^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._shortWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._minWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n }\n if (!this._weekdaysParse[i]) {\n regex =\n '^' +\n this.weekdays(mom, '') +\n '|^' +\n this.weekdaysShort(mom, '') +\n '|^' +\n this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'dddd' &&\n this._fullWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'ddd' &&\n this._shortWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'dd' &&\n this._minWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n function weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict\n ? this._weekdaysStrictRegex\n : this._weekdaysRegex;\n }\n }\n\n function weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict\n ? this._weekdaysShortStrictRegex\n : this._weekdaysShortRegex;\n }\n }\n\n function weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict\n ? this._weekdaysMinStrictRegex\n : this._weekdaysMinRegex;\n }\n }\n\n function computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = regexEscape(this.weekdaysMin(mom, ''));\n shortp = regexEscape(this.weekdaysShort(mom, ''));\n longp = regexEscape(this.weekdays(mom, ''));\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysMinStrictRegex = new RegExp(\n '^(' + minPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('hmmss', 0, 0, function () {\n return (\n '' +\n hFormat.apply(this) +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n });\n\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('Hmmss', 0, 0, function () {\n return (\n '' +\n this.hours() +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n });\n\n function meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(\n this.hours(),\n this.minutes(),\n lowercase\n );\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n // ALIASES\n\n addUnitAlias('hour', 'h');\n\n // PRIORITY\n addUnitPriority('hour', 13);\n\n // PARSING\n\n function matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n // LOCALES\n\n function localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n getSetHour = makeGetSet('Hours', true);\n\n function localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse,\n };\n\n // internal storage for locale config files\n var locales = {},\n localeFamilies = {},\n globalLocale;\n\n function commonPrefix(arr1, arr2) {\n var i,\n minl = Math.min(arr1.length, arr2.length);\n for (i = 0; i < minl; i += 1) {\n if (arr1[i] !== arr2[i]) {\n return i;\n }\n }\n return minl;\n }\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (\n next &&\n next.length >= j &&\n commonPrefix(split, next) >= j - 1\n ) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }\n\n function loadLocale(name) {\n var oldLocale = null,\n aliasedRequire;\n // TODO: Find a better way to register and load all the locales in Node\n if (\n locales[name] === undefined &&\n typeof module !== 'undefined' &&\n module &&\n module.exports\n ) {\n try {\n oldLocale = globalLocale._abbr;\n aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {\n // mark as not found to avoid repeating expensive file require call causing high CPU\n // when trying to find en-US, en_US, en-us for every format call\n locales[name] = null; // null means not found\n }\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple(\n 'defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'\n );\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config,\n });\n return null;\n }\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig;\n\n if (locales[name] != null && locales[name].parentLocale != null) {\n // Update existing child locale in-place to avoid memory-leaks\n locales[name].set(mergeConfigs(locales[name]._config, config));\n } else {\n // MERGE\n tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n config = mergeConfigs(parentConfig, config);\n if (tmpLocale == null) {\n // updateLocale is called for creating a new locale\n // Set abbr so it will have a name (getters return\n // undefined otherwise).\n config.abbr = name;\n }\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n }\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n if (name === getSetGlobalLocale()) {\n getSetGlobalLocale(name);\n }\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n // returns locale data\n function getLocale(key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys(locales);\n }\n\n function checkOverflow(m) {\n var overflow,\n a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11\n ? MONTH\n : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])\n ? DATE\n : a[HOUR] < 0 ||\n a[HOUR] > 24 ||\n (a[HOUR] === 24 &&\n (a[MINUTE] !== 0 ||\n a[SECOND] !== 0 ||\n a[MILLISECOND] !== 0))\n ? HOUR\n : a[MINUTE] < 0 || a[MINUTE] > 59\n ? MINUTE\n : a[SECOND] < 0 || a[SECOND] > 59\n ? SECOND\n : a[MILLISECOND] < 0 || a[MILLISECOND] > 999\n ? MILLISECOND\n : -1;\n\n if (\n getParsingFlags(m)._overflowDayOfYear &&\n (overflow < YEAR || overflow > DATE)\n ) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n // iso 8601 regex\n // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/],\n ['YYYYMM', /\\d{6}/, false],\n ['YYYY', /\\d{4}/, false],\n ],\n // iso time formats and regexes\n isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/],\n ],\n aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n };\n\n // date from iso format\n function configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n function extractFromRFC2822Strings(\n yearStr,\n monthStr,\n dayStr,\n hourStr,\n minuteStr,\n secondStr\n ) {\n var result = [\n untruncateYear(yearStr),\n defaultLocaleMonthsShort.indexOf(monthStr),\n parseInt(dayStr, 10),\n parseInt(hourStr, 10),\n parseInt(minuteStr, 10),\n ];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n }\n\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n return year;\n }\n\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^)]*\\)|[\\n\\t]/g, ' ')\n .replace(/(\\s\\s+)/g, ' ')\n .replace(/^\\s\\s*/, '')\n .replace(/\\s\\s*$/, '');\n }\n\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(\n parsedInput[0],\n parsedInput[1],\n parsedInput[2]\n ).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n return true;\n }\n\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10),\n m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n }\n\n // date and time from ref 2822 format\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i)),\n parsedArray;\n if (match) {\n parsedArray = extractFromRFC2822Strings(\n match[4],\n match[3],\n match[2],\n match[5],\n match[6],\n match[7]\n );\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n if (config._strict) {\n config._isValid = false;\n } else {\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n }\n\n hooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [\n nowValue.getUTCFullYear(),\n nowValue.getUTCMonth(),\n nowValue.getUTCDate(),\n ];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (\n config._dayOfYear > daysInYear(yearToUse) ||\n config._dayOfYear === 0\n ) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] =\n config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (\n config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0\n ) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(\n null,\n input\n );\n expectedWeekday = config._useUTC\n ? config._d.getUTCDay()\n : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (\n config._w &&\n typeof config._w.d !== 'undefined' &&\n config._w.d !== expectedWeekday\n ) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(\n w.GG,\n config._a[YEAR],\n weekOfYear(createLocal(), 1, 4).year\n );\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n // constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n // constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0,\n era;\n\n tokens =\n expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) ||\n [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(\n string.indexOf(parsedInput) + parsedInput.length\n );\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver =\n stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (\n config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0\n ) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(\n config._locale,\n config._a[HOUR],\n config._meridiem\n );\n\n // handle era\n era = getParsingFlags(config).era;\n if (era !== null) {\n config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n }\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n function meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n // date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n scoreToBeat,\n i,\n currentScore,\n validFormatFound,\n bestFormatIsValid = false;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n validFormatFound = false;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (isValid(tempConfig)) {\n validFormatFound = true;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (!bestFormatIsValid) {\n if (\n scoreToBeat == null ||\n currentScore < scoreToBeat ||\n validFormatFound\n ) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n if (validFormatFound) {\n bestFormatIsValid = true;\n }\n }\n } else {\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i),\n dayOrDate = i.day === undefined ? i.date : i.day;\n config._a = map(\n [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],\n function (obj) {\n return obj && parseInt(obj, 10);\n }\n );\n\n configFromArray(config);\n }\n\n function createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig(config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({ nullInput: true });\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n\n if (format === true || format === false) {\n strict = format;\n format = undefined;\n }\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if (\n (isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)\n ) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n ),\n prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +new Date();\n };\n\n var ordering = [\n 'year',\n 'quarter',\n 'month',\n 'week',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'millisecond',\n ];\n\n function isDurationValid(m) {\n var key,\n unitHasDecimal = false,\n i;\n for (key in m) {\n if (\n hasOwnProp(m, key) &&\n !(\n indexOf.call(ordering, key) !== -1 &&\n (m[key] == null || !isNaN(m[key]))\n )\n ) {\n return false;\n }\n }\n\n for (i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds =\n +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days + weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months + quarters * 3 + years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration(obj) {\n return obj instanceof Duration;\n }\n\n function absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n // compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n (dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n ) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n // FORMATTING\n\n function offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset(),\n sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return (\n sign +\n zeroFill(~~(offset / 60), 2) +\n separator +\n zeroFill(~~offset % 60, 2)\n );\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher),\n chunk,\n parts,\n minutes;\n\n if (matches === null) {\n return null;\n }\n\n chunk = matches[matches.length - 1] || [];\n parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff =\n (isMoment(input) || isDate(input)\n ? input.valueOf()\n : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset());\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(\n this,\n createDuration(input - offset, 'm'),\n 1,\n false\n );\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n\n function hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime() {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {},\n other;\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted =\n this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n // ASP.NET json date format regex\n var aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n isoRegex = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\n function createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months,\n };\n } else if (isNumber(input) || !isNaN(+input)) {\n duration = {};\n if (key) {\n duration[key] = +input;\n } else {\n duration.milliseconds = +input;\n }\n } else if ((match = aspNetRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match\n };\n } else if ((match = isoRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign),\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (\n typeof duration === 'object' &&\n ('from' in duration || 'to' in duration)\n ) {\n diffRes = momentsDifference(\n createLocal(duration.from),\n createLocal(duration.to)\n );\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n ret._isValid = input._isValid;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {};\n\n res.months =\n other.month() - base.month() + (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return { milliseconds: 0, months: 0 };\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n // TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add'),\n subtract = createAdder(-1, 'subtract');\n\n function isString(input) {\n return typeof input === 'string' || input instanceof String;\n }\n\n // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\n function isMomentInput(input) {\n return (\n isMoment(input) ||\n isDate(input) ||\n isString(input) ||\n isNumber(input) ||\n isNumberOrStringArray(input) ||\n isMomentInputObject(input) ||\n input === null ||\n input === undefined\n );\n }\n\n function isMomentInputObject(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'years',\n 'year',\n 'y',\n 'months',\n 'month',\n 'M',\n 'days',\n 'day',\n 'd',\n 'dates',\n 'date',\n 'D',\n 'hours',\n 'hour',\n 'h',\n 'minutes',\n 'minute',\n 'm',\n 'seconds',\n 'second',\n 's',\n 'milliseconds',\n 'millisecond',\n 'ms',\n ],\n i,\n property;\n\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n }\n\n function isNumberOrStringArray(input) {\n var arrayTest = isArray(input),\n dataTypeTest = false;\n if (arrayTest) {\n dataTypeTest =\n input.filter(function (item) {\n return !isNumber(item) && isString(input);\n }).length === 0;\n }\n return arrayTest && dataTypeTest;\n }\n\n function isCalendarSpec(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'sameDay',\n 'nextDay',\n 'lastDay',\n 'nextWeek',\n 'lastWeek',\n 'sameElse',\n ],\n i,\n property;\n\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n }\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6\n ? 'sameElse'\n : diff < -1\n ? 'lastWeek'\n : diff < 0\n ? 'lastDay'\n : diff < 1\n ? 'sameDay'\n : diff < 2\n ? 'nextDay'\n : diff < 7\n ? 'nextWeek'\n : 'sameElse';\n }\n\n function calendar$1(time, formats) {\n // Support for single parameter, formats only overload to the calendar function\n if (arguments.length === 1) {\n if (!arguments[0]) {\n time = undefined;\n formats = undefined;\n } else if (isMomentInput(arguments[0])) {\n time = arguments[0];\n formats = undefined;\n } else if (isCalendarSpec(arguments[0])) {\n formats = arguments[0];\n time = undefined;\n }\n }\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse',\n output =\n formats &&\n (isFunction(formats[format])\n ? formats[format].call(this, now)\n : formats[format]);\n\n return this.format(\n output || this.localeData().calendar(format, this, createLocal(now))\n );\n }\n\n function clone() {\n return new Moment(this);\n }\n\n function isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n inclusivity = inclusivity || '()';\n return (\n (inclusivity[0] === '('\n ? this.isAfter(localFrom, units)\n : !this.isBefore(localFrom, units)) &&\n (inclusivity[1] === ')'\n ? this.isBefore(localTo, units)\n : !this.isAfter(localTo, units))\n );\n }\n\n function isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return (\n this.clone().startOf(units).valueOf() <= inputMs &&\n inputMs <= this.clone().endOf(units).valueOf()\n );\n }\n }\n\n function isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n\n function isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n\n function diff(input, units, asFloat) {\n var that, zoneDelta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n case 'month':\n output = monthDiff(this, that);\n break;\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n case 'second':\n output = (this - that) / 1e3;\n break; // 1000\n case 'minute':\n output = (this - that) / 6e4;\n break; // 1000 * 60\n case 'hour':\n output = (this - that) / 36e5;\n break; // 1000 * 60 * 60\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break; // 1000 * 60 * 60 * 24, negate dst\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break; // 1000 * 60 * 60 * 24 * 7, negate dst\n default:\n output = this - that;\n }\n\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff(a, b) {\n if (a.date() < b.date()) {\n // end-of-month calculations work correct when the start month has more\n // days than the end month.\n return -monthDiff(b, a);\n }\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n var utc = keepOffset !== true,\n m = utc ? this.clone().utc() : this;\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(\n m,\n utc\n ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'\n : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)\n .toISOString()\n .replace('Z', formatMoment(m, 'Z'));\n }\n }\n return formatMoment(\n m,\n utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment',\n zone = '',\n prefix,\n year,\n datetime,\n suffix;\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n prefix = '[' + func + '(\"]';\n year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n datetime = '-MM-DD[T]HH:mm:ss.SSS';\n suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format(inputString) {\n if (!inputString) {\n inputString = this.isUtc()\n ? hooks.defaultFormatUtc\n : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ to: this, from: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ from: this, to: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n function locale(key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData() {\n return this._locale;\n }\n\n var MS_PER_SECOND = 1000,\n MS_PER_MINUTE = 60 * MS_PER_SECOND,\n MS_PER_HOUR = 60 * MS_PER_MINUTE,\n MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n // actual modulo - handles negative numbers (for dates before 1970):\n function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }\n\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n\n function startOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n case 'quarter':\n time = startOfDate(\n this.year(),\n this.month() - (this.month() % 3),\n 1\n );\n break;\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n case 'week':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday()\n );\n break;\n case 'isoWeek':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1)\n );\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n );\n break;\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function endOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n case 'quarter':\n time =\n startOfDate(\n this.year(),\n this.month() - (this.month() % 3) + 3,\n 1\n ) - 1;\n break;\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n case 'week':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday() + 7\n ) - 1;\n break;\n case 'isoWeek':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1) + 7\n ) - 1;\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n case 'hour':\n time = this._d.valueOf();\n time +=\n MS_PER_HOUR -\n mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n ) -\n 1;\n break;\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n }\n\n function unix() {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate() {\n return new Date(this.valueOf());\n }\n\n function toArray() {\n var m = this;\n return [\n m.year(),\n m.month(),\n m.date(),\n m.hour(),\n m.minute(),\n m.second(),\n m.millisecond(),\n ];\n }\n\n function toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds(),\n };\n }\n\n function toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2() {\n return isValid(this);\n }\n\n function parsingFlags() {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt() {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict,\n };\n }\n\n addFormatToken('N', 0, 0, 'eraAbbr');\n addFormatToken('NN', 0, 0, 'eraAbbr');\n addFormatToken('NNN', 0, 0, 'eraAbbr');\n addFormatToken('NNNN', 0, 0, 'eraName');\n addFormatToken('NNNNN', 0, 0, 'eraNarrow');\n\n addFormatToken('y', ['y', 1], 'yo', 'eraYear');\n addFormatToken('y', ['yy', 2], 0, 'eraYear');\n addFormatToken('y', ['yyy', 3], 0, 'eraYear');\n addFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n\n addRegexToken('N', matchEraAbbr);\n addRegexToken('NN', matchEraAbbr);\n addRegexToken('NNN', matchEraAbbr);\n addRegexToken('NNNN', matchEraName);\n addRegexToken('NNNNN', matchEraNarrow);\n\n addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (\n input,\n array,\n config,\n token\n ) {\n var era = config._locale.erasParse(input, token, config._strict);\n if (era) {\n getParsingFlags(config).era = era;\n } else {\n getParsingFlags(config).invalidEra = input;\n }\n });\n\n addRegexToken('y', matchUnsigned);\n addRegexToken('yy', matchUnsigned);\n addRegexToken('yyy', matchUnsigned);\n addRegexToken('yyyy', matchUnsigned);\n addRegexToken('yo', matchEraYearOrdinal);\n\n addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\n addParseToken(['yo'], function (input, array, config, token) {\n var match;\n if (config._locale._eraYearOrdinalRegex) {\n match = input.match(config._locale._eraYearOrdinalRegex);\n }\n\n if (config._locale.eraYearOrdinalParse) {\n array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n } else {\n array[YEAR] = parseInt(input, 10);\n }\n });\n\n function localeEras(m, format) {\n var i,\n l,\n date,\n eras = this._eras || getLocale('en')._eras;\n for (i = 0, l = eras.length; i < l; ++i) {\n switch (typeof eras[i].since) {\n case 'string':\n // truncate time\n date = hooks(eras[i].since).startOf('day');\n eras[i].since = date.valueOf();\n break;\n }\n\n switch (typeof eras[i].until) {\n case 'undefined':\n eras[i].until = +Infinity;\n break;\n case 'string':\n // truncate time\n date = hooks(eras[i].until).startOf('day').valueOf();\n eras[i].until = date.valueOf();\n break;\n }\n }\n return eras;\n }\n\n function localeErasParse(eraName, format, strict) {\n var i,\n l,\n eras = this.eras(),\n name,\n abbr,\n narrow;\n eraName = eraName.toUpperCase();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n name = eras[i].name.toUpperCase();\n abbr = eras[i].abbr.toUpperCase();\n narrow = eras[i].narrow.toUpperCase();\n\n if (strict) {\n switch (format) {\n case 'N':\n case 'NN':\n case 'NNN':\n if (abbr === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNN':\n if (name === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNNN':\n if (narrow === eraName) {\n return eras[i];\n }\n break;\n }\n } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n return eras[i];\n }\n }\n }\n\n function localeErasConvertYear(era, year) {\n var dir = era.since <= era.until ? +1 : -1;\n if (year === undefined) {\n return hooks(era.since).year();\n } else {\n return hooks(era.since).year() + (year - era.offset) * dir;\n }\n }\n\n function getEraName() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].name;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].name;\n }\n }\n\n return '';\n }\n\n function getEraNarrow() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].narrow;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].narrow;\n }\n }\n\n return '';\n }\n\n function getEraAbbr() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].abbr;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].abbr;\n }\n }\n\n return '';\n }\n\n function getEraYear() {\n var i,\n l,\n dir,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (\n (eras[i].since <= val && val <= eras[i].until) ||\n (eras[i].until <= val && val <= eras[i].since)\n ) {\n return (\n (this.year() - hooks(eras[i].since).year()) * dir +\n eras[i].offset\n );\n }\n }\n\n return this.year();\n }\n\n function erasNameRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNameRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNameRegex : this._erasRegex;\n }\n\n function erasAbbrRegex(isStrict) {\n if (!hasOwnProp(this, '_erasAbbrRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasAbbrRegex : this._erasRegex;\n }\n\n function erasNarrowRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNarrowRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNarrowRegex : this._erasRegex;\n }\n\n function matchEraAbbr(isStrict, locale) {\n return locale.erasAbbrRegex(isStrict);\n }\n\n function matchEraName(isStrict, locale) {\n return locale.erasNameRegex(isStrict);\n }\n\n function matchEraNarrow(isStrict, locale) {\n return locale.erasNarrowRegex(isStrict);\n }\n\n function matchEraYearOrdinal(isStrict, locale) {\n return locale._eraYearOrdinalRegex || matchUnsigned;\n }\n\n function computeErasParse() {\n var abbrPieces = [],\n namePieces = [],\n narrowPieces = [],\n mixedPieces = [],\n i,\n l,\n eras = this.eras();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n namePieces.push(regexEscape(eras[i].name));\n abbrPieces.push(regexEscape(eras[i].abbr));\n narrowPieces.push(regexEscape(eras[i].narrow));\n\n mixedPieces.push(regexEscape(eras[i].name));\n mixedPieces.push(regexEscape(eras[i].abbr));\n mixedPieces.push(regexEscape(eras[i].narrow));\n }\n\n this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n this._erasNarrowRegex = new RegExp(\n '^(' + narrowPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n // PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1);\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (\n input,\n week,\n config,\n token\n ) {\n week[token.substr(0, 2)] = toInt(input);\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n // MOMENTS\n\n function getSetWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy\n );\n }\n\n function getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.isoWeek(),\n this.isoWeekday(),\n 1,\n 4\n );\n }\n\n function getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getISOWeeksInISOWeekYear() {\n return weeksInYear(this.isoWeekYear(), 1, 4);\n }\n\n function getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getWeeksInWeekYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n // FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n // ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n // PRIORITY\n\n addUnitPriority('quarter', 7);\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter(input) {\n return input == null\n ? Math.ceil((this.month() + 1) / 3)\n : this.month((input - 1) * 3 + (this.month() % 3));\n }\n\n // FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // ALIASES\n\n addUnitAlias('date', 'D');\n\n // PRIORITY\n addUnitPriority('date', 9);\n\n // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict\n ? locale._dayOfMonthOrdinalParse || locale._ordinalParse\n : locale._dayOfMonthOrdinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n // PRIORITY\n addUnitPriority('dayOfYear', 4);\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n // MOMENTS\n\n function getSetDayOfYear(input) {\n var dayOfYear =\n Math.round(\n (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5\n ) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // ALIASES\n\n addUnitAlias('minute', 'm');\n\n // PRIORITY\n\n addUnitPriority('minute', 14);\n\n // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // ALIASES\n\n addUnitAlias('second', 's');\n\n // PRIORITY\n\n addUnitPriority('second', 15);\n\n // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n // ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n // PRIORITY\n\n addUnitPriority('millisecond', 16);\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token, getSetMillisecond;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n\n getSetMillisecond = makeGetSet('Milliseconds', false);\n\n // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n if (typeof Symbol !== 'undefined' && Symbol.for != null) {\n proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n return 'Moment<' + this.format() + '>';\n };\n }\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.eraName = getEraName;\n proto.eraNarrow = getEraNarrow;\n proto.eraAbbr = getEraAbbr;\n proto.eraYear = getEraYear;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.weeksInWeekYear = getWeeksInWeekYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate(\n 'dates accessor is deprecated. Use date instead.',\n getSetDayOfMonth\n );\n proto.months = deprecate(\n 'months accessor is deprecated. Use month instead',\n getSetMonth\n );\n proto.years = deprecate(\n 'years accessor is deprecated. Use year instead',\n getSetYear\n );\n proto.zone = deprecate(\n 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',\n getSetZone\n );\n proto.isDSTShifted = deprecate(\n 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',\n isDaylightSavingTimeShifted\n );\n\n function createUnix(input) {\n return createLocal(input * 1000);\n }\n\n function createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat(string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n proto$1.eras = localeEras;\n proto$1.erasParse = localeErasParse;\n proto$1.erasConvertYear = localeErasConvertYear;\n proto$1.erasAbbrRegex = erasAbbrRegex;\n proto$1.erasNameRegex = erasNameRegex;\n proto$1.erasNarrowRegex = erasNarrowRegex;\n\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1(format, index, field, setter) {\n var locale = getLocale(),\n utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i,\n out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n function listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0,\n i,\n out = [];\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n\n function listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n eras: [\n {\n since: '0001-01-01',\n until: +Infinity,\n offset: 1,\n name: 'Anno Domini',\n narrow: 'AD',\n abbr: 'AD',\n },\n {\n since: '0000-12-31',\n until: -Infinity,\n offset: 1,\n name: 'Before Christ',\n narrow: 'BC',\n abbr: 'BC',\n },\n ],\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n toInt((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n });\n\n // Side effect imports\n\n hooks.lang = deprecate(\n 'moment.lang is deprecated. Use moment.locale instead.',\n getSetGlobalLocale\n );\n hooks.langData = deprecate(\n 'moment.langData is deprecated. Use moment.localeData instead.',\n getLocale\n );\n\n var mathAbs = Math.abs;\n\n function abs() {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble() {\n var milliseconds = this._milliseconds,\n days = this._days,\n months = this._months,\n data = this._data,\n seconds,\n minutes,\n hours,\n years,\n monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (\n !(\n (milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0)\n )\n ) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return (days * 4800) / 146097;\n }\n\n function monthsToDays(months) {\n // the reverse of daysToMonths\n return (months * 146097) / 4800;\n }\n\n function as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days,\n months,\n milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n switch (units) {\n case 'month':\n return months;\n case 'quarter':\n return months / 3;\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n case 'day':\n return days + milliseconds / 864e5;\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n // TODO: Use this.as('ms')?\n function valueOf$1() {\n if (!this.isValid()) {\n return NaN;\n }\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms'),\n asSeconds = makeAs('s'),\n asMinutes = makeAs('m'),\n asHours = makeAs('h'),\n asDays = makeAs('d'),\n asWeeks = makeAs('w'),\n asMonths = makeAs('M'),\n asQuarters = makeAs('Q'),\n asYears = makeAs('y');\n\n function clone$1() {\n return createDuration(this);\n }\n\n function get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds'),\n seconds = makeGetter('seconds'),\n minutes = makeGetter('minutes'),\n hours = makeGetter('hours'),\n days = makeGetter('days'),\n months = makeGetter('months'),\n years = makeGetter('years');\n\n function weeks() {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round,\n thresholds = {\n ss: 44, // a few seconds to seconds\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month/week\n w: null, // weeks to month\n M: 11, // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n var duration = createDuration(posNegDuration).abs(),\n seconds = round(duration.as('s')),\n minutes = round(duration.as('m')),\n hours = round(duration.as('h')),\n days = round(duration.as('d')),\n months = round(duration.as('M')),\n weeks = round(duration.as('w')),\n years = round(duration.as('y')),\n a =\n (seconds <= thresholds.ss && ['s', seconds]) ||\n (seconds < thresholds.s && ['ss', seconds]) ||\n (minutes <= 1 && ['m']) ||\n (minutes < thresholds.m && ['mm', minutes]) ||\n (hours <= 1 && ['h']) ||\n (hours < thresholds.h && ['hh', hours]) ||\n (days <= 1 && ['d']) ||\n (days < thresholds.d && ['dd', days]);\n\n if (thresholds.w != null) {\n a =\n a ||\n (weeks <= 1 && ['w']) ||\n (weeks < thresholds.w && ['ww', weeks]);\n }\n a = a ||\n (months <= 1 && ['M']) ||\n (months < thresholds.M && ['MM', months]) ||\n (years <= 1 && ['y']) || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n // This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n\n function humanize(argWithSuffix, argThresholds) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var withSuffix = false,\n th = thresholds,\n locale,\n output;\n\n if (typeof argWithSuffix === 'object') {\n argThresholds = argWithSuffix;\n argWithSuffix = false;\n }\n if (typeof argWithSuffix === 'boolean') {\n withSuffix = argWithSuffix;\n }\n if (typeof argThresholds === 'object') {\n th = Object.assign({}, thresholds, argThresholds);\n if (argThresholds.s != null && argThresholds.ss == null) {\n th.ss = argThresholds.s - 1;\n }\n }\n\n locale = this.localeData();\n output = relativeTime$1(this, !withSuffix, th, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function sign(x) {\n return (x > 0) - (x < 0) || +x;\n }\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000,\n days = abs$1(this._days),\n months = abs$1(this._months),\n minutes,\n hours,\n years,\n s,\n total = this.asSeconds(),\n totalSign,\n ymSign,\n daysSign,\n hmsSign;\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n\n totalSign = total < 0 ? '-' : '';\n ymSign = sign(this._months) !== sign(total) ? '-' : '';\n daysSign = sign(this._days) !== sign(total) ? '-' : '';\n hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n\n return (\n totalSign +\n 'P' +\n (years ? ymSign + years + 'Y' : '') +\n (months ? ymSign + months + 'M' : '') +\n (days ? daysSign + days + 'D' : '') +\n (hours || minutes || seconds ? 'T' : '') +\n (hours ? hmsSign + hours + 'H' : '') +\n (minutes ? hmsSign + minutes + 'M' : '') +\n (seconds ? hmsSign + s + 'S' : '')\n );\n }\n\n var proto$2 = Duration.prototype;\n\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n\n proto$2.toIsoString = deprecate(\n 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',\n toISOString$1\n );\n proto$2.lang = lang;\n\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n //! moment.js\n\n hooks.version = '2.29.1';\n\n setHookCallback(createLocal);\n\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n // currently HTML5 input type only supports 24-hour formats\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // \n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // \n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // \n DATE: 'YYYY-MM-DD', // \n TIME: 'HH:mm', // \n TIME_SECONDS: 'HH:mm:ss', // \n TIME_MS: 'HH:mm:ss.SSS', // \n WEEK: 'GGGG-[W]WW', // \n MONTH: 'YYYY-MM', // \n };\n\n return hooks;\n\n})));\n","\n\n// currently used to initiate the velocity style object to 0\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = mapToZero;\n\nfunction mapToZero(obj) {\n var ret = {};\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n ret[key] = 0;\n }\n }\n return ret;\n}\n\nmodule.exports = exports['default'];","\n// turn {x: {val: 1, stiffness: 1, damping: 2}, y: 2} generated by\n// `{x: spring(1, {stiffness: 1, damping: 2}), y: 2}` into {x: 1, y: 2}\n\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = stripStyle;\n\nfunction stripStyle(style) {\n var ret = {};\n for (var key in style) {\n if (!Object.prototype.hasOwnProperty.call(style, key)) {\n continue;\n }\n ret[key] = typeof style[key] === 'number' ? style[key] : style[key].val;\n }\n return ret;\n}\n\nmodule.exports = exports['default'];","\n\n// stepper is used a lot. Saves allocation to return the same array wrapper.\n// This is fine and danger-free against mutations because the callsite\n// immediately destructures it and gets the numbers inside without passing the\n\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = stepper;\n\nvar reusedTuple = [0, 0];\n\nfunction stepper(secondPerFrame, x, v, destX, k, b, precision) {\n // Spring stiffness, in kg / s^2\n\n // for animations, destX is really spring length (spring at rest). initial\n // position is considered as the stretched/compressed position of a spring\n var Fspring = -k * (x - destX);\n\n // Damping, in kg / s\n var Fdamper = -b * v;\n\n // usually we put mass here, but for animation purposes, specifying mass is a\n // bit redundant. you could simply adjust k and b accordingly\n // let a = (Fspring + Fdamper) / mass;\n var a = Fspring + Fdamper;\n\n var newV = v + a * secondPerFrame;\n var newX = x + newV * secondPerFrame;\n\n if (Math.abs(newV) < precision && Math.abs(newX - destX) < precision) {\n reusedTuple[0] = destX;\n reusedTuple[1] = 0;\n return reusedTuple;\n }\n\n reusedTuple[0] = newX;\n reusedTuple[1] = newV;\n return reusedTuple;\n}\n\nmodule.exports = exports[\"default\"];\n// array reference around.","// Generated by CoffeeScript 1.7.1\n(function() {\n var getNanoSeconds, hrtime, loadTime;\n\n if ((typeof performance !== \"undefined\" && performance !== null) && performance.now) {\n module.exports = function() {\n return performance.now();\n };\n } else if ((typeof process !== \"undefined\" && process !== null) && process.hrtime) {\n module.exports = function() {\n return (getNanoSeconds() - loadTime) / 1e6;\n };\n hrtime = process.hrtime;\n getNanoSeconds = function() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n loadTime = getNanoSeconds();\n } else if (Date.now) {\n module.exports = function() {\n return Date.now() - loadTime;\n };\n loadTime = Date.now();\n } else {\n module.exports = function() {\n return new Date().getTime() - loadTime;\n };\n loadTime = new Date().getTime();\n }\n\n}).call(this);\n","if performance? and performance.now\n module.exports = -> performance.now()\nelse if process? and process.hrtime\n module.exports = -> (getNanoSeconds() - nodeLoadTime) / 1e6\n hrtime = process.hrtime\n getNanoSeconds = ->\n hr = hrtime()\n hr[0] * 1e9 + hr[1]\n moduleLoadTime = getNanoSeconds()\n upTime = process.uptime() * 1e9\n nodeLoadTime = moduleLoadTime - upTime\nelse if Date.now\n module.exports = -> Date.now() - loadTime\n loadTime = Date.now()\nelse\n module.exports = -> new Date().getTime() - loadTime\n loadTime = new Date().getTime()\n","var now = require('performance-now')\n , root = typeof window === 'undefined' ? global : window\n , vendors = ['moz', 'webkit']\n , suffix = 'AnimationFrame'\n , raf = root['request' + suffix]\n , caf = root['cancel' + suffix] || root['cancelRequest' + suffix]\n\nfor(var i = 0; !raf && i < vendors.length; i++) {\n raf = root[vendors[i] + 'Request' + suffix]\n caf = root[vendors[i] + 'Cancel' + suffix]\n || root[vendors[i] + 'CancelRequest' + suffix]\n}\n\n// Some versions of FF have rAF but not cAF\nif(!raf || !caf) {\n var last = 0\n , id = 0\n , queue = []\n , frameDuration = 1000 / 60\n\n raf = function(callback) {\n if(queue.length === 0) {\n var _now = now()\n , next = Math.max(0, frameDuration - (_now - last))\n last = next + _now\n setTimeout(function() {\n var cp = queue.slice(0)\n // Clear queue here to prevent\n // callbacks from appending listeners\n // to the current frame's queue\n queue.length = 0\n for(var i = 0; i < cp.length; i++) {\n if(!cp[i].cancelled) {\n try{\n cp[i].callback(last)\n } catch(e) {\n setTimeout(function() { throw e }, 0)\n }\n }\n }\n }, Math.round(next))\n }\n queue.push({\n handle: ++id,\n callback: callback,\n cancelled: false\n })\n return id\n }\n\n caf = function(handle) {\n for(var i = 0; i < queue.length; i++) {\n if(queue[i].handle === handle) {\n queue[i].cancelled = true\n }\n }\n }\n}\n\nmodule.exports = function(fn) {\n // Wrap in a new function to prevent\n // `cancel` potentially being assigned\n // to the native rAF function\n return raf.call(root, fn)\n}\nmodule.exports.cancel = function() {\n caf.apply(root, arguments)\n}\nmodule.exports.polyfill = function(object) {\n if (!object) {\n object = root;\n }\n object.requestAnimationFrame = raf\n object.cancelAnimationFrame = caf\n}\n","\n\n// usage assumption: currentStyle values have already been rendered but it says\n// nothing of whether currentStyle is stale (see unreadPropStyle)\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = shouldStopAnimation;\n\nfunction shouldStopAnimation(currentStyle, style, currentVelocity) {\n for (var key in style) {\n if (!Object.prototype.hasOwnProperty.call(style, key)) {\n continue;\n }\n\n if (currentVelocity[key] !== 0) {\n return false;\n }\n\n var styleValue = typeof style[key] === 'number' ? style[key] : style[key].val;\n // stepper will have already taken care of rounding precision errors, so\n // won't have such thing as 0.9999 !=== 1\n if (currentStyle[key] !== styleValue) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = exports['default'];","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\nvar Motion = (function (_React$Component) {\n _inherits(Motion, _React$Component);\n\n _createClass(Motion, null, [{\n key: 'propTypes',\n value: {\n // TOOD: warn against putting a config in here\n defaultStyle: _propTypes2['default'].objectOf(_propTypes2['default'].number),\n style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired,\n children: _propTypes2['default'].func.isRequired,\n onRest: _propTypes2['default'].func\n },\n enumerable: true\n }]);\n\n function Motion(props) {\n var _this = this;\n\n _classCallCheck(this, Motion);\n\n _React$Component.call(this, props);\n this.wasAnimating = false;\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyle = null;\n\n this.clearUnreadPropStyle = function (destStyle) {\n var dirty = false;\n var _state = _this.state;\n var currentStyle = _state.currentStyle;\n var currentVelocity = _state.currentVelocity;\n var lastIdealStyle = _state.lastIdealStyle;\n var lastIdealVelocity = _state.lastIdealVelocity;\n\n for (var key in destStyle) {\n if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {\n continue;\n }\n\n var styleValue = destStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n currentStyle = _extends({}, currentStyle);\n currentVelocity = _extends({}, currentVelocity);\n lastIdealStyle = _extends({}, lastIdealStyle);\n lastIdealVelocity = _extends({}, lastIdealVelocity);\n }\n\n currentStyle[key] = styleValue;\n currentVelocity[key] = 0;\n lastIdealStyle[key] = styleValue;\n lastIdealVelocity[key] = 0;\n }\n }\n\n if (dirty) {\n _this.setState({ currentStyle: currentStyle, currentVelocity: currentVelocity, lastIdealStyle: lastIdealStyle, lastIdealVelocity: lastIdealVelocity });\n }\n };\n\n this.startAnimationIfNecessary = function () {\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n // check if we need to animate in the first place\n var propsStyle = _this.props.style;\n if (_shouldStopAnimation2['default'](_this.state.currentStyle, propsStyle, _this.state.currentVelocity)) {\n if (_this.wasAnimating && _this.props.onRest) {\n _this.props.onRest();\n }\n\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.wasAnimating = false;\n _this.accumulatedTime = 0;\n return;\n }\n\n _this.wasAnimating = true;\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n\n for (var key in propsStyle) {\n if (!Object.prototype.hasOwnProperty.call(propsStyle, key)) {\n continue;\n }\n\n var styleValue = propsStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = _this.state.lastIdealStyle[key];\n var newLastIdealVelocityValue = _this.state.lastIdealVelocity[key];\n for (var i = 0; i < framesToCatchUp; i++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyle: newCurrentStyle,\n currentVelocity: newCurrentVelocity,\n lastIdealStyle: newLastIdealStyle,\n lastIdealVelocity: newLastIdealVelocity\n });\n\n _this.unreadPropStyle = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n Motion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyle = _props.defaultStyle;\n var style = _props.style;\n\n var currentStyle = defaultStyle || _stripStyle2['default'](style);\n var currentVelocity = _mapToZero2['default'](currentStyle);\n return {\n currentStyle: currentStyle,\n currentVelocity: currentVelocity,\n lastIdealStyle: currentStyle,\n lastIdealVelocity: currentVelocity\n };\n };\n\n // it's possible that currentStyle's value is stale: if props is immediately\n // changed from 0 to 400 to spring(0) again, the async currentStyle is still\n // at 0 (didn't have time to tick and interpolate even once). If we naively\n // compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n // In reality currentStyle should be 400\n\n Motion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n Motion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyle != null) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyle);\n }\n\n this.unreadPropStyle = props.style;\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n Motion.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n Motion.prototype.render = function render() {\n var renderedChildren = this.props.children(this.state.currentStyle);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return Motion;\n})(_react2['default'].Component);\n\nexports['default'] = Motion;\nmodule.exports = exports['default'];\n\n// after checking for unreadPropStyle != null, we manually go set the\n// non-interpolating values (those that are a number, without a spring\n// config)","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\nfunction shouldStopAnimationAll(currentStyles, styles, currentVelocities) {\n for (var i = 0; i < currentStyles.length; i++) {\n if (!_shouldStopAnimation2['default'](currentStyles[i], styles[i], currentVelocities[i])) {\n return false;\n }\n }\n return true;\n}\n\nvar StaggeredMotion = (function (_React$Component) {\n _inherits(StaggeredMotion, _React$Component);\n\n _createClass(StaggeredMotion, null, [{\n key: 'propTypes',\n value: {\n // TOOD: warn against putting a config in here\n defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].objectOf(_propTypes2['default'].number)),\n styles: _propTypes2['default'].func.isRequired,\n children: _propTypes2['default'].func.isRequired\n },\n enumerable: true\n }]);\n\n function StaggeredMotion(props) {\n var _this = this;\n\n _classCallCheck(this, StaggeredMotion);\n\n _React$Component.call(this, props);\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyles = null;\n\n this.clearUnreadPropStyle = function (unreadPropStyles) {\n var _state = _this.state;\n var currentStyles = _state.currentStyles;\n var currentVelocities = _state.currentVelocities;\n var lastIdealStyles = _state.lastIdealStyles;\n var lastIdealVelocities = _state.lastIdealVelocities;\n\n var someDirty = false;\n for (var i = 0; i < unreadPropStyles.length; i++) {\n var unreadPropStyle = unreadPropStyles[i];\n var dirty = false;\n\n for (var key in unreadPropStyle) {\n if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {\n continue;\n }\n\n var styleValue = unreadPropStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n someDirty = true;\n currentStyles[i] = _extends({}, currentStyles[i]);\n currentVelocities[i] = _extends({}, currentVelocities[i]);\n lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);\n lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);\n }\n currentStyles[i][key] = styleValue;\n currentVelocities[i][key] = 0;\n lastIdealStyles[i][key] = styleValue;\n lastIdealVelocities[i][key] = 0;\n }\n }\n }\n\n if (someDirty) {\n _this.setState({ currentStyles: currentStyles, currentVelocities: currentVelocities, lastIdealStyles: lastIdealStyles, lastIdealVelocities: lastIdealVelocities });\n }\n };\n\n this.startAnimationIfNecessary = function () {\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n var destStyles = _this.props.styles(_this.state.lastIdealStyles);\n\n // check if we need to animate in the first place\n if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities)) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.accumulatedTime = 0;\n return;\n }\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var newLastIdealStyles = [];\n var newLastIdealVelocities = [];\n var newCurrentStyles = [];\n var newCurrentVelocities = [];\n\n for (var i = 0; i < destStyles.length; i++) {\n var destStyle = destStyles[i];\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n\n for (var key in destStyle) {\n if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {\n continue;\n }\n\n var styleValue = destStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = _this.state.lastIdealStyles[i][key];\n var newLastIdealVelocityValue = _this.state.lastIdealVelocities[i][key];\n for (var j = 0; j < framesToCatchUp; j++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n newCurrentStyles[i] = newCurrentStyle;\n newCurrentVelocities[i] = newCurrentVelocity;\n newLastIdealStyles[i] = newLastIdealStyle;\n newLastIdealVelocities[i] = newLastIdealVelocity;\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyles: newCurrentStyles,\n currentVelocities: newCurrentVelocities,\n lastIdealStyles: newLastIdealStyles,\n lastIdealVelocities: newLastIdealVelocities\n });\n\n _this.unreadPropStyles = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n StaggeredMotion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyles = _props.defaultStyles;\n var styles = _props.styles;\n\n var currentStyles = defaultStyles || styles().map(_stripStyle2['default']);\n var currentVelocities = currentStyles.map(function (currentStyle) {\n return _mapToZero2['default'](currentStyle);\n });\n return {\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n lastIdealStyles: currentStyles,\n lastIdealVelocities: currentVelocities\n };\n };\n\n StaggeredMotion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n StaggeredMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyles != null) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyles);\n }\n\n this.unreadPropStyles = props.styles(this.state.lastIdealStyles);\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n StaggeredMotion.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n StaggeredMotion.prototype.render = function render() {\n var renderedChildren = this.props.children(this.state.currentStyles);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return StaggeredMotion;\n})(_react2['default'].Component);\n\nexports['default'] = StaggeredMotion;\nmodule.exports = exports['default'];\n\n// it's possible that currentStyle's value is stale: if props is immediately\n// changed from 0 to 400 to spring(0) again, the async currentStyle is still\n// at 0 (didn't have time to tick and interpolate even once). If we naively\n// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n// In reality currentStyle should be 400\n\n// after checking for unreadPropStyles != null, we manually go set the\n// non-interpolating values (those that are a number, without a spring\n// config)","\n\n// core keys merging algorithm. If previous render's keys are [a, b], and the\n// next render's [c, b, d], what's the final merged keys and ordering?\n\n// - c and a must both be before b\n// - b before d\n// - ordering between a and c ambiguous\n\n// this reduces to merging two partially ordered lists (e.g. lists where not\n// every item has a definite ordering, like comparing a and c above). For the\n// ambiguous ordering we deterministically choose to place the next render's\n// item after the previous'; so c after a\n\n// this is called a topological sorting. Except the existing algorithms don't\n// work well with js bc of the amount of allocation, and isn't optimized for our\n// current use-case bc the runtime is linear in terms of edges (see wiki for\n// meaning), which is huge when two lists have many common elements\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = mergeDiff;\n\nfunction mergeDiff(prev, next, onRemove) {\n // bookkeeping for easier access of a key's index below. This is 2 allocations +\n // potentially triggering chrome hash map mode for objs (so it might be faster\n\n var prevKeyIndex = {};\n for (var i = 0; i < prev.length; i++) {\n prevKeyIndex[prev[i].key] = i;\n }\n var nextKeyIndex = {};\n for (var i = 0; i < next.length; i++) {\n nextKeyIndex[next[i].key] = i;\n }\n\n // first, an overly elaborate way of merging prev and next, eliminating\n // duplicates (in terms of keys). If there's dupe, keep the item in next).\n // This way of writing it saves allocations\n var ret = [];\n for (var i = 0; i < next.length; i++) {\n ret[i] = next[i];\n }\n for (var i = 0; i < prev.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(nextKeyIndex, prev[i].key)) {\n // this is called my TM's `mergeAndSync`, which calls willLeave. We don't\n // merge in keys that the user desires to kill\n var fill = onRemove(i, prev[i]);\n if (fill != null) {\n ret.push(fill);\n }\n }\n }\n\n // now all the items all present. Core sorting logic to have the right order\n return ret.sort(function (a, b) {\n var nextOrderA = nextKeyIndex[a.key];\n var nextOrderB = nextKeyIndex[b.key];\n var prevOrderA = prevKeyIndex[a.key];\n var prevOrderB = prevKeyIndex[b.key];\n\n if (nextOrderA != null && nextOrderB != null) {\n // both keys in next\n return nextKeyIndex[a.key] - nextKeyIndex[b.key];\n } else if (prevOrderA != null && prevOrderB != null) {\n // both keys in prev\n return prevKeyIndex[a.key] - prevKeyIndex[b.key];\n } else if (nextOrderA != null) {\n // key a in next, key b in prev\n\n // how to determine the order between a and b? We find a \"pivot\" (term\n // abuse), a key present in both prev and next, that is sandwiched between\n // a and b. In the context of our above example, if we're comparing a and\n // d, b's (the only) pivot\n for (var i = 0; i < next.length; i++) {\n var pivot = next[i].key;\n if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {\n continue;\n }\n\n if (nextOrderA < nextKeyIndex[pivot] && prevOrderB > prevKeyIndex[pivot]) {\n return -1;\n } else if (nextOrderA > nextKeyIndex[pivot] && prevOrderB < prevKeyIndex[pivot]) {\n return 1;\n }\n }\n // pluggable. default to: next bigger than prev\n return 1;\n }\n // prevOrderA, nextOrderB\n for (var i = 0; i < next.length; i++) {\n var pivot = next[i].key;\n if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {\n continue;\n }\n if (nextOrderB < nextKeyIndex[pivot] && prevOrderA > prevKeyIndex[pivot]) {\n return 1;\n } else if (nextOrderB > nextKeyIndex[pivot] && prevOrderA < prevKeyIndex[pivot]) {\n return -1;\n }\n }\n // pluggable. default to: next bigger than prev\n return -1;\n });\n}\n\nmodule.exports = exports['default'];\n// to loop through and find a key's index each time), but I no longer care","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _mergeDiff = require('./mergeDiff');\n\nvar _mergeDiff2 = _interopRequireDefault(_mergeDiff);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\n// the children function & (potential) styles function asks as param an\n// Array, where each TransitionPlainStyle is of the format\n// {key: string, data?: any, style: PlainStyle}. However, the way we keep\n// internal states doesn't contain such a data structure (check the state and\n// TransitionMotionState). So when children function and others ask for such\n// data we need to generate them on the fly by combining mergedPropsStyles and\n// currentStyles/lastIdealStyles\nfunction rehydrateStyles(mergedPropsStyles, unreadPropStyles, plainStyles) {\n // Copy the value to a `const` so that Flow understands that the const won't\n // change and will be non-nullable in the callback below.\n var cUnreadPropStyles = unreadPropStyles;\n if (cUnreadPropStyles == null) {\n return mergedPropsStyles.map(function (mergedPropsStyle, i) {\n return {\n key: mergedPropsStyle.key,\n data: mergedPropsStyle.data,\n style: plainStyles[i]\n };\n });\n }\n return mergedPropsStyles.map(function (mergedPropsStyle, i) {\n for (var j = 0; j < cUnreadPropStyles.length; j++) {\n if (cUnreadPropStyles[j].key === mergedPropsStyle.key) {\n return {\n key: cUnreadPropStyles[j].key,\n data: cUnreadPropStyles[j].data,\n style: plainStyles[i]\n };\n }\n }\n return { key: mergedPropsStyle.key, data: mergedPropsStyle.data, style: plainStyles[i] };\n });\n}\n\nfunction shouldStopAnimationAll(currentStyles, destStyles, currentVelocities, mergedPropsStyles) {\n if (mergedPropsStyles.length !== destStyles.length) {\n return false;\n }\n\n for (var i = 0; i < mergedPropsStyles.length; i++) {\n if (mergedPropsStyles[i].key !== destStyles[i].key) {\n return false;\n }\n }\n\n // we have the invariant that mergedPropsStyles and\n // currentStyles/currentVelocities/last* are synced in terms of cells, see\n // mergeAndSync comment for more info\n for (var i = 0; i < mergedPropsStyles.length; i++) {\n if (!_shouldStopAnimation2['default'](currentStyles[i], destStyles[i].style, currentVelocities[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n// core key merging logic\n\n// things to do: say previously merged style is {a, b}, dest style (prop) is {b,\n// c}, previous current (interpolating) style is {a, b}\n// **invariant**: current[i] corresponds to merged[i] in terms of key\n\n// steps:\n// turn merged style into {a?, b, c}\n// add c, value of c is destStyles.c\n// maybe remove a, aka call willLeave(a), then merged is either {b, c} or {a, b, c}\n// turn current (interpolating) style from {a, b} into {a?, b, c}\n// maybe remove a\n// certainly add c, value of c is willEnter(c)\n// loop over merged and construct new current\n// dest doesn't change, that's owner's\nfunction mergeAndSync(willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldLastIdealStyles, oldLastIdealVelocities) {\n var newMergedPropsStyles = _mergeDiff2['default'](oldMergedPropsStyles, destStyles, function (oldIndex, oldMergedPropsStyle) {\n var leavingStyle = willLeave(oldMergedPropsStyle);\n if (leavingStyle == null) {\n didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });\n return null;\n }\n if (_shouldStopAnimation2['default'](oldCurrentStyles[oldIndex], leavingStyle, oldCurrentVelocities[oldIndex])) {\n didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });\n return null;\n }\n return { key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data, style: leavingStyle };\n });\n\n var newCurrentStyles = [];\n var newCurrentVelocities = [];\n var newLastIdealStyles = [];\n var newLastIdealVelocities = [];\n for (var i = 0; i < newMergedPropsStyles.length; i++) {\n var newMergedPropsStyleCell = newMergedPropsStyles[i];\n var foundOldIndex = null;\n for (var j = 0; j < oldMergedPropsStyles.length; j++) {\n if (oldMergedPropsStyles[j].key === newMergedPropsStyleCell.key) {\n foundOldIndex = j;\n break;\n }\n }\n // TODO: key search code\n if (foundOldIndex == null) {\n var plainStyle = willEnter(newMergedPropsStyleCell);\n newCurrentStyles[i] = plainStyle;\n newLastIdealStyles[i] = plainStyle;\n\n var velocity = _mapToZero2['default'](newMergedPropsStyleCell.style);\n newCurrentVelocities[i] = velocity;\n newLastIdealVelocities[i] = velocity;\n } else {\n newCurrentStyles[i] = oldCurrentStyles[foundOldIndex];\n newLastIdealStyles[i] = oldLastIdealStyles[foundOldIndex];\n newCurrentVelocities[i] = oldCurrentVelocities[foundOldIndex];\n newLastIdealVelocities[i] = oldLastIdealVelocities[foundOldIndex];\n }\n }\n\n return [newMergedPropsStyles, newCurrentStyles, newCurrentVelocities, newLastIdealStyles, newLastIdealVelocities];\n}\n\nvar TransitionMotion = (function (_React$Component) {\n _inherits(TransitionMotion, _React$Component);\n\n _createClass(TransitionMotion, null, [{\n key: 'propTypes',\n value: {\n defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].shape({\n key: _propTypes2['default'].string.isRequired,\n data: _propTypes2['default'].any,\n style: _propTypes2['default'].objectOf(_propTypes2['default'].number).isRequired\n })),\n styles: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].arrayOf(_propTypes2['default'].shape({\n key: _propTypes2['default'].string.isRequired,\n data: _propTypes2['default'].any,\n style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired\n }))]).isRequired,\n children: _propTypes2['default'].func.isRequired,\n willEnter: _propTypes2['default'].func,\n willLeave: _propTypes2['default'].func,\n didLeave: _propTypes2['default'].func\n },\n enumerable: true\n }, {\n key: 'defaultProps',\n value: {\n willEnter: function willEnter(styleThatEntered) {\n return _stripStyle2['default'](styleThatEntered.style);\n },\n // recall: returning null makes the current unmounting TransitionStyle\n // disappear immediately\n willLeave: function willLeave() {\n return null;\n },\n didLeave: function didLeave() {}\n },\n enumerable: true\n }]);\n\n function TransitionMotion(props) {\n var _this = this;\n\n _classCallCheck(this, TransitionMotion);\n\n _React$Component.call(this, props);\n this.unmounting = false;\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyles = null;\n\n this.clearUnreadPropStyle = function (unreadPropStyles) {\n var _mergeAndSync = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, unreadPropStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);\n\n var mergedPropsStyles = _mergeAndSync[0];\n var currentStyles = _mergeAndSync[1];\n var currentVelocities = _mergeAndSync[2];\n var lastIdealStyles = _mergeAndSync[3];\n var lastIdealVelocities = _mergeAndSync[4];\n\n for (var i = 0; i < unreadPropStyles.length; i++) {\n var unreadPropStyle = unreadPropStyles[i].style;\n var dirty = false;\n\n for (var key in unreadPropStyle) {\n if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {\n continue;\n }\n\n var styleValue = unreadPropStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n currentStyles[i] = _extends({}, currentStyles[i]);\n currentVelocities[i] = _extends({}, currentVelocities[i]);\n lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);\n lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);\n mergedPropsStyles[i] = {\n key: mergedPropsStyles[i].key,\n data: mergedPropsStyles[i].data,\n style: _extends({}, mergedPropsStyles[i].style)\n };\n }\n currentStyles[i][key] = styleValue;\n currentVelocities[i][key] = 0;\n lastIdealStyles[i][key] = styleValue;\n lastIdealVelocities[i][key] = 0;\n mergedPropsStyles[i].style[key] = styleValue;\n }\n }\n }\n\n // unlike the other 2 components, we can't detect staleness and optionally\n // opt out of setState here. each style object's data might contain new\n // stuff we're not/cannot compare\n _this.setState({\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n mergedPropsStyles: mergedPropsStyles,\n lastIdealStyles: lastIdealStyles,\n lastIdealVelocities: lastIdealVelocities\n });\n };\n\n this.startAnimationIfNecessary = function () {\n if (_this.unmounting) {\n return;\n }\n\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n // https://github.com/chenglou/react-motion/pull/420\n // > if execution passes the conditional if (this.unmounting), then\n // executes async defaultRaf and after that component unmounts and after\n // that the callback of defaultRaf is called, then setState will be called\n // on unmounted component.\n if (_this.unmounting) {\n return;\n }\n\n var propStyles = _this.props.styles;\n var destStyles = typeof propStyles === 'function' ? propStyles(rehydrateStyles(_this.state.mergedPropsStyles, _this.unreadPropStyles, _this.state.lastIdealStyles)) : propStyles;\n\n // check if we need to animate in the first place\n if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities, _this.state.mergedPropsStyles)) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.accumulatedTime = 0;\n return;\n }\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var _mergeAndSync2 = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, destStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);\n\n var newMergedPropsStyles = _mergeAndSync2[0];\n var newCurrentStyles = _mergeAndSync2[1];\n var newCurrentVelocities = _mergeAndSync2[2];\n var newLastIdealStyles = _mergeAndSync2[3];\n var newLastIdealVelocities = _mergeAndSync2[4];\n\n for (var i = 0; i < newMergedPropsStyles.length; i++) {\n var newMergedPropsStyle = newMergedPropsStyles[i].style;\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n\n for (var key in newMergedPropsStyle) {\n if (!Object.prototype.hasOwnProperty.call(newMergedPropsStyle, key)) {\n continue;\n }\n\n var styleValue = newMergedPropsStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = newLastIdealStyles[i][key];\n var newLastIdealVelocityValue = newLastIdealVelocities[i][key];\n for (var j = 0; j < framesToCatchUp; j++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n newLastIdealStyles[i] = newLastIdealStyle;\n newLastIdealVelocities[i] = newLastIdealVelocity;\n newCurrentStyles[i] = newCurrentStyle;\n newCurrentVelocities[i] = newCurrentVelocity;\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyles: newCurrentStyles,\n currentVelocities: newCurrentVelocities,\n lastIdealStyles: newLastIdealStyles,\n lastIdealVelocities: newLastIdealVelocities,\n mergedPropsStyles: newMergedPropsStyles\n });\n\n _this.unreadPropStyles = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n TransitionMotion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyles = _props.defaultStyles;\n var styles = _props.styles;\n var willEnter = _props.willEnter;\n var willLeave = _props.willLeave;\n var didLeave = _props.didLeave;\n\n var destStyles = typeof styles === 'function' ? styles(defaultStyles) : styles;\n\n // this is special. for the first time around, we don't have a comparison\n // between last (no last) and current merged props. we'll compute last so:\n // say default is {a, b} and styles (dest style) is {b, c}, we'll\n // fabricate last as {a, b}\n var oldMergedPropsStyles = undefined;\n if (defaultStyles == null) {\n oldMergedPropsStyles = destStyles;\n } else {\n oldMergedPropsStyles = defaultStyles.map(function (defaultStyleCell) {\n // TODO: key search code\n for (var i = 0; i < destStyles.length; i++) {\n if (destStyles[i].key === defaultStyleCell.key) {\n return destStyles[i];\n }\n }\n return defaultStyleCell;\n });\n }\n var oldCurrentStyles = defaultStyles == null ? destStyles.map(function (s) {\n return _stripStyle2['default'](s.style);\n }) : defaultStyles.map(function (s) {\n return _stripStyle2['default'](s.style);\n });\n var oldCurrentVelocities = defaultStyles == null ? destStyles.map(function (s) {\n return _mapToZero2['default'](s.style);\n }) : defaultStyles.map(function (s) {\n return _mapToZero2['default'](s.style);\n });\n\n var _mergeAndSync3 = mergeAndSync(\n // Because this is an old-style createReactClass component, Flow doesn't\n // understand that the willEnter and willLeave props have default values\n // and will always be present.\n willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldCurrentStyles, // oldLastIdealStyles really\n oldCurrentVelocities);\n\n var mergedPropsStyles = _mergeAndSync3[0];\n var currentStyles = _mergeAndSync3[1];\n var currentVelocities = _mergeAndSync3[2];\n var lastIdealStyles = _mergeAndSync3[3];\n var lastIdealVelocities = _mergeAndSync3[4];\n // oldLastIdealVelocities really\n\n return {\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n lastIdealStyles: lastIdealStyles,\n lastIdealVelocities: lastIdealVelocities,\n mergedPropsStyles: mergedPropsStyles\n };\n };\n\n // after checking for unreadPropStyles != null, we manually go set the\n // non-interpolating values (those that are a number, without a spring\n // config)\n\n TransitionMotion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n TransitionMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyles) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyles);\n }\n\n var styles = props.styles;\n if (typeof styles === 'function') {\n this.unreadPropStyles = styles(rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.lastIdealStyles));\n } else {\n this.unreadPropStyles = styles;\n }\n\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n TransitionMotion.prototype.componentWillUnmount = function componentWillUnmount() {\n this.unmounting = true;\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n TransitionMotion.prototype.render = function render() {\n var hydratedStyles = rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.currentStyles);\n var renderedChildren = this.props.children(hydratedStyles);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return TransitionMotion;\n})(_react2['default'].Component);\n\nexports['default'] = TransitionMotion;\nmodule.exports = exports['default'];\n\n// list of styles, each containing interpolating values. Part of what's passed\n// to children function. Notice that this is\n// Array, without the wrapper that is {key: ...,\n// data: ... style: ActualInterpolatingStyleObject}. Only mergedPropsStyles\n// contains the key & data info (so that we only have a single source of truth\n// for these, and to save space). Check the comment for `rehydrateStyles` to\n// see how we regenerate the entirety of what's passed to children function\n\n// the array that keeps track of currently rendered stuff! Including stuff\n// that you've unmounted but that's still animating. This is where it lives\n\n// it's possible that currentStyle's value is stale: if props is immediately\n// changed from 0 to 400 to spring(0) again, the async currentStyle is still\n// at 0 (didn't have time to tick and interpolate even once). If we naively\n// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n// In reality currentStyle should be 400","\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = {\n noWobble: { stiffness: 170, damping: 26 }, // the default, if nothing provided\n gentle: { stiffness: 120, damping: 14 },\n wobbly: { stiffness: 180, damping: 12 },\n stiff: { stiffness: 210, damping: 20 }\n};\nmodule.exports = exports[\"default\"];","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports['default'] = spring;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _presets = require('./presets');\n\nvar _presets2 = _interopRequireDefault(_presets);\n\nvar defaultConfig = _extends({}, _presets2['default'].noWobble, {\n precision: 0.01\n});\n\nfunction spring(val, config) {\n return _extends({}, defaultConfig, config, { val: val });\n}\n\nmodule.exports = exports['default'];","'use strict';\n\nexports.__esModule = true;\nexports['default'] = reorderKeys;\n\nvar hasWarned = false;\n\nfunction reorderKeys() {\n if (process.env.NODE_ENV === 'development') {\n if (!hasWarned) {\n hasWarned = true;\n console.error('`reorderKeys` has been removed, since it is no longer needed for TransitionMotion\\'s new styles array API.');\n }\n }\n}\n\nmodule.exports = exports['default'];","'use strict';\n\nexports.__esModule = true;\n\nfunction _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; }\n\nvar _Motion = require('./Motion');\n\nexports.Motion = _interopRequire(_Motion);\n\nvar _StaggeredMotion = require('./StaggeredMotion');\n\nexports.StaggeredMotion = _interopRequire(_StaggeredMotion);\n\nvar _TransitionMotion = require('./TransitionMotion');\n\nexports.TransitionMotion = _interopRequire(_TransitionMotion);\n\nvar _spring = require('./spring');\n\nexports.spring = _interopRequire(_spring);\n\nvar _presets = require('./presets');\n\nexports.presets = _interopRequire(_presets);\n\nvar _stripStyle = require('./stripStyle');\n\nexports.stripStyle = _interopRequire(_stripStyle);\n\n// deprecated, dummy warning function\n\nvar _reorderKeys = require('./reorderKeys');\n\nexports.reorderKeys = _interopRequire(_reorderKeys);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ReactHeight = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar getElementHeightDefault = function getElementHeightDefault(el) {\n return el.clientHeight;\n};\n\nvar ReactHeight =\n/*#__PURE__*/\nfunction (_PureComponent) {\n _inherits(ReactHeight, _PureComponent);\n\n function ReactHeight(props) {\n var _this;\n\n _classCallCheck(this, ReactHeight);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactHeight).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"setWrapperRef\", function (el) {\n _this.wrapper = el;\n });\n\n _this.state = {\n dirty: props.dirty,\n height: 0\n };\n return _this;\n }\n\n _createClass(ReactHeight, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n var getElementHeight = this.props.getElementHeight;\n var height = getElementHeight(this.wrapper);\n var dirty = false;\n this.setState({\n height: height,\n dirty: dirty\n }, function () {\n var onHeightReady = _this2.props.onHeightReady;\n var currentHeight = _this2.state.height;\n onHeightReady(currentHeight);\n });\n } // eslint-disable-next-line react/no-deprecated\n\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(_ref) {\n var children = _ref.children,\n dirty = _ref.dirty;\n var oldChildren = this.props.children;\n\n if (children !== oldChildren || dirty) {\n this.setState({\n dirty: true\n });\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n var _this3 = this;\n\n var getElementHeight = this.props.getElementHeight;\n var height = getElementHeight(this.wrapper);\n var dirty = false;\n var currentSavedHeight = this.state.height;\n\n if (height === currentSavedHeight) {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n dirty: dirty\n });\n } else {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n height: height,\n dirty: dirty\n }, function () {\n var onHeightReady = _this3.props.onHeightReady;\n var currentHeight = _this3.state.height;\n onHeightReady(currentHeight);\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n _onHeightReady = _this$props.onHeightReady,\n _getElementHeight = _this$props.getElementHeight,\n _dirty = _this$props.dirty,\n hidden = _this$props.hidden,\n children = _this$props.children,\n props = _objectWithoutProperties(_this$props, [\"onHeightReady\", \"getElementHeight\", \"dirty\", \"hidden\", \"children\"]);\n\n var dirty = this.state.dirty;\n\n if (hidden && !dirty) {\n return null;\n }\n\n if (hidden) {\n return _react[\"default\"].createElement(\"div\", {\n style: {\n height: 0,\n overflow: 'hidden'\n }\n }, _react[\"default\"].createElement(\"div\", _extends({\n ref: this.setWrapperRef\n }, props), children));\n }\n\n return _react[\"default\"].createElement(\"div\", _extends({\n ref: this.setWrapperRef\n }, props), children);\n }\n }]);\n\n return ReactHeight;\n}(_react.PureComponent);\n\nexports.ReactHeight = ReactHeight;\n\n_defineProperty(ReactHeight, \"defaultProps\", {\n hidden: false,\n dirty: true,\n getElementHeight: getElementHeightDefault\n});","\"use strict\";\n\nvar _require = require('./ReactHeight'),\n ReactHeight = _require.ReactHeight;\n\nReactHeight.ReactHeight = ReactHeight;\nmodule.exports = ReactHeight;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {Motion, spring} from 'react-motion';\nimport HeightReporter from 'react-height';\n\n\nconst PRECISION = 0.5;\n\n\nconst stringHeight = height => Math.max(0, parseFloat(height)).toFixed(1);\n\n\nexport default class Collapse extends React.Component {\n static propTypes = {\n isOpened: PropTypes.bool.isRequired,\n children: PropTypes.node.isRequired,\n fixedHeight: PropTypes.number,\n style: PropTypes.object, // eslint-disable-line react/forbid-prop-types\n springConfig: PropTypes.objectOf(PropTypes.number),\n keepCollapsedContent: PropTypes.bool,\n onRest: PropTypes.func,\n onHeightReady: PropTypes.func\n };\n\n\n static defaultProps = {\n fixedHeight: -1,\n style: {},\n keepCollapsedContent: false,\n onHeightReady: () => {} // eslint-disable-line no-empty-function\n };\n\n\n constructor(props) {\n super(props);\n this.state = {height: -1, isOpenedChanged: false};\n }\n\n\n componentWillMount() {\n this.height = stringHeight(0);\n this.renderStatic = true;\n }\n\n\n componentWillReceiveProps({isOpened}) {\n this.setState({isOpenedChanged: isOpened !== this.props.isOpened});\n }\n\n\n componentDidUpdate({isOpened}) {\n if (isOpened !== this.props.isOpened) {\n const report = this.props.isOpened ? this.state.height : 0;\n\n this.props.onHeightReady(report);\n }\n }\n\n\n onHeightReady = height => {\n const {isOpened, onHeightReady} = this.props;\n\n if (this.renderStatic && isOpened) {\n this.height = stringHeight(height);\n }\n\n this.setState({height: isOpened || !this.renderStatic ? height : 0});\n\n const reportHeight = isOpened ? height : 0;\n\n if (this.state.height !== reportHeight) {\n onHeightReady(reportHeight);\n }\n };\n\n\n getMotionHeight(height) {\n const {isOpened, springConfig, fixedHeight} = this.props;\n const {isOpenedChanged} = this.state;\n\n const newHeight = isOpened ? Math.max(0, parseFloat(height)).toFixed(1) : stringHeight(0);\n\n // No need to animate if content is closed and it was closed previously\n // Also no need to animate if height did not change\n const skipAnimation = !isOpenedChanged && !isOpened ||\n this.height === newHeight && fixedHeight === -1;\n\n const springHeight = spring(isOpened ? Math.max(0, height) : 0, {\n precision: PRECISION,\n ...springConfig\n });\n const instantHeight = isOpened ? Math.max(0, height) : 0;\n\n return skipAnimation ? instantHeight : springHeight;\n }\n\n\n renderFixed() {\n const {\n springConfig: _springConfig,\n onHeightReady: _onHeightReady,\n onRest: _onRest,\n isOpened,\n style,\n children,\n fixedHeight,\n keepCollapsedContent,\n ...props\n } = this.props;\n\n if (this.renderStatic) {\n this.renderStatic = false;\n const newStyle = {overflow: 'hidden', height: isOpened ? fixedHeight : 0};\n\n if (!keepCollapsedContent && !isOpened) {\n return null;\n }\n this.height = stringHeight(fixedHeight);\n return
{children}
;\n }\n\n return (\n \n {({height}) => {\n this.height = stringHeight(height);\n\n // TODO: this should be done using onEnd from ReactMotion, which is not yet implemented\n // See https://github.com/chenglou/react-motion/issues/235\n if (!keepCollapsedContent && !isOpened && this.height === stringHeight(0)) {\n return null;\n }\n\n const newStyle = {overflow: 'hidden', height};\n\n return
{children}
;\n }}\n \n );\n }\n\n\n render() {\n const {\n springConfig: _springConfig,\n onHeightReady: _onHeightReady,\n isOpened,\n style,\n children,\n fixedHeight,\n keepCollapsedContent,\n onRest,\n ...props\n } = this.props;\n\n if (fixedHeight > -1) {\n return this.renderFixed();\n }\n\n const renderStatic = this.renderStatic;\n const {height} = this.state;\n const currentStringHeight = parseFloat(height).toFixed(1);\n\n if (height > -1 && renderStatic) {\n this.renderStatic = false;\n }\n\n // Cache Content so it is not re-rendered on each animation step\n const content = {children};\n\n if (renderStatic) {\n const newStyle = isOpened ? {height: 'auto'} : {overflow: 'hidden', height: 0};\n\n if (!isOpened && height > -1) {\n if (!keepCollapsedContent) {\n return null;\n }\n\n return (\n
\n {content}\n
\n );\n }\n\n // to prevent loosing input after causing this component to rerender\n return (\n \n {() =>\n
{content}
\n }\n
\n );\n }\n\n return (\n \n {st => {\n this.height = stringHeight(st.height);\n\n // TODO: this should be done using onEnd from ReactMotion, which is not yet implemented\n // See https://github.com/chenglou/react-motion/issues/235\n if (!isOpened && this.height === '0.0') {\n if (!keepCollapsedContent) {\n return null;\n }\n return (\n
{content}
\n );\n }\n\n const newStyle = isOpened && this.height === currentStringHeight ? {height: 'auto'} : {\n height: st.height, overflow: 'hidden'\n };\n\n return
{content}
;\n }}\n \n );\n }\n}\n","'use strict';\n\n// Babel6 does not hack the default behaviour of ES Modules anymore, so we should export\nconst Collapse = require('./Collapse').default;\n\nmodule.exports = Collapse;\n","'use strict';\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction ToObject(val) {\n\tif (val == null) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction ownEnumerableKeys(obj) {\n\tvar keys = Object.getOwnPropertyNames(obj);\n\n\tif (Object.getOwnPropertySymbols) {\n\t\tkeys = keys.concat(Object.getOwnPropertySymbols(obj));\n\t}\n\n\treturn keys.filter(function (key) {\n\t\treturn propIsEnumerable.call(obj, key);\n\t});\n}\n\nmodule.exports = Object.assign || function (target, source) {\n\tvar from;\n\tvar keys;\n\tvar to = ToObject(target);\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = arguments[s];\n\t\tkeys = ownEnumerableKeys(Object(from));\n\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tto[keys[i]] = from[keys[i]];\n\t\t}\n\t}\n\n\treturn to;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\n// -- Inlined from fbjs --\n\nvar emptyObject = {};\n\nif (process.env.NODE_ENV !== 'production') {\n Object.freeze(emptyObject);\n}\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction _invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nvar warning = function(){};\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\n// /-- Inlined from fbjs --\n\nvar MIXINS_KEY = 'mixins';\n\n// Helper function to allow the creation of anonymous functions which do not\n// have .name set to the name of the variable being assigned to.\nfunction identity(fn) {\n return fn;\n}\n\nvar ReactPropTypeLocationNames;\nif (process.env.NODE_ENV !== 'production') {\n ReactPropTypeLocationNames = {\n prop: 'prop',\n context: 'context',\n childContext: 'child context'\n };\n} else {\n ReactPropTypeLocationNames = {};\n}\n\nfunction factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {\n /**\n * Policies that describe methods in `ReactClassInterface`.\n */\n\n var injectedMixins = [];\n\n /**\n * Composite components are higher-level components that compose other composite\n * or host components.\n *\n * To create a new type of `ReactClass`, pass a specification of\n * your new class to `React.createClass`. The only requirement of your class\n * specification is that you implement a `render` method.\n *\n * var MyComponent = React.createClass({\n * render: function() {\n * return
Hello World
;\n * }\n * });\n *\n * The class specification supports a specific protocol of methods that have\n * special meaning (e.g. `render`). See `ReactClassInterface` for\n * more the comprehensive protocol. Any other properties and methods in the\n * class specification will be available on the prototype.\n *\n * @interface ReactClassInterface\n * @internal\n */\n var ReactClassInterface = {\n /**\n * An array of Mixin objects to include when defining your component.\n *\n * @type {array}\n * @optional\n */\n mixins: 'DEFINE_MANY',\n\n /**\n * An object containing properties and methods that should be defined on\n * the component's constructor instead of its prototype (static methods).\n *\n * @type {object}\n * @optional\n */\n statics: 'DEFINE_MANY',\n\n /**\n * Definition of prop types for this component.\n *\n * @type {object}\n * @optional\n */\n propTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types for this component.\n *\n * @type {object}\n * @optional\n */\n contextTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types this component sets for its children.\n *\n * @type {object}\n * @optional\n */\n childContextTypes: 'DEFINE_MANY',\n\n // ==== Definition methods ====\n\n /**\n * Invoked when the component is mounted. Values in the mapping will be set on\n * `this.props` if that prop is not specified (i.e. using an `in` check).\n *\n * This method is invoked before `getInitialState` and therefore cannot rely\n * on `this.state` or use `this.setState`.\n *\n * @return {object}\n * @optional\n */\n getDefaultProps: 'DEFINE_MANY_MERGED',\n\n /**\n * Invoked once before the component is mounted. The return value will be used\n * as the initial value of `this.state`.\n *\n * getInitialState: function() {\n * return {\n * isOn: false,\n * fooBaz: new BazFoo()\n * }\n * }\n *\n * @return {object}\n * @optional\n */\n getInitialState: 'DEFINE_MANY_MERGED',\n\n /**\n * @return {object}\n * @optional\n */\n getChildContext: 'DEFINE_MANY_MERGED',\n\n /**\n * Uses props from `this.props` and state from `this.state` to render the\n * structure of the component.\n *\n * No guarantees are made about when or how often this method is invoked, so\n * it must not have side effects.\n *\n * render: function() {\n * var name = this.props.name;\n * return
Hello, {name}!
;\n * }\n *\n * @return {ReactComponent}\n * @required\n */\n render: 'DEFINE_ONCE',\n\n // ==== Delegate methods ====\n\n /**\n * Invoked when the component is initially created and about to be mounted.\n * This may have side effects, but any external subscriptions or data created\n * by this method must be cleaned up in `componentWillUnmount`.\n *\n * @optional\n */\n componentWillMount: 'DEFINE_MANY',\n\n /**\n * Invoked when the component has been mounted and has a DOM representation.\n * However, there is no guarantee that the DOM node is in the document.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been mounted (initialized and rendered) for the first time.\n *\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidMount: 'DEFINE_MANY',\n\n /**\n * Invoked before the component receives new props.\n *\n * Use this as an opportunity to react to a prop transition by updating the\n * state using `this.setState`. Current props are accessed via `this.props`.\n *\n * componentWillReceiveProps: function(nextProps, nextContext) {\n * this.setState({\n * likesIncreasing: nextProps.likeCount > this.props.likeCount\n * });\n * }\n *\n * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop\n * transition may cause a state change, but the opposite is not true. If you\n * need it, you are probably looking for `componentWillUpdate`.\n *\n * @param {object} nextProps\n * @optional\n */\n componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Invoked while deciding if the component should be updated as a result of\n * receiving new props, state and/or context.\n *\n * Use this as an opportunity to `return false` when you're certain that the\n * transition to the new props/state/context will not require a component\n * update.\n *\n * shouldComponentUpdate: function(nextProps, nextState, nextContext) {\n * return !equal(nextProps, this.props) ||\n * !equal(nextState, this.state) ||\n * !equal(nextContext, this.context);\n * }\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @return {boolean} True if the component should update.\n * @optional\n */\n shouldComponentUpdate: 'DEFINE_ONCE',\n\n /**\n * Invoked when the component is about to update due to a transition from\n * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`\n * and `nextContext`.\n *\n * Use this as an opportunity to perform preparation before an update occurs.\n *\n * NOTE: You **cannot** use `this.setState()` in this method.\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @param {ReactReconcileTransaction} transaction\n * @optional\n */\n componentWillUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component's DOM representation has been updated.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been updated.\n *\n * @param {object} prevProps\n * @param {?object} prevState\n * @param {?object} prevContext\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component is about to be removed from its parent and have\n * its DOM representation destroyed.\n *\n * Use this as an opportunity to deallocate any external resources.\n *\n * NOTE: There is no `componentDidUnmount` since your component will have been\n * destroyed by that point.\n *\n * @optional\n */\n componentWillUnmount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillMount`.\n *\n * @optional\n */\n UNSAFE_componentWillMount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillReceiveProps`.\n *\n * @optional\n */\n UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillUpdate`.\n *\n * @optional\n */\n UNSAFE_componentWillUpdate: 'DEFINE_MANY',\n\n // ==== Advanced methods ====\n\n /**\n * Updates the component's currently mounted DOM representation.\n *\n * By default, this implements React's rendering and reconciliation algorithm.\n * Sophisticated clients may wish to override this.\n *\n * @param {ReactReconcileTransaction} transaction\n * @internal\n * @overridable\n */\n updateComponent: 'OVERRIDE_BASE'\n };\n\n /**\n * Similar to ReactClassInterface but for static methods.\n */\n var ReactClassStaticInterface = {\n /**\n * This method is invoked after a component is instantiated and when it\n * receives new props. Return an object to update state in response to\n * prop changes. Return null to indicate no change to state.\n *\n * If an object is returned, its keys will be merged into the existing state.\n *\n * @return {object || null}\n * @optional\n */\n getDerivedStateFromProps: 'DEFINE_MANY_MERGED'\n };\n\n /**\n * Mapping from class specification keys to special processing functions.\n *\n * Although these are declared like instance properties in the specification\n * when defining classes using `React.createClass`, they are actually static\n * and are accessible on the constructor instead of the prototype. Despite\n * being static, they must be defined outside of the \"statics\" key under\n * which all other static methods are defined.\n */\n var RESERVED_SPEC_KEYS = {\n displayName: function(Constructor, displayName) {\n Constructor.displayName = displayName;\n },\n mixins: function(Constructor, mixins) {\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n mixSpecIntoComponent(Constructor, mixins[i]);\n }\n }\n },\n childContextTypes: function(Constructor, childContextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, childContextTypes, 'childContext');\n }\n Constructor.childContextTypes = _assign(\n {},\n Constructor.childContextTypes,\n childContextTypes\n );\n },\n contextTypes: function(Constructor, contextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, contextTypes, 'context');\n }\n Constructor.contextTypes = _assign(\n {},\n Constructor.contextTypes,\n contextTypes\n );\n },\n /**\n * Special case getDefaultProps which should move into statics but requires\n * automatic merging.\n */\n getDefaultProps: function(Constructor, getDefaultProps) {\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps = createMergedResultFunction(\n Constructor.getDefaultProps,\n getDefaultProps\n );\n } else {\n Constructor.getDefaultProps = getDefaultProps;\n }\n },\n propTypes: function(Constructor, propTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, propTypes, 'prop');\n }\n Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);\n },\n statics: function(Constructor, statics) {\n mixStaticSpecIntoComponent(Constructor, statics);\n },\n autobind: function() {}\n };\n\n function validateTypeDef(Constructor, typeDef, location) {\n for (var propName in typeDef) {\n if (typeDef.hasOwnProperty(propName)) {\n // use a warning instead of an _invariant so components\n // don't show up in prod but only in __DEV__\n if (process.env.NODE_ENV !== 'production') {\n warning(\n typeof typeDef[propName] === 'function',\n '%s: %s type `%s` is invalid; it must be a function, usually from ' +\n 'React.PropTypes.',\n Constructor.displayName || 'ReactClass',\n ReactPropTypeLocationNames[location],\n propName\n );\n }\n }\n }\n }\n\n function validateMethodOverride(isAlreadyDefined, name) {\n var specPolicy = ReactClassInterface.hasOwnProperty(name)\n ? ReactClassInterface[name]\n : null;\n\n // Disallow overriding of base class methods unless explicitly allowed.\n if (ReactClassMixin.hasOwnProperty(name)) {\n _invariant(\n specPolicy === 'OVERRIDE_BASE',\n 'ReactClassInterface: You are attempting to override ' +\n '`%s` from your class specification. Ensure that your method names ' +\n 'do not overlap with React methods.',\n name\n );\n }\n\n // Disallow defining methods more than once unless explicitly allowed.\n if (isAlreadyDefined) {\n _invariant(\n specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',\n 'ReactClassInterface: You are attempting to define ' +\n '`%s` on your component more than once. This conflict may be due ' +\n 'to a mixin.',\n name\n );\n }\n }\n\n /**\n * Mixin helper which handles policy validation and reserved\n * specification keys when building React classes.\n */\n function mixSpecIntoComponent(Constructor, spec) {\n if (!spec) {\n if (process.env.NODE_ENV !== 'production') {\n var typeofSpec = typeof spec;\n var isMixinValid = typeofSpec === 'object' && spec !== null;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n isMixinValid,\n \"%s: You're attempting to include a mixin that is either null \" +\n 'or not an object. Check the mixins included by the component, ' +\n 'as well as any mixins they include themselves. ' +\n 'Expected object but got %s.',\n Constructor.displayName || 'ReactClass',\n spec === null ? null : typeofSpec\n );\n }\n }\n\n return;\n }\n\n _invariant(\n typeof spec !== 'function',\n \"ReactClass: You're attempting to \" +\n 'use a component class or function as a mixin. Instead, just use a ' +\n 'regular object.'\n );\n _invariant(\n !isValidElement(spec),\n \"ReactClass: You're attempting to \" +\n 'use a component as a mixin. Instead, just use a regular object.'\n );\n\n var proto = Constructor.prototype;\n var autoBindPairs = proto.__reactAutoBindPairs;\n\n // By handling mixins before any other properties, we ensure the same\n // chaining order is applied to methods with DEFINE_MANY policy, whether\n // mixins are listed before or after these methods in the spec.\n if (spec.hasOwnProperty(MIXINS_KEY)) {\n RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n }\n\n for (var name in spec) {\n if (!spec.hasOwnProperty(name)) {\n continue;\n }\n\n if (name === MIXINS_KEY) {\n // We have already handled mixins in a special case above.\n continue;\n }\n\n var property = spec[name];\n var isAlreadyDefined = proto.hasOwnProperty(name);\n validateMethodOverride(isAlreadyDefined, name);\n\n if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n RESERVED_SPEC_KEYS[name](Constructor, property);\n } else {\n // Setup methods on prototype:\n // The following member methods should not be automatically bound:\n // 1. Expected ReactClass methods (in the \"interface\").\n // 2. Overridden methods (that were mixed in).\n var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n var isFunction = typeof property === 'function';\n var shouldAutoBind =\n isFunction &&\n !isReactClassMethod &&\n !isAlreadyDefined &&\n spec.autobind !== false;\n\n if (shouldAutoBind) {\n autoBindPairs.push(name, property);\n proto[name] = property;\n } else {\n if (isAlreadyDefined) {\n var specPolicy = ReactClassInterface[name];\n\n // These cases should already be caught by validateMethodOverride.\n _invariant(\n isReactClassMethod &&\n (specPolicy === 'DEFINE_MANY_MERGED' ||\n specPolicy === 'DEFINE_MANY'),\n 'ReactClass: Unexpected spec policy %s for key %s ' +\n 'when mixing in component specs.',\n specPolicy,\n name\n );\n\n // For methods which are defined more than once, call the existing\n // methods before calling the new property, merging if appropriate.\n if (specPolicy === 'DEFINE_MANY_MERGED') {\n proto[name] = createMergedResultFunction(proto[name], property);\n } else if (specPolicy === 'DEFINE_MANY') {\n proto[name] = createChainedFunction(proto[name], property);\n }\n } else {\n proto[name] = property;\n if (process.env.NODE_ENV !== 'production') {\n // Add verbose displayName to the function, which helps when looking\n // at profiling tools.\n if (typeof property === 'function' && spec.displayName) {\n proto[name].displayName = spec.displayName + '_' + name;\n }\n }\n }\n }\n }\n }\n }\n\n function mixStaticSpecIntoComponent(Constructor, statics) {\n if (!statics) {\n return;\n }\n\n for (var name in statics) {\n var property = statics[name];\n if (!statics.hasOwnProperty(name)) {\n continue;\n }\n\n var isReserved = name in RESERVED_SPEC_KEYS;\n _invariant(\n !isReserved,\n 'ReactClass: You are attempting to define a reserved ' +\n 'property, `%s`, that shouldn\\'t be on the \"statics\" key. Define it ' +\n 'as an instance property instead; it will still be accessible on the ' +\n 'constructor.',\n name\n );\n\n var isAlreadyDefined = name in Constructor;\n if (isAlreadyDefined) {\n var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)\n ? ReactClassStaticInterface[name]\n : null;\n\n _invariant(\n specPolicy === 'DEFINE_MANY_MERGED',\n 'ReactClass: You are attempting to define ' +\n '`%s` on your component more than once. This conflict may be ' +\n 'due to a mixin.',\n name\n );\n\n Constructor[name] = createMergedResultFunction(Constructor[name], property);\n\n return;\n }\n\n Constructor[name] = property;\n }\n }\n\n /**\n * Merge two objects, but throw if both contain the same key.\n *\n * @param {object} one The first object, which is mutated.\n * @param {object} two The second object\n * @return {object} one after it has been mutated to contain everything in two.\n */\n function mergeIntoWithNoDuplicateKeys(one, two) {\n _invariant(\n one && two && typeof one === 'object' && typeof two === 'object',\n 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'\n );\n\n for (var key in two) {\n if (two.hasOwnProperty(key)) {\n _invariant(\n one[key] === undefined,\n 'mergeIntoWithNoDuplicateKeys(): ' +\n 'Tried to merge two objects with the same key: `%s`. This conflict ' +\n 'may be due to a mixin; in particular, this may be caused by two ' +\n 'getInitialState() or getDefaultProps() methods returning objects ' +\n 'with clashing keys.',\n key\n );\n one[key] = two[key];\n }\n }\n return one;\n }\n\n /**\n * Creates a function that invokes two functions and merges their return values.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n function createMergedResultFunction(one, two) {\n return function mergedResult() {\n var a = one.apply(this, arguments);\n var b = two.apply(this, arguments);\n if (a == null) {\n return b;\n } else if (b == null) {\n return a;\n }\n var c = {};\n mergeIntoWithNoDuplicateKeys(c, a);\n mergeIntoWithNoDuplicateKeys(c, b);\n return c;\n };\n }\n\n /**\n * Creates a function that invokes two functions and ignores their return vales.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n function createChainedFunction(one, two) {\n return function chainedFunction() {\n one.apply(this, arguments);\n two.apply(this, arguments);\n };\n }\n\n /**\n * Binds a method to the component.\n *\n * @param {object} component Component whose method is going to be bound.\n * @param {function} method Method to be bound.\n * @return {function} The bound method.\n */\n function bindAutoBindMethod(component, method) {\n var boundMethod = method.bind(component);\n if (process.env.NODE_ENV !== 'production') {\n boundMethod.__reactBoundContext = component;\n boundMethod.__reactBoundMethod = method;\n boundMethod.__reactBoundArguments = null;\n var componentName = component.constructor.displayName;\n var _bind = boundMethod.bind;\n boundMethod.bind = function(newThis) {\n for (\n var _len = arguments.length,\n args = Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n // User is trying to bind() an autobound method; we effectively will\n // ignore the value of \"this\" that the user is trying to use, so\n // let's warn.\n if (newThis !== component && newThis !== null) {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n 'bind(): React component methods may only be bound to the ' +\n 'component instance. See %s',\n componentName\n );\n }\n } else if (!args.length) {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n 'bind(): You are binding a component method to the component. ' +\n 'React does this for you automatically in a high-performance ' +\n 'way, so you can safely remove this call. See %s',\n componentName\n );\n }\n return boundMethod;\n }\n var reboundMethod = _bind.apply(boundMethod, arguments);\n reboundMethod.__reactBoundContext = component;\n reboundMethod.__reactBoundMethod = method;\n reboundMethod.__reactBoundArguments = args;\n return reboundMethod;\n };\n }\n return boundMethod;\n }\n\n /**\n * Binds all auto-bound methods in a component.\n *\n * @param {object} component Component whose method is going to be bound.\n */\n function bindAutoBindMethods(component) {\n var pairs = component.__reactAutoBindPairs;\n for (var i = 0; i < pairs.length; i += 2) {\n var autoBindKey = pairs[i];\n var method = pairs[i + 1];\n component[autoBindKey] = bindAutoBindMethod(component, method);\n }\n }\n\n var IsMountedPreMixin = {\n componentDidMount: function() {\n this.__isMounted = true;\n }\n };\n\n var IsMountedPostMixin = {\n componentWillUnmount: function() {\n this.__isMounted = false;\n }\n };\n\n /**\n * Add more to the ReactClass base class. These are all legacy features and\n * therefore not already part of the modern ReactComponent.\n */\n var ReactClassMixin = {\n /**\n * TODO: This will be deprecated because state should always keep a consistent\n * type signature and the only use case for this, is to avoid that.\n */\n replaceState: function(newState, callback) {\n this.updater.enqueueReplaceState(this, newState, callback);\n },\n\n /**\n * Checks whether or not this composite component is mounted.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function() {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this.__didWarnIsMounted,\n '%s: isMounted is deprecated. Instead, make sure to clean up ' +\n 'subscriptions and pending requests in componentWillUnmount to ' +\n 'prevent memory leaks.',\n (this.constructor && this.constructor.displayName) ||\n this.name ||\n 'Component'\n );\n this.__didWarnIsMounted = true;\n }\n return !!this.__isMounted;\n }\n };\n\n var ReactClassComponent = function() {};\n _assign(\n ReactClassComponent.prototype,\n ReactComponent.prototype,\n ReactClassMixin\n );\n\n /**\n * Creates a composite component class given a class specification.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass\n *\n * @param {object} spec Class specification (which must define `render`).\n * @return {function} Component constructor function.\n * @public\n */\n function createClass(spec) {\n // To keep our warnings more understandable, we'll use a little hack here to\n // ensure that Constructor.name !== 'Constructor'. This makes sure we don't\n // unnecessarily identify a class without displayName as 'Constructor'.\n var Constructor = identity(function(props, context, updater) {\n // This constructor gets overridden by mocks. The argument is used\n // by mocks to assert on what gets mounted.\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this instanceof Constructor,\n 'Something is calling a React component directly. Use a factory or ' +\n 'JSX instead. See: https://fb.me/react-legacyfactory'\n );\n }\n\n // Wire up auto-binding\n if (this.__reactAutoBindPairs.length) {\n bindAutoBindMethods(this);\n }\n\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n\n this.state = null;\n\n // ReactClasses doesn't have constructors. Instead, they use the\n // getInitialState and componentWillMount methods for initialization.\n\n var initialState = this.getInitialState ? this.getInitialState() : null;\n if (process.env.NODE_ENV !== 'production') {\n // We allow auto-mocks to proceed as if they're returning null.\n if (\n initialState === undefined &&\n this.getInitialState._isMockFunction\n ) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n initialState = null;\n }\n }\n _invariant(\n typeof initialState === 'object' && !Array.isArray(initialState),\n '%s.getInitialState(): must return an object or null',\n Constructor.displayName || 'ReactCompositeComponent'\n );\n\n this.state = initialState;\n });\n Constructor.prototype = new ReactClassComponent();\n Constructor.prototype.constructor = Constructor;\n Constructor.prototype.__reactAutoBindPairs = [];\n\n injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));\n\n mixSpecIntoComponent(Constructor, IsMountedPreMixin);\n mixSpecIntoComponent(Constructor, spec);\n mixSpecIntoComponent(Constructor, IsMountedPostMixin);\n\n // Initialize the defaultProps property after all mixins have been merged.\n if (Constructor.getDefaultProps) {\n Constructor.defaultProps = Constructor.getDefaultProps();\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // This is a tag to indicate that the use of these method names is ok,\n // since it's used with createClass. If it's not, then it's likely a\n // mistake so we'll warn you to use the static property, property\n // initializer or constructor respectively.\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps.isReactClassApproved = {};\n }\n if (Constructor.prototype.getInitialState) {\n Constructor.prototype.getInitialState.isReactClassApproved = {};\n }\n }\n\n _invariant(\n Constructor.prototype.render,\n 'createClass(...): Class specification must implement a `render` method.'\n );\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n !Constructor.prototype.componentShouldUpdate,\n '%s has a method called ' +\n 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +\n 'The name is phrased as a question because the function is ' +\n 'expected to return a value.',\n spec.displayName || 'A component'\n );\n warning(\n !Constructor.prototype.componentWillRecieveProps,\n '%s has a method called ' +\n 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',\n spec.displayName || 'A component'\n );\n warning(\n !Constructor.prototype.UNSAFE_componentWillRecieveProps,\n '%s has a method called UNSAFE_componentWillRecieveProps(). ' +\n 'Did you mean UNSAFE_componentWillReceiveProps()?',\n spec.displayName || 'A component'\n );\n }\n\n // Reduce time spent doing lookups by setting these on the prototype.\n for (var methodName in ReactClassInterface) {\n if (!Constructor.prototype[methodName]) {\n Constructor.prototype[methodName] = null;\n }\n }\n\n return Constructor;\n }\n\n return createClass;\n}\n\nmodule.exports = factory;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar React = require('react');\nvar factory = require('./factory');\n\nif (typeof React === 'undefined') {\n throw Error(\n 'create-react-class could not find the React object. If you are using script tags, ' +\n 'make sure that React is being loaded before create-react-class.'\n );\n}\n\n// Hack to grab NoopUpdateQueue from isomorphic React\nvar ReactNoopUpdateQueue = new React.Component().updater;\n\nmodule.exports = factory(\n React.Component,\n React.isValidElement,\n ReactNoopUpdateQueue\n);\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class'),\n\tmoment = require('moment')\n\t;\n\nvar DateTimePickerDays = createClass({\n\trender: function() {\n\t\tvar footer = this.renderFooter(),\n\t\t\tdate = this.props.viewDate,\n\t\t\tlocale = date.localeData(),\n\t\t\ttableChildren\n\t\t\t;\n\n\t\ttableChildren = [\n\t\t\tReact.createElement('thead', { key: 'th' }, [\n\t\t\t\tReact.createElement('tr', { key: 'h' }, [\n\t\t\t\t\tReact.createElement('th', { key: 'p', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'months' )}, React.createElement('span', {}, '‹' )),\n\t\t\t\t\tReact.createElement('th', { key: 's', className: 'rdtSwitch', onClick: this.props.showView( 'months' ), colSpan: 5, 'data-value': this.props.viewDate.month() }, locale.months( date ) + ' ' + date.year() ),\n\t\t\t\t\tReact.createElement('th', { key: 'n', className: 'rdtNext', onClick: this.props.addTime( 1, 'months' )}, React.createElement('span', {}, '›' ))\n\t\t\t\t]),\n\t\t\t\tReact.createElement('tr', { key: 'd'}, this.getDaysOfWeek( locale ).map( function( day, index ) { return React.createElement('th', { key: day + index, className: 'dow'}, day ); }) )\n\t\t\t]),\n\t\t\tReact.createElement('tbody', { key: 'tb' }, this.renderDays())\n\t\t];\n\n\t\tif ( footer )\n\t\t\ttableChildren.push( footer );\n\n\t\treturn React.createElement('div', { className: 'rdtDays' },\n\t\t\tReact.createElement('table', {}, tableChildren )\n\t\t);\n\t},\n\n\t/**\n\t * Get a list of the days of the week\n\t * depending on the current locale\n\t * @return {array} A list with the shortname of the days\n\t */\n\tgetDaysOfWeek: function( locale ) {\n\t\tvar days = locale._weekdaysMin,\n\t\t\tfirst = locale.firstDayOfWeek(),\n\t\t\tdow = [],\n\t\t\ti = 0\n\t\t\t;\n\n\t\tdays.forEach( function( day ) {\n\t\t\tdow[ (7 + ( i++ ) - first) % 7 ] = day;\n\t\t});\n\n\t\treturn dow;\n\t},\n\n\trenderDays: function() {\n\t\tvar date = this.props.viewDate,\n\t\t\tselected = this.props.selectedDate && this.props.selectedDate.clone(),\n\t\t\tprevMonth = date.clone().subtract( 1, 'months' ),\n\t\t\tcurrentYear = date.year(),\n\t\t\tcurrentMonth = date.month(),\n\t\t\tweeks = [],\n\t\t\tdays = [],\n\t\t\trenderer = this.props.renderDay || this.renderDay,\n\t\t\tisValid = this.props.isValidDate || this.alwaysValidDate,\n\t\t\tclasses, isDisabled, dayProps, currentDate\n\t\t\t;\n\n\t\t// Go to the last week of the previous month\n\t\tprevMonth.date( prevMonth.daysInMonth() ).startOf( 'week' );\n\t\tvar lastDay = prevMonth.clone().add( 42, 'd' );\n\n\t\twhile ( prevMonth.isBefore( lastDay ) ) {\n\t\t\tclasses = 'rdtDay';\n\t\t\tcurrentDate = prevMonth.clone();\n\n\t\t\tif ( ( prevMonth.year() === currentYear && prevMonth.month() < currentMonth ) || ( prevMonth.year() < currentYear ) )\n\t\t\t\tclasses += ' rdtOld';\n\t\t\telse if ( ( prevMonth.year() === currentYear && prevMonth.month() > currentMonth ) || ( prevMonth.year() > currentYear ) )\n\t\t\t\tclasses += ' rdtNew';\n\n\t\t\tif ( selected && prevMonth.isSame( selected, 'day' ) )\n\t\t\t\tclasses += ' rdtActive';\n\n\t\t\tif ( prevMonth.isSame( moment(), 'day' ) )\n\t\t\t\tclasses += ' rdtToday';\n\n\t\t\tisDisabled = !isValid( currentDate, selected );\n\t\t\tif ( isDisabled )\n\t\t\t\tclasses += ' rdtDisabled';\n\n\t\t\tdayProps = {\n\t\t\t\tkey: prevMonth.format( 'M_D' ),\n\t\t\t\t'data-value': prevMonth.date(),\n\t\t\t\tclassName: classes\n\t\t\t};\n\n\t\t\tif ( !isDisabled )\n\t\t\t\tdayProps.onClick = this.updateSelectedDate;\n\n\t\t\tdays.push( renderer( dayProps, currentDate, selected ) );\n\n\t\t\tif ( days.length === 7 ) {\n\t\t\t\tweeks.push( React.createElement('tr', { key: prevMonth.format( 'M_D' )}, days ) );\n\t\t\t\tdays = [];\n\t\t\t}\n\n\t\t\tprevMonth.add( 1, 'd' );\n\t\t}\n\n\t\treturn weeks;\n\t},\n\n\tupdateSelectedDate: function( event ) {\n\t\tthis.props.updateSelectedDate( event, true );\n\t},\n\n\trenderDay: function( props, currentDate ) {\n\t\treturn React.createElement('td', props, currentDate.date() );\n\t},\n\n\trenderFooter: function() {\n\t\tif ( !this.props.timeFormat )\n\t\t\treturn '';\n\n\t\tvar date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn React.createElement('tfoot', { key: 'tf'},\n\t\t\tReact.createElement('tr', {},\n\t\t\t\tReact.createElement('td', { onClick: this.props.showView( 'time' ), colSpan: 7, className: 'rdtTimeToggle' }, date.format( this.props.timeFormat ))\n\t\t\t)\n\t\t);\n\t},\n\n\talwaysValidDate: function() {\n\t\treturn 1;\n\t}\n});\n\nmodule.exports = DateTimePickerDays;\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class')\n;\n\nvar DateTimePickerMonths = createClass({\n\trender: function() {\n\t\treturn React.createElement('div', { className: 'rdtMonths' }, [\n\t\t\tReact.createElement('table', { key: 'a' }, React.createElement('thead', {}, React.createElement('tr', {}, [\n\t\t\t\tReact.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'years' )}, React.createElement('span', {}, '‹' )),\n\t\t\t\tReact.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2, 'data-value': this.props.viewDate.year() }, this.props.viewDate.year() ),\n\t\t\t\tReact.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 1, 'years' )}, React.createElement('span', {}, '›' ))\n\t\t\t]))),\n\t\t\tReact.createElement('table', { key: 'months' }, React.createElement('tbody', { key: 'b' }, this.renderMonths()))\n\t\t]);\n\t},\n\n\trenderMonths: function() {\n\t\tvar date = this.props.selectedDate,\n\t\t\tmonth = this.props.viewDate.month(),\n\t\t\tyear = this.props.viewDate.year(),\n\t\t\trows = [],\n\t\t\ti = 0,\n\t\t\tmonths = [],\n\t\t\trenderer = this.props.renderMonth || this.renderMonth,\n\t\t\tisValid = this.props.isValidDate || this.alwaysValidDate,\n\t\t\tclasses, props, currentMonth, isDisabled, noOfDaysInMonth, daysInMonth, validDay,\n\t\t\t// Date is irrelevant because we're only interested in month\n\t\t\tirrelevantDate = 1\n\t\t\t;\n\n\t\twhile (i < 12) {\n\t\t\tclasses = 'rdtMonth';\n\t\t\tcurrentMonth =\n\t\t\t\tthis.props.viewDate.clone().set({ year: year, month: i, date: irrelevantDate });\n\n\t\t\tnoOfDaysInMonth = currentMonth.endOf( 'month' ).format( 'D' );\n\t\t\tdaysInMonth = Array.from({ length: noOfDaysInMonth }, function( e, i ) {\n\t\t\t\treturn i + 1;\n\t\t\t});\n\n\t\t\tvalidDay = daysInMonth.find(function( d ) {\n\t\t\t\tvar day = currentMonth.clone().set( 'date', d );\n\t\t\t\treturn isValid( day );\n\t\t\t});\n\n\t\t\tisDisabled = ( validDay === undefined );\n\n\t\t\tif ( isDisabled )\n\t\t\t\tclasses += ' rdtDisabled';\n\n\t\t\tif ( date && i === date.month() && year === date.year() )\n\t\t\t\tclasses += ' rdtActive';\n\n\t\t\tprops = {\n\t\t\t\tkey: i,\n\t\t\t\t'data-value': i,\n\t\t\t\tclassName: classes\n\t\t\t};\n\n\t\t\tif ( !isDisabled )\n\t\t\t\tprops.onClick = ( this.props.updateOn === 'months' ?\n\t\t\t\t\tthis.updateSelectedMonth : this.props.setDate( 'month' ) );\n\n\t\t\tmonths.push( renderer( props, i, year, date && date.clone() ) );\n\n\t\t\tif ( months.length === 4 ) {\n\t\t\t\trows.push( React.createElement('tr', { key: month + '_' + rows.length }, months ) );\n\t\t\t\tmonths = [];\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\n\t\treturn rows;\n\t},\n\n\tupdateSelectedMonth: function( event ) {\n\t\tthis.props.updateSelectedDate( event );\n\t},\n\n\trenderMonth: function( props, month ) {\n\t\tvar localMoment = this.props.viewDate;\n\t\tvar monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\t\tvar strLength = 3;\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\tvar monthStrFixedLength = monthStr.substring( 0, strLength );\n\t\treturn React.createElement('td', props, capitalize( monthStrFixedLength ) );\n\t},\n\n\talwaysValidDate: function() {\n\t\treturn 1;\n\t},\n});\n\nfunction capitalize( str ) {\n\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n}\n\nmodule.exports = DateTimePickerMonths;\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class')\n;\n\nvar DateTimePickerYears = createClass({\n\trender: function() {\n\t\tvar year = parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\n\t\treturn React.createElement('div', { className: 'rdtYears' }, [\n\t\t\tReact.createElement('table', { key: 'a' }, React.createElement('thead', {}, React.createElement('tr', {}, [\n\t\t\t\tReact.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 10, 'years' )}, React.createElement('span', {}, '‹' )),\n\t\t\t\tReact.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2 }, year + '-' + ( year + 9 ) ),\n\t\t\t\tReact.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 10, 'years' )}, React.createElement('span', {}, '›' ))\n\t\t\t]))),\n\t\t\tReact.createElement('table', { key: 'years' }, React.createElement('tbody', {}, this.renderYears( year )))\n\t\t]);\n\t},\n\n\trenderYears: function( year ) {\n\t\tvar years = [],\n\t\t\ti = -1,\n\t\t\trows = [],\n\t\t\trenderer = this.props.renderYear || this.renderYear,\n\t\t\tselectedDate = this.props.selectedDate,\n\t\t\tisValid = this.props.isValidDate || this.alwaysValidDate,\n\t\t\tclasses, props, currentYear, isDisabled, noOfDaysInYear, daysInYear, validDay,\n\t\t\t// Month and date are irrelevant here because\n\t\t\t// we're only interested in the year\n\t\t\tirrelevantMonth = 0,\n\t\t\tirrelevantDate = 1\n\t\t\t;\n\n\t\tyear--;\n\t\twhile (i < 11) {\n\t\t\tclasses = 'rdtYear';\n\t\t\tcurrentYear = this.props.viewDate.clone().set(\n\t\t\t\t{ year: year, month: irrelevantMonth, date: irrelevantDate } );\n\n\t\t\t// Not sure what 'rdtOld' is for, commenting out for now as it's not working properly\n\t\t\t// if ( i === -1 | i === 10 )\n\t\t\t\t// classes += ' rdtOld';\n\n\t\t\tnoOfDaysInYear = currentYear.endOf( 'year' ).format( 'DDD' );\n\t\t\tdaysInYear = Array.from({ length: noOfDaysInYear }, function( e, i ) {\n\t\t\t\treturn i + 1;\n\t\t\t});\n\n\t\t\tvalidDay = daysInYear.find(function( d ) {\n\t\t\t\tvar day = currentYear.clone().dayOfYear( d );\n\t\t\t\treturn isValid( day );\n\t\t\t});\n\n\t\t\tisDisabled = ( validDay === undefined );\n\n\t\t\tif ( isDisabled )\n\t\t\t\tclasses += ' rdtDisabled';\n\n\t\t\tif ( selectedDate && selectedDate.year() === year )\n\t\t\t\tclasses += ' rdtActive';\n\n\t\t\tprops = {\n\t\t\t\tkey: year,\n\t\t\t\t'data-value': year,\n\t\t\t\tclassName: classes\n\t\t\t};\n\n\t\t\tif ( !isDisabled )\n\t\t\t\tprops.onClick = ( this.props.updateOn === 'years' ?\n\t\t\t\t\tthis.updateSelectedYear : this.props.setDate('year') );\n\n\t\t\tyears.push( renderer( props, year, selectedDate && selectedDate.clone() ));\n\n\t\t\tif ( years.length === 4 ) {\n\t\t\t\trows.push( React.createElement('tr', { key: i }, years ) );\n\t\t\t\tyears = [];\n\t\t\t}\n\n\t\t\tyear++;\n\t\t\ti++;\n\t\t}\n\n\t\treturn rows;\n\t},\n\n\tupdateSelectedYear: function( event ) {\n\t\tthis.props.updateSelectedDate( event );\n\t},\n\n\trenderYear: function( props, year ) {\n\t\treturn React.createElement('td', props, year );\n\t},\n\n\talwaysValidDate: function() {\n\t\treturn 1;\n\t},\n});\n\nmodule.exports = DateTimePickerYears;\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class'),\n\tassign = require('object-assign')\n\t;\n\nvar DateTimePickerTime = createClass({\n\tgetInitialState: function() {\n\t\treturn this.calculateState( this.props );\n\t},\n\n\tcalculateState: function( props ) {\n\t\tvar date = props.selectedDate || props.viewDate,\n\t\t\tformat = props.timeFormat,\n\t\t\tcounters = []\n\t\t\t;\n\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar hours = date.format( 'H' );\n\n\t\tvar daypart = false;\n\t\tif ( this.state !== null && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {\n\t\t\tif ( this.props.timeFormat.indexOf( ' A' ) !== -1 ) {\n\t\t\t\tdaypart = ( hours >= 12 ) ? 'PM' : 'AM';\n\t\t\t} else {\n\t\t\t\tdaypart = ( hours >= 12 ) ? 'pm' : 'am';\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\thours: hours,\n\t\t\tminutes: date.format( 'mm' ),\n\t\t\tseconds: date.format( 'ss' ),\n\t\t\tmilliseconds: date.format( 'SSS' ),\n\t\t\tdaypart: daypart,\n\t\t\tcounters: counters\n\t\t};\n\t},\n\n\trenderCounter: function( type ) {\n\t\tif ( type !== 'daypart' ) {\n\t\t\tvar value = this.state[ type ];\n\t\t\tif ( type === 'hours' && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {\n\t\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\t\tif ( value === 0 ) {\n\t\t\t\t\tvalue = 12;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn React.createElement('div', { key: type, className: 'rdtCounter' }, [\n\t\t\t\tReact.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'increase', type ), onContextMenu: this.disableContextMenu }, '▲' ),\n\t\t\t\tReact.createElement('div', { key: 'c', className: 'rdtCount' }, value ),\n\t\t\t\tReact.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'decrease', type ), onContextMenu: this.disableContextMenu }, '▼' )\n\t\t\t]);\n\t\t}\n\t\treturn '';\n\t},\n\n\trenderDayPart: function() {\n\t\treturn React.createElement('div', { key: 'dayPart', className: 'rdtCounter' }, [\n\t\t\tReact.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▲' ),\n\t\t\tReact.createElement('div', { key: this.state.daypart, className: 'rdtCount' }, this.state.daypart ),\n\t\t\tReact.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▼' )\n\t\t]);\n\t},\n\n\trender: function() {\n\t\tvar me = this,\n\t\t\tcounters = []\n\t\t;\n\n\t\tthis.state.counters.forEach( function( c ) {\n\t\t\tif ( counters.length )\n\t\t\t\tcounters.push( React.createElement('div', { key: 'sep' + counters.length, className: 'rdtCounterSeparator' }, ':' ) );\n\t\t\tcounters.push( me.renderCounter( c ) );\n\t\t});\n\n\t\tif ( this.state.daypart !== false ) {\n\t\t\tcounters.push( me.renderDayPart() );\n\t\t}\n\n\t\tif ( this.state.counters.length === 3 && this.props.timeFormat.indexOf( 'S' ) !== -1 ) {\n\t\t\tcounters.push( React.createElement('div', { className: 'rdtCounterSeparator', key: 'sep5' }, ':' ) );\n\t\t\tcounters.push(\n\t\t\t\tReact.createElement('div', { className: 'rdtCounter rdtMilli', key: 'm' },\n\t\t\t\t\tReact.createElement('input', { value: this.state.milliseconds, type: 'text', onChange: this.updateMilli } )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('div', { className: 'rdtTime' },\n\t\t\tReact.createElement('table', {}, [\n\t\t\t\tthis.renderHeader(),\n\t\t\t\tReact.createElement('tbody', { key: 'b'}, React.createElement('tr', {}, React.createElement('td', {},\n\t\t\t\t\tReact.createElement('div', { className: 'rdtCounters' }, counters )\n\t\t\t\t)))\n\t\t\t])\n\t\t);\n\t},\n\n\tcomponentWillMount: function() {\n\t\tvar me = this;\n\t\tme.timeConstraints = {\n\t\t\thours: {\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 23,\n\t\t\t\tstep: 1\n\t\t\t},\n\t\t\tminutes: {\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 59,\n\t\t\t\tstep: 1\n\t\t\t},\n\t\t\tseconds: {\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 59,\n\t\t\t\tstep: 1\n\t\t\t},\n\t\t\tmilliseconds: {\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 999,\n\t\t\t\tstep: 1\n\t\t\t}\n\t\t};\n\t\t['hours', 'minutes', 'seconds', 'milliseconds'].forEach( function( type ) {\n\t\t\tassign(me.timeConstraints[ type ], me.props.timeConstraints[ type ]);\n\t\t});\n\t\tthis.setState( this.calculateState( this.props ) );\n\t},\n\n\tcomponentWillReceiveProps: function( nextProps ) {\n\t\tthis.setState( this.calculateState( nextProps ) );\n\t},\n\n\tupdateMilli: function( e ) {\n\t\tvar milli = parseInt( e.target.value, 10 );\n\t\tif ( milli === e.target.value && milli >= 0 && milli < 1000 ) {\n\t\t\tthis.props.setTime( 'milliseconds', milli );\n\t\t\tthis.setState( { milliseconds: milli } );\n\t\t}\n\t},\n\n\trenderHeader: function() {\n\t\tif ( !this.props.dateFormat )\n\t\t\treturn null;\n\n\t\tvar date = this.props.selectedDate || this.props.viewDate;\n\t\treturn React.createElement('thead', { key: 'h' }, React.createElement('tr', {},\n\t\t\tReact.createElement('th', { className: 'rdtSwitch', colSpan: 4, onClick: this.props.showView( 'days' ) }, date.format( this.props.dateFormat ) )\n\t\t));\n\t},\n\n\tonStartClicking: function( action, type ) {\n\t\tvar me = this;\n\n\t\treturn function() {\n\t\t\tvar update = {};\n\t\t\tupdate[ type ] = me[ action ]( type );\n\t\t\tme.setState( update );\n\n\t\t\tme.timer = setTimeout( function() {\n\t\t\t\tme.increaseTimer = setInterval( function() {\n\t\t\t\t\tupdate[ type ] = me[ action ]( type );\n\t\t\t\t\tme.setState( update );\n\t\t\t\t}, 70);\n\t\t\t}, 500);\n\n\t\t\tme.mouseUpListener = function() {\n\t\t\t\tclearTimeout( me.timer );\n\t\t\t\tclearInterval( me.increaseTimer );\n\t\t\t\tme.props.setTime( type, me.state[ type ] );\n\t\t\t\tdocument.body.removeEventListener( 'mouseup', me.mouseUpListener );\n\t\t\t\tdocument.body.removeEventListener( 'touchend', me.mouseUpListener );\n\t\t\t};\n\n\t\t\tdocument.body.addEventListener( 'mouseup', me.mouseUpListener );\n\t\t\tdocument.body.addEventListener( 'touchend', me.mouseUpListener );\n\t\t};\n\t},\n\n\tdisableContextMenu: function( event ) {\n\t\tevent.preventDefault();\n\t\treturn false;\n\t},\n\n\tpadValues: {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t},\n\n\ttoggleDayPart: function( type ) { // type is always 'hours'\n\t\tvar value = parseInt( this.state[ type ], 10) + 12;\n\t\tif ( value > this.timeConstraints[ type ].max )\n\t\t\tvalue = this.timeConstraints[ type ].min + ( value - ( this.timeConstraints[ type ].max + 1 ) );\n\t\treturn this.pad( type, value );\n\t},\n\n\tincrease: function( type ) {\n\t\tvar value = parseInt( this.state[ type ], 10) + this.timeConstraints[ type ].step;\n\t\tif ( value > this.timeConstraints[ type ].max )\n\t\t\tvalue = this.timeConstraints[ type ].min + ( value - ( this.timeConstraints[ type ].max + 1 ) );\n\t\treturn this.pad( type, value );\n\t},\n\n\tdecrease: function( type ) {\n\t\tvar value = parseInt( this.state[ type ], 10) - this.timeConstraints[ type ].step;\n\t\tif ( value < this.timeConstraints[ type ].min )\n\t\t\tvalue = this.timeConstraints[ type ].max + 1 - ( this.timeConstraints[ type ].min - value );\n\t\treturn this.pad( type, value );\n\t},\n\n\tpad: function( type, value ) {\n\t\tvar str = value + '';\n\t\twhile ( str.length < this.padValues[ type ] )\n\t\t\tstr = '0' + str;\n\t\treturn str;\n\t},\n});\n\nmodule.exports = DateTimePickerTime;\n","'use strict';\n\nvar React = require('react'),\n\tcreateClass = require('create-react-class'),\n\tDaysView = require('./DaysView'),\n\tMonthsView = require('./MonthsView'),\n\tYearsView = require('./YearsView'),\n\tTimeView = require('./TimeView')\n\t;\n\nvar CalendarContainer = createClass({\n\tviewComponents: {\n\t\tdays: DaysView,\n\t\tmonths: MonthsView,\n\t\tyears: YearsView,\n\t\ttime: TimeView\n\t},\n\n\trender: function() {\n\t\treturn React.createElement( this.viewComponents[ this.props.view ], this.props.viewProps );\n\t}\n});\n\nmodule.exports = CalendarContainer;\n","import { Component, createElement } from 'react';\nimport { findDOMNode } from 'react-dom';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n\n\n while (current.parentNode) {\n if (isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}\n\n// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};\n\nfunction autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();\n\nvar passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_this, eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_this, eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (!WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n };\n /**\n * Remove all document's event listeners for this component\n */\n\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n };\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _props = this.props,\n excludeScrollbar = _props.excludeScrollbar,\n props = _objectWithoutProperties(_props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}\n\nexport { IGNORE_CLASS_NAME };\nexport default onClickOutsideHOC;\n","'use strict';\n\nvar assign = require('object-assign'),\n\tPropTypes = require('prop-types'),\n\tcreateClass = require('create-react-class'),\n\tmoment = require('moment'),\n\tReact = require('react'),\n\tCalendarContainer = require('./src/CalendarContainer'),\n\tonClickOutside = require('react-onclickoutside').default\n\t;\n\nvar viewModes = Object.freeze({\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n});\n\nvar TYPES = PropTypes;\nvar Datetime = createClass({\n\tdisplayName: 'DateTime',\n\tpropTypes: {\n\t\t// value: TYPES.object | TYPES.string,\n\t\t// defaultValue: TYPES.object | TYPES.string,\n\t\t// viewDate: TYPES.object | TYPES.string,\n\t\tonFocus: TYPES.func,\n\t\tonBlur: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonViewModeChange: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\t// dateFormat: TYPES.string | TYPES.bool,\n\t\t// timeFormat: TYPES.string | TYPES.bool,\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tviewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool\n\t},\n\n\tgetInitialState: function() {\n\t\tthis.checkTZ( this.props );\n\t\t\n\t\tvar state = this.getStateFromProps( this.props );\n\n\t\tif ( state.open === undefined )\n\t\t\tstate.open = !this.props.input;\n\n\t\tstate.currentView = this.props.dateFormat ?\n\t\t\t(this.props.viewMode || state.updateOn || viewModes.DAYS) : viewModes.TIME;\n\n\t\treturn state;\n\t},\n\n\tparseDate: function (date, formats) {\n\t\tvar parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, formats.datetime);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t},\n\n\tgetStateFromProps: function( props ) {\n\t\tvar formats = this.getFormats( props ),\n\t\t\tdate = props.value || props.defaultValue,\n\t\t\tselectedDate, viewDate, updateOn, inputValue\n\t\t\t;\n\n\t\tselectedDate = this.parseDate(date, formats);\n\n\t\tviewDate = this.parseDate(props.viewDate, formats);\n\n\t\tviewDate = selectedDate ?\n\t\t\tselectedDate.clone().startOf('month') :\n\t\t\tviewDate ? viewDate.clone().startOf('month') : this.localMoment().startOf('month');\n\n\t\tupdateOn = this.getUpdateOn(formats);\n\n\t\tif ( selectedDate )\n\t\t\tinputValue = selectedDate.format(formats.datetime);\n\t\telse if ( date.isValid && !date.isValid() )\n\t\t\tinputValue = '';\n\t\telse\n\t\t\tinputValue = date || '';\n\n\t\treturn {\n\t\t\tupdateOn: updateOn,\n\t\t\tinputFormat: formats.datetime,\n\t\t\tviewDate: viewDate,\n\t\t\tselectedDate: selectedDate,\n\t\t\tinputValue: inputValue,\n\t\t\topen: props.open\n\t\t};\n\t},\n\n\tgetUpdateOn: function( formats ) {\n\t\tif ( formats.date.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t} else if ( formats.date.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t} else if ( formats.date.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t},\n\n\tgetFormats: function( props ) {\n\t\tvar formats = {\n\t\t\t\tdate: props.dateFormat || '',\n\t\t\t\ttime: props.timeFormat || ''\n\t\t\t},\n\t\t\tlocale = this.localMoment( props.date, null, props ).localeData()\n\t\t\t;\n\n\t\tif ( formats.date === true ) {\n\t\t\tformats.date = locale.longDateFormat('L');\n\t\t}\n\t\telse if ( this.getUpdateOn(formats) !== viewModes.DAYS ) {\n\t\t\tformats.time = '';\n\t\t}\n\n\t\tif ( formats.time === true ) {\n\t\t\tformats.time = locale.longDateFormat('LT');\n\t\t}\n\n\t\tformats.datetime = formats.date && formats.time ?\n\t\t\tformats.date + ' ' + formats.time :\n\t\t\tformats.date || formats.time\n\t\t;\n\n\t\treturn formats;\n\t},\n\n\tcomponentWillReceiveProps: function( nextProps ) {\n\t\tvar formats = this.getFormats( nextProps ),\n\t\t\tupdatedState = {}\n\t\t;\n\n\t\tif ( nextProps.value !== this.props.value ||\n\t\t\tformats.datetime !== this.getFormats( this.props ).datetime ) {\n\t\t\tupdatedState = this.getStateFromProps( nextProps );\n\t\t}\n\n\t\tif ( updatedState.open === undefined ) {\n\t\t\tif ( typeof nextProps.open !== 'undefined' ) {\n\t\t\t\tupdatedState.open = nextProps.open;\n\t\t\t} else if ( this.props.closeOnSelect && this.state.currentView !== viewModes.TIME ) {\n\t\t\t\tupdatedState.open = false;\n\t\t\t} else {\n\t\t\t\tupdatedState.open = this.state.open;\n\t\t\t}\n\t\t}\n\n\t\tif ( nextProps.viewMode !== this.props.viewMode ) {\n\t\t\tupdatedState.currentView = nextProps.viewMode;\n\t\t}\n\n\t\tif ( nextProps.locale !== this.props.locale ) {\n\t\t\tif ( this.state.viewDate ) {\n\t\t\t\tvar updatedViewDate = this.state.viewDate.clone().locale( nextProps.locale );\n\t\t\t\tupdatedState.viewDate = updatedViewDate;\n\t\t\t}\n\t\t\tif ( this.state.selectedDate ) {\n\t\t\t\tvar updatedSelectedDate = this.state.selectedDate.clone().locale( nextProps.locale );\n\t\t\t\tupdatedState.selectedDate = updatedSelectedDate;\n\t\t\t\tupdatedState.inputValue = updatedSelectedDate.format( formats.datetime );\n\t\t\t}\n\t\t}\n\n\t\tif ( nextProps.utc !== this.props.utc || nextProps.displayTimeZone !== this.props.displayTimeZone ) {\n\t\t\tif ( nextProps.utc ) {\n\t\t\t\tif ( this.state.viewDate )\n\t\t\t\t\tupdatedState.viewDate = this.state.viewDate.clone().utc();\n\t\t\t\tif ( this.state.selectedDate ) {\n\t\t\t\t\tupdatedState.selectedDate = this.state.selectedDate.clone().utc();\n\t\t\t\t\tupdatedState.inputValue = updatedState.selectedDate.format( formats.datetime );\n\t\t\t\t}\n\t\t\t} else if ( nextProps.displayTimeZone ) {\n\t\t\t\tif ( this.state.viewDate )\n\t\t\t\t\tupdatedState.viewDate = this.state.viewDate.clone().tz(nextProps.displayTimeZone);\n\t\t\t\tif ( this.state.selectedDate ) {\n\t\t\t\t\tupdatedState.selectedDate = this.state.selectedDate.clone().tz(nextProps.displayTimeZone);\n\t\t\t\t\tupdatedState.inputValue = updatedState.selectedDate.tz(nextProps.displayTimeZone).format( formats.datetime );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( this.state.viewDate )\n\t\t\t\t\tupdatedState.viewDate = this.state.viewDate.clone().local();\n\t\t\t\tif ( this.state.selectedDate ) {\n\t\t\t\t\tupdatedState.selectedDate = this.state.selectedDate.clone().local();\n\t\t\t\t\tupdatedState.inputValue = updatedState.selectedDate.format(formats.datetime);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( nextProps.viewDate !== this.props.viewDate ) {\n\t\t\tupdatedState.viewDate = moment(nextProps.viewDate);\n\t\t}\n\n\t\tthis.checkTZ( nextProps );\n\n\t\tthis.setState( updatedState );\n\t},\n\n\tonInputChange: function( e ) {\n\t\tvar value = e.target === null ? e : e.target.value,\n\t\t\tlocalMoment = this.localMoment( value, this.state.inputFormat ),\n\t\t\tupdate = { inputValue: value }\n\t\t\t;\n\n\t\tif ( localMoment.isValid() && !this.props.value ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t} else {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\treturn this.setState( update, function() {\n\t\t\treturn this.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t},\n\n\tonInputKey: function( e ) {\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis.closeCalendar();\n\t\t}\n\t},\n\n\tshowView: function( view ) {\n\t\tvar me = this;\n\t\treturn function() {\n\t\t\tme.state.currentView !== view && me.props.onViewModeChange( view );\n\t\t\tme.setState({ currentView: view });\n\t\t};\n\t},\n\n\tsetDate: function( type ) {\n\t\tvar me = this,\n\t\t\tnextViews = {\n\t\t\t\tmonth: viewModes.DAYS,\n\t\t\t\tyear: viewModes.MONTHS,\n\t\t\t}\n\t\t;\n\t\treturn function( e ) {\n\t\t\tme.setState({\n\t\t\t\tviewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.getAttribute('data-value'), 10) ).startOf( type ),\n\t\t\t\tcurrentView: nextViews[ type ]\n\t\t\t});\n\t\t\tme.props.onViewModeChange( nextViews[ type ] );\n\t\t};\n\t},\n\n\tsubtractTime: function( amount, type, toSelected ) {\n\t\tvar me = this;\n\t\treturn function() {\n\t\t\tme.props.onNavigateBack( amount, type );\n\t\t\tme.updateTime( 'subtract', amount, type, toSelected );\n\t\t};\n\t},\n\n\taddTime: function( amount, type, toSelected ) {\n\t\tvar me = this;\n\t\treturn function() {\n\t\t\tme.props.onNavigateForward( amount, type );\n\t\t\tme.updateTime( 'add', amount, type, toSelected );\n\t\t};\n\t},\n\n\tupdateTime: function( op, amount, type, toSelected ) {\n\t\tvar update = {},\n\t\t\tdate = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t},\n\n\tallowedSetTime: ['hours', 'minutes', 'seconds', 'milliseconds'],\n\tsetTime: function( type, value ) {\n\t\tvar index = this.allowedSetTime.indexOf( type ) + 1,\n\t\t\tstate = this.state,\n\t\t\tdate = (state.selectedDate || state.viewDate).clone(),\n\t\t\tnextType\n\t\t\t;\n\n\t\t// It is needed to set all the time properties\n\t\t// to not to reset the time\n\t\tdate[ type ]( value );\n\t\tfor (; index < this.allowedSetTime.length; index++) {\n\t\t\tnextType = this.allowedSetTime[index];\n\t\t\tdate[ nextType ]( date[nextType]() );\n\t\t}\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tinputValue: date.format( state.inputFormat )\n\t\t\t});\n\t\t}\n\t\tthis.props.onChange( date );\n\t},\n\n\tupdateSelectedDate: function( e, close ) {\n\t\tvar target = e.currentTarget,\n\t\t\tmodifier = 0,\n\t\t\tviewDate = this.state.viewDate,\n\t\t\tcurrentDate = this.state.selectedDate || viewDate,\n\t\t\tdate\n\t\t\t;\n\n\t\tif (target.className.indexOf('rdtDay') !== -1) {\n\t\t\tif (target.className.indexOf('rdtNew') !== -1)\n\t\t\t\tmodifier = 1;\n\t\t\telse if (target.className.indexOf('rdtOld') !== -1)\n\t\t\t\tmodifier = -1;\n\n\t\t\tdate = viewDate.clone()\n\t\t\t\t.month( viewDate.month() + modifier )\n\t\t\t\t.date( parseInt( target.getAttribute('data-value'), 10 ) );\n\t\t} else if (target.className.indexOf('rdtMonth') !== -1) {\n\t\t\tdate = viewDate.clone()\n\t\t\t\t.month( parseInt( target.getAttribute('data-value'), 10 ) )\n\t\t\t\t.date( currentDate.date() );\n\t\t} else if (target.className.indexOf('rdtYear') !== -1) {\n\t\t\tdate = viewDate.clone()\n\t\t\t\t.month( currentDate.month() )\n\t\t\t\t.date( currentDate.date() )\n\t\t\t\t.year( parseInt( target.getAttribute('data-value'), 10 ) );\n\t\t}\n\n\t\tdate.hours( currentDate.hours() )\n\t\t\t.minutes( currentDate.minutes() )\n\t\t\t.seconds( currentDate.seconds() )\n\t\t\t.milliseconds( currentDate.milliseconds() );\n\n\t\tif ( !this.props.value ) {\n\t\t\tvar open = !( this.props.closeOnSelect && close );\n\t\t\tif ( !open ) {\n\t\t\t\tthis.props.onBlur( date );\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone().startOf('month'),\n\t\t\t\tinputValue: date.format( this.state.inputFormat ),\n\t\t\t\topen: open\n\t\t\t});\n\t\t} else {\n\t\t\tif ( this.props.closeOnSelect && close ) {\n\t\t\t\tthis.closeCalendar();\n\t\t\t}\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t},\n\n\topenCalendar: function( e ) {\n\t\tif ( !this.state.open ) {\n\t\t\tthis.setState({ open: true }, function() {\n\t\t\t\tthis.props.onFocus( e );\n\t\t\t});\n\t\t}\n\t},\n\n\tcloseCalendar: function() {\n\t\tthis.setState({ open: false }, function () {\n\t\t\tthis.props.onBlur( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t},\n\n\thandleClickOutside: function() {\n\t\tif ( this.props.input && this.state.open && this.props.open === undefined && !this.props.disableCloseOnClickOutside ) {\n\t\t\tthis.setState({ open: false }, function() {\n\t\t\t\tthis.props.onBlur( this.state.selectedDate || this.state.inputValue );\n\t\t\t});\n\t\t}\n\t},\n\n\tlocalMoment: function( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tvar m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t},\n\n\tcheckTZ: function( props ) {\n\t\tvar con = console;\n\n\t\tif ( props.displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tcon && con.error('react-datetime: displayTimeZone prop with value \"' + props.displayTimeZone + '\" is used but moment.js timezone is not loaded.');\n\t\t}\n\t},\n\n\tcomponentProps: {\n\t\tfromProps: ['value', 'isValidDate', 'renderDay', 'renderMonth', 'renderYear', 'timeConstraints'],\n\t\tfromState: ['viewDate', 'selectedDate', 'updateOn'],\n\t\tfromThis: ['setDate', 'setTime', 'showView', 'addTime', 'subtractTime', 'updateSelectedDate', 'localMoment', 'handleClickOutside']\n\t},\n\n\tgetComponentProps: function() {\n\t\tvar me = this,\n\t\t\tformats = this.getFormats( this.props ),\n\t\t\tprops = {dateFormat: formats.date, timeFormat: formats.time}\n\t\t\t;\n\n\t\tthis.componentProps.fromProps.forEach( function( name ) {\n\t\t\tprops[ name ] = me.props[ name ];\n\t\t});\n\t\tthis.componentProps.fromState.forEach( function( name ) {\n\t\t\tprops[ name ] = me.state[ name ];\n\t\t});\n\t\tthis.componentProps.fromThis.forEach( function( name ) {\n\t\t\tprops[ name ] = me[ name ];\n\t\t});\n\n\t\treturn props;\n\t},\n\n\toverrideEvent: function( handler, action ) {\n\t\tif ( !this.overridenEvents ) {\n\t\t\tthis.overridenEvents = {};\n\t\t}\n\n\t\tif ( !this.overridenEvents[handler] ) {\n\t\t\tvar me = this;\n\t\t\tthis.overridenEvents[handler] = function( e ) {\n\t\t\t\tvar result;\n\t\t\t\tif ( me.props.inputProps && me.props.inputProps[handler] ) {\n\t\t\t\t\tresult = me.props.inputProps[handler]( e );\n\t\t\t\t}\n\t\t\t\tif ( result !== false ) {\n\t\t\t\t\taction( e );\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\treturn this.overridenEvents[handler];\n\t},\n\n\trender: function() {\n\t\t// TODO: Make a function or clean up this code,\n\t\t// logic right now is really hard to follow\n\t\tvar className = 'rdt' + (this.props.className ?\n\t\t\t\t\t\t\t\t\t( Array.isArray( this.props.className ) ?\n\t\t\t\t\t\t\t\t\t' ' + this.props.className.join( ' ' ) : ' ' + this.props.className) : ''),\n\t\t\tchildren = [];\n\n\t\tif ( this.props.input ) {\n\t\t\tvar finalInputProps = assign(\n\t\t\t\t{ type: 'text', className: 'form-control', value: this.state.inputValue },\n\t\t\t\tthis.props.inputProps,\n\t\t\t\t{\n\t\t\t\t\tonClick: this.overrideEvent( 'onClick', this.openCalendar ),\n\t\t\t\t\tonFocus: this.overrideEvent( 'onFocus', this.openCalendar ),\n\t\t\t\t\tonChange: this.overrideEvent( 'onChange', this.onInputChange ),\n\t\t\t\t\tonKeyDown: this.overrideEvent( 'onKeyDown', this.onInputKey ),\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( this.props.renderInput ) {\n\t\t\t\tchildren = [ React.createElement('div', { key: 'i' }, this.props.renderInput( finalInputProps, this.openCalendar, this.closeCalendar )) ];\n\t\t\t} else {\n\t\t\t\tchildren = [ React.createElement('input', assign({ key: 'i' }, finalInputProps ))];\n\t\t\t}\n\t\t} else {\n\t\t\tclassName += ' rdtStatic';\n\t\t}\n\n\t\tif ( this.props.open || (this.props.open === undefined && this.state.open ) )\n\t\t\tclassName += ' rdtOpen';\n\n\t\treturn React.createElement( ClickableWrapper, {className: className, onClickOut: this.handleClickOutside}, children.concat(\n\t\t\tReact.createElement( 'div',\n\t\t\t\t{ key: 'dt', className: 'rdtPicker' },\n\t\t\t\tReact.createElement( CalendarContainer, { view: this.state.currentView, viewProps: this.getComponentProps() })\n\t\t\t)\n\t\t));\n\t}\n});\n\nvar ClickableWrapper = onClickOutside( createClass({\n\trender: function() {\n\t\treturn React.createElement( 'div', { className: this.props.className }, this.props.children );\n\t},\n\thandleClickOutside: function( e ) {\n\t\tthis.props.onClickOut( e );\n\t}\n}));\n\nDatetime.defaultProps = {\n\tclassName: '',\n\tdefaultValue: '',\n\tinputProps: {},\n\tinput: true,\n\tonFocus: function() {},\n\tonBlur: function() {},\n\tonChange: function() {},\n\tonViewModeChange: function() {},\n\tonNavigateBack: function() {},\n\tonNavigateForward: function() {},\n\ttimeFormat: true,\n\ttimeConstraints: {},\n\tdateFormat: true,\n\tstrictParsing: true,\n\tcloseOnSelect: false,\n\tcloseOnTab: true,\n\tutc: false\n};\n\n// Make moment accessible through the Datetime class\nDatetime.moment = moment;\n\nmodule.exports = Datetime;\n","import React, {PureComponent} from 'react';\nimport enhanceWithClickOutside from '../enhanceWithClickOutside/index';\nimport moment, {Moment, isMoment} from 'moment';\nimport mergeClassNames from 'classnames';\n// @ts-ignore missing typings - we can not update due to a know issue with firefox (https://github.com/neos/neos-ui/pull/1874)\nimport Collapse from 'react-collapse';\nimport DatePicker, {TimeConstraints} from 'react-datetime';\n\nimport {PickDefaultProps} from '../../types';\nimport Button from '../Button';\nimport Icon from '../Icon';\n\n\nexport interface DateInputProps {\n /**\n * The Date instance which represents the selected value.\n */\n readonly value?: Date;\n\n /**\n * Additional className to render into the wrapper div\n */\n readonly className?: string;\n\n /**\n * An optional placeholder which will be rendered if no date was selected.\n */\n readonly placeholder?: string;\n\n /**\n * An optional id for the input.\n */\n readonly id?: string;\n\n /**\n * The label which will be displayed within the `Select Today` btn.\n */\n readonly todayLabel: string;\n\n /**\n * The label which will be displayed within the `Apply` btn.\n */\n readonly applyLabel: string;\n\n /**\n * The moment format string to use to format the passed value.\n */\n readonly labelFormat?: string;\n\n /**\n * Display only date picker\n */\n readonly dateOnly?: boolean;\n\n /**\n * Display only time picker\n */\n readonly timeOnly?: boolean;\n\n /**\n * Add some constraints to the timepicker.\n * It accepts an object with the format { hours: { min: 9, max: 15, step: 2 }},\n * this example means the hours can't be lower than 9 and higher than 15,\n * and it will change adding or subtracting 2 hours everytime the buttons are clicked.\n * The constraints can be added to the hours, minutes, seconds and milliseconds.\n */\n readonly timeConstraints?: TimeConstraints;\n\n /**\n * Locale for the date picker (determines time format)\n */\n readonly locale: string;\n\n /**\n * Disable the DateInput\n */\n readonly disabled?: boolean;\n\n /**\n * The changehandler to call when the date changes.\n */\n readonly onChange: (date: Date | null) => void;\n\n /**\n * An optional theme using tremr\n */\n readonly theme?: DateInputTheme;\n}\n\ninterface DateInputTheme {\n 'wrapper': string;\n 'disabled': string;\n 'disabled-cursor': string;\n 'calendarInputWrapper': string;\n 'calendarIconBtn': string;\n 'calendarFakeInputWrapper': string;\n 'calendarFakeInputMirror': string;\n 'calendarFakeInput': string;\n 'applyBtn': string;\n 'closeCalendarIconBtn': string;\n 'selectTodayBtn': string;\n}\n\nconst defaultProps: PickDefaultProps = {\n labelFormat: 'DD-MM-YYYY hh:mm',\n timeConstraints: {\n minutes: {\n min: 0,\n max: 59,\n step: 5\n }\n },\n};\n\ninterface DateInputState {\n readonly isOpen: boolean;\n readonly transientDate: Date | null; // TODO do we have a breaking change when we use 'undefined' in favor of 'null'?\n}\n\nconst initialState: DateInputState = {\n isOpen: false,\n transientDate: null\n};\n\nexport class DateInput extends PureComponent {\n public static readonly defaultProps = defaultProps;\n public readonly state = initialState;\n\n public render(): JSX.Element {\n const {\n placeholder,\n theme,\n value,\n className,\n id,\n todayLabel,\n applyLabel,\n labelFormat,\n dateOnly,\n timeOnly,\n locale,\n disabled\n } = this.props;\n const selectedDate = value ? moment(value).format(labelFormat) : '';\n\n const wrapper = mergeClassNames(\n theme!.wrapper,\n {\n [theme!.disabled]: disabled,\n },\n );\n\n const calendarInputWrapper = mergeClassNames(className, theme!.calendarInputWrapper);\n\n const calendarFakeInputMirror = mergeClassNames(\n theme!.calendarFakeInputMirror,\n {\n [theme!['disabled-cursor']]: disabled,\n },\n );\n\n const calendarIconBtn = mergeClassNames(\n theme!.calendarIconBtn,\n {\n [theme!['disabled-cursor']]: disabled,\n },\n );\n\n const closeCalendarIconBtn = mergeClassNames(\n theme!.closeCalendarIconBtn,\n {\n [theme!['disabled-cursor']]: disabled,\n },\n );\n\n return (\n
\n
\n \n \n \n
\n \n \n
\n \n \n \n
\n \n \n {todayLabel}\n \n \n \n {applyLabel}\n \n \n
\n );\n }\n\n private readonly handleClick = () => {\n if (!this.props.disabled) {\n this.toggle();\n }\n }\n\n private readonly handleFocus = () => {\n if (!this.props.disabled) {\n this.open();\n }\n }\n\n private readonly handleClearValueClick = () => {\n if (!this.props.disabled) {\n this.setState({isOpen: false}, () => {\n this.props.onChange(null);\n });\n }\n }\n\n private readonly handleApply = () => {\n this.setState({\n isOpen: false\n }, () => {\n this.props.onChange(this.state.transientDate);\n });\n }\n\n private readonly handleChange = (value: Moment | string) => {\n const momentVal: Moment = isMoment(value) ? value : moment(value);\n this.setState({\n transientDate: momentVal.toDate()\n });\n }\n\n private readonly handleSelectTodayBtnClick = () => {\n this.setState({\n isOpen: false\n }, () => {\n let date = moment().toDate();\n if (this.props.dateOnly) {\n date = moment().utc().startOf('day').toDate();\n }\n this.props.onChange(date);\n });\n }\n\n public handleClickOutside = () => this.close();\n\n private readonly toggle = () => {\n this.setState({\n isOpen: !this.state.isOpen\n });\n }\n\n private readonly open = () => {\n this.setState({\n isOpen: true\n });\n }\n\n private readonly close = () => {\n this.setState({\n isOpen: false\n });\n }\n}\n\n//\n// Add the click-outside functionality to the DateInput component.\n//\nconst EnhancedDateInput = enhanceWithClickOutside(DateInput);\n\nexport default EnhancedDateInput;\n","import {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport DateInput from './dateInput';\nimport style from './style.css';\n\nexport default themr(identifiers.dateInput, style)(DateInput);\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CloseOnEscape = function (_Component) {\n _inherits(CloseOnEscape, _Component);\n\n function CloseOnEscape() {\n _classCallCheck(this, CloseOnEscape);\n\n var _this = _possibleConstructorReturn(this, (CloseOnEscape.__proto__ || Object.getPrototypeOf(CloseOnEscape)).call(this));\n\n _this.onEscape = _this.onEscape.bind(_this);\n return _this;\n }\n\n _createClass(CloseOnEscape, [{\n key: 'onEscape',\n value: function onEscape(_ref) {\n var keyCode = _ref.keyCode;\n\n if (keyCode === 27) {\n this.props.onEscape();\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n document.addEventListener('keydown', this.onEscape);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n document.removeEventListener('keydown', this.onEscape);\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children;\n }\n }]);\n\n return CloseOnEscape;\n}(_react.Component);\n\nexports.default = CloseOnEscape;\n\n\nCloseOnEscape.propTypes = {\n onEscape: _propTypes2.default.func.isRequired\n};","export var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport { canUseDOM } from './utils';\n\nvar Portal = function (_React$Component) {\n _inherits(Portal, _React$Component);\n\n function Portal() {\n _classCallCheck(this, Portal);\n\n return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));\n }\n\n _createClass(Portal, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.defaultNode) {\n document.body.removeChild(this.defaultNode);\n }\n this.defaultNode = null;\n }\n }, {\n key: 'render',\n value: function render() {\n if (!canUseDOM) {\n return null;\n }\n if (!this.props.node && !this.defaultNode) {\n this.defaultNode = document.createElement('div');\n document.body.appendChild(this.defaultNode);\n }\n return ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);\n }\n }]);\n\n return Portal;\n}(React.Component);\n\nPortal.propTypes = {\n children: PropTypes.node.isRequired,\n node: PropTypes.any\n};\n\nexport default Portal;","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// This file is a fallback for a consumer who is not yet on React 16\n// as createPortal was introduced in React 16\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\n\nvar Portal = function (_React$Component) {\n _inherits(Portal, _React$Component);\n\n function Portal() {\n _classCallCheck(this, Portal);\n\n return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));\n }\n\n _createClass(Portal, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.renderPortal();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(props) {\n this.renderPortal();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n ReactDOM.unmountComponentAtNode(this.defaultNode || this.props.node);\n if (this.defaultNode) {\n document.body.removeChild(this.defaultNode);\n }\n this.defaultNode = null;\n this.portal = null;\n }\n }, {\n key: 'renderPortal',\n value: function renderPortal(props) {\n if (!this.props.node && !this.defaultNode) {\n this.defaultNode = document.createElement('div');\n document.body.appendChild(this.defaultNode);\n }\n\n var children = this.props.children;\n // https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b\n if (typeof this.props.children.type === 'function') {\n children = React.cloneElement(this.props.children);\n }\n\n this.portal = ReactDOM.unstable_renderSubtreeIntoContainer(this, children, this.props.node || this.defaultNode);\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return Portal;\n}(React.Component);\n\nexport default Portal;\n\n\nPortal.propTypes = {\n children: PropTypes.node.isRequired,\n node: PropTypes.any\n};","import ReactDOM from 'react-dom';\n\nimport Portalv4 from './Portal';\nimport LegacyPortal from './LegacyPortal';\n\nvar Portal = void 0;\n\nif (ReactDOM.createPortal) {\n Portal = Portalv4;\n} else {\n Portal = LegacyPortal;\n}\n\nexport default Portal;","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Portal from './PortalCompat';\n\nvar KEYCODES = {\n ESCAPE: 27\n};\n\nvar PortalWithState = function (_React$Component) {\n _inherits(PortalWithState, _React$Component);\n\n function PortalWithState(props) {\n _classCallCheck(this, PortalWithState);\n\n var _this = _possibleConstructorReturn(this, (PortalWithState.__proto__ || Object.getPrototypeOf(PortalWithState)).call(this, props));\n\n _this.portalNode = null;\n _this.state = { active: !!props.defaultOpen };\n _this.openPortal = _this.openPortal.bind(_this);\n _this.closePortal = _this.closePortal.bind(_this);\n _this.wrapWithPortal = _this.wrapWithPortal.bind(_this);\n _this.handleOutsideMouseClick = _this.handleOutsideMouseClick.bind(_this);\n _this.handleKeydown = _this.handleKeydown.bind(_this);\n return _this;\n }\n\n _createClass(PortalWithState, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (this.props.closeOnEsc) {\n document.addEventListener('keydown', this.handleKeydown);\n }\n if (this.props.closeOnOutsideClick) {\n document.addEventListener('click', this.handleOutsideMouseClick);\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.props.closeOnEsc) {\n document.removeEventListener('keydown', this.handleKeydown);\n }\n if (this.props.closeOnOutsideClick) {\n document.removeEventListener('click', this.handleOutsideMouseClick);\n }\n }\n }, {\n key: 'openPortal',\n value: function openPortal(e) {\n if (this.state.active) {\n return;\n }\n if (e && e.nativeEvent) {\n e.nativeEvent.stopImmediatePropagation();\n }\n this.setState({ active: true }, this.props.onOpen);\n }\n }, {\n key: 'closePortal',\n value: function closePortal() {\n if (!this.state.active) {\n return;\n }\n this.setState({ active: false }, this.props.onClose);\n }\n }, {\n key: 'wrapWithPortal',\n value: function wrapWithPortal(children) {\n var _this2 = this;\n\n if (!this.state.active) {\n return null;\n }\n return React.createElement(\n Portal,\n {\n node: this.props.node,\n key: 'react-portal',\n ref: function ref(portalNode) {\n return _this2.portalNode = portalNode;\n }\n },\n children\n );\n }\n }, {\n key: 'handleOutsideMouseClick',\n value: function handleOutsideMouseClick(e) {\n if (!this.state.active) {\n return;\n }\n var root = this.portalNode && (this.portalNode.props.node || this.portalNode.defaultNode);\n if (!root || root.contains(e.target) || e.button && e.button !== 0) {\n return;\n }\n this.closePortal();\n }\n }, {\n key: 'handleKeydown',\n value: function handleKeydown(e) {\n if (e.keyCode === KEYCODES.ESCAPE && this.state.active) {\n this.closePortal();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children({\n openPortal: this.openPortal,\n closePortal: this.closePortal,\n portal: this.wrapWithPortal,\n isOpen: this.state.active\n });\n }\n }]);\n\n return PortalWithState;\n}(React.Component);\n\nPortalWithState.propTypes = {\n children: PropTypes.func.isRequired,\n defaultOpen: PropTypes.bool,\n node: PropTypes.any,\n closeOnEsc: PropTypes.bool,\n closeOnOutsideClick: PropTypes.bool,\n onOpen: PropTypes.func,\n onClose: PropTypes.func\n};\n\nPortalWithState.defaultProps = {\n onOpen: function onOpen() {},\n onClose: function onClose() {}\n};\n\nexport default PortalWithState;","import Portal from './PortalCompat';\nimport PortalWithState from './PortalWithState';\n\nexport { Portal, PortalWithState };","import mergeClassNames from 'classnames';\nimport React, {PureComponent, ReactNode} from 'react';\nimport enhanceWithClickOutside from '../enhanceWithClickOutside/index';\nimport CloseOnEscape from 'react-close-on-escape';\nimport {Portal} from 'react-portal';\n\ntype DialogType = 'success' | 'warn' | 'error';\ntype DialogStyle = 'wide' | 'jumbo' | 'narrow';\n\ninterface DialogTheme {\n readonly 'dialog': string;\n readonly 'dialog__body': string;\n readonly 'dialog__contentsPosition': string;\n readonly 'dialog__contents': string;\n readonly 'dialog__title': string;\n readonly 'dialog__closeBtn': string;\n readonly 'dialog__actions': string;\n readonly 'dialog--wide': string;\n readonly 'dialog--jumbo': string;\n readonly 'dialog--narrow': string;\n readonly 'dialog--success': string;\n readonly 'dialog--warn': string;\n readonly 'dialog--error': string;\n}\n\nexport interface DialogProps {\n /**\n * This prop controls the rendered state of the Dialog, when falsy, nothing gets rendered into the DOM.\n */\n readonly isOpen: boolean;\n\n /**\n * The handler which gets called once the user clicks on the close symbol in the top right corner of the Dialog.\n */\n readonly onRequestClose: () => void;\n\n /**\n * The title to be rendered on top of the Dialogs contents.\n */\n readonly title: ReactNode;\n\n /**\n * The `type` prop defines the type of the `Dialog`.\n */\n readonly type: DialogType;\n\n /**\n * The `style` prop defines the visual style of the `Dialog`.\n */\n readonly style: DialogStyle;\n\n /**\n * The contents to be rendered within the Dialog.\n */\n readonly children: ReactNode;\n\n /**\n * An Array of nodes(e.g. Action Buttons) which are placed at the bottom of the Dialog.\n */\n readonly actions: ReadonlyArray;\n\n /**\n * This prop controls the focus state of the Dialog.\n */\n readonly autoFocus: boolean;\n\n /**\n * An optional `className` to attach to the wrapper.\n */\n readonly className?: string;\n\n /**\n * An optional `contentsClassName` to attach to the content area of the dialog.\n */\n readonly contentsClassName?: string;\n\n /**\n * An optional css theme to be injected.\n */\n readonly theme: DialogTheme;\n}\n\nexport class DialogWithoutEscape extends PureComponent {\n // tslint:disable-next-line:readonly-keyword\n private ref?: HTMLDivElement;\n\n public render(): JSX.Element {\n const {\n title,\n children,\n actions,\n theme,\n type\n } = this.props;\n\n const finalClassNameBody = mergeClassNames(\n theme.dialog__body,\n {\n [theme['dialog--success']]: type === 'success',\n [theme['dialog--warn']]: type === 'warn',\n [theme['dialog--error']]: type === 'error',\n },\n 'dialog__body'\n );\n\n return (\n
\n
\n\n
\n {title}\n
\n
\n {children}\n
\n\n {actions && actions.length ?\n
\n {React.Children.map(actions, (action, index) => {action})}\n
: null\n }\n
\n
\n );\n }\n\n private readonly handleReference = (ref: HTMLDivElement) => {\n // tslint:disable-next-line:no-object-mutation\n this.ref = ref;\n }\n\n public readonly handleClickOutside = () => {\n this.props.onRequestClose();\n }\n\n public readonly componentDidMount = (): void => {\n document.addEventListener('keydown', (event : KeyboardEvent) => this.handleKeyPress(event));\n const {autoFocus} = this.props;\n if (this.ref && autoFocus) {\n this.ref.focus();\n }\n }\n\n public readonly componentWillUnmount = (): void => {\n document.removeEventListener('keydown', (event : KeyboardEvent) => this.handleKeyPress(event));\n }\n\n /**\n * Closes the dialog when the escape key has been pressed.\n *\n * @param {KeyboardEvent} event\n * @returns {void}\n */\n public readonly handleKeyPress = (event : KeyboardEvent): void => {\n if (event.key === 'Escape') {\n this.props.onRequestClose();\n }\n }\n}\n\nconst EnhancedDialogWithoutEscapeWithClickOutside = enhanceWithClickOutside(DialogWithoutEscape);\n\n// tslint:disable-next-line:max-classes-per-file\nclass DialogWithEscape extends PureComponent {\n public render(): JSX.Element | null {\n const {\n className,\n title,\n style,\n children,\n isOpen,\n actions,\n theme,\n type,\n onRequestClose,\n ...rest\n } = this.props;\n\n const sectionClassName = mergeClassNames(\n theme.dialog,\n {\n [theme['dialog--wide']]: style === 'wide',\n [theme['dialog--jumbo']]: style === 'jumbo',\n [theme['dialog--narrow']]: style === 'narrow',\n },\n {\n [theme['dialog--success']]: type === 'success',\n [theme['dialog--warn']]: type === 'warn',\n [theme['dialog--error']]: type === 'error',\n },\n className,\n );\n\n if (!this.props.isOpen) {\n return null;\n }\n\n return (\n \n \n
\n \n
\n
\n
\n );\n }\n\n private readonly onEscape = () => {\n this.props.onRequestClose();\n }\n}\n\nexport default DialogWithEscape;\n","import {themr} from '@friendsofreactjs/react-css-themr';\n\nimport identifiers from '../identifiers';\nimport Dialog from './dialog';\nimport style from './style.css';\n\nexport default themr(identifiers.dialog, style)(Dialog);\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

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

fred, barney, & pebbles

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